*** empty log message ***
diff --git a/.classpath b/.classpath
index 51c65a5..8762fa2 100644
--- a/.classpath
+++ b/.classpath
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-    <classpathentry kind="lib"
-        path="/org.eclipse.core.resources/resources.jar" sourcepath="/org.eclipse.core.resources/resourcessrc.zip"/>
+    <classpathentry kind="lib" path="/org.eclipse.core.resources/resources.jar" sourcepath="/org.eclipse.core.resources/resourcessrc.zip"/>
     <classpathentry kind="lib" path="/org.apache.xerces/xerces.jar"/>
-    <classpathentry kind="lib"
-        path="/org.eclipse.core.runtime/runtime.jar" sourcepath="/org.eclipse.core.runtime/runtimesrc.zip"/>
+    <classpathentry kind="lib" path="/org.eclipse.core.runtime/runtime.jar" sourcepath="/org.eclipse.core.runtime/runtimesrc.zip"/>
     <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
+    <classpathentry kind="src" path="Eclipse Java Ant Compiler"/>
     <classpathentry kind="src" path="Eclipse Java Batch Compiler"/>
     <classpathentry kind="src" path="Eclipse Java Code Assist"/>
     <classpathentry kind="src" path="Eclipse Java Compiler"/>
@@ -13,5 +12,7 @@
     <classpathentry kind="src" path="Eclipse Java Evaluation"/>
     <classpathentry kind="src" path="Eclipse Java Model"/>
     <classpathentry kind="src" path="Eclipse Java Formatter"/>
+    <classpathentry kind="lib" path="/org.eclipse.ant.core/ant.jar"/>
+    <classpathentry kind="lib" path="/org.eclipse.ant.core/antsupport.jar" sourcepath="/org.eclipse.ant.core/antsupportsrc.zip"/>
     <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java b/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
index 6d1e55c..959480f 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
@@ -75,6 +75,6 @@
 	return new NameEnvironmentAnswer(new CompilationUnit(null, fullName));

 }

 public String toString() {

-	return "ClasspathDirectory "/*nonNLS*/ + path;

+	return "ClasspathDirectory " + path; //$NON-NLS-1$

 }

 }

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java b/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
index 5bdafd4..70c5634 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
@@ -80,6 +80,6 @@
 	}

 }

 public String toString() {

-	return "Classpath for jar file "/*nonNLS*/ + zipFile;

+	return "Classpath for jar file " + zipFile; //$NON-NLS-1$

 }

 }

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java b/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
index bf7d5f5..b23c86b 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java
@@ -16,11 +16,11 @@
 	this.contents = contents;

 	this.fileName = fileName.toCharArray();

 

-	int start = fileName.lastIndexOf("/"/*nonNLS*/) + 1;

-	if (start == 0 || start < fileName.lastIndexOf("\\"/*nonNLS*/))

-		start = fileName.lastIndexOf("\\"/*nonNLS*/) + 1;

+	int start = fileName.lastIndexOf("/") + 1; //$NON-NLS-1$

+	if (start == 0 || start < fileName.lastIndexOf("\\")) //$NON-NLS-1$

+		start = fileName.lastIndexOf("\\") + 1; //$NON-NLS-1$

 

-	int end = fileName.lastIndexOf("."/*nonNLS*/);

+	int end = fileName.lastIndexOf("."); //$NON-NLS-1$

 	if (end == -1)

 		end = fileName.length();

 

@@ -70,6 +70,6 @@
 	return mainTypeName;

 }

 public String toString() {

-	return "CompilationUnit["/*nonNLS*/ + new String(fileName) + "]"/*nonNLS*/; 

+	return "CompilationUnit[" + new String(fileName) + "]";  //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java b/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
index b187763..b2ab53f 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java
@@ -12,13 +12,13 @@
 	public int counter = 0;

 public void find(File f, String pattern, boolean verbose) {

 	if (verbose) {

-		System.out.println(Main.bind("scanning.start"/*nonNLS*/,f.getAbsolutePath()));

+		System.out.println(Main.bind("scanning.start",f.getAbsolutePath())); //$NON-NLS-1$

 	}

 	find0(f, pattern, verbose);

 	System.arraycopy(resultFiles, 0, (resultFiles = new String[counter]), 0, counter);

 	if (verbose) {

 		System.out.println();

-		System.out.println(Main.bind("scanning.done"/*nonNLS*/,f.getAbsolutePath()));

+		System.out.println(Main.bind("scanning.done",f.getAbsolutePath())); //$NON-NLS-1$

 	}

 }

 public void find0(File f, String pattern, boolean verbose) {

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
index 265ca32..ed8fc7c 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
@@ -37,7 +37,7 @@
 				if (file.isDirectory()) {

 					classpaths[i] = new ClasspathDirectory(file);

 					pathNames[i] = ((ClasspathDirectory) classpaths[i]).path;

-				} else if (classpathNames[i].endsWith(".jar"/*nonNLS*/) | (classpathNames[i].endsWith(".zip"/*nonNLS*/))) {

+				} else if (classpathNames[i].endsWith(".jar") | (classpathNames[i].endsWith(".zip"))) { //$NON-NLS-2$ //$NON-NLS-1$

 					classpaths[i] = new ClasspathJar(file);

 					pathNames[i] = classpathNames[i].substring(0, classpathNames[i].lastIndexOf('.'));

 				}

@@ -65,7 +65,7 @@
 	for (int i = initialFileNames.length; --i >= 0;) {

 		String fileName = initialFileNames[i];

 		String matchingPathName = null;

-		if (fileName.lastIndexOf("."/*nonNLS*/) != -1)

+		if (fileName.lastIndexOf(".") != -1) //$NON-NLS-1$

 			fileName = fileName.substring(0, fileName.lastIndexOf('.')); // remove trailing ".java"

 

 		fileName = convertPathSeparators(fileName);

@@ -101,8 +101,8 @@
 			return null; // looking for a file which we know was provided at the beginning of the compilation

 

 	String filename = new String(name);

-	String binaryFilename = filename + ".class"/*nonNLS*/;

-	String sourceFilename = filename + ".java"/*nonNLS*/;

+	String binaryFilename = filename + ".class"; //$NON-NLS-1$

+	String sourceFilename = filename + ".java"; //$NON-NLS-1$

 	for (int i = 0, length = classpaths.length; i < length; i++) {

 		Classpath classpath = classpaths[i];

 		boolean binaryExists = classpath.exists(binaryFilename, packageName);

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 757ff35..0be5954 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -20,27 +20,32 @@
 import java.util.*;

 

 public class Main implements ConfigurableProblems, ProblemSeverities {

+	private ConfigurableOption[] options;

+	private static final String[] problemOption ={

+		CompilerOptions.OPTION_ReportMethodWithConstructorName,

+		CompilerOptions.OPTION_ReportHiddenCatchBlock,

+		CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod,

+		CompilerOptions.OPTION_ReportDeprecation,

+		CompilerOptions.OPTION_ReportUnusedLocal,

+		CompilerOptions.OPTION_ReportUnusedParameter,

+		CompilerOptions.OPTION_ReportSyntheticAccessEmulation,

+		CompilerOptions.OPTION_ReportNonExternalizedStringLiteral,

+		CompilerOptions.OPTION_ReportInvalidImport,

+		CompilerOptions.OPTION_ReportUnreachableCode,

+		CompilerOptions.OPTION_ReportAssertIdentifier,

+	};

+	private boolean noWarn = false;

+	

 	PrintWriter out;

 	boolean systemExitWhenFinished = true;

 	boolean proceedOnError = false;

-	int warningMask =

-		ParsingOptionalError |

-		MethodWithConstructorName | OverriddenPackageDefaultMethod |

-		UsingDeprecatedAPI | MaskedCatchBlock |

-		UnusedLocalVariable | UnusedArgument |

-		TemporaryWarning | OverriddenPackageDefaultMethod |

-		AccessEmulation;

 			

-	int debugMask = CompilerOptions.Lines | CompilerOptions.Source;

-	int targetJDK = CompilerOptions.JDK1_1;

 	boolean verbose = false;

 	boolean produceRefInfo = false;

-	boolean importProblemIsError = true;

 	boolean timer = false;

 	boolean showProgress = false;

 	public long time = 0;

 	long lineCount;

-	boolean preserveAllLocalVariables = false; // The unused and final local variables will be optimized

 

 	String[] filenames;

 	String[] classpaths;

@@ -51,8 +56,8 @@
 	int globalErrorsCount;

 	int globalWarningsCount;

 

-	String versionID = "1.0NL"/*nonNLS*/;

-	private static final char[] CLASS_FILE_EXTENSION = ".class"/*nonNLS*/.toCharArray();

+	String versionID = "0.125.12 (jck1.3a)"; //$NON-NLS-1$

+	private static final char[] CLASS_FILE_EXTENSION = ".class".toCharArray(); //$NON-NLS-1$

 

 	int exportedClassFilesCounter;

 

@@ -63,16 +68,20 @@
 

 	/* Bundle containing messages */

 	protected static ResourceBundle bundle;

-	private final static String bundleName = "org.eclipse.jdt.internal.compiler.batch.messages"/*nonNLS*/;

+	private final static String bundleName = "org.eclipse.jdt.internal.compiler.batch.messages"; //$NON-NLS-1$

 	static {

-		String ver = System.getProperty("java.version"/*nonNLS*/);

-		JDK1_1 = ((ver != null) && ver.startsWith("1.1"/*nonNLS*/));

+		String ver = System.getProperty("java.version"); //$NON-NLS-1$

+		JDK1_1 = ((ver != null) && ver.startsWith("1.1")); //$NON-NLS-1$

 		relocalize();

 	}

+	

+	private boolean proceed = true;

+	

 protected Main(PrintWriter writer, boolean systemExitWhenFinished) {

 	this.out = writer;

 	this.systemExitWhenFinished = systemExitWhenFinished;

 	exportedClassFilesCounter = 0;

+	options = Compiler.getDefaultOptions(Locale.getDefault());

 }

 /*

  *  Low-level API performing the actual compilation

@@ -81,71 +90,73 @@
 	// decode command line arguments

 	try {

 		configure(argv);

-		if (showProgress) System.out.print(Main.bind("progress.compiling"/*nonNLS*/));

-		for (int i = 0; i < repetitions; i++){

-			globalProblemsCount = 0;

-			globalErrorsCount = 0;

-			globalWarningsCount = 0;		

-			lineCount = 0;

-			if (repetitions > 1){

-				out.flush();

-				out.println(Main.bind("compile.repetition"/*nonNLS*/,String.valueOf(i+1),String.valueOf(repetitions)));

-			}

-			long startTime = System.currentTimeMillis();

-

-			// request compilation

-			performCompilation();

-			if (timer) {

-				time = System.currentTimeMillis() - startTime;

-				if (lineCount != 0){

-					out.println(Main.bind("compile.instantTime"/*nonNLS*/,new String[]{String.valueOf(lineCount),String.valueOf(time),String.valueOf((((int)((lineCount*10000.0)/time))/10.0))}));

-				} else {

-					out.println(Main.bind("compile.totalTime"/*nonNLS*/,String.valueOf(time)));

-					

+		if(proceed){

+			if (showProgress) out.print(Main.bind("progress.compiling")); //$NON-NLS-1$

+			for (int i = 0; i < repetitions; i++){

+				globalProblemsCount = 0;

+				globalErrorsCount = 0;

+				globalWarningsCount = 0;		

+				lineCount = 0;

+	

+				if (repetitions > 1){

+					out.flush();

+					out.println(Main.bind("compile.repetition",String.valueOf(i+1),String.valueOf(repetitions))); //$NON-NLS-1$

 				}

-			}

-			if (globalProblemsCount > 0) {

-				if (globalProblemsCount == 1) {

-					out.print(Main.bind("compile.oneProblem"/*nonNLS*/));

-				} else {

-					out.print(Main.bind("compile.severalProblems"/*nonNLS*/,String.valueOf(globalProblemsCount)));

-				}

-				out.print(" ("/*nonNLS*/);

-				if (globalErrorsCount > 0) {

-					if (globalErrorsCount == 1) {

-						out.print(Main.bind("compile.oneError"/*nonNLS*/));

+				long startTime = System.currentTimeMillis();

+				// request compilation

+				performCompilation();

+				if (timer) {

+	

+					time = System.currentTimeMillis() - startTime;

+					if (lineCount != 0){

+						out.println(Main.bind("compile.instantTime",new String[]{String.valueOf(lineCount),String.valueOf(time),String.valueOf((((int)((lineCount*10000.0)/time))/10.0))})); //$NON-NLS-1$

 					} else {

-						out.print(Main.bind("compile.severalErrors"/*nonNLS*/,String.valueOf(globalErrorsCount)));

+						out.println(Main.bind("compile.totalTime",String.valueOf(time)));				 //$NON-NLS-1$

 					}

 				}

-				if (globalWarningsCount > 0) {

+				if (globalProblemsCount > 0) {

+					if (globalProblemsCount == 1) {

+						out.print(Main.bind("compile.oneProblem")); //$NON-NLS-1$

+					} else {

+						out.print(Main.bind("compile.severalProblems",String.valueOf(globalProblemsCount))); //$NON-NLS-1$

+					}

+					out.print(" ("); //$NON-NLS-1$

 					if (globalErrorsCount > 0) {

-						out.print(", "/*nonNLS*/);

+						if (globalErrorsCount == 1) {

+							out.print(Main.bind("compile.oneError")); //$NON-NLS-1$

+						} else {

+							out.print(Main.bind("compile.severalErrors",String.valueOf(globalErrorsCount))); //$NON-NLS-1$

+						}

 					}

-					if (globalWarningsCount == 1) {

-						out.print(Main.bind("compile.oneWarning"/*nonNLS*/));

+					if (globalWarningsCount > 0) {

+						if (globalErrorsCount > 0) {

+							out.print(", "); //$NON-NLS-1$

+						}

+						if (globalWarningsCount == 1) {

+							out.print(Main.bind("compile.oneWarning")); //$NON-NLS-1$

+						} else {

+							out.print(Main.bind("compile.severalWarnings",String.valueOf(globalWarningsCount))); //$NON-NLS-1$

+						}

+					}

+					out.println(")"); //$NON-NLS-1$

+				}

+				if (exportedClassFilesCounter != 0 && (this.showProgress || this.timer || this.verbose)) {

+					if (exportedClassFilesCounter == 1) {

+						out.print(Main.bind("compile.oneClassFileGenerated")); //$NON-NLS-1$

 					} else {

-						out.print(Main.bind("compile.severalWarnings"/*nonNLS*/,String.valueOf(globalWarningsCount)));

+						out.print(Main.bind("compile.severalClassFilesGenerated",String.valueOf(exportedClassFilesCounter))); //$NON-NLS-1$

 					}

 				}

-				out.println(")"/*nonNLS*/);

 			}

-			if (exportedClassFilesCounter != 0 && (this.showProgress || this.timer || this.verbose)) {

-				if (exportedClassFilesCounter == 1) {

-					out.print(Main.bind("compile.oneClassFileGenerated"/*nonNLS*/));

-				} else {

-					out.print(Main.bind("compile.severalClassFilesGenerated"/*nonNLS*/,String.valueOf(exportedClassFilesCounter)));

-				}

-			}

+			if (showProgress) System.out.println();

 		}

-		if (showProgress) System.out.println();

 		if (systemExitWhenFinished){

 			out.flush();

 			System.exit(globalErrorsCount > 0 ? -1 : 0);

 		}

 	} catch (InvalidInputException e) {

 		out.println(e.getMessage());

-		out.println("------------------------"/*nonNLS*/);

+		out.println("------------------------"); //$NON-NLS-1$

 		printUsage();

 		if (systemExitWhenFinished){

 			System.exit(-1);			

@@ -195,7 +206,7 @@
 				argv[count-1] += File.pathSeparator;

 				insideClasspath = true;

 			} else {

-				tokenizer = new StringTokenizer(subCommandLine, File.pathSeparator + " "/*nonNLS*/);

+				tokenizer = new StringTokenizer(subCommandLine, File.pathSeparator + " "); //$NON-NLS-1$

 				while (tokenizer.hasMoreTokens()) {

 					if (count == argv.length) {

 						System.arraycopy(argv, 0, (argv = new String[count * 2]), 0, count);

@@ -224,7 +235,7 @@
 				}

 				argv[count++] = commandLine.substring(startIndex, commandLine.length());

 			} else {

-				tokenizer = new StringTokenizer(commandLine.substring(startIndex, commandLine.length()), File.pathSeparator + " "/*nonNLS*/);

+				tokenizer = new StringTokenizer(commandLine.substring(startIndex, commandLine.length()), File.pathSeparator + " "); //$NON-NLS-1$

 				while (tokenizer.hasMoreTokens()) {

 					if (count == argv.length) {

 						System.arraycopy(argv, 0, (argv = new String[count * 2]), 0, count);

@@ -237,21 +248,31 @@
 	System.arraycopy(argv, 0, argv = new String[count], 0, count);

 	new Main(writer, false).compile(argv);

 }

+private void setOptionValueIndex(String id,int valueIndex){

+	for(int i = 0 ; i < options.length ; i++){

+		if(options[i].getID().equals(id)){

+			options[i].setValueIndex(valueIndex);

+			return;

+		}

+	}

+}

+

 /*

 Decode the command line arguments 

  */

 private void configure(String[] argv) throws InvalidInputException {

 	if ((argv == null) || (argv.length == 0))

-		throw new InvalidInputException(Main.bind("configure.noSourceFile"/*nonNLS*/));

+		throw new InvalidInputException(Main.bind("configure.noSourceFile")); //$NON-NLS-1$

 	final int InsideClasspath = 1;

 	final int InsideDestinationPath = 2;

 	final int TargetSetting = 4;

 	final int InsideLog = 8;

 	final int InsideRepetition = 16;

+	final int InsideSource = 32;

 	final int Default = 0;

 	int DEFAULT_SIZE_CLASSPATH = 4;

-	boolean noWarnOptionInUsed = false;

 	boolean warnOptionInUsed = false;

+	boolean noWarnOptionInUsed = false;

 	int pathCount = 0;

 	int index = -1, filesCount = 0, argCount = argv.length;

 	int mode = Default;

@@ -261,7 +282,7 @@
 	

 	while (++index < argCount) {

 		String currentArg = argv[index].trim();

-		if (currentArg.endsWith(".java"/*nonNLS*/)) {

+		if (currentArg.endsWith(".java")) { //$NON-NLS-1$

 			if (filenames == null) {

 				filenames = new String[argCount - index];

 			} else if (filesCount == filenames.length) {

@@ -272,169 +293,189 @@
 			mode = Default;

 			continue;

 		}

-		if (currentArg.equals("-log"/*nonNLS*/)) {

+		if (currentArg.equals("-log")) { //$NON-NLS-1$

 			if (log != null)

-				throw new InvalidInputException(Main.bind("configure.duplicateLog"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.duplicateLog",currentArg)); //$NON-NLS-1$

 			mode = InsideLog;

 			continue;

 		}

-		if (currentArg.equals("-repeat"/*nonNLS*/)) {

+		if (currentArg.equals("-repeat")) { //$NON-NLS-1$

 			if (repetitions > 0)

-				throw new InvalidInputException(Main.bind("configure.duplicateRepeat"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.duplicateRepeat",currentArg)); //$NON-NLS-1$

 			mode = InsideRepetition;

 			continue;

 		}

-		if (currentArg.equals("-d"/*nonNLS*/)) {

+		if (currentArg.equals("-source")) { //$NON-NLS-1$

+			mode = InsideSource;

+			continue;

+		}

+		if (currentArg.equals("-d")) { //$NON-NLS-1$

 			if (destinationPath != null)

-				throw new InvalidInputException(Main.bind("configure.duplicateOutputPath"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.duplicateOutputPath",currentArg)); //$NON-NLS-1$

 			mode = InsideDestinationPath;

 			continue;

 		}

-		if (currentArg.equals("-classpath"/*nonNLS*/)) {

+		if (currentArg.equals("-classpath")) { //$NON-NLS-1$

 			if (pathCount > 0)

-				throw new InvalidInputException(Main.bind("configure.duplicateClasspath"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.duplicateClasspath",currentArg)); //$NON-NLS-1$

 			classpaths = new String[DEFAULT_SIZE_CLASSPATH];

 			mode = InsideClasspath;

 			continue;

 		}

-		if (currentArg.equals("-progress"/*nonNLS*/)) {

+		if (currentArg.equals("-progress")) { //$NON-NLS-1$

 			mode = Default;

 			showProgress = true;

 			continue;

 		}

-		if (currentArg.equals("-proceedOnError"/*nonNLS*/)) {

+		if (currentArg.equals("-proceedOnError")) { //$NON-NLS-1$

 			mode = Default;

 			proceedOnError = true;

 			continue;

 		}

-		if (currentArg.equals("-time"/*nonNLS*/)) {

+		if (currentArg.equals("-time")) { //$NON-NLS-1$

 			mode = Default;

 			timer = true;

 			continue;

 		}

-		if (currentArg.equals("-version"/*nonNLS*/) || currentArg.equals("-v"/*nonNLS*/)) {

+		if (currentArg.equals("-version") || currentArg.equals("-v")) { //$NON-NLS-1$ //$NON-NLS-2$

 			versionIDRequired = true;

 			continue;

 		}

-		if (currentArg.equals("-help"/*nonNLS*/)) {

+		if (currentArg.equals("-help")) { //$NON-NLS-1$

 			printUsageRequired = true;

 			continue;

 		}		

-		if (currentArg.equals("-noImportError"/*nonNLS*/)) {

+		if (currentArg.equals("-noImportError")) { //$NON-NLS-1$

 			mode = Default;

-			importProblemIsError = false;

+			setOptionValueIndex("org.eclipse.jdt.internal.compiler.Compiler.problemInvalidImport",2); //$NON-NLS-1$

 			continue;

 		}

-		if (currentArg.equals("-noExit"/*nonNLS*/)) {

+		if (currentArg.equals("-noExit")) { //$NON-NLS-1$

 			mode = Default;

 			systemExitWhenFinished = false;

 			continue;

 		}		

-		if (currentArg.equals("-verbose"/*nonNLS*/)) {

+		if (currentArg.equals("-verbose")) { //$NON-NLS-1$

 			mode = Default;

 			verbose = true;

 			continue;

 		}

-		if (currentArg.equals("-referenceInfo"/*nonNLS*/)) {

+		if (currentArg.equals("-referenceInfo")) { //$NON-NLS-1$

 			mode = Default;

 			produceRefInfo = true;

 			continue;

 		}

-		if (currentArg.startsWith("-g"/*nonNLS*/)) {

+		if (currentArg.startsWith("-g")) { //$NON-NLS-1$

 			mode = Default;

-			debugMask = 0; // reinitialize the default value

 			String debugOption = currentArg;

 			int length = currentArg.length();

 			if (length == 2) {

-				debugMask = CompilerOptions.Lines | CompilerOptions.Vars | CompilerOptions.Source;

+				setOptionValueIndex(CompilerOptions.OPTION_LocalVariableAttribute, 0);

+				setOptionValueIndex(CompilerOptions.OPTION_LineNumberAttribute, 0);

+				setOptionValueIndex(CompilerOptions.OPTION_SourceFileAttribute, 0);

 				continue;

 			}

 			if (length > 3) {

-				if (length == 7 && debugOption.equals("-g:none"/*nonNLS*/))

+				setOptionValueIndex(CompilerOptions.OPTION_LocalVariableAttribute, 1);

+				setOptionValueIndex(CompilerOptions.OPTION_LineNumberAttribute, 1);

+				setOptionValueIndex(CompilerOptions.OPTION_SourceFileAttribute, 1);				

+				if (length == 7 && debugOption.equals("-g:none")) //$NON-NLS-1$

 					continue;

-				StringTokenizer tokenizer = new StringTokenizer(debugOption.substring(3, debugOption.length()), ","/*nonNLS*/);

+				StringTokenizer tokenizer = new StringTokenizer(debugOption.substring(3, debugOption.length()), ","); //$NON-NLS-1$

 				while (tokenizer.hasMoreTokens()) {

 					String token = tokenizer.nextToken();

-					if (token.equals("vars"/*nonNLS*/)) {

-						debugMask |= CompilerOptions.Vars;

-					} else if (token.equals("lines"/*nonNLS*/)) {

-						debugMask |= CompilerOptions.Lines;

-					} else if (token.equals("source"/*nonNLS*/)) {

-						debugMask |= CompilerOptions.Source;

+					if (token.equals("vars")) { //$NON-NLS-1$

+						setOptionValueIndex(CompilerOptions.OPTION_LocalVariableAttribute, 0);

+					} else if (token.equals("lines")) { //$NON-NLS-1$

+						setOptionValueIndex(CompilerOptions.OPTION_LineNumberAttribute, 0);

+					} else if (token.equals("source")) { //$NON-NLS-1$

+						setOptionValueIndex(CompilerOptions.OPTION_SourceFileAttribute, 0);

 					} else {

-						throw new InvalidInputException(Main.bind("configure.invalidDebugOption"/*nonNLS*/,debugOption));

+						throw new InvalidInputException(Main.bind("configure.invalidDebugOption",debugOption)); //$NON-NLS-1$

 					}

 				}

 				continue;

 			}

-			throw new InvalidInputException(Main.bind("configure.invalidDebugOption"/*nonNLS*/,debugOption));

+			throw new InvalidInputException(Main.bind("configure.invalidDebugOption",debugOption)); //$NON-NLS-1$

 		}

-		if (currentArg.startsWith("-nowarn"/*nonNLS*/)) {

+		if (currentArg.startsWith("-nowarn")) { //$NON-NLS-1$

 			noWarnOptionInUsed = true;

+			noWarn = true;

 			if (warnOptionInUsed)

-				throw new InvalidInputException(Main.bind("configure.duplicateWarningConfiguration"/*nonNLS*/));

-			mode = Default;

-			warningMask = TemporaryWarning; // reinitialize the default value (still see TemporaryWarning)		

+				throw new InvalidInputException(Main.bind("configure.duplicateWarningConfiguration")); //$NON-NLS-1$

+			mode = Default;		

 			continue;

 		}

-		if (currentArg.startsWith("-warn"/*nonNLS*/)) {

+		if (currentArg.startsWith("-warn")) { //$NON-NLS-1$

 			warnOptionInUsed = true;

 			if (noWarnOptionInUsed)

-				throw new InvalidInputException(Main.bind("configure.duplicateWarningConfiguration"/*nonNLS*/));

+				throw new InvalidInputException(Main.bind("configure.duplicateWarningConfiguration")); //$NON-NLS-1$

 			mode = Default;

 			String warningOption = currentArg;

 			int length = currentArg.length();

-			if (length == 10 && warningOption.equals("-warn:none"/*nonNLS*/)) {

-				warningMask = TemporaryWarning; // reinitialize the default value (still see TemporaryWarning)

+			if (length == 10 && warningOption.equals("-warn:none")) { //$NON-NLS-1$

+				noWarn = true;

 				continue;

 			}

 			if (length < 6)

-				throw new InvalidInputException(Main.bind("configure.invalidWarningConfiguration"/*nonNLS*/,warningOption));

-			StringTokenizer tokenizer = new StringTokenizer(warningOption.substring(6, warningOption.length()), ","/*nonNLS*/);

+				throw new InvalidInputException(Main.bind("configure.invalidWarningConfiguration",warningOption)); //$NON-NLS-1$

+			StringTokenizer tokenizer = new StringTokenizer(warningOption.substring(6, warningOption.length()), ","); //$NON-NLS-1$

 			int tokenCounter = 0;

-			warningMask = 0; // reinitialize the default value				

+

+			setOptionValueIndex(CompilerOptions.OPTION_ReportMethodWithConstructorName, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportHiddenCatchBlock, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportDeprecation, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportUnusedLocal, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportUnusedParameter, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, 2);

+			setOptionValueIndex(CompilerOptions.OPTION_ReportAssertIdentifier, 2);

+			

 			while (tokenizer.hasMoreTokens()) {

 				String token = tokenizer.nextToken();

 				tokenCounter++;

-				if (token.equals("constructorName"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.MethodWithConstructorName;

-				} else if (token.equals("packageDefaultMethod"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.OverriddenPackageDefaultMethod;

-				} else if (token.equals("maskedCatchBlocks"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.MaskedCatchBlock;

-				} else if (token.equals("deprecation"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.UsingDeprecatedAPI;

-				} else if (token.equals("unusedLocals"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.UnusedLocalVariable;

-				} else if (token.equals("unusedArguments"/*nonNLS*/)) {

-					warningMask |= CompilerOptions.UnusedArgument;

-				} else if (token.equals("syntheticAccess"/*nonNLS*/)){

-					warningMask |= CompilerOptions.AccessEmulation;

-				} else if (token.equals("nls"/*nonNLS*/)){

-					warningMask |= CompilerOptions.NonExternalizedString;

+				if (token.equals("constructorName")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportMethodWithConstructorName, 1);

+				} else if (token.equals("packageDefaultMethod")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, 1);

+				} else if (token.equals("maskedCatchBlocks")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportHiddenCatchBlock, 1);

+				} else if (token.equals("deprecation")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportDeprecation, 1);

+				} else if (token.equals("unusedLocals")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportUnusedLocal, 1);

+				} else if (token.equals("unusedArguments")) { //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportUnusedParameter, 1);

+				} else if (token.equals("syntheticAccess")){ //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, 1);

+				} else if (token.equals("nls")){ //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, 1);

+				} else if (token.equals("assertIdentifier")){ //$NON-NLS-1$

+					setOptionValueIndex(CompilerOptions.OPTION_ReportAssertIdentifier, 1);

 				} else {

-					throw new InvalidInputException(Main.bind("configure.invalidWarning"/*nonNLS*/,token));

+					throw new InvalidInputException(Main.bind("configure.invalidWarning",token)); //$NON-NLS-1$

 				}

 			}

 			if (tokenCounter == 0)

-				throw new InvalidInputException(Main.bind("configure.invalidWarningOption"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.invalidWarningOption",currentArg)); //$NON-NLS-1$

 			continue;

 		}

-		if (currentArg.equals("-target"/*nonNLS*/)) {

+		if (currentArg.equals("-target")) { //$NON-NLS-1$

 			mode = TargetSetting;

 			continue;

 		}

-		if (currentArg.equals("-preserveAllLocals"/*nonNLS*/)) {

-			preserveAllLocalVariables = true;

+		if (currentArg.equals("-preserveAllLocals")) { //$NON-NLS-1$

+			setOptionValueIndex(CompilerOptions.OPTION_PreserveUnusedLocal, 0);

 			continue;

 		}

 		if (mode == TargetSetting) {

-			if (currentArg.equals("1.1"/*nonNLS*/)) {

-				targetJDK = CompilerOptions.JDK1_1;

-			} else if (currentArg.equals("1.2"/*nonNLS*/)) {

-				targetJDK = CompilerOptions.JDK1_2;

+			if (currentArg.equals("1.1")) { //$NON-NLS-1$

+				setOptionValueIndex(CompilerOptions.OPTION_TargetPlatform, 0);

+			} else if (currentArg.equals("1.2")) { //$NON-NLS-1$

+				setOptionValueIndex(CompilerOptions.OPTION_TargetPlatform, 1);

 			} else {

-				throw new InvalidInputException(Main.bind("configure.targetJDK"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.targetJDK",currentArg)); //$NON-NLS-1$

 			}

 			mode = Default;

 			continue;

@@ -448,10 +489,21 @@
 			try {

 				repetitions = Integer.parseInt(currentArg);

 				if (repetitions <= 0){

-					throw new InvalidInputException(Main.bind("configure.repetition"/*nonNLS*/,currentArg));

+					throw new InvalidInputException(Main.bind("configure.repetition",currentArg)); //$NON-NLS-1$

 				}

 			} catch(NumberFormatException e){

-				throw new InvalidInputException(Main.bind("configure.repetition"/*nonNLS*/,currentArg));

+				throw new InvalidInputException(Main.bind("configure.repetition",currentArg)); //$NON-NLS-1$

+			}

+			mode = Default;

+			continue;

+		}

+		if (mode == InsideSource){

+			if (currentArg.equals("1.3")) { //$NON-NLS-1$

+				setOptionValueIndex(CompilerOptions.OPTION_Source, 0);

+			} else if (currentArg.equals("1.4")) { //$NON-NLS-1$

+				setOptionValueIndex(CompilerOptions.OPTION_Source, 1);

+			} else {

+				throw new InvalidInputException(Main.bind("configure.source",currentArg)); //$NON-NLS-1$

 			}

 			mode = Default;

 			continue;

@@ -479,12 +531,12 @@
 			currentArg = currentArg.substring(0, currentArg.length() - File.separator.length());

 		File dir = new File(currentArg);

 		if (!dir.isDirectory())

-			throw new InvalidInputException(Main.bind("configure.directoryNotExist"/*nonNLS*/,currentArg));

+			throw new InvalidInputException(Main.bind("configure.directoryNotExist",currentArg)); //$NON-NLS-1$

 		FileFinder finder = new FileFinder();

 		try{

-			finder.find(dir, ".JAVA"/*nonNLS*/, verbose);

+			finder.find(dir, ".JAVA", verbose); //$NON-NLS-1$

 		} catch(Exception e){

-			throw new InvalidInputException(Main.bind("configure.IOError"/*nonNLS*/,currentArg));		

+			throw new InvalidInputException(Main.bind("configure.IOError",currentArg));		 //$NON-NLS-1$

 		}

 		if (filenames != null) {

 			// some source files were specified explicitly

@@ -501,27 +553,38 @@
 		continue;

 	}

 

+	if(noWarn){

+		for(int i = 0; i < problemOption.length ; i++){

+			for(int j = 0 ; j < options.length ; j++){

+				if(options[j].getID().equals(problemOption[i]) && options[j].getValueIndex() == 1){

+					options[j].setValueIndex(2);

+				}

+			}

+		}

+	}

 	/*

 	 * Standalone options

 	 */

 	if (versionIDRequired) {

-		out.println(Main.bind("configure.version"/*nonNLS*/,this.versionID));

+		out.println(Main.bind("configure.version",this.versionID)); //$NON-NLS-1$

 		out.println();

+		proceed = false;

 		return;

 	}

 		

 	if (printUsageRequired) {

 		printUsage();

+		proceed = false;

 		return;

 	}	

 	

 	if (filesCount != 0)

 		System.arraycopy(filenames, 0, (filenames = new String[filesCount]), 0, filesCount);

 	if (pathCount == 0) {

-		String classProp = System.getProperty("LFclasspath"/*nonNLS*/);

+		String classProp = System.getProperty("LFclasspath"); //$NON-NLS-1$

 		if ((classProp == null) || (classProp.length() == 0)) {

-			out.println(Main.bind("configure.noClasspath"/*nonNLS*/));

-			classProp = "."/*nonNLS*/;

+			out.println(Main.bind("configure.noClasspath")); //$NON-NLS-1$

+			classProp = "."; //$NON-NLS-1$

 		}

 		StringTokenizer tokenizer = new StringTokenizer(classProp, File.pathSeparator);

 		classpaths = new String[tokenizer.countTokens()];

@@ -536,26 +599,27 @@
 	for (int i = 0, max = classpaths.length; i < max; i++) {

 		File file = new File(classpaths[i]);

 		if (!file.exists())

-			throw new InvalidInputException(Main.bind("configure.incorrectClasspath"/*nonNLS*/,classpaths[i]));

+			throw new InvalidInputException(Main.bind("configure.incorrectClasspath",classpaths[i])); //$NON-NLS-1$

 	}

 	if (destinationPath == null) {

-		destinationPath = System.getProperty("user.dir"/*nonNLS*/);

-	} else if ("none"/*nonNLS*/.equals(destinationPath)) {

+		destinationPath = System.getProperty("user.dir"); //$NON-NLS-1$

+	} else if ("none".equals(destinationPath)) { //$NON-NLS-1$

 		destinationPath = null;

 	}

 		

 	if (filenames == null)

-		throw new InvalidInputException(Main.bind("configure.noSource"/*nonNLS*/));

+		throw new InvalidInputException(Main.bind("configure.noSource")); //$NON-NLS-1$

 

 	if (log != null){

 		try {

 			out = new PrintWriter(new FileOutputStream(log, false));

 		} catch(IOException e){

-			throw new InvalidInputException(Main.bind("configure.cannotOpenLog"/*nonNLS*/));

+			throw new InvalidInputException(Main.bind("configure.cannotOpenLog")); //$NON-NLS-1$

 		}

 	} else {

 		showProgress = false;

 	}

+

 	if (repetitions == 0) {

 		repetitions = 1;

 	}

@@ -584,22 +648,22 @@
 					if (problems[i] != null) {

 						globalProblemsCount++;

 						if (localErrorCount == 0)

-							out.println("----------"/*nonNLS*/);

-						out.print(globalProblemsCount + ". "/*nonNLS*/ + (problems[i].isError() ? Main.bind("requestor.error"/*nonNLS*/) : Main.bind("requestor.warning"/*nonNLS*/)));

+							out.println("----------"); //$NON-NLS-1$

+						out.print(globalProblemsCount + ". " + (problems[i].isError() ? Main.bind("requestor.error") : Main.bind("requestor.warning"))); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 						if (problems[i].isError()) {

 							globalErrorsCount++;

 						} else {

 							globalWarningsCount++;

 						}

-						out.print(" "/*nonNLS*/);

-						out.print(Main.bind("requestor.in"/*nonNLS*/,new String(problems[i].getOriginatingFileName())));

+						out.print(" "); //$NON-NLS-1$

+						out.print(Main.bind("requestor.in",new String(problems[i].getOriginatingFileName()))); //$NON-NLS-1$

 						try {

 							out.println(((DefaultProblem)problems[i]).errorReportSource(compilationResult.compilationUnit));

 							out.println(problems[i].getMessage());

 						} catch (Exception e) {

-							out.println(Main.bind("requestor.notRetrieveErrorMessage"/*nonNLS*/,problems[i].toString()));

+							out.println(Main.bind("requestor.notRetrieveErrorMessage",problems[i].toString())); //$NON-NLS-1$

 						}

-						out.println("----------"/*nonNLS*/);

+						out.println("----------"); //$NON-NLS-1$

 						if (problems[i].isError())

 							localErrorCount++;

 					}

@@ -620,19 +684,18 @@
 protected CompilationUnit[] getCompilationUnits() throws InvalidInputException {

 	int fileCount = filenames.length;

 	CompilationUnit[] units = new CompilationUnit[fileCount];

-

 	HashtableOfObject knownFileNames = new HashtableOfObject(fileCount);

 	

 	for (int i = 0; i < fileCount; i++) {

 		char[] charName = filenames[i].toCharArray();

 		if (knownFileNames.get(charName) != null){

-			throw new InvalidInputException(Main.bind("unit.more"/*nonNLS*/,filenames[i]));			

+			throw new InvalidInputException(Main.bind("unit.more",filenames[i]));			 //$NON-NLS-1$

 		} else {

 			knownFileNames.put(charName, charName);

 		}

 		File file = new File(filenames[i]);

 		if (!file.exists())

-			throw new InvalidInputException(Main.bind("unit.missing"/*nonNLS*/,filenames[i]));

+			throw new InvalidInputException(Main.bind("unit.missing",filenames[i])); //$NON-NLS-1$

 		units[i] = new CompilationUnit(null, filenames[i]);

 	}

 	return units;

@@ -662,13 +725,7 @@
  *  Low-level API performing the actual compilation

  */

 protected ConfigurableOption[] getOptions() {

-	CompilerOptions options = new CompilerOptions();

-	options.produceDebugAttributes(debugMask);

-	options.preserveAllLocalVariables(preserveAllLocalVariables);

-	options.handleImportProblemAsError(importProblemIsError);

-	options.setWarningThreshold(warningMask);

-	options.setTargetJDK(targetJDK);

-	return options.getConfigurableOptions(Locale.getDefault());

+	return options;

 }

 protected IProblemFactory getProblemFactory() {

 	return new DefaultProblemFactory(Locale.getDefault());

@@ -704,7 +761,7 @@
 				} catch (IOException e) {

 					String fileName = destinationPath + new String(relativeName);

 					e.printStackTrace();

-					System.out.println(Main.bind("output.noClassFileCreated"/*nonNLS*/,fileName));

+					System.out.println(Main.bind("output.noClassFileCreated",fileName)); //$NON-NLS-1$

 				}

 				exportedClassFilesCounter++;

 			}

@@ -722,45 +779,15 @@
 				getOptions(),

 		 		getBatchRequestor(),

 				getProblemFactory());

-

 	CompilerOptions options = batchCompiler.options;

+

 	// set the non-externally configurable options.

 	options.setVerboseMode(verbose);

 	options.produceReferenceInfo(produceRefInfo);

-	

 	batchCompiler.compile(getCompilationUnits());

 }

 private void printUsage() {

-	out.println(Main.bind("misc.usage"/*nonNLS*/,this.versionID));

-	/*out.println(

-		"Eclipse Java Compiler "+ this.versionID + ", Copyright IBM Corp 2000\n\n" +

-		"Usage: <options> <source files | directories>\n\n" +

-					"where options include:\n" +

-					"-version or -v\tdisplays the version number (standalone option)\n" +

-					"-help\tdisplay this help message (standalone option)\n" +

-					"-noExit\tPrevent the compiler to call System.exit at the end of the compilation process\n" +					

-					"-classpath <dir 1>;<dir 2>;...;<dir P>\n" +

-					"-d <dir>\tdestination directory\n\t\t, specified '-d none' if you don't want to dump files\n" +

-					"-verbose\tprint accessed/processed compilation units \n" +

-					"-time\t\tdisplay total compilation time" +

-							"\n\t\tand speed if line attributes are enabled\n" +

-					"-log <filename>\tspecify a log file for recording problems\n" +

-					"-progress\t\tshow progress (only in -log mode)\n" +

-					"-g[:<level>]\tspecify the level of details for debug attributes" +

-							"\n\t\t-g\tgenerate all debug info"+

-							"\n\t\t-g:none\tno debug info"+

-							"\n\t\t-g:{lines,vars,source}\tonly some debug info\n" +

-					"-nowarn\t\tdo not report warnings \n" +

-					"-warn:<mask>\tspecify the level of details for warnings\n" +

-							"\t\t-warn:none no warning\n"+

-							"\t\t-warn:{constructorName, packageDefaultMethod, deprecation,\n" +

-							"\t\t\tmaskedCatchBlocks, unusedLocals, unusedArguments, \n" +

-							"\t\t\tsyntheticAccess}\n" +					

-					"-noImportError\tdo not report errors on incorrect imports\n" +

-					"-proceedOnError\tkeep compiling when error, \n\t\tdumping class files with problem methods\n" +

-					"-referenceInfo\tcompute reference info\n" +

-					"-preserveAllLocals\trequest code gen preserve all local variables\n" +

-					"-repeat <n>\trepeat compilation process for performance analysis\n");*/

+	out.println(Main.bind("misc.usage",this.versionID)); //$NON-NLS-1$

 	out.flush();

 }

 

@@ -784,14 +811,14 @@
  */

 public static String bind(String id, String[] bindings) {

 	if (id == null)

-		return "No message available"/*nonNLS*/;

+		return "No message available"; //$NON-NLS-1$

 	String message = null;

 	try {

 		message = bundle.getString(id);

 	} catch (MissingResourceException e) {

 		// If we got an exception looking for the message, fail gracefully by just returning

 		// the id we were looking for.  In most cases this is semi-informative so is not too bad.

-		return "Missing message: "/*nonNLS*/+id+" in: "/*nonNLS*/+bundleName;

+		return "Missing message: "+id+" in: "+bundleName; //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	if (bindings == null)

 		return message;

@@ -810,7 +837,7 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);

+					output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$

 				}

 			} else {

 				output.append(message.substring(end, length));

diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 6d4bc76..accca92 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -24,6 +24,7 @@
 configure.noSourceFile = no source file specified

 configure.duplicateLog = duplicate log specification: {0}

 configure.duplicateRepeat = duplicate repeat specification: {0}

+configure.source = invalid source option, source is either '1.3' or '1.4': {0}

 configure.duplicateOutputPath = duplicate output path specification: {0}

 configure.duplicateClasspath = duplicate classpath specification: {0}

 configure.invalidDebugOption = invalid debug option: {0}

@@ -55,4 +56,4 @@
 output.noClassFileCreated = No .class file created for file named {0} because of a IOException.

 

 ### miscellaneous

-misc.usage = Eclipse Java Compiler {0}, Copyright IBM Corp 2000\n\nUsage: <options> <source files | directories>\n\nwhere options include:\n-version or -v\tdisplays the version number (standalone option)\n-help\tdisplay this help message (standalone option)\n-noExit\tPrevent the compiler to call System.exit at the end of the compilation process\n-classpath <dir 1>;<dir 2>;...;<dir P>\n-d <dir>\tdestination directory, specified '-d none' if you don't want to dump files\n-verbose\tprint accessed/processed compilation units \n-time\t\tdisplay total compilation time and speed if line attributes are enabled\n-log <filename>\tspecify a log file for recording problems\n-progress\t\tshow progress (only in -log mode)\n-g[:<level>]\tspecify the level of details for debug attributes\n\t\t-g\tgenerate all debug info\n\t\t-g:none\tno debug info\n\t\t-g:{lines,vars,source}\tonly some debug info\n-nowarn\t\tdo not report warnings \n-warn:<mask>\tspecify the level of details for warnings\n\t\t-warn:none no warning\n\t\t-warn:{constructorName, packageDefaultMethod, deprecation,\n\t\t\tmaskedCatchBlocks, unusedLocals, unusedArguments, \n\t\t\tsyntheticAccess}\n-noImportError\tdo not report errors on incorrect imports\n-proceedOnError\tkeep compiling when error, dumping class files with problem methods\n-referenceInfo\tcompute reference info\n-preserveAllLocals\trequest code gen preserve all local variables\n-repeat <n>\trepeat compilation process for performance analysis\n

+misc.usage = Eclipse Java Compiler {0}, Copyright IBM Corp 2000\n\nUsage: <options> <source files | directories>\n\nwhere options include:\n-version or -v\tdisplays the version number (standalone option)\n-help\tdisplay this help message (standalone option)\n-noExit\tPrevent the compiler to call System.exit at the end of the compilation process\n-classpath <dir 1>;<dir 2>;...;<dir P>\n-d <dir>\tdestination directory, specified '-d none' if you don't want to dump files\n-verbose\tprint accessed/processed compilation units \n-time\t\tdisplay total compilation time and speed if line attributes are enabled\n-log <filename>\tspecify a log file for recording problems\n-progress\t\tshow progress (only in -log mode)\n-g[:<level>]\tspecify the level of details for debug attributes\n\t\t-g\tgenerate all debug info\n\t\t-g:none\tno debug info\n\t\t-g:{lines,vars,source}\tonly some debug info\n-nowarn\t\tdo not report warnings \n-warn:<mask>\tspecify the level of details for warnings\n\t\t-warn:none no warning\n\t\t-warn:{constructorName, packageDefaultMethod, deprecation,\n\t\t\tmaskedCatchBlocks, unusedLocals, unusedArguments, \n\t\t\tsyntheticAccess,assertIdentifier}\n-noImportError\tdo not report errors on incorrect imports\n-proceedOnError\tkeep compiling when error, dumping class files with problem methods\n-referenceInfo\tcompute reference info\n-preserveAllLocals\trequest code gen preserve all local variables\n-repeat <n>\trepeat compilation process for performance analysis\n-source 1.4\t\nActive the assertion inside the compiler. By default assertions are disabled.

diff --git a/build.properties b/build.properties
index 58814dd..f695e22 100644
--- a/build.properties
+++ b/build.properties
@@ -4,6 +4,7 @@
 				build.properties,\

 				scripts/

 

+build.vaj.Eclipse\ Java\ Ant\ Compiler=Eclipse Java Ant Compiler

 build.vaj.Eclipse\ Java\ Batch\ Compiler=Eclipse Java Batch Compiler

 build.vaj.Eclipse\ Java\ Code\ Assist=Eclipse Java Code Assist

 build.vaj.Eclipse\ Java\ Compiler=Eclipse Java Compiler

@@ -12,7 +13,8 @@
 build.vaj.Eclipse\ Java\ Formatter=Eclipse Java Formatter

 build.vaj.Eclipse\ Java\ Model=Eclipse Java Model

 

-source.jdtcore.jar = Eclipse Java Batch Compiler,\

+source.jdtcore.jar = Eclipse Java Ant Compiler,\

+					 Eclipse Java Batch Compiler,\

 					 Eclipse Java Code Assist,\

 					 Eclipse Java Formatter,\

 					 Eclipse Java Compiler,\

diff --git a/changes.txt b/changes.txt
index 02bc782..1be915b 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,14 +1,55 @@
-STREAM: 1.0 NL

+STREAM: 2.0

 

-What's new in this drop

+What's new in this drop (since 0.9)

 ==================================================================================

   * JCK1.3a compliant. 

   * All messages have been externalized. 

+  * Added 2 new APIs on JavaConventions for classpath validation.

+         - IJavaModelStatus validateClasspath(IJavaProject project, IClasspathEntry[] classpath, IPath outputLocation) 

+         - IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment) 

+ * Ant Eclipse compiler task added (org.eclipse.jdt.core.ant.Jdtcom)

+ * Assertions support enabled: by default the compiler is 1.3 compliant, but it can optionally be turned into source 1.4 mode cf. JavaCore options.

+ * Added new APIs on JavaCore so as to change optional settings (compiler, formatter, codeassist, ...). 

+ 		- Description of available options is available in JavaCore.ini 	along with default values. 

+ 		- Option settings are globally kept on JavaCore.

+

+PRs Fixed in this Release (since 1.0NL stream)

+==================================================================================

+1GI6T4Y: ITPJCORE:WINNT - NPE in JavaModeManager retrieving workspace options

+1GE4ILR: ITPJCORE:ALL - Eval - Evaluation in Binary Project fails

+1GI3LLC: ITPJCORE:ALL - Incorrect formatting for the new keyword

+1GHU6O5: ITPJCORE:WINNT - RMIC test fail

+1GHH6O7: ITPJCORE:ALL - Need to tune the exception analysis for AssertStatement

+1GHUW7T: ITPJCORE:WIN2000 - Build Problem

+1GI3IG9: ITPJCORE:ALL - internal compiler error involving bogus method/field declaration

+1GHU4PK: ITPJCORE:WINNT - NoSuchMethodError when running program

+1GHONAX: ITPJCORE:WIN2000 - Compiler uses different name lookup for refactoring

+1GEJYAJ: ITPJCORE:WIN2000 - Compiler - Binding of QualifiedNameReference is null

+1GHFHWR: ITPJCORE:ALL - Assertions: CodeAssist and Selection need to be updated

+1GHFHXG: ITPJCORE:ALL - Assertions: Add optional warning on assert identifier

+1GCZ9VM: ITPJCORE:WIN2000 - DCR - Compiler - Batch compiler should be API

+1GHO6QR: ITPJCORE:WINNT - Code Assist - no method completion when return type is secondary one

+1GH0AU7: ITPJCORE:ALL - Eval - VerifyError in scrapbook page

+1GH2R62: ITPJCORE:WIN2000 - Typo in progress message

+1GGYL32: ITPJCORE:ALL - Default supertypes are not visible when qualified

+1GDFJK0: IVJIDT:WIN2000 - Using 'synchronized' produces invalid exception table values in class, causes "Illegal exception table range" exception, VAJ 3.5+ 

+1GGAK6G: ITPJCORE:ALL - Incorrect javadoc comment in JavaElement 

+1GF9L3K: ITPDUI:ALL - Eval - Private array resolution failure 

+1GF8KHX: ITPJUI:ALL - Invalid project build path should be warning, not error 

+1GF7JIH: ITPJCORE:ALL - Exception when removing network drive 

+1GEYBL9: ITPJUI:WINNT - Adding source folders on CP is very confusing 

+1GEJAOT: ITPJUI:WINNT - JRE Source attachment set to path to does not exist 

+1GEHZNB: ITPJUI:WINNT - smoke 114: formatter inserts extra tab in first line 

+1GCZZT4: ITPJCORE:Fault-tolerance - missing constructor invocation could still answer the allocated type 

+1GAU96P: ITPJCORE:WINNT - DCR - JM - JavaProject should provide a class path validation method 

+1G7A1TL: ITPJCORE:WINNT - DCR - JM - Rules for classpath not specified 

+1FVVWZT: ITPJCORE:ALL - JM - IBinaryType should implement getSourceFileName() 

+

 

 PRs Fixed in 1.0NL stream (since 0.9)

 ==================================================================================

 1GGCYEU: ITPJCORE:ALL - Using Ant for build skip files

-1GH3218: ITPJUI:WIN - mnemonic problems

+1GH3218: ITPJUI:WIN - mnuemonic problems

 1GGLLUG: ITPJCORE:WINNT - @deprecated does not work if it is followed by a TAB 

 1GG8T8H: ITPJCORE:ALL - JCK1.3a - dasg04203 - definitely assigned value before the third operand of the conditional operator ? : 

 1GG8T56: ITPJCORE:ALL - JCK1.3a - dasg04103 - definitely assigned value before the second operand of the conditional operator ? : 

@@ -29,4 +70,128 @@
 1GF9Y01: ITPCORE:WIN2000 - NPE when deleting everything in a java file and saving it. 

 1G2F1DT: ITPJCORE:WINNT - Error messages non NLS for JavaModelStatu

 1GGCQZ3: ITPJCORE:ALL - NL problems in xml fil  

-1GFIRSN: ITPJCORE:WINNT - Classpath - Should allow nesting in binary output when no source folder in on CP 

+1GFIRSN: ITPJCORE:WINNT - Classpath - Should allow nesting in binary output when no source folder in on CP

+

+

+PRs Closed in this Release

+==================================================================================

+1GGRCGZ: ITPJUI:WIN2000 - Can't rename/copy/move/delete default package

+1GDRXHP: ITPDUI:WINNT - NPE inspecting local var

+1G7RAO5: ITPJCORE:ALL - Java Model Core Tests: JavaProjectTests>>testProjectClose() has been removed

+1GF7PZW: ITPJCORE:WINNT - Evaluation - Walkback reporting error on local variable type 

+1GGLNOQ: ITPJCORE:WINNT - @deprecated does not work if it is followed by a TAB - use a space instead. 

+1G295FE: ITPJCORE:ALL - Improve package fragment root management for java project 

+1GFQ3FD: ITPJUI:WINNT - Non java resources do not show up under default package, but do under other packages 

+1GFBJS9: ITPJUI:ALL - Unbound variable path task not removed 

+1GF2LA7: ITPJCORE:WINNT - Adding classpath variable triggers many builds? 

+1GEAHG1: ITPJCORE:WIN2000 - Positions of type and method declarations 

+1GD57YY: ITPJCORE:WINNT - Unhandled exception in standalone compiler 

+1GBPLAP: ITPJUI:WINNT - create class/package not allowed with umlaut 

+1G82CEX: ITPJCORE:Adding evaluation support in debugger 

+1G4GELA: ITPJCORE:WINNT - NPE: after restarting a crashed workbench 

+1G3FV4S: ITPJCORE:WIN - DOMException when renaming constructor 

+1G0K0OI: ITPCORE:ALL - Too many ICompilationUnits 

+1FRTN67: ITPJCORE:ALL - JM - CodeAssist/TypeHierarchy optimization 

+1FJOQSH: LFCOM:WINNT - usage of strictfp modifier 

+1FFYDGD: LFCOM:ALL - Weird behavior on incorrect source 

+1ETNYD2: IVJIDT:AIX - Format code with "Experminent with Code" 

+1ETAM38: IVJIDT:AIX - Code Formatter does not put CR after comment end 

+1GE906O: ITPJCORE:ALL - Having trouble getting projects to build properly - project properties noting getting set correctly 

+1GE6V5W: ITPJCORE:WINNT - Problems saving workspace 

+1GDXCY7: ITPJCORE:WIN2000 - Adding a project to build path doesn't trigger build in dependents 

+1GAM4RI: ITPJCORE:WINNT - Errors did not go away after adding jars to buildpath 

+1GAJBOB: ITPJUI:WINNT - Code Assist continues after entering blank 

+1G4CLZM: ITPJUI:WINNT - 'Import Selection' - Set not found 

+1G47HWU: ITPJUI:WINNT - Method Stub Generation: Error on methods throwing Exceptions 

+1G3H21Z: ITPJCORE:ALL - Package fragment reorganization problems 

+1FWCDYN: ITPJUI:WINNT - resources prematurely made local 

+1FWAPGJ: ITPJCORE:ALL - Synchronization is confusing with Java builder 

+1FW8MAI: ITPCORE:WIN2000 - Compiler does not recompile all the classes 

+1FW6JQG: ITPUI:WINNT - Joining a team may have incorrect classpath 

+1GEAX3R: ITPJCORE:WIN2000 - bad error message for ambiguous references 

+1GDJ1QU: ITPJCORE:WINNT - NPE building project 

+1GD0MLS: ITPJCORE:ALL - Stack traces in log of unknown origin 

+1G0UYOQ: ITPJCORE:ALL - Different text range definitions 

+1GFJ764: ITPJCORE:ALL - Inconpatible conditional operand types 

+1GFBFV7: ITPJCORE:WINNT - Resource copy - should not copy nested internal JARs 

+1GF9OW7: ITPJCORE:ALL - Build silently fails for reappearing deleted classes 

+1GEOY41: ITPJCORE:WINNT - DeltaProcessor - createElements seems bogus 

+1GENY3I: ITPJUI:WINNT - Rename Refactoring introduced compile errors 

+1GEJC08: ITPJCORE:WIN2000 - Assertion failed in builder 

+1GEI1SS: ITPJCORE:ALL - .java file outside of the classpath should be a compilation unit 

+1GE6PGY: ITPJUI:ALL - Wrong class everywhere 

+1GE2UUN: ITPDUI:IndexOutOfBounds during eval? 

+1GE25VE: ITPJUI:WIN2000 - Cannot search on text selection 

+1GDXD7U: ITPJCORE:WINNT - Search not working for projects 

+1GDX5E3: ITPJCORE:WINNT - Assertion failed when rename Java Project 

+1GDTT7B: ITPJCORE:WIN2000 - Classpath extension in jar manifest not respected 

+1GDMMBJ: ITPDUI:WINNT - Stack trace on inspect 

+1GDKLB6: ITPDUI:Linux - Inspect from editor broken in linux 

+1GDJ3BJ: ITPJCORE:WINNT - Error while typing in editor 

+1GDIUMQ: ITPJCORE:WINNT - Build time anomaly when doing incremental builds 

+1GDG971: ITPJCORE:WIN2000 - Classpath changes aren't honored by the builder 

+1GDDWFM: ITPJCORE:WINNT - Builder leaving bogus errors after auto-build + hand build 

+1GDBL1B: ITPJCORE:WIN2000 - Throwable type hierarchy calculation is slow 

+1GD4KY2: ITPJCORE:WINNT - False compile errors not going away when building by hand 

+1GCTG65: ITPJUI:WIN2000 - Classpath file is copied to bin 

+1GCR9MT: ITPJCORE:WINNT - ClassCastException creating a text file 

+1GCP6LR: ITPJUI:WINNT - User must get feedback if .classpath file is manipulated 

+1GCNFC2: ITPJCORE:ALL - ArrayIndeOutOfBoundsException in CodeAssist 

+1GCN2N4: ITPJUI:WIN2000 - Walkback while organizing imports 

+1GCFZPA: ITPJCORE:WINNT - Could SourceRange be public API? 

+1GCFNQR: ITPJCORE:WINNT - How should the path in ITypeNameRequestor be used? 

+1GCBQ2E: ITPJCORE:WINNT - how to efficiently find methods along 'the ripple'? 

+1GBRLSV: ITPJCORE:WIN2000 - Question: how to I find an inner type 

+1GBALN1: ITPJUI:Incorrect source for created class 

+1GAUUQ9: ITPJCORE:WINNT - JavaBuilder doesn't handle internal exceptions during full build 

+1GAP1QC: ITPJCORE:WINNT - JavaProject.configure creates invalid output path 

+1GAML2O: ITPJCORE:WINNT - NPE during start-up 

+1GALZ9N: ITPJCORE:WINNT - Compiler work being done on empty projects 

+1GAJ82M: ITPJUI:WINNT - walkback when delete a jar from a java project 

+1GAH7KH: ITPJCORE:WINNT - Reopened projects show the bin folder as a package 

+1G86704: ITPJUI:WINNT - Drap'nDrop doesn't give operation progress 

+1G840BE: ITPJUI:WINNT - code assist - only some keywords are recognized 

+1G82D17: ITPJCORE:WINNT - getJavaModel(IWorkspace) looks like an accessor but it does creation 

+1G58H14: ITPJCORE:WIN98 - OutOfMemoryException building a big workbench 

+1G4W2XB: ITPJCORE:WIN98 - CodeAssist should not always report an error when no completion was found 

+1G4U1CZ: ITPJCORE:WINNT - JavaDCDuplicateInnerClassName test is failing 

+1G4ENQI: ITPJUI:WIN - NewInterface wizard adds wrong import for inner types 

+1G4CKVG: ITPJCORE:WIN - Can't patch classes in jar 

+1G426W6: ITPJCORE:WINNT - VerifyError running jre Eclipse 010 with the IBM 1.3 VM 

+1G41GH7: ITPJCORE:WINNT - adding a project invokes a recompile 

+1G3T0OO: ITPJCORE:WINNT - Invisible class in all possible super classes 

+1G3MKWT: ITPJCORE:WIN - Would like more progress on java reorg operations 

+1G3DP5Z: ITPJCORE:WIN - IPackageFragment.delete() doesn't delete resources 

+1G31A03: ITPJCORE:WIN98 - Building vs. packaging 

+1G2NW6V: ITPJUI:WIN2000 - Open on selection doesn't work for inner classes 

+1G14M8E: ITPCOM:WINNT - Wrong completion when package name collides with a class name 

+1G03GWJ: ITPJCORE:ALL - TypeHierarchy update tuning 

+1FYEH7R: ITPJCORE:WINNT - CoreException running WorkingCopyTests with autobuild on 

+1FY94XA: ITPJCORE:WINNT - JM - testWorkingCopyGeneral() tests randomly fail 

+1FXOAS3: ITPJCORE:ALL - JDOM - remove deprecated method #findNode 

+1FWYKB2: ITPJCORE:WIN98 - Feature: When I open a class file for a member type... 

+1FWX73S: ITPJCORE:WINNT - Java Builder error when saving html file 

+1FWWU28: ITPJCORE:WIN98 - Cannot access compilation unit - Reason: Java Image Builder 

+1FWUZ9J: ITPJCORE:WINNT - Add autobuilding option to test suite 

+1FWUXTH: ITPJCORE:WINNT - Java Image Builder error message no help 

+1FWT5CP: ITPJCORE:ALL - Disable timestamps assertion failed 

+1FWST7K: ITPJCORE:WINNT - SCENARIO B3 - error saving jsp 

+1FWNLL4: ITPJCORE:WIN2000 - "Editing" internal jar results in ImageBuilderInternalException 

+1FWN24W: ITPSRCEDIT:WIN - Get error message if class not saved - task list out of sync 

+1FWHWGK: ITPJCORE:ALL - javadoc - warnings during javadoc generation 

+1FW6M3U: ITPJCORE:WIN98 - JDOM cannot reproduce "import java. lang. *;" 

+1FVU7O2: ITPJCORE:WINNT - JDOM cannot handle "import java.lang.* " 

+1FVRW2A: ITPJCORE:WIN98 - Source text still accessible after manually deleting file 

+1FVL59P: ITPJUI:WINNT - double clicking on task does not go to right place in source 

+1FVII1P: ITPJCORE:ALL - JDOM - Import names reported by parser do not contain '.*' 

+1FUNPVG: ITPJCORE:ALL - JavaDCChangeFromFullyQualifiedToImportTest1 is failing 

+1FU4P4U: ITPJCORE:ALL - JM - factory should throw detailed exception if unable to create an element 

+1FT78Y7: ITPJCORE:ALL - JM - Reference info is slow 

+1FSZXSX: ITPCOM:WINNT - Do we need FieldEndPosition? 

+1FRKC3T: ITPJCORE:ALL - JM - Incremental Reconciler 

+1FRK6S7: ITPJCORE:ALL - JM - hook for builder to get/put binary types 

+1FPCMAN: ITPJCORE:ALL - JM - Validating Save Operation 

+1GFBCOU: ITPJCORE:WINNT - CodeCompletion - Code assist fails in a method with an incorrect return type

+1GF1VHY: ITPJCORE:ALL - JM - validateFieldName/PackageName should warn if uppercase

+1GEMNE8: ITPJCORE:WIN2000 - JM - JDT DeltaProcessor is very eager

+1FVXJPZ: ITPJCORE:WIN2000 - minor- review error messages
\ No newline at end of file
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index fe8b2e0..f5b0f04 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -24,7 +24,10 @@
  * It contains two public APIs used to call CodeAssist on a given source with

  * a given environment, assisting position and storage (and possibly options).

  */

-public final class CompletionEngine extends Engine implements ISearchRequestor, TypeConstants {

+public final class CompletionEngine

+	extends Engine

+	implements ISearchRequestor, TypeConstants {

+	CompletionOptions options;

 	CompletionParser parser;

 	ISearchableNameEnvironment nameEnvironment;

 	ICompletionRequestor requestor;

@@ -33,773 +36,696 @@
 	char[] source;

 	boolean resolvingImports = false;

 	boolean insideQualifiedReference = false;

-	int startPosition, endPosition;

+	int startPosition, actualCompletionPosition, endPosition;

 	HashtableOfObject knownPkgs = new HashtableOfObject(10);

-/*

-	static final char[][] mainDeclarations =

-		new char[][] {

-			"package".toCharArray(),

-			"import".toCharArray(),

-			"abstract".toCharArray(),

-			"final".toCharArray(),

-			"public".toCharArray(),

-			"class".toCharArray(),

-			"interface".toCharArray()};

+	/*

+		static final char[][] mainDeclarations =

+			new char[][] {

+				"package".toCharArray(),

+				"import".toCharArray(),

+				"abstract".toCharArray(),

+				"final".toCharArray(),

+				"public".toCharArray(),

+				"class".toCharArray(),

+				"interface".toCharArray()};

+	

+		static final char[][] modifiers = // may want field, method, type & member type modifiers

+			new char[][] {

+				"abstract".toCharArray(),

+				"final".toCharArray(),

+				"native".toCharArray(),

+				"public".toCharArray(),

+				"protected".toCharArray(),

+				"private".toCharArray(),

+				"static".toCharArray(),

+				"strictfp".toCharArray(),

+				"synchronized".toCharArray(),

+				"transient".toCharArray(),

+				"volatile".toCharArray()};

+	*/

+	static final char[][] baseTypes = new char[][] { "boolean" //$NON-NLS-1$

+		

+		.toCharArray(), "byte" //$NON-NLS-1$

+		

+		.toCharArray(), "char" //$NON-NLS-1$

+		

+		.toCharArray(), "double" //$NON-NLS-1$

+		

+		.toCharArray(), "float" //$NON-NLS-1$

+		

+		.toCharArray(), "int" //$NON-NLS-1$

+		

+		.toCharArray(), "long" //$NON-NLS-1$

+		

+		.toCharArray(), "short" //$NON-NLS-1$

+		

+		.toCharArray(), "void" //$NON-NLS-1$

+		

+		.toCharArray()};

 

-	static final char[][] modifiers = // may want field, method, type & member type modifiers

-		new char[][] {

-			"abstract".toCharArray(),

-			"final".toCharArray(),

-			"native".toCharArray(),

-			"public".toCharArray(),

-			"protected".toCharArray(),

-			"private".toCharArray(),

-			"static".toCharArray(),

-			"strictfp".toCharArray(),

-			"synchronized".toCharArray(),

-			"transient".toCharArray(),

-			"volatile".toCharArray()};

-*/

-	static final char[][] baseTypes = 

-		new char[][] {

-			"boolean"/*nonNLS*/.toCharArray(),

-			"byte"/*nonNLS*/.toCharArray(),

-			"char"/*nonNLS*/.toCharArray(),

-			"double"/*nonNLS*/.toCharArray(),

-			"float"/*nonNLS*/.toCharArray(),

-			"int"/*nonNLS*/.toCharArray(),

-			"long"/*nonNLS*/.toCharArray(),

-			"short"/*nonNLS*/.toCharArray(),

-			"void"/*nonNLS*/.toCharArray()}; 

+	static final char[] classField = "class"  //$NON-NLS-1$

+	.toCharArray();

+	static final char[] lengthField = "length"  //$NON-NLS-1$

+	.toCharArray();

+	static final char[] THIS = "this"  //$NON-NLS-1$

+	.toCharArray();

+	/**

+	 * The CompletionEngine is responsible for computing source completions.

+	 *

+	 * It requires a searchable name environment, which supports some

+	 * specific search APIs, and a requestor to feed back the results to a UI.

+	 *

+	 *  @param environment com.ibm.codeassist.java.api.ISearchableNameEnvironment

+	 *      used to resolve type/package references and search for types/packages

+	 *      based on partial names.

+	 *

+	 *  @param requestor com.ibm.codeassist.java.api.ICompletionRequestor

+	 *      since the engine might produce answers of various forms, the engine 

+	 *      is associated with a requestor able to accept all possible completions.

+	 *

+	 *  @param options com.ibm.compiler.java.api.ConfigurableOptions

+	 *		set of options used to configure the code assist engine.

+	 */

 

-	static final char[] classField = "class"/*nonNLS*/.toCharArray();

-	static final char[] lengthField = "length"/*nonNLS*/.toCharArray();

-/**

- * The CompletionEngine is responsible for computing source completions.

- *

- * It requires a searchable name environment, which supports some

- * specific search APIs, and a requestor to feed back the results to a UI.

- *

- *  @param environment com.ibm.codeassist.java.api.ISearchableNameEnvironment

- *      used to resolve type/package references and search for types/packages

- *      based on partial names.

- *

- *  @param requestor com.ibm.codeassist.java.api.ICompletionRequestor

- *      since the engine might produce answers of various forms, the engine 

- *      is associated with a requestor able to accept all possible completions.

- *

- *  @param options com.ibm.compiler.java.api.ConfigurableOptions

- *		set of options used to configure the code assist engine.

- */

+	public CompletionEngine(

+		ISearchableNameEnvironment nameEnvironment,

+		ICompletionRequestor requestor,

+		ConfigurableOption[] settings) {

 

-public CompletionEngine(

-	ISearchableNameEnvironment nameEnvironment, ICompletionRequestor requestor, ConfigurableOption[] settings) {

+		this.requestor = requestor;

+		this.nameEnvironment = nameEnvironment;

 

-	this.requestor = requestor;

-	this.nameEnvironment = nameEnvironment;

-

-	CompilerOptions options = new CompilerOptions(settings);

-	ProblemReporter problemReporter =

-		new ProblemReporter(

-			DefaultErrorHandlingPolicies.proceedWithAllProblems(),

-			options,

-			new DefaultProblemFactory(Locale.getDefault())) {

-				public void record(IProblem problem, CompilationResult unitResult) {

-					if (problem.getID() != ProblemIrritants.UnmatchedBracket) {

-						unitResult.record(problem);

-						CompletionEngine.this.requestor.acceptError(problem);

-					}

+		options = new CompletionOptions(settings);

+		CompilerOptions compilerOptions = new CompilerOptions(settings);

+		ProblemReporter problemReporter =

+			new ProblemReporter(

+				DefaultErrorHandlingPolicies.proceedWithAllProblems(),

+				compilerOptions,

+				new DefaultProblemFactory(Locale.getDefault())) {

+			public void record(IProblem problem, CompilationResult unitResult) {

+				if (problem.getID() != ProblemIrritants.UnmatchedBracket) {

+					unitResult.record(problem);

+					CompletionEngine.this.requestor.acceptError(problem);

 				}

-			};

-

-	this.parser = new CompletionParser(problemReporter);

-	this.lookupEnvironment = new LookupEnvironment(this, options, problemReporter, nameEnvironment);

-}

-/**

- * One result of the search consists of a new class.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.M".

- *    The default package is represented by an empty array.

- */

-public void acceptClass(char[] packageName, char[] className, int modifiers) {

-	char[] completionName = CharOperation.concat(packageName, className, '.');

-	if (resolvingImports) {

-		completionName = CharOperation.concat(completionName, new char[] {';'});

-	} else if (!insideQualifiedReference) {

-		if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

-	 		if (packageName == null || packageName.length == 0)

-				if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

-					return; // ignore types from the default package from outside it

-		} else {

-			completionName = className;

-		}

-	}

-

-	requestor.acceptClass(

-		packageName,

-		className,

-		completionName,

-		modifiers,

-		startPosition,

-		endPosition);

-}

-/**

- * One result of the search consists of a new interface.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.I".

- *    The default package is represented by an empty array.

- */

-public void acceptInterface(char[] packageName, char[] interfaceName, int modifiers) {

-	char[] completionName = CharOperation.concat(packageName, interfaceName, '.');

-	if (resolvingImports) {

-		completionName = CharOperation.concat(completionName, new char[] {';'});

-	} else if (!insideQualifiedReference) {

-		if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

-	 		if (packageName == null || packageName.length == 0)

-				if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

-					return; // ignore types from the default package from outside it

-		} else {

-			completionName = interfaceName;

-		}

-	}

-

-	requestor.acceptInterface(

-		packageName,

-		interfaceName,

-		completionName,

-		modifiers,

-		startPosition,

-		endPosition);

-}

-/**

- * One result of the search consists of a new package.

- *

- * NOTE - All package names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    The default package is represented by an empty array.

- */

-public void acceptPackage(char[] packageName) {

-	if (this.knownPkgs.containsKey(packageName)) return;

-	this.knownPkgs.put(packageName, this);

-	requestor.acceptPackage(

-		packageName,

-		resolvingImports ? CharOperation.concat(packageName, new char[] {'.', '*', ';'}) : packageName,

-		startPosition,

-		endPosition);

-}

-/**

- * One result of the search consists of a new type.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.M".

- *    The default package is represented by an empty array.

- */

-public void acceptType(char[] packageName, char[] typeName) {

-	char[] completionName = CharOperation.concat(packageName, typeName, '.');

-	if (resolvingImports) {

-		completionName = CharOperation.concat(completionName, new char[] {';'});

-	} else if (!insideQualifiedReference) {

-		if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

-	 		if (packageName == null || packageName.length == 0)

-				if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

-					return; // ignore types from the default package from outside it

-		} else {

-			completionName = typeName;

-		}

-	}

-

-	requestor.acceptType(

-		packageName,

-		typeName,

-		completionName,

-		startPosition,

-		endPosition);

-}

-private void complete(AstNode astNode, Binding qualifiedBinding, Scope scope) {

-	setSourceRange(astNode.sourceStart, astNode.sourceEnd); // defaults... some nodes will change these

-

-	if (astNode instanceof CompletionOnFieldType) {

-		CompletionOnSingleTypeReference type =

-			(CompletionOnSingleTypeReference) ((CompletionOnFieldType) astNode).type;

-		char[] token = type.token;

-		setSourceRange(type.sourceStart, type.sourceEnd);

-//		findKeywords(token, modifiers, scope); // could be the start of a field, method or member type

-		findTypesAndPackages(token, scope);

-	} else if (astNode instanceof CompletionOnSingleNameReference) {

-		char[] token = ((CompletionOnSingleNameReference) astNode).token;

-		findVariablesAndMethods(token, scope);

-		findTypesAndPackages(token, scope); // can be the start of a qualified type name

-	} else if (astNode instanceof CompletionOnSingleTypeReference) {

-		char[] token = ((CompletionOnSingleTypeReference) astNode).token;

-		if (qualifiedBinding == null)

-			findTypesAndPackages(token, scope); // can be the start of a qualified type name

-		else

-			findMemberTypes(token, (ReferenceBinding) qualifiedBinding, scope);

-	} else if (astNode instanceof CompletionOnQualifiedNameReference) {

-		insideQualifiedReference = true;

-		CompletionOnQualifiedNameReference ref = (CompletionOnQualifiedNameReference) astNode;

-		char[] token = ref.completionIdentifier;

-		long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1];

-		if (qualifiedBinding instanceof VariableBinding) {

-			setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

-			TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type;

-			if (receiverType != null)

-				findFieldsAndMethods(token, receiverType, scope);

-		} else if (qualifiedBinding instanceof ReferenceBinding) {

-			ReferenceBinding receiverType = (ReferenceBinding) qualifiedBinding;

-			setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

-			findMemberTypes(token, receiverType, scope);

-			findClassField(token, (TypeBinding) qualifiedBinding);

-			findFields(token, receiverType, scope, new ObjectVector(), true);

-			findMethods(token, null, receiverType, scope, new ObjectVector(), true, false);

-		} else if (qualifiedBinding instanceof PackageBinding) {

-			setSourceRange(astNode.sourceStart, (int) completionPosition); // replace to the end of the completion identifier

-			findTypesAndSubpackages(token, (PackageBinding) qualifiedBinding);

-		}

-	} else if (astNode instanceof CompletionOnQualifiedTypeReference) {

-		insideQualifiedReference = true;

-		CompletionOnQualifiedTypeReference ref = (CompletionOnQualifiedTypeReference) astNode;

-		char[] token = ref.completionIdentifier;

-		long completionPosition = ref.sourcePositions[ref.tokens.length]; // get the source positions of the completion identifier

-		if (qualifiedBinding instanceof ReferenceBinding) {

-			setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

-			findMemberTypes(token, (ReferenceBinding) qualifiedBinding, scope);

-		} else if (qualifiedBinding instanceof PackageBinding) {

-			setSourceRange(astNode.sourceStart, (int) completionPosition); // replace to the end of the completion identifier

-			findTypesAndSubpackages(token, (PackageBinding) qualifiedBinding);

-		}

-	} else if (astNode instanceof CompletionOnMemberAccess) {

-		CompletionOnMemberAccess access = (CompletionOnMemberAccess) astNode;

-		long completionPosition = access.nameSourcePosition;

-		setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

-		findFieldsAndMethods(access.token, (TypeBinding) qualifiedBinding, scope);

-	} else if (astNode instanceof CompletionOnMessageSend) {

-		CompletionOnMessageSend messageSend = (CompletionOnMessageSend) astNode;

-		TypeBinding[] argTypes = computeTypes(messageSend.arguments, (BlockScope) scope);

-		if (qualifiedBinding == null)

-			findMessageSends(messageSend.selector, argTypes, scope);

-		else

-			findMethods(messageSend.selector, argTypes, (ReferenceBinding) qualifiedBinding, scope, new ObjectVector(), false, true);

-	} else if (astNode instanceof CompletionOnExplicitConstructorCall) {

-		CompletionOnExplicitConstructorCall constructorCall = (CompletionOnExplicitConstructorCall) astNode;

-		TypeBinding[] argTypes = computeTypes(constructorCall.arguments, (BlockScope) scope);

-		findConstructors((ReferenceBinding) qualifiedBinding, argTypes, scope);

-	} else if (astNode instanceof CompletionOnQualifiedAllocationExpression) {

-		CompletionOnQualifiedAllocationExpression allocExpression = (CompletionOnQualifiedAllocationExpression) astNode;

-		TypeBinding[] argTypes = computeTypes(allocExpression.arguments, (BlockScope) scope);

-		findConstructors((ReferenceBinding) qualifiedBinding, argTypes, scope);

-	} else if (astNode instanceof CompletionOnClassLiteralAccess) {

-		char[] token = ((CompletionOnClassLiteralAccess) astNode).completionIdentifier;

-		findClassField(token, (TypeBinding) qualifiedBinding);

-	}

-}

-/**

- * Ask the engine to compute a completion at the specified position

- * of the given compilation unit.

- *

- *  @return void

- *      completion results are answered through a requestor.

- *

- *  @param unit com.ibm.compiler.java.api.env.ICompilationUnit

- *      the source of the current compilation unit.

- *

- *  @param completionPosition int

- *      a position in the source where the completion is taking place. 

- *      This position is relative to the source provided.

- */

-public void complete(ICompilationUnit sourceUnit, int completionPosition) {

-	try {

-		int actualCompletionPosition = completionPosition - 1; // for now until we can change the UI.

-		CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

-		CompilationUnitDeclaration parsedUnit = parser.dietParse(sourceUnit, result, actualCompletionPosition);

-

-//		boolean completionNodeFound = false;

-		if (parsedUnit != null) {

-			// scan the package & import statements first

-			if (parsedUnit.currentPackage instanceof CompletionOnPackageReference) {

-				findPackages((CompletionOnPackageReference) parsedUnit.currentPackage);

-				return;

 			}

-			ImportReference[] imports = parsedUnit.imports;

-			if (imports != null) {

-				for (int i = 0, length = imports.length; i < length; i++) {

-					ImportReference importReference = imports[i];

-					if (importReference instanceof CompletionOnImportReference) {

-						findImports((CompletionOnImportReference) importReference);

-						return;

-					}

+		};

+

+		this.parser =

+			new CompletionParser(problemReporter, compilerOptions.getAssertMode());

+		this.lookupEnvironment =

+			new LookupEnvironment(this, compilerOptions, problemReporter, nameEnvironment);

+	}

+	/**

+	 * One result of the search consists of a new class.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.M".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptClass(char[] packageName, char[] className, int modifiers) {

+		char[] completionName = CharOperation.concat(packageName, className, '.');

+		if (resolvingImports) {

+			completionName = CharOperation.concat(completionName, new char[] { ';' });

+		} else

+			if (!insideQualifiedReference) {

+				if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

+					if (packageName == null || packageName.length == 0)

+						if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

+							return; // ignore types from the default package from outside it

+				} else {

+					completionName = className;

 				}

 			}

 

-			if (parsedUnit.types != null) {

-				try {

-					lookupEnvironment.buildTypeBindings(parsedUnit);

-					if ((unitScope = parsedUnit.scope) != null) {

+		requestor.acceptClass(

+			packageName,

+			className,

+			completionName,

+			modifiers,

+			startPosition,

+			endPosition);

+	}

+	/**

+	 * One result of the search consists of a new interface.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.I".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptInterface(

+		char[] packageName,

+		char[] interfaceName,

+		int modifiers) {

+		char[] completionName = CharOperation.concat(packageName, interfaceName, '.');

+		if (resolvingImports) {

+			completionName = CharOperation.concat(completionName, new char[] { ';' });

+		} else

+			if (!insideQualifiedReference) {

+				if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

+					if (packageName == null || packageName.length == 0)

+						if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

+							return; // ignore types from the default package from outside it

+				} else {

+					completionName = interfaceName;

+				}

+			}

+

+		requestor.acceptInterface(

+			packageName,

+			interfaceName,

+			completionName,

+			modifiers,

+			startPosition,

+			endPosition);

+	}

+	/**

+	 * One result of the search consists of a new package.

+	 *

+	 * NOTE - All package names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptPackage(char[] packageName) {

+		if (this.knownPkgs.containsKey(packageName))

+			return;

+		this.knownPkgs.put(packageName, this);

+		requestor.acceptPackage(

+			packageName,

+			resolvingImports

+				? CharOperation.concat(packageName, new char[] { '.', '*', ';' })

+				: packageName,

+			startPosition,

+			endPosition);

+	}

+	/**

+	 * One result of the search consists of a new type.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.M".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptType(char[] packageName, char[] typeName) {

+		char[] completionName = CharOperation.concat(packageName, typeName, '.');

+		if (resolvingImports) {

+			completionName = CharOperation.concat(completionName, new char[] { ';' });

+		} else

+			if (!insideQualifiedReference) {

+				if (mustQualifyType(CharOperation.splitOn('.', packageName), completionName)) {

+					if (packageName == null || packageName.length == 0)

+						if (unitScope != null && unitScope.fPackage.compoundName != NoCharChar)

+							return; // ignore types from the default package from outside it

+				} else {

+					completionName = typeName;

+				}

+			}

+

+		requestor.acceptType(

+			packageName,

+			typeName,

+			completionName,

+			startPosition,

+			endPosition);

+	}

+	private void complete(AstNode astNode, Binding qualifiedBinding, Scope scope) {

+		setSourceRange(astNode.sourceStart, astNode.sourceEnd);

+		// defaults... some nodes will change these

+		if (astNode instanceof CompletionOnFieldType) {

+			CompletionOnSingleTypeReference type =

+				(CompletionOnSingleTypeReference) ((CompletionOnFieldType) astNode).type;

+			char[] token = type.token;

+			setSourceRange(type.sourceStart, type.sourceEnd);

+			//		findKeywords(token, modifiers, scope); // could be the start of a field, method or member type

+			findTypesAndPackages(token, scope);

+		} else

+			if (astNode instanceof CompletionOnSingleNameReference) {

+				char[] token = ((CompletionOnSingleNameReference) astNode).token;

+				findVariablesAndMethods(

+					token,

+					scope,

+					(CompletionOnSingleNameReference) astNode,

+					scope);

+				findTypesAndPackages(token, scope);

+				// can be the start of a qualified type name

+			} else

+				if (astNode instanceof CompletionOnSingleTypeReference) {

+					char[] token = ((CompletionOnSingleTypeReference) astNode).token;

+					if (qualifiedBinding == null)

+						findTypesAndPackages(token, scope);

+					// can be the start of a qualified type name

+					else

+						findMemberTypes(

+							token,

+							(ReferenceBinding) qualifiedBinding,

+							scope,

+							scope.enclosingSourceType());

+				} else

+					if (astNode instanceof CompletionOnQualifiedNameReference) {

+						insideQualifiedReference = true;

+						CompletionOnQualifiedNameReference ref =

+							(CompletionOnQualifiedNameReference) astNode;

+						char[] token = ref.completionIdentifier;

+						long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1];

+						if (qualifiedBinding instanceof VariableBinding) {

+							setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

+							TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type;

+							if (receiverType != null)

+								findFieldsAndMethods(token, receiverType, scope, ref,scope);

+						} else

+							if (qualifiedBinding instanceof ReferenceBinding) {

+								ReferenceBinding receiverType = (ReferenceBinding) qualifiedBinding;

+								setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

+								findMemberTypes(token, receiverType, scope, scope.enclosingSourceType());

+								findClassField(token, (TypeBinding) qualifiedBinding);

+								findFields(

+									token,

+									receiverType,

+									scope,

+									new ObjectVector(),

+									new ObjectVector(),

+									true,

+									ref,

+									scope);

+								findMethods(

+									token,

+									null,

+									receiverType,

+									scope,

+									new ObjectVector(),

+									true,

+									false,

+									ref);

+							} else

+								if (qualifiedBinding instanceof PackageBinding) {

+									setSourceRange(astNode.sourceStart, (int) completionPosition);

+									// replace to the end of the completion identifier

+									findTypesAndSubpackages(token, (PackageBinding) qualifiedBinding);

+								}

+					} else

+						if (astNode instanceof CompletionOnQualifiedTypeReference) {

+							insideQualifiedReference = true;

+							CompletionOnQualifiedTypeReference ref =

+								(CompletionOnQualifiedTypeReference) astNode;

+							char[] token = ref.completionIdentifier;

+							long completionPosition = ref.sourcePositions[ref.tokens.length];

+							// get the source positions of the completion identifier

+							if (qualifiedBinding instanceof ReferenceBinding) {

+								setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

+								findMemberTypes(

+									token,

+									(ReferenceBinding) qualifiedBinding,

+									scope,

+									scope.enclosingSourceType());

+							} else

+								if (qualifiedBinding instanceof PackageBinding) {

+									setSourceRange(astNode.sourceStart, (int) completionPosition);

+									// replace to the end of the completion identifier

+									findTypesAndSubpackages(token, (PackageBinding) qualifiedBinding);

+								}

+						} else

+							if (astNode instanceof CompletionOnMemberAccess) {

+								CompletionOnMemberAccess access = (CompletionOnMemberAccess) astNode;

+								long completionPosition = access.nameSourcePosition;

+								setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);

+								findFieldsAndMethods(

+									access.token,

+									(TypeBinding) qualifiedBinding,

+									scope,

+									access,

+									scope);

+							} else

+								if (astNode instanceof CompletionOnMessageSend) {

+									CompletionOnMessageSend messageSend = (CompletionOnMessageSend) astNode;

+									TypeBinding[] argTypes =

+										computeTypes(messageSend.arguments, (BlockScope) scope);

+									if (qualifiedBinding == null)

+										findMessageSends(messageSend.selector, argTypes, scope, messageSend);

+									else

+										findMethods(

+											messageSend.selector,

+											argTypes,

+											(ReferenceBinding) qualifiedBinding,

+											scope,

+											new ObjectVector(),

+											false,

+											true,

+											messageSend);

+								} else

+									if (astNode instanceof CompletionOnExplicitConstructorCall) {

+										CompletionOnExplicitConstructorCall constructorCall =

+											(CompletionOnExplicitConstructorCall) astNode;

+										TypeBinding[] argTypes =

+											computeTypes(constructorCall.arguments, (BlockScope) scope);

+										findConstructors(

+											(ReferenceBinding) qualifiedBinding,

+											argTypes,

+											scope,

+											constructorCall);

+									} else

+										if (astNode instanceof CompletionOnQualifiedAllocationExpression) {

+											CompletionOnQualifiedAllocationExpression allocExpression =

+												(CompletionOnQualifiedAllocationExpression) astNode;

+											TypeBinding[] argTypes =

+												computeTypes(allocExpression.arguments, (BlockScope) scope);

+											findConstructors(

+												(ReferenceBinding) qualifiedBinding,

+												argTypes,

+												scope,

+												allocExpression);

+										} else

+											if (astNode instanceof CompletionOnClassLiteralAccess) {

+												char[] token = ((CompletionOnClassLiteralAccess) astNode).completionIdentifier;

+												findClassField(token, (TypeBinding) qualifiedBinding);

+											}

+	}

+	/**

+	 * Ask the engine to compute a completion at the specified position

+	 * of the given compilation unit.

+	 *

+	 *  @return void

+	 *      completion results are answered through a requestor.

+	 *

+	 *  @param unit com.ibm.compiler.java.api.env.ICompilationUnit

+	 *      the source of the current compilation unit.

+	 *

+	 *  @param completionPosition int

+	 *      a position in the source where the completion is taking place. 

+	 *      This position is relative to the source provided.

+	 */

+	public void complete(ICompilationUnit sourceUnit, int completionPosition) {

+		try {

+			actualCompletionPosition = completionPosition - 1;

+			// for now until we can change the UI.

+			CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

+			CompilationUnitDeclaration parsedUnit =

+				parser.dietParse(sourceUnit, result, actualCompletionPosition);

+

+			//		boolean completionNodeFound = false;

+			if (parsedUnit != null) {

+				// scan the package & import statements first

+				if (parsedUnit.currentPackage instanceof CompletionOnPackageReference) {

+					findPackages((CompletionOnPackageReference) parsedUnit.currentPackage);

+					return;

+				}

+				ImportReference[] imports = parsedUnit.imports;

+				if (imports != null) {

+					for (int i = 0, length = imports.length; i < length; i++) {

+						ImportReference importReference = imports[i];

+						if (importReference instanceof CompletionOnImportReference) {

+							findImports((CompletionOnImportReference) importReference);

+							return;

+						}

+					}

+				}

+

+				if (parsedUnit.types != null) {

+					try {

+						lookupEnvironment.buildTypeBindings(parsedUnit);

+						if ((unitScope = parsedUnit.scope) != null) {

 							source = sourceUnit.getContents();

 							lookupEnvironment.completeTypeBindings(parsedUnit, true);

 							parsedUnit.scope.faultInTypes();

 							parseMethod(parsedUnit, actualCompletionPosition);

 							parsedUnit.resolve();

-					}

-				} catch (CompletionNodeFound e) {

-//					completionNodeFound = true;

-					if (e.astNode != null) // if null then we found a problem in the completion node

-						complete(e.astNode, e.qualifiedBinding, e.scope);

-				}

-			}

-		}

-

-/* Ignore package, import, class & interface keywords for now...

-		if (!completionNodeFound) {

-			if (parsedUnit == null || parsedUnit.types == null) {

-				// this is not good enough... can still be trying to define a second type

-				CompletionScanner scanner = (CompletionScanner) parser.scanner;

-				setSourceRange(scanner.completedIdentifierStart, scanner.completedIdentifierEnd);

-				findKeywords(scanner.completionIdentifier, mainDeclarations, null);

-			}

-			// currently have no way to know if extends/implements are possible keywords

-		}

-*/	} catch (IndexOutOfBoundsException e) { // work-around internal failure - 1GEMF6D

-	} catch (InvalidCursorLocation e) { // may eventually report a usefull error

-	} catch (AbortCompilation e) { // ignore this exception for now since it typically means we cannot find java.lang.Object

-	} finally {

-		reset();

-	}

-}

-private TypeBinding[] computeTypes(Expression[] arguments, BlockScope scope) {

-	if (arguments == null) return null;

-

-	int argsLength = arguments.length;

-	TypeBinding[] argTypes = new TypeBinding[argsLength];

-	for (int a = argsLength; --a >= 0;)

-		argTypes[a] = arguments[a].resolveType(scope);

-	return argTypes;

-}

-private void findClassField(char[] token, TypeBinding receiverType) {

-	if (token == null) return;

-

-	if (token.length <= classField.length && CharOperation.prefixEquals(token, classField, false /* ignore case */))

-		requestor.acceptField(

-			NoChar,

-			NoChar,

-			classField,

-			NoChar,

-			NoChar,

-			classField,

-			CompilerModifiers.AccStatic | CompilerModifiers.AccPublic,

-			startPosition,

-			endPosition);

-}

-private void findConstructors(ReferenceBinding currentType, TypeBinding[] argTypes, Scope scope) {

-	// No visibility checks can be performed without the scope & invocationSite

-	MethodBinding[] methods = currentType.methods();

-	int minArgLength = argTypes == null ? 0 : argTypes.length;

-	next : for (int f = methods.length; --f >= 0;) {

-		MethodBinding constructor = methods[f];

-		if (constructor.isConstructor()) {

-			TypeBinding[] parameters = constructor.parameters;

-			int paramLength = parameters.length;

-			if (minArgLength > paramLength) continue next;

-			for (int a = minArgLength; --a >= 0;)

-				if (argTypes[a] != null) // can be null if it could not be resolved properly

-					if (!scope.areTypesCompatible(argTypes[a], constructor.parameters[a])) continue next;

-

-			char[][] parameterPackageNames = new char[paramLength][];

-			char[][] parameterTypeNames = new char[paramLength][];

-			for (int i = 0; i < paramLength; i++) {

-				TypeBinding type = parameters[i];

-				parameterPackageNames[i] = type.qualifiedPackageName();

-				parameterTypeNames[i] = type.qualifiedSourceName();

-			}

-			char[] completion = TypeConstants.NoChar; // nothing to insert - do not want to replace the existing selector & arguments

-			if (source == null || source.length <= endPosition || source[endPosition] != ')')

-				completion = new char[] {')'};

-			requestor.acceptMethod(

-				currentType.qualifiedPackageName(),

-				currentType.qualifiedSourceName(),

-				currentType.sourceName(),

-				parameterPackageNames,

-				parameterTypeNames,

-				TypeConstants.NoChar,

-				TypeConstants.NoChar,

-				completion,

-				constructor.modifiers,

-				endPosition,

-				endPosition);

-		}

-	}

-}

-// Helper method for findFields(char[], ReferenceBinding, Scope, ObjectVector, boolean)

-

-private void findFields(

-	char[] fieldName,

-	FieldBinding[] fields,

-	Scope scope,

-	ObjectVector fieldsFound,

-	boolean onlyStaticFields) {

-

-	// Inherited fields which are hidden by subclasses are filtered out

-	// No visibility checks can be performed without the scope & invocationSite

-

-	int fieldLength = fieldName.length;

-	next : for (int f = fields.length; --f >= 0;) {

-		FieldBinding field = fields[f];

-		if (onlyStaticFields && !field.isStatic()) continue next;

-		if (fieldLength > field.name.length) continue next;

-		if (!CharOperation.prefixEquals(fieldName, field.name, false /* ignore case */)) continue next;

-

-		for (int i = fieldsFound.size; --i >= 0;) {

-			FieldBinding otherField = (FieldBinding) fieldsFound.elementAt(i);

-			if (field == otherField) continue next;

-			if (CharOperation.equals(field.name, otherField.name, true)) {

-				if (field.declaringClass.isSuperclassOf(otherField.declaringClass)) continue next;

-				if (otherField.declaringClass.isInterface())

-					if (field.declaringClass.implementsInterface(otherField.declaringClass, true)) continue next;

-			}

-		}

-

-		fieldsFound.add(field);

-		requestor.acceptField(

-			field.declaringClass.qualifiedPackageName(),

-			field.declaringClass.qualifiedSourceName(),

-			field.name,

-			field.type.qualifiedPackageName(),

-			field.type.qualifiedSourceName(),

-			field.name, // may include some qualification to resolve ambiguities

-			field.modifiers,

-			startPosition,

-			endPosition);

-	}

-}

-private void findFields(

-	char[] fieldName,

-	ReferenceBinding receiverType,

-	Scope scope,

-	ObjectVector fieldsFound,

-	boolean onlyStaticFields) {

-

-	if (fieldName == null) return;

-

-	ReferenceBinding currentType = receiverType;

-	ReferenceBinding[][] interfacesToVisit = null;

-	int lastPosition = -1;

-	do {

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			if (interfacesToVisit == null)

-				interfacesToVisit = new ReferenceBinding[5][];

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-		}

-

-		findFields(fieldName, currentType.fields(), scope, fieldsFound, onlyStaticFields);

-		currentType = currentType.superclass();

-	} while (currentType != null);

-

-	if (interfacesToVisit != null) {

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				ReferenceBinding anInterface = interfaces[j];

-				if ((anInterface.tagBits & TagBits.InterfaceVisited) == 0) { // if interface as not already been visited

-					anInterface.tagBits |= TagBits.InterfaceVisited;

-

-					findFields(fieldName, anInterface.fields(), scope, fieldsFound, onlyStaticFields);

-

-					ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

-					if (itsInterfaces != NoSuperInterfaces) {

-						if (++lastPosition == interfacesToVisit.length)

-							System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-						interfacesToVisit[lastPosition] = itsInterfaces;

+						}

+					} catch (CompletionNodeFound e) {

+						//					completionNodeFound = true;

+						if (e.astNode != null)

+							// if null then we found a problem in the completion node

+							complete(e.astNode, e.qualifiedBinding, e.scope);

 					}

 				}

 			}

-		}

 

-		// bit reinitialization

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++)

-				interfaces[j].tagBits &= ~TagBits.InterfaceVisited;

+			/* Ignore package, import, class & interface keywords for now...

+					if (!completionNodeFound) {

+						if (parsedUnit == null || parsedUnit.types == null) {

+							// this is not good enough... can still be trying to define a second type

+							CompletionScanner scanner = (CompletionScanner) parser.scanner;

+							setSourceRange(scanner.completedIdentifierStart, scanner.completedIdentifierEnd);

+							findKeywords(scanner.completionIdentifier, mainDeclarations, null);

+						}

+						// currently have no way to know if extends/implements are possible keywords

+					}

+			*/

+		} catch (IndexOutOfBoundsException e) { // work-around internal failure - 1GEMF6D

+		} catch (InvalidCursorLocation e) { // may eventually report a usefull error

+		} catch (AbortCompilation e) { // ignore this exception for now since it typically means we cannot find java.lang.Object

+		} finally {

+			reset();

 		}

 	}

-}

-private void findFieldsAndMethods(char[] token, TypeBinding receiverType, Scope scope) {

-	if (token == null) return;

+	private TypeBinding[] computeTypes(Expression[] arguments, BlockScope scope) {

+		if (arguments == null)

+			return null;

 

-	if (receiverType.isBaseType()) return; // nothing else is possible with base types

-	if (receiverType.isArrayType()) {

-		if (token.length <= lengthField.length && CharOperation.prefixEquals(token, lengthField, false /* ignore case */))

+		int argsLength = arguments.length;

+		TypeBinding[] argTypes = new TypeBinding[argsLength];

+		for (int a = argsLength; --a >= 0;)

+			argTypes[a] = arguments[a].resolveType(scope);

+		return argTypes;

+	}

+	private void findClassField(char[] token, TypeBinding receiverType) {

+		if (token == null)

+			return;

+

+		if (token.length <= classField.length

+			&& CharOperation.prefixEquals(token, classField, false /* ignore case */

+			))

 			requestor.acceptField(

 				NoChar,

 				NoChar,

-				lengthField,

+				classField,

 				NoChar,

 				NoChar,

-				lengthField,

-				CompilerModifiers.AccPublic,

+				classField,

+				CompilerModifiers.AccStatic | CompilerModifiers.AccPublic,

 				startPosition,

 				endPosition);

-

-		receiverType = scope.getJavaLangObject();

 	}

+	private void findConstructors(

+		ReferenceBinding currentType,

+		TypeBinding[] argTypes,

+		Scope scope,

+		InvocationSite invocationSite) {

+		// No visibility checks can be performed without the scope & invocationSite

+		MethodBinding[] methods = currentType.methods();

+		int minArgLength = argTypes == null ? 0 : argTypes.length;

+		next : for (int f = methods.length; --f >= 0;) {

+			MethodBinding constructor = methods[f];

+			if (constructor.isConstructor()) {

+				if (options.checkVisibilitySensitive()

+					&& !constructor.canBeSeenBy(invocationSite, scope))

+					continue next;

 

-	findFields(token, (ReferenceBinding) receiverType, scope, new ObjectVector(), false);

-	findMethods(token, null, (ReferenceBinding) receiverType, scope, new ObjectVector(), false, false);

-}

-private void findImports(CompletionOnImportReference importReference) {

-	char[] importName = CharOperation.concatWith(importReference.tokens, '.');

-	if (importName.length == 0) return;

-	resolvingImports = true;

-	setSourceRange(importReference.sourceStart, importReference.declarationSourceEnd); // want to replace the existing .*;

-	nameEnvironment.findPackages(importName, this);

-	nameEnvironment.findTypes(importName, this);

-}

-// what about onDemand types? Ignore them since it does not happen!

-// import p1.p2.A.*;

-private void findKeywords(char[] keyword, char[][] choices, Scope scope) {

-	int length = keyword.length;

-	if (length > 0)

-		for (int i = 0; i < choices.length; i++)

-			if (length <= choices[i].length && CharOperation.prefixEquals(keyword, choices[i], false /* ignore case */))

-				requestor.acceptKeyword(choices[i], startPosition, endPosition);

-}

-// Helper method for findMemberTypes(char[], ReferenceBinding, Scope)

+				TypeBinding[] parameters = constructor.parameters;

+				int paramLength = parameters.length;

+				if (minArgLength > paramLength)

+					continue next;

+				for (int a = minArgLength; --a >= 0;)

+					if (argTypes[a] != null) // can be null if it could not be resolved properly

+						if (!scope.areTypesCompatible(argTypes[a], constructor.parameters[a]))

+							continue next;

 

-private void findMemberTypes(char[] typeName, ReferenceBinding[] memberTypes, ObjectVector typesFound) {

-

-	// Inherited member types which are hidden by subclasses are filtered out

-	// No visibility checks can be performed without the scope & invocationSite

-

-	int typeLength = typeName.length;

-	next : for (int m = memberTypes.length; --m >= 0;) {

-		ReferenceBinding memberType = memberTypes[m];

-//		if (!wantClasses && memberType.isClass()) continue next;

-//		if (!wantInterfaces && memberType.isInterface()) continue next;

-		if (typeLength > memberType.sourceName.length) continue next;

-		if (!CharOperation.prefixEquals(typeName, memberType.sourceName, false /* ignore case */)) continue next;

-

-		for (int i = typesFound.size; --i >= 0;) {

-			ReferenceBinding otherType = (ReferenceBinding) typesFound.elementAt(i);

-			if (memberType == otherType) continue next;

-			if (CharOperation.equals(memberType.sourceName, otherType.sourceName, true)) {

-				if (memberType.enclosingType().isSuperclassOf(otherType.enclosingType())) continue next;

-				if (otherType.enclosingType().isInterface())

-					if (memberType.enclosingType().implementsInterface(otherType.enclosingType(), true)) continue next;

+				char[][] parameterPackageNames = new char[paramLength][];

+				char[][] parameterTypeNames = new char[paramLength][];

+				for (int i = 0; i < paramLength; i++) {

+					TypeBinding type = parameters[i];

+					parameterPackageNames[i] = type.qualifiedPackageName();

+					parameterTypeNames[i] = type.qualifiedSourceName();

+				}

+				char[] completion = TypeConstants.NoChar;

+				// nothing to insert - do not want to replace the existing selector & arguments

+				if (source == null

+					|| source.length <= endPosition

+					|| source[endPosition] != ')')

+					completion = new char[] { ')' };

+				requestor.acceptMethod(

+					currentType.qualifiedPackageName(),

+					currentType.qualifiedSourceName(),

+					currentType.sourceName(),

+					parameterPackageNames,

+					parameterTypeNames,

+					TypeConstants.NoChar,

+					TypeConstants.NoChar,

+					completion,

+					constructor.modifiers,

+					endPosition,

+					endPosition);

 			}

 		}

-

-		typesFound.add(memberType);

-		if (memberType.isClass())

-			requestor.acceptClass(

-				memberType.qualifiedPackageName(),

-				memberType.qualifiedSourceName(),

-				memberType.sourceName(),

-				memberType.modifiers,

-				startPosition,

-				endPosition);

-		else

-			requestor.acceptInterface(

-				memberType.qualifiedPackageName(),

-				memberType.qualifiedSourceName(),

-				memberType.sourceName(),

-				memberType.modifiers,

-				startPosition,

-				endPosition);

 	}

-}

-private void findMemberTypes(char[] typeName, ReferenceBinding currentType, Scope scope) {

-	if (typeName == null) return;

-	if (currentType.superInterfaces() == null) return; // we're trying to find a supertype

+	// Helper method for findFields(char[], ReferenceBinding, Scope, ObjectVector, boolean)

 

-	ObjectVector typesFound = new ObjectVector();

-	if (insideQualifiedReference || typeName.length == 0) { // do not search up the hierarchy

-		findMemberTypes(typeName, currentType.memberTypes(), typesFound);

-		return;

-	}

+	private void findFields(

+		char[] fieldName,

+		FieldBinding[] fields,

+		Scope scope,

+		ObjectVector fieldsFound,

+		ObjectVector localsFound,

+		boolean onlyStaticFields,

+		ReferenceBinding receiverType,

+		InvocationSite invocationSite,

+		Scope invocationScope) {

 

-	ReferenceBinding[][] interfacesToVisit = null;

-	int lastPosition = -1;

-	do {

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			if (interfacesToVisit == null)

-				interfacesToVisit = new ReferenceBinding[5][];

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-		}

+		// Inherited fields which are hidden by subclasses are filtered out

+		// No visibility checks can be performed without the scope & invocationSite

 

-		findMemberTypes(typeName, currentType.memberTypes(), typesFound);

-		currentType = currentType.superclass();

-	} while (currentType != null);

+		int fieldLength = fieldName.length;

+		next : for (int f = fields.length; --f >= 0;) {

+			FieldBinding field = fields[f];

+			if (onlyStaticFields && !field.isStatic())

+				continue next;

+			if (fieldLength > field.name.length)

+				continue next;

+			if (!CharOperation.prefixEquals(fieldName, field.name, false /* ignore case */

+				))

+				continue next;

 

-	if (interfacesToVisit != null) {

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				ReferenceBinding anInterface = interfaces[j];

-				if ((anInterface.tagBits & TagBits.InterfaceVisited) == 0) { // if interface as not already been visited

-					anInterface.tagBits |= TagBits.InterfaceVisited;

+			if (options.checkVisibilitySensitive()

+				&& !field.canBeSeenBy(receiverType, invocationSite, scope))

+				continue next;

 

-					findMemberTypes(typeName, anInterface.memberTypes(), typesFound);

-

-					ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

-					if (itsInterfaces != NoSuperInterfaces) {

-						if (++lastPosition == interfacesToVisit.length)

-							System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-						interfacesToVisit[lastPosition] = itsInterfaces;

-					}

+			for (int i = fieldsFound.size; --i >= 0;) {

+				FieldBinding otherField = (FieldBinding) fieldsFound.elementAt(i);

+				if (field == otherField)

+					continue next;

+				if (CharOperation.equals(field.name, otherField.name, true)) {

+					if (field.declaringClass.isSuperclassOf(otherField.declaringClass))

+						continue next;

+					if (otherField.declaringClass.isInterface())

+						if (field.declaringClass.implementsInterface(otherField.declaringClass, true))

+							continue next;

 				}

 			}

-		}

 

-		// bit reinitialization

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++)

-				interfaces[j].tagBits &= ~TagBits.InterfaceVisited;

-		}

-	}

-}

-private void findMessageSends(char[] token, TypeBinding[] argTypes, Scope scope) {

-	if (token == null) return;

+			fieldsFound.add(field);

 

-	boolean staticsOnly = false; // need to know if we're in a static context (or inside a constructor)

-	int tokenLength = token.length;

-	ObjectVector methodsFound = new ObjectVector();

-	done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

-		switch (scope.kind) {

-			case Scope.METHOD_SCOPE :

-				// handle the error case inside an explicit constructor call (see MethodScope>>findField)

-				MethodScope methodScope = (MethodScope) scope;

-				staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;

-				break;

-			case Scope.CLASS_SCOPE :

-				ClassScope classScope = (ClassScope) scope;

-				SourceTypeBinding enclosingType = classScope.referenceContext.binding;

-				findMethods(token, argTypes, enclosingType, classScope, methodsFound, staticsOnly, true);

-				staticsOnly |= enclosingType.isStatic();

-				break;

-			case Scope.COMPILATION_UNIT_SCOPE :

-				break done;

-		}

-		scope = scope.parent;

-	}

-}

-// Helper method for findMethods(char[], TypeBinding[], ReferenceBinding, Scope, ObjectVector, boolean, boolean)

-

-private void findMethods(

-	char[] methodName,

-	TypeBinding[] argTypes,

-	MethodBinding[] methods,

-	Scope scope,

-	ObjectVector methodsFound,

-//	boolean noVoidReturnType, how do you know?

-	boolean onlyStaticMethods,

-	boolean exactMatch) {

-

-	// Inherited methods which are hidden by subclasses are filtered out

-	// No visibility checks can be performed without the scope & invocationSite

-

-	int methodLength = methodName.length;

-	int minArgLength = argTypes == null ? 0 : argTypes.length;

-	next : for (int f = methods.length; --f >= 0;) {

-		MethodBinding method = methods[f];

-		if (method.isConstructor()) continue next;

-//		if (noVoidReturnType && method.returnType == BaseTypes.VoidBinding) continue next;

-		if (onlyStaticMethods && !method.isStatic()) continue next;

-		if (exactMatch) {

-			if (!CharOperation.equals(methodName, method.selector, false /* ignore case */)) continue next;

-		} else {

-			if (methodLength > method.selector.length) continue next;

-			if (!CharOperation.prefixEquals(methodName, method.selector, false /* ignore case */)) continue next;

-		}

-		if (minArgLength > method.parameters.length) continue next;

-		for (int a = minArgLength; --a >= 0;)

-			if (argTypes[a] != null) // can be null if it could not be resolved properly

-				if (!scope.areTypesCompatible(argTypes[a], method.parameters[a])) continue next;

-

-		for (int i = methodsFound.size; --i >= 0;) {

-			MethodBinding otherMethod = (MethodBinding) methodsFound.elementAt(i);

-			if (method == otherMethod) continue next;

-			if (CharOperation.equals(method.selector, otherMethod.selector, true) && method.areParametersEqual(otherMethod)) {

-				if (method.declaringClass.isSuperclassOf(otherMethod.declaringClass)) continue next;

-				if (otherMethod.declaringClass.isInterface())

-					if (method.declaringClass.implementsInterface(otherMethod.declaringClass, true)) continue next;

+			for (int l = localsFound.size; --l >= 0;) {

+				LocalVariableBinding local = (LocalVariableBinding) localsFound.elementAt(l);

+				if (CharOperation.equals(field.name, local.name, true)) {

+					char[] completion = field.name;

+					SourceTypeBinding enclosing = scope.enclosingSourceType();

+					if (field.isStatic()) {

+						char[] name = enclosing.compoundName[enclosing.compoundName.length-1];

+						completion = CharOperation.concat(name ,completion,'.');

+					} else {;

+						if(enclosing == invocationScope.enclosingSourceType()){

+							completion = CharOperation.concat(THIS,completion,'.');

+						} else {

+							char[] name = enclosing.compoundName[enclosing.compoundName.length-1];

+							if(!enclosing.isNestedType()){

+								completion = CharOperation.concat(THIS,completion,'.');

+								completion = CharOperation.concat(name,completion,'.');

+							} else if (!enclosing.isAnonymousType()){

+								completion = CharOperation.concat(THIS,completion,'.');

+								int index = CharOperation.lastIndexOf('$',name);

+								char[] shortName = CharOperation.subarray(name,index+1,name.length);

+								completion = CharOperation.concat(shortName,completion,'.');

+							}

+						}

+					}

+					requestor

+						.acceptField(

+							field.declaringClass.qualifiedPackageName(),

+							field.declaringClass.qualifiedSourceName(),

+							field.name,

+							field.type.qualifiedPackageName(),

+							field.type.qualifiedSourceName(),

+							completion,

+					// may include some qualification to resolve ambiguities

+					field.modifiers, startPosition, endPosition);

+					continue next;

+				}

 			}

-		}

 

-		methodsFound.add(method);

-		int length = method.parameters.length;

-		char[][] parameterPackageNames = new char[length][];

-		char[][] parameterTypeNames = new char[length][];

-		for (int i = 0; i < length; i++) {

-			TypeBinding type = method.parameters[i];

-			parameterPackageNames[i] = type.qualifiedPackageName();

-			parameterTypeNames[i] = type.qualifiedSourceName();

+			requestor

+				.acceptField(

+					field.declaringClass.qualifiedPackageName(),

+					field.declaringClass.qualifiedSourceName(),

+					field.name,

+					field.type.qualifiedPackageName(),

+					field.type.qualifiedSourceName(),

+					field.name,

+			// may include some qualification to resolve ambiguities

+			field.modifiers, startPosition, endPosition);

 		}

-		char[] completion = TypeConstants.NoChar; // nothing to insert - do not want to replace the existing selector & arguments

-		if (!exactMatch) {

-			if (source != null && source.length > endPosition && source[endPosition] == '(')

-				completion = method.selector;

-			else

-				completion = CharOperation.concat(method.selector, new char[] {'(', ')'});

-		}

-		requestor.acceptMethod(

-			method.declaringClass.qualifiedPackageName(),

-			method.declaringClass.qualifiedSourceName(),

-			method.selector,

-			parameterPackageNames,

-			parameterTypeNames,

-			method.returnType.qualifiedPackageName(),

-			method.returnType.qualifiedSourceName(),

-			completion,

-			method.modifiers,

-			startPosition,

-			endPosition);

 	}

-}

-private void findMethods(

-	char[] selector,

-	TypeBinding[] argTypes,

-	ReferenceBinding receiverType,

-	Scope scope,

-	ObjectVector methodsFound,

-	boolean onlyStaticMethods,

-	boolean exactMatch) {

+	private void findFields(

+		char[] fieldName,

+		ReferenceBinding receiverType,

+		Scope scope,

+		ObjectVector fieldsFound,

+		ObjectVector localsFound,

+		boolean onlyStaticFields,

+		InvocationSite invocationSite,

+		Scope invocationScope) {

 

-	if (selector == null) return;

+		if (fieldName == null)

+			return;

 

-	ReferenceBinding currentType = receiverType;

-	if (currentType.isInterface()) {

-		findMethods(selector, argTypes, currentType.methods(), scope, methodsFound, onlyStaticMethods, exactMatch);

+		ReferenceBinding currentType = receiverType;

+		ReferenceBinding[][] interfacesToVisit = null;

+		int lastPosition = -1;

+		do {

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				if (interfacesToVisit == null)

+					interfacesToVisit = new ReferenceBinding[5][];

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

+			}

 

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			ReferenceBinding[][] interfacesToVisit = new ReferenceBinding[5][];

-			int lastPosition = 0;

-			interfacesToVisit[lastPosition] = itsInterfaces;

-			

+			findFields(

+				fieldName,

+				currentType.fields(),

+				scope,

+				fieldsFound,

+				localsFound,

+				onlyStaticFields,

+				receiverType,

+				invocationSite,

+				invocationScope);

+			currentType = currentType.superclass();

+		} while (currentType != null);

+

+		if (interfacesToVisit != null) {

 			for (int i = 0; i <= lastPosition; i++) {

 				ReferenceBinding[] interfaces = interfacesToVisit[i];

 				for (int j = 0, length = interfaces.length; j < length; j++) {

-					currentType = interfaces[j];

-					if ((currentType.tagBits & TagBits.InterfaceVisited) == 0) { // if interface as not already been visited

-						currentType.tagBits |= TagBits.InterfaceVisited;

+					ReferenceBinding anInterface = interfaces[j];

+					if ((anInterface.tagBits & TagBits.InterfaceVisited) == 0) {

+						// if interface as not already been visited

+						anInterface.tagBits |= TagBits.InterfaceVisited;

 

-						findMethods(selector, argTypes, currentType.methods(), scope, methodsFound, onlyStaticMethods, exactMatch);

+						findFields(

+							fieldName,

+							anInterface.fields(),

+							scope,

+							fieldsFound,

+							localsFound,

+							onlyStaticFields,

+							receiverType,

+							invocationSite,

+							invocationScope);

 

-						itsInterfaces = currentType.superInterfaces();

+						ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

 						if (itsInterfaces != NoSuperInterfaces) {

 							if (++lastPosition == interfacesToVisit.length)

-								System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

+								System.arraycopy(

+									interfacesToVisit,

+									0,

+									interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+									0,

+									lastPosition);

 							interfacesToVisit[lastPosition] = itsInterfaces;

 						}

 					}

@@ -813,191 +739,721 @@
 					interfaces[j].tagBits &= ~TagBits.InterfaceVisited;

 			}

 		}

-		currentType = scope.getJavaLangObject();

 	}

+	private void findFieldsAndMethods(

+		char[] token,

+		TypeBinding receiverType,

+		Scope scope,

+		InvocationSite invocationSite,

+		Scope invocationScope) {

+		if (token == null)

+			return;

 

-	while (currentType != null) {

-		findMethods(selector, argTypes, currentType.methods(), scope, methodsFound, onlyStaticMethods, exactMatch);

-		currentType = currentType.superclass();

+		if (receiverType.isBaseType())

+			return; // nothing else is possible with base types

+		if (receiverType.isArrayType()) {

+			if (token.length <= lengthField.length

+				&& CharOperation.prefixEquals(token, lengthField, false /* ignore case */

+				))

+				requestor.acceptField(

+					NoChar,

+					NoChar,

+					lengthField,

+					NoChar,

+					NoChar,

+					lengthField,

+					CompilerModifiers.AccPublic,

+					startPosition,

+					endPosition);

+

+			receiverType = scope.getJavaLangObject();

+		}

+

+		findFields(

+			token,

+			(ReferenceBinding) receiverType,

+			scope,

+			new ObjectVector(),

+			new ObjectVector(),

+			false,

+			invocationSite,

+			invocationScope);

+		findMethods(

+			token,

+			null,

+			(ReferenceBinding) receiverType,

+			scope,

+			new ObjectVector(),

+			false,

+			false,

+			invocationSite);

 	}

-}

-private void findNestedTypes(char[] typeName, ReferenceBinding currentType, Scope scope) {

-	if (typeName == null) return;

+	private void findImports(CompletionOnImportReference importReference) {

+		char[] importName = CharOperation.concatWith(importReference.tokens, '.');

+		if (importName.length == 0)

+			return;

+		resolvingImports = true;

+		setSourceRange(

+			importReference.sourceStart,

+			importReference.declarationSourceEnd);

+		// want to replace the existing .*;

+		nameEnvironment.findPackages(importName, this);

+		nameEnvironment.findTypes(importName, this);

+	}

+	// what about onDemand types? Ignore them since it does not happen!

+	// import p1.p2.A.*;

+	private void findKeywords(char[] keyword, char[][] choices, Scope scope) {

+		int length = keyword.length;

+		if (length > 0)

+			for (int i = 0; i < choices.length; i++)

+				if (length <= choices[i].length

+					&& CharOperation.prefixEquals(keyword, choices[i], false /* ignore case */

+					))

+					requestor.acceptKeyword(choices[i], startPosition, endPosition);

+	}

+	// Helper method for findMemberTypes(char[], ReferenceBinding, Scope)

 

-	int typeLength = typeName.length;

-	while (scope != null) { // done when a COMPILATION_UNIT_SCOPE is found

-		switch (scope.kind) {

-			case Scope.METHOD_SCOPE :

-			case Scope.BLOCK_SCOPE :

-				BlockScope blockScope = (BlockScope) scope;

-				next : for (int i = 0, length = blockScope.scopeIndex; i < length; i++) {

-					if (blockScope.subscopes[i] instanceof ClassScope) {

-						SourceTypeBinding localType = ((ClassScope) blockScope.subscopes[i]).referenceContext.binding;

-						if (!localType.isAnonymousType()) {

-							if (typeLength > localType.sourceName.length) continue next;

-							if (!CharOperation.prefixEquals(typeName, localType.sourceName, false /* ignore case */)) continue next;

+	private void findMemberTypes(

+		char[] typeName,

+		ReferenceBinding[] memberTypes,

+		ObjectVector typesFound,

+		ReferenceBinding receiverType,

+		SourceTypeBinding invocationType) {

 

-							requestor.acceptClass(

-								localType.qualifiedPackageName(),

-								localType.sourceName,

-								localType.sourceName,

-								localType.modifiers,

-								startPosition,

-								endPosition);

+		// Inherited member types which are hidden by subclasses are filtered out

+		// No visibility checks can be performed without the scope & invocationSite

+

+		int typeLength = typeName.length;

+		next : for (int m = memberTypes.length; --m >= 0;) {

+			ReferenceBinding memberType = memberTypes[m];

+			//		if (!wantClasses && memberType.isClass()) continue next;

+			//		if (!wantInterfaces && memberType.isInterface()) continue next;

+			if (typeLength > memberType.sourceName.length)

+				continue next;

+			if (!CharOperation.prefixEquals(typeName, memberType.sourceName, false

+				/* ignore case */

+				))

+				continue next;

+

+			if (options.checkVisibilitySensitive()

+				&& !memberType.canBeSeenBy(receiverType, invocationType))

+				continue next;

+

+			for (int i = typesFound.size; --i >= 0;) {

+				ReferenceBinding otherType = (ReferenceBinding) typesFound.elementAt(i);

+				if (memberType == otherType)

+					continue next;

+				if (CharOperation.equals(memberType.sourceName, otherType.sourceName, true)) {

+					if (memberType.enclosingType().isSuperclassOf(otherType.enclosingType()))

+						continue next;

+					if (otherType.enclosingType().isInterface())

+						if (memberType

+							.enclosingType()

+							.implementsInterface(otherType.enclosingType(), true))

+							continue next;

+				}

+			}

+

+			typesFound.add(memberType);

+			if (memberType.isClass())

+				requestor.acceptClass(

+					memberType.qualifiedPackageName(),

+					memberType.qualifiedSourceName(),

+					memberType.sourceName(),

+					memberType.modifiers,

+					startPosition,

+					endPosition);

+			else

+				requestor.acceptInterface(

+					memberType.qualifiedPackageName(),

+					memberType.qualifiedSourceName(),

+					memberType.sourceName(),

+					memberType.modifiers,

+					startPosition,

+					endPosition);

+		}

+	}

+	private void findMemberTypes(

+		char[] typeName,

+		ReferenceBinding receiverType,

+		Scope scope,

+		SourceTypeBinding typeInvocation) {

+

+		ReferenceBinding currentType = receiverType;

+		if (typeName == null)

+			return;

+		if (currentType.superInterfaces() == null)

+			return; // we're trying to find a supertype

+

+		ObjectVector typesFound = new ObjectVector();

+		if (insideQualifiedReference

+			|| typeName.length == 0) { // do not search up the hierarchy

+			findMemberTypes(

+				typeName,

+				currentType.memberTypes(),

+				typesFound,

+				receiverType,

+				typeInvocation);

+			return;

+		}

+

+		ReferenceBinding[][] interfacesToVisit = null;

+		int lastPosition = -1;

+		do {

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				if (interfacesToVisit == null)

+					interfacesToVisit = new ReferenceBinding[5][];

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

+			}

+

+			findMemberTypes(

+				typeName,

+				currentType.memberTypes(),

+				typesFound,

+				receiverType,

+				typeInvocation);

+			currentType = currentType.superclass();

+		} while (currentType != null);

+

+		if (interfacesToVisit != null) {

+			for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++) {

+					ReferenceBinding anInterface = interfaces[j];

+					if ((anInterface.tagBits & TagBits.InterfaceVisited) == 0) {

+						// if interface as not already been visited

+						anInterface.tagBits |= TagBits.InterfaceVisited;

+

+						findMemberTypes(

+							typeName,

+							anInterface.memberTypes(),

+							typesFound,

+							receiverType,

+							typeInvocation);

+

+						ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

+						if (itsInterfaces != NoSuperInterfaces) {

+							if (++lastPosition == interfacesToVisit.length)

+								System.arraycopy(

+									interfacesToVisit,

+									0,

+									interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+									0,

+									lastPosition);

+							interfacesToVisit[lastPosition] = itsInterfaces;

 						}

 					}

 				}

-				break;

-			case Scope.CLASS_SCOPE :

-				findMemberTypes(typeName, scope.enclosingSourceType(), scope);

-				if (typeLength == 0) return; // do not search outside the class scope if no prefix was provided

-				break;

-			case Scope.COMPILATION_UNIT_SCOPE :

-				return;

+			}

+

+			// bit reinitialization

+			for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++)

+					interfaces[j].tagBits &= ~TagBits.InterfaceVisited;

+			}

 		}

-		scope = scope.parent;

 	}

-}

-private void findPackages(CompletionOnPackageReference packageStatement) {

-	char[] packageName = CharOperation.concatWith(packageStatement.tokens, '.');

-	if (packageName.length == 0) return;

+	private void findMessageSends(

+		char[] token,

+		TypeBinding[] argTypes,

+		Scope scope,

+		InvocationSite invocationSite) {

+		if (token == null)

+			return;

 

-	setSourceRange(packageStatement.sourceStart, packageStatement.sourceEnd);

-	nameEnvironment.findPackages(CharOperation.toLowerCase(packageName), this);

-}

-private void findTypesAndPackages(char[] token, Scope scope) {

-	if (token == null) return;

+		boolean staticsOnly = false;

+		// need to know if we're in a static context (or inside a constructor)

+		int tokenLength = token.length;

+		ObjectVector methodsFound = new ObjectVector();

+		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

+			switch (scope.kind) {

+				case Scope.METHOD_SCOPE :

+					// handle the error case inside an explicit constructor call (see MethodScope>>findField)

+					MethodScope methodScope = (MethodScope) scope;

+					staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;

+					break;

+				case Scope.CLASS_SCOPE :

+					ClassScope classScope = (ClassScope) scope;

+					SourceTypeBinding enclosingType = classScope.referenceContext.binding;

+					findMethods(

+						token,

+						argTypes,

+						enclosingType,

+						classScope,

+						methodsFound,

+						staticsOnly,

+						true,

+						invocationSite);

+					staticsOnly |= enclosingType.isStatic();

+					break;

+				case Scope.COMPILATION_UNIT_SCOPE :

+					break done;

+			}

+			scope = scope.parent;

+		}

+	}

+	// Helper method for findMethods(char[], TypeBinding[], ReferenceBinding, Scope, ObjectVector, boolean, boolean)

 

-	if (scope.enclosingSourceType() != null)

-		findNestedTypes(token, scope.enclosingSourceType(), scope);

+	private void findMethods(

+		char[] methodName,

+		TypeBinding[] argTypes,

+		MethodBinding[] methods,

+		Scope scope,

+		ObjectVector methodsFound,

+	//	boolean noVoidReturnType, how do you know?

+	boolean onlyStaticMethods,

+		boolean exactMatch,

+		TypeBinding receiverType,

+		InvocationSite invocationSite) {

 

-	if (unitScope != null) {

-		int typeLength = token.length;

-		SourceTypeBinding[] types = unitScope.topLevelTypes;

-		for (int i = 0, length = types.length; i < length; i++) {

-			SourceTypeBinding sourceType = types[i];

-			if (typeLength > sourceType.sourceName.length) continue;

-			if (!CharOperation.prefixEquals(token, sourceType.sourceName, false /* ignore case */)) continue;

+		// Inherited methods which are hidden by subclasses are filtered out

+		// No visibility checks can be performed without the scope & invocationSite

 

-			requestor.acceptType(

-				sourceType.qualifiedPackageName(),

-				sourceType.sourceName(),

-				sourceType.sourceName(),

+		int methodLength = methodName.length;

+		int minArgLength = argTypes == null ? 0 : argTypes.length;

+		next : for (int f = methods.length; --f >= 0;) {

+			MethodBinding method = methods[f];

+			if (method.isConstructor())

+				continue next;

+			//		if (noVoidReturnType && method.returnType == BaseTypes.VoidBinding) continue next;

+			if (onlyStaticMethods && !method.isStatic())

+				continue next;

+

+			if (options.checkVisibilitySensitive()

+				&& !method.canBeSeenBy(receiverType, invocationSite, scope))

+				continue next;

+

+			if (exactMatch) {

+				if (!CharOperation.equals(methodName, method.selector, false /* ignore case */

+					))

+					continue next;

+			} else {

+				if (methodLength > method.selector.length)

+					continue next;

+				if (!CharOperation.prefixEquals(methodName, method.selector, false

+					/* ignore case */

+					))

+					continue next;

+			}

+			if (minArgLength > method.parameters.length)

+				continue next;

+			for (int a = minArgLength; --a >= 0;)

+				if (argTypes[a] != null) // can be null if it could not be resolved properly

+					if (!scope.areTypesCompatible(argTypes[a], method.parameters[a]))

+						continue next;

+

+			for (int i = methodsFound.size; --i >= 0;) {

+				MethodBinding otherMethod = (MethodBinding) methodsFound.elementAt(i);

+				if (method == otherMethod)

+					continue next;

+				if (CharOperation.equals(method.selector, otherMethod.selector, true)

+					&& method.areParametersEqual(otherMethod)) {

+					if (method.declaringClass.isSuperclassOf(otherMethod.declaringClass))

+						continue next;

+					if (otherMethod.declaringClass.isInterface())

+						if (method

+							.declaringClass

+							.implementsInterface(otherMethod.declaringClass, true))

+							continue next;

+				}

+			}

+

+			methodsFound.add(method);

+			int length = method.parameters.length;

+			char[][] parameterPackageNames = new char[length][];

+			char[][] parameterTypeNames = new char[length][];

+			for (int i = 0; i < length; i++) {

+				TypeBinding type = method.parameters[i];

+				parameterPackageNames[i] = type.qualifiedPackageName();

+				parameterTypeNames[i] = type.qualifiedSourceName();

+			}

+			char[] completion = TypeConstants.NoChar;

+			// nothing to insert - do not want to replace the existing selector & arguments

+			if (!exactMatch) {

+				if (source != null

+					&& source.length > endPosition

+					&& source[endPosition] == '(')

+					completion = method.selector;

+				else

+					completion = CharOperation.concat(method.selector, new char[] { '(', ')' });

+			}

+			requestor.acceptMethod(

+				method.declaringClass.qualifiedPackageName(),

+				method.declaringClass.qualifiedSourceName(),

+				method.selector,

+				parameterPackageNames,

+				parameterTypeNames,

+				method.returnType.qualifiedPackageName(),

+				method.returnType.qualifiedSourceName(),

+				completion,

+				method.modifiers,

 				startPosition,

 				endPosition);

 		}

 	}

+	private void findMethods(

+		char[] selector,

+		TypeBinding[] argTypes,

+		ReferenceBinding receiverType,

+		Scope scope,

+		ObjectVector methodsFound,

+		boolean onlyStaticMethods,

+		boolean exactMatch,

+		InvocationSite invocationSite) {

 

-	if (token.length == 0) return;

-	findKeywords(token, baseTypes, scope);

-	nameEnvironment.findTypes(token, this);

-	nameEnvironment.findPackages(token, this);

-}

-private void findTypesAndSubpackages(char[] token, PackageBinding packageBinding) {

-	char[] qualifiedName = CharOperation.concatWith(packageBinding.compoundName, token, '.');

-	if (token == null || token.length == 0) {

-		int length = qualifiedName.length;

-		System.arraycopy(qualifiedName, 0, qualifiedName = new char[length + 1], 0, length);

-		qualifiedName[length] = '.';

-	}

-	nameEnvironment.findTypes(qualifiedName, this);

-	nameEnvironment.findPackages(qualifiedName, this);

-}

-private void findVariablesAndMethods(char[] token, Scope scope) {

-	if (token == null) return;

+		if (selector == null)

+			return;

 

-	// Should local variables hide fields from the receiver type or any of its enclosing types?

-	// we know its an implicit field/method access... see BlockScope getBinding/getImplicitMethod

+		ReferenceBinding currentType = receiverType;

+		if (currentType.isInterface()) {

+			findMethods(

+				selector,

+				argTypes,

+				currentType.methods(),

+				scope,

+				methodsFound,

+				onlyStaticMethods,

+				exactMatch,

+				receiverType,

+				invocationSite);

 

-	boolean staticsOnly = false; // need to know if we're in a static context (or inside a constructor)

-	char[][] found = null;

-	int lastPosition = -1;

-	int tokenLength = token.length;

-	ObjectVector fieldsFound = new ObjectVector();

-	ObjectVector methodsFound = new ObjectVector();

-	done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

-		switch (scope.kind) {

-			case Scope.METHOD_SCOPE :

-				// handle the error case inside an explicit constructor call (see MethodScope>>findField)

-				MethodScope methodScope = (MethodScope) scope;

-				staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;

-			case Scope.BLOCK_SCOPE :

-				BlockScope blockScope = (BlockScope) scope;

-				next : for (int i = 0, length = blockScope.locals.length; i < length; i++) {

-					LocalVariableBinding local = blockScope.locals[i];

-					if (local == null) break next;

-					if (tokenLength > local.name.length) continue next;

-					if (!CharOperation.prefixEquals(token, local.name, false /* ignore case */)) continue next;

-					if (local.isSecret()) continue next;

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				ReferenceBinding[][] interfacesToVisit = new ReferenceBinding[5][];

+				int lastPosition = 0;

+				interfacesToVisit[lastPosition] = itsInterfaces;

 

-					if (found == null) {

-						found = new char[5][];

-					} else {

-						for (int f = 0; f < found.length; f++) {

-							char[] name = found[f];

-							if (name == null) break;

-							if (CharOperation.equals(name, local.name, false /* ignore case */)) continue next;

+				for (int i = 0; i <= lastPosition; i++) {

+					ReferenceBinding[] interfaces = interfacesToVisit[i];

+					for (int j = 0, length = interfaces.length; j < length; j++) {

+						currentType = interfaces[j];

+						if ((currentType.tagBits & TagBits.InterfaceVisited) == 0) {

+							// if interface as not already been visited

+							currentType.tagBits |= TagBits.InterfaceVisited;

+

+							findMethods(

+								selector,

+								argTypes,

+								currentType.methods(),

+								scope,

+								methodsFound,

+								onlyStaticMethods,

+								exactMatch,

+								receiverType,

+								invocationSite);

+

+							itsInterfaces = currentType.superInterfaces();

+							if (itsInterfaces != NoSuperInterfaces) {

+								if (++lastPosition == interfacesToVisit.length)

+									System.arraycopy(

+										interfacesToVisit,

+										0,

+										interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+										0,

+										lastPosition);

+								interfacesToVisit[lastPosition] = itsInterfaces;

+							}

 						}

 					}

-					if (++lastPosition == found.length)

-						System.arraycopy(found, 0, found = new char[lastPosition * 2][], 0, lastPosition);

-					found[lastPosition] = local.name;

-

-					requestor.acceptLocalVariable(

-						local.name,

-						NoChar,

-						local.type == null ? local.declaration.type.toString().toCharArray() : local.type.qualifiedSourceName(),

-						local.modifiers,

-						startPosition,

-						endPosition);

 				}

-				break;

-			case Scope.CLASS_SCOPE :

-				ClassScope classScope = (ClassScope) scope;

-				SourceTypeBinding enclosingType = classScope.referenceContext.binding;

-/*				if (tokenLength == 0) { // only search inside the type itself if no prefix was provided

-					findFields(token, enclosingType.fields(), classScope, fieldsFound, staticsOnly);

-					findMethods(token, enclosingType.methods(), classScope, methodsFound, staticsOnly, false);

-					break done;

-				} else { */

-					findFields(token, enclosingType, classScope, fieldsFound, staticsOnly);

-					findMethods(token, null, enclosingType, classScope, methodsFound, staticsOnly, false);

-					staticsOnly |= enclosingType.isStatic();

-//				}

-				break;

-			case Scope.COMPILATION_UNIT_SCOPE :

-				break done;

-		}

-		scope = scope.parent;

-	}

-}

-public AssistParser getParser(){

-	return parser;

-}

-private boolean mustQualifyType(char[][] packageName, char[] readableTypeName) {

-	// If there are no types defined into the current CU yet.

-	if (unitScope == null)

-		return true;

-	if (CharOperation.equals(unitScope.fPackage.compoundName, packageName))

-		return false;

 

-	ImportBinding[] imports = unitScope.imports;

-	for (int i = 0, length = imports.length; i < length; i++) {

-		if (imports[i].onDemand) {

-			if (CharOperation.equals(imports[i].compoundName, packageName))

-				return false; // how do you match p1.p2.A.* ?

-		} else if (CharOperation.equals(imports[i].readableName(), readableTypeName)) {

-			return false;

+				// bit reinitialization

+				for (int i = 0; i <= lastPosition; i++) {

+					ReferenceBinding[] interfaces = interfacesToVisit[i];

+					for (int j = 0, length = interfaces.length; j < length; j++)

+						interfaces[j].tagBits &= ~TagBits.InterfaceVisited;

+				}

+			}

+			currentType = scope.getJavaLangObject();

+		}

+

+		while (currentType != null) {

+			findMethods(

+				selector,

+				argTypes,

+				currentType.methods(),

+				scope,

+				methodsFound,

+				onlyStaticMethods,

+				exactMatch,

+				receiverType,

+				invocationSite);

+			currentType = currentType.superclass();

 		}

 	}

-	return true;

-}

-protected void reset() {

-	super.reset();

-	this.knownPkgs = new HashtableOfObject(10);

-}

-private void setSourceRange(int start, int end) {

-	this.startPosition = start;

-	this.endPosition = end + 1; // Add 1 for now

-}

-}

+	private void findNestedTypes(

+		char[] typeName,

+		SourceTypeBinding currentType,

+		Scope scope) {

+		if (typeName == null)

+			return;

+

+		int typeLength = typeName.length;

+		while (scope != null) { // done when a COMPILATION_UNIT_SCOPE is found

+			switch (scope.kind) {

+				case Scope.METHOD_SCOPE :

+				case Scope.BLOCK_SCOPE :

+					BlockScope blockScope = (BlockScope) scope;

+					next : for (int i = 0, length = blockScope.scopeIndex; i < length; i++) {

+						if (blockScope.subscopes[i] instanceof ClassScope) {

+							SourceTypeBinding localType =

+								((ClassScope) blockScope.subscopes[i]).referenceContext.binding;

+							if (!localType.isAnonymousType()) {

+								if (typeLength > localType.sourceName.length)

+									continue next;

+								if (!CharOperation.prefixEquals(typeName, localType.sourceName, false

+									/* ignore case */

+									))

+									continue next;

+

+								requestor.acceptClass(

+									localType.qualifiedPackageName(),

+									localType.sourceName,

+									localType.sourceName,

+									localType.modifiers,

+									startPosition,

+									endPosition);

+							}

+						}

+					}

+					break;

+				case Scope.CLASS_SCOPE :

+					findMemberTypes(typeName, scope.enclosingSourceType(), scope, currentType);

+					if (typeLength == 0)

+						return; // do not search outside the class scope if no prefix was provided

+					break;

+				case Scope.COMPILATION_UNIT_SCOPE :

+					return;

+			}

+			scope = scope.parent;

+		}

+	}

+	private void findPackages(CompletionOnPackageReference packageStatement) {

+		char[] packageName = CharOperation.concatWith(packageStatement.tokens, '.');

+		if (packageName.length == 0)

+			return;

+

+		setSourceRange(packageStatement.sourceStart, packageStatement.sourceEnd);

+		nameEnvironment.findPackages(CharOperation.toLowerCase(packageName), this);

+	}

+	private void findTypesAndPackages(char[] token, Scope scope) {

+		if (token == null)

+			return;

+

+		if (scope.enclosingSourceType() != null)

+			findNestedTypes(token, scope.enclosingSourceType(), scope);

+

+		if (unitScope != null) {

+			int typeLength = token.length;

+			SourceTypeBinding[] types = unitScope.topLevelTypes;

+			for (int i = 0, length = types.length; i < length; i++) {

+				SourceTypeBinding sourceType = types[i];

+				if (typeLength > sourceType.sourceName.length)

+					continue;

+				if (!CharOperation.prefixEquals(token, sourceType.sourceName, false

+					/* ignore case */

+					))

+					continue;

+

+				requestor.acceptType(

+					sourceType.qualifiedPackageName(),

+					sourceType.sourceName(),

+					sourceType.sourceName(),

+					startPosition,

+					endPosition);

+			}

+		}

+

+		if (token.length == 0)

+			return;

+		findKeywords(token, baseTypes, scope);

+		nameEnvironment.findTypes(token, this);

+		nameEnvironment.findPackages(token, this);

+	}

+	private void findTypesAndSubpackages(

+		char[] token,

+		PackageBinding packageBinding) {

+		char[] qualifiedName =

+			CharOperation.concatWith(packageBinding.compoundName, token, '.');

+		if (token == null || token.length == 0) {

+			int length = qualifiedName.length;

+			System.arraycopy(

+				qualifiedName,

+				0,

+				qualifiedName = new char[length + 1],

+				0,

+				length);

+			qualifiedName[length] = '.';

+		}

+		nameEnvironment.findTypes(qualifiedName, this);

+		nameEnvironment.findPackages(qualifiedName, this);

+	}

+	private void findVariablesAndMethods(

+		char[] token,

+		Scope scope,

+		InvocationSite invocationSite,

+		Scope invocationScope) {

+		if (token == null)

+			return;

+

+		// Should local variables hide fields from the receiver type or any of its enclosing types?

+		// we know its an implicit field/method access... see BlockScope getBinding/getImplicitMethod

+

+		boolean staticsOnly = false;

+		// need to know if we're in a static context (or inside a constructor)

+		int lastPosition = -1;

+		int tokenLength = token.length;

+

+		ObjectVector localsFound = new ObjectVector();

+		ObjectVector fieldsFound = new ObjectVector();

+		ObjectVector methodsFound = new ObjectVector();

+		

+		Scope currentScope = scope;

+		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

+			switch (currentScope.kind) {

+				case Scope.METHOD_SCOPE :

+					// handle the error case inside an explicit constructor call (see MethodScope>>findField)

+					MethodScope methodScope = (MethodScope) currentScope;

+					staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;

+				case Scope.BLOCK_SCOPE :

+					BlockScope blockScope = (BlockScope) currentScope;

+					next : for (int i = 0, length = blockScope.locals.length; i < length; i++) {

+						LocalVariableBinding local = blockScope.locals[i];

+						if (local == null)

+							break next;

+						if (tokenLength > local.name.length)

+							continue next;

+						if (!CharOperation.prefixEquals(token, local.name, false /* ignore case */

+							))

+							continue next;

+						if (local.isSecret())

+							continue next;

+

+						for (int f = 0; f < localsFound.size; f++) {

+							LocalVariableBinding otherLocal =

+								(LocalVariableBinding) localsFound.elementAt(f);

+							if (CharOperation.equals(otherLocal.name, local.name, false /* ignore case */

+								))

+								continue next;

+						}

+						localsFound.add(local);

+

+						requestor.acceptLocalVariable(

+							local.name,

+							NoChar,

+							local.type == null

+								? local.declaration.type.toString().toCharArray()

+								: local.type.qualifiedSourceName(),

+							local.modifiers,

+							startPosition,

+							endPosition);

+					}

+					break;

+				case Scope.COMPILATION_UNIT_SCOPE :

+					break done;

+			}

+			currentScope = currentScope.parent;

+		}

+		

+		currentScope = scope;

+		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

+			switch (currentScope.kind) {

+				case Scope.CLASS_SCOPE :

+					ClassScope classScope = (ClassScope) currentScope;

+					SourceTypeBinding enclosingType = classScope.referenceContext.binding;

+					/*				if (tokenLength == 0) { // only search inside the type itself if no prefix was provided

+										findFields(token, enclosingType.fields(), classScope, fieldsFound, staticsOnly);

+										findMethods(token, enclosingType.methods(), classScope, methodsFound, staticsOnly, false);

+										break done;

+									} else { */

+					findFields(

+						token,

+						enclosingType,

+						classScope,

+						fieldsFound,

+						localsFound,

+						staticsOnly,

+						invocationSite,

+						invocationScope);

+					findMethods(

+						token,

+						null,

+						enclosingType,

+						classScope,

+						methodsFound,

+						staticsOnly,

+						false,

+						invocationSite);

+					staticsOnly |= enclosingType.isStatic();

+					//				}

+					break;

+				case Scope.COMPILATION_UNIT_SCOPE :

+					break done;

+			}

+			currentScope = currentScope.parent;

+		}

+	}

+	public AssistParser getParser() {

+		return parser;

+	}

+	private boolean mustQualifyType(

+		char[][] packageName,

+		char[] readableTypeName) {

+		// If there are no types defined into the current CU yet.

+		if (unitScope == null)

+			return true;

+		if (CharOperation.equals(unitScope.fPackage.compoundName, packageName))

+			return false;

+

+		ImportBinding[] imports = unitScope.imports;

+		for (int i = 0, length = imports.length; i < length; i++) {

+			if (imports[i].onDemand) {

+				if (CharOperation.equals(imports[i].compoundName, packageName))

+					return false; // how do you match p1.p2.A.* ?

+			} else

+				if (CharOperation.equals(imports[i].readableName(), readableTypeName)) {

+					return false;

+				}

+		}

+		return true;

+	}

+	protected void reset() {

+		super.reset();

+		this.knownPkgs = new HashtableOfObject(10);

+	}

+	private void setSourceRange(int start, int end) {

+		this.startPosition = start;

+		if (options.checkEntireWordReplacement()) {

+			this.endPosition = end + 1; // Add 1 for now

+		} else {

+			this.endPosition = actualCompletionPosition + 1;

+		}

+	}

+

+	/**

+	 * Returns all the options of the Completion Engine to be shown by the UI

+	 *

+	 * @param locale java.util.Locale

+	 * @return com.ibm.compiler.java.ConfigurableOption[]

+	 */

+	public static ConfigurableOption[] getDefaultOptions(Locale locale) {

+		String[] ids =

+			ConfigurableOption.getIDs(CompletionEngine.class.getName(), locale);

+

+		ConfigurableOption[] result = new ConfigurableOption[ids.length];

+		for (int i = 0; i < ids.length; i++) {

+			result[i] = new ConfigurableOption(ids[i], locale);

+		}

+

+		return result;

+	}

+}
\ No newline at end of file
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java b/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
index 46432c4..364322e 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/ISearchRequestor.java
@@ -13,39 +13,43 @@
  * to the raw name environment results before answering them to the UI.

  */

 public interface ISearchRequestor {

-/**

- * One result of the search consists of a new class.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.M".

- *    The default package is represented by an empty array.

- */

-public void acceptClass(char[] packageName, char[] typeName, int modifiers);

-/**

- * One result of the search consists of a new interface.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.I".

- *    The default package is represented by an empty array.

- */

-public void acceptInterface(char[] packageName, char[] typeName, int modifiers);

-/**

- * One result of the search consists of a new package.

- *

- * NOTE - All package names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    The default package is represented by an empty array.

- */

-public void acceptPackage(char[] packageName);

-/**

- * One result of the search consists of a new type.

- *

- * NOTE - All package and type names are presented in their readable form:

- *    Package names are in the form "a.b.c".

- *    Nested type names are in the qualified form "A.M".

- *    The default package is represented by an empty array.

- */

-public void acceptType(char[] packageName, char[] typeName);

-}

+	

+	/**

+	 * One result of the search consists of a new class.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.M".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptClass(char[] packageName, char[] typeName, int modifiers);

+

+	/**

+	 * One result of the search consists of a new interface.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.I".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptInterface(char[] packageName, char[] typeName, int modifiers);

+

+	/**

+	 * One result of the search consists of a new package.

+	 *

+	 * NOTE - All package names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptPackage(char[] packageName);

+

+	/**

+	 * One result of the search consists of a new type.

+	 *

+	 * NOTE - All package and type names are presented in their readable form:

+	 *    Package names are in the form "a.b.c".

+	 *    Nested type names are in the qualified form "A.M".

+	 *    The default package is represented by an empty array.

+	 */

+	public void acceptType(char[] packageName, char[] typeName);

+}
\ No newline at end of file
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java b/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
index 808c774..15fadba 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
@@ -74,7 +74,7 @@
 				}

 			};

 

-	this.parser = new SelectionParser(problemReporter);

+	this.parser = new SelectionParser(problemReporter, options.getAssertMode());

 	this.lookupEnvironment = new LookupEnvironment(this, options, problemReporter, nameEnvironment);

 }

 /**

@@ -366,11 +366,12 @@
 		// compute parse tree for this most outer type

 		CompilationResult result = new CompilationResult(outerType.getFileName(), 1, 1);

 		CompilationUnitDeclaration parsedUnit = 

-			SourceTypeConverter.buildCompilationUnit(

-				outerType,

+			SourceTypeConverter.buildCompilationUnit(  

+				new ISourceType[]{outerType}, 

 				false, // don't need field and methods

+				true, // by default get member types

 				this.parser.problemReporter(),

-				result);

+				result); 

 

 		if (parsedUnit != null && parsedUnit.types != null) {

 			// find the type declaration that corresponds to the original source type

@@ -400,7 +401,7 @@
 							selectionIdentifier,

 							new long[previousIdentifiers.length + 1]);

 				}

-				field.name = "<fakeField>"/*nonNLS*/.toCharArray();

+				field.name = "<fakeField>".toCharArray(); //$NON-NLS-1$

 				typeDecl.fields = new FieldDeclaration[] {field};

 

 				// build bindings

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java
index 79e6f08..7421006 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java
@@ -41,11 +41,11 @@
 		throw new CompletionNodeFound(this, targetType, scope);

 }

 public String toStringExpression() {

-	StringBuffer result = new StringBuffer("<CompleteOnClassLiteralAccess:"/*nonNLS*/);

+	StringBuffer result = new StringBuffer("<CompleteOnClassLiteralAccess:"); //$NON-NLS-1$

 	result.append(type.toString());

-	result.append("."/*nonNLS*/);

+	result.append("."); //$NON-NLS-1$

 	result.append(completionIdentifier);

-	result.append(">"/*nonNLS*/);

+	result.append(">"); //$NON-NLS-1$

 	return result.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExceptionReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExceptionReference.java
index 6b14d5a..fddf441 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExceptionReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExceptionReference.java
@@ -36,6 +36,6 @@
 	super(source, pos);

 }

 public String toStringExpression(int tab) {

-	return "<CompleteOnException:"/*nonNLS*/ + new String(token) + ">"/*nonNLS*/;

+	return "<CompleteOnException:" + new String(token) + ">"; //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java
index 33a2a6a..47d62d5 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java
@@ -48,23 +48,23 @@
 }

 public String toString(int tab) {

 	String s = tabString(tab);

-	s += "<CompleteOnExplicitConstructorCall:"/*nonNLS*/;

+	s += "<CompleteOnExplicitConstructorCall:"; //$NON-NLS-1$

 	if (qualification != null)

-		s = s + qualification.toStringExpression() + "."/*nonNLS*/;

+		s = s + qualification.toStringExpression() + "."; //$NON-NLS-1$

 	if (accessMode == This) {

-		s = s + "this("/*nonNLS*/;

+		s = s + "this("; //$NON-NLS-1$

 	} else {

-		s = s + "super("/*nonNLS*/;

+		s = s + "super("; //$NON-NLS-1$

 	}

 	if (arguments != null) {

 		for (int i = 0; i < arguments.length; i++) {

 			s += arguments[i].toStringExpression();

 			if (i != arguments.length - 1) {

-				s += ", "/*nonNLS*/;

+				s += ", "; //$NON-NLS-1$

 			}

 		};

 	}

-	s += ")>"/*nonNLS*/;

+	s += ")>"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java
index 33a99a1..d71d7b7 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.java
@@ -36,14 +36,14 @@
 public String toString(int tab, boolean withOnDemand) {

 

 	StringBuffer buffer = new StringBuffer(tabString(tab));

-	buffer.	append("<CompleteOnImport:"/*nonNLS*/);

+	buffer.	append("<CompleteOnImport:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
index 55098d0..0d3d063 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
@@ -43,8 +43,8 @@
 public String toStringExpression(){

 	/* slow code */

 	

-	return 	"<CompleteOnMemberAccess:"/*nonNLS*/ 

+	return 	"<CompleteOnMemberAccess:"  //$NON-NLS-1$

 			+ super.toStringExpression() 

-			+ ">"/*nonNLS*/;

+			+ ">"; //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java
index bb9419e..3c91fd1 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java
@@ -45,19 +45,19 @@
 public String toStringExpression() {

 	/*slow code*/

 

-	String s = "<CompleteOnMessageSend:"/*nonNLS*/;

+	String s = "<CompleteOnMessageSend:"; //$NON-NLS-1$

 	if (receiver != ThisReference.ThisImplicit)

-		s = s + receiver.toStringExpression() + "."/*nonNLS*/;

-	s = s + new String(selector) + "("/*nonNLS*/;

+		s = s + receiver.toStringExpression() + "."; //$NON-NLS-1$

+	s = s + new String(selector) + "("; //$NON-NLS-1$

 	if (arguments != null) {

 		for (int i = 0; i < arguments.length; i++) {

 			s += arguments[i].toStringExpression();

 			if (i != arguments.length - 1) {

-				s += ", "/*nonNLS*/;

+				s += ", "; //$NON-NLS-1$

 			}

 		};

 	}

-	s = s + ")>"/*nonNLS*/;

+	s = s + ")>"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java
index 1f7e313..7c3af04 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.java
@@ -34,14 +34,14 @@
 }

 public String toString(int tab, boolean withOnDemand) {

 	StringBuffer buffer = new StringBuffer(tabString(tab));

-	buffer.	append("<CompleteOnPackage:"/*nonNLS*/);

+	buffer.	append("<CompleteOnPackage:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
index 63b20d5..aba7d73 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
@@ -56,8 +56,8 @@
 public String toStringExpression(int tab) {

 	return 

 		((this.enclosingInstance == null) ? 

-			"<CompleteOnAllocationExpression:"/*nonNLS*/ : 

-			"<CompleteOnQualifiedAllocationExpression:"/*nonNLS*/) + 

-		super.toStringExpression(tab) + ">"/*nonNLS*/;

+			"<CompleteOnAllocationExpression:" :  //$NON-NLS-1$

+			"<CompleteOnQualifiedAllocationExpression:") +  //$NON-NLS-1$

+		super.toStringExpression(tab) + ">"; //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedExceptionReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedExceptionReference.java
index 4d02d45..e55f052 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedExceptionReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedExceptionReference.java
@@ -39,12 +39,12 @@
 public String toStringExpression(int tab) {

 

 	StringBuffer buffer = new StringBuffer();

-	buffer. append("<CompleteOnException:"/*nonNLS*/);

+	buffer. append("<CompleteOnException:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

-		buffer.append("."/*nonNLS*/);

+		buffer.append("."); //$NON-NLS-1$

 	}

-	buffer.append(completionIdentifier).append(">"/*nonNLS*/);

+	buffer.append(completionIdentifier).append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java
index df2ef46..036d3f3 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java
@@ -61,12 +61,12 @@
 }

 public String toStringExpression() {

 

-	StringBuffer buffer = new StringBuffer("<CompleteOnName:"/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("<CompleteOnName:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

-		buffer.append("."/*nonNLS*/);

+		buffer.append("."); //$NON-NLS-1$

 	}

-	buffer.append(completionIdentifier).append(">"/*nonNLS*/);

+	buffer.append(completionIdentifier).append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
index d1a29bd..65eb427 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java
@@ -49,12 +49,12 @@
 public String toStringExpression(int tab) {

 

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("<CompleteOnType:"/*nonNLS*/);

+	buffer.append("<CompleteOnType:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

-		buffer.append("."/*nonNLS*/);

+		buffer.append("."); //$NON-NLS-1$

 	}

-	buffer.append(completionIdentifier).append(">"/*nonNLS*/);

+	buffer.append(completionIdentifier).append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java
index 71cc394..db8f08f 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.java
@@ -36,6 +36,6 @@
 	throw new CompletionNodeFound(this, scope);

 }

 public String toStringExpression() {

-	return "<CompleteOnName:"/*nonNLS*/ + super.toStringExpression() + ">"/*nonNLS*/;

+	return "<CompleteOnName:" + super.toStringExpression() + ">"; //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java
index f9c4c6d..b75bbe5 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java
@@ -42,6 +42,6 @@
 }

 public String toStringExpression(int tab){

 

-	return "<CompleteOnType:"/*nonNLS*/ + new String(token) + ">"/*nonNLS*/ ;

+	return "<CompleteOnType:" + new String(token) + ">" ; //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
index 62a3b91..46e3212 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
@@ -70,8 +70,13 @@
 	// it is poped when a block is exited 

 	int blockInvocationPtr;

 	int[] blockInvocationStack = new int[StackIncrement];

+	

+/** @deprecated - should use constructor with assertMode */

 public CompletionParser(ProblemReporter problemReporter) {

-	super(problemReporter);

+	this(problemReporter, false/*no assertion by default*/);

+}

+public CompletionParser(ProblemReporter problemReporter, boolean assertMode) {

+	super(problemReporter, assertMode);

 }

 public char[] assistIdentifier(){

 	return ((CompletionScanner)scanner).completionIdentifier;

@@ -312,6 +317,11 @@
 					messageSend.receiver = ThisReference.ThisImplicit;

 					break;

 				case NAME_RECEIVER:

+					// remove special flags for primitive types

+					while (this.identifierLengthPtr >= 0 && this.identifierLengthStack[this.identifierLengthPtr] < 0) {

+						this.identifierLengthPtr--;

+					}

+				

 					// remove selector 

 					this.identifierPtr--; 

 					this.identifierLengthStack[this.identifierLengthPtr]--;

@@ -860,7 +870,7 @@
 	this.blockInvocationPtr = -1;

 }

 public void initializeScanner(){

-	this.scanner = new CompletionScanner();

+	this.scanner = new CompletionScanner(this.assertMode);

 }

 /**

  * Returns whether we are directly or indirectly inside a field initializer.

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
index 2ac0910..cdca930 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
@@ -29,8 +29,8 @@
 	public int completedIdentifierEnd = -1;

 

 	public static final char[] EmptyCompletionIdentifier = {};

-public CompletionScanner() {

-	super();

+public CompletionScanner(boolean assertMode) {

+	super(false, false, false, assertMode);

 }

 /* 

  * Truncate the current identifier if it is containing the cursor location. Since completion is performed

@@ -646,7 +646,7 @@
 					if (atEnd())

 						return TokenNameEOF;

 					//the atEnd may not be <currentPosition == source.length> if source is only some part of a real (external) stream

-					throw new InvalidInputException("Ctrl-Z"/*nonNLS*/);

+					throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$

 

 				default :

 					if (Character.isJavaIdentifierStart(currentCharacter))

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.java
index 543d318..adb6de9 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.java
@@ -14,10 +14,10 @@
 	public String irritant;

 

 	/* Possible irritants */

-	public static final String NO_COMPLETION_INSIDE_UNICODE = "No Completion Inside Unicode"/*nonNLS*/;

-	public static final String NO_COMPLETION_INSIDE_COMMENT = "No Completion Inside Comment"/*nonNLS*/;     

-	public static final String NO_COMPLETION_INSIDE_STRING = "No Completion Inside String"/*nonNLS*/;       

-	public static final String NO_COMPLETION_INSIDE_NUMBER = "No Completion Inside Number"/*nonNLS*/;       

+	public static final String NO_COMPLETION_INSIDE_UNICODE = "No Completion Inside Unicode"; //$NON-NLS-1$

+	public static final String NO_COMPLETION_INSIDE_COMMENT = "No Completion Inside Comment";      //$NON-NLS-1$

+	public static final String NO_COMPLETION_INSIDE_STRING = "No Completion Inside String";        //$NON-NLS-1$

+	public static final String NO_COMPLETION_INSIDE_NUMBER = "No Completion Inside Number";        //$NON-NLS-1$

     

 public InvalidCursorLocation(String irritant){

 	this.irritant = irritant;

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index 1e93c1b..92eca57 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -52,8 +52,8 @@
 	//  and it is poped when the type is exited)

 	protected int inMethodPtr;

 	protected boolean[] inMethodStack = new boolean[StackIncrement];

-public AssistParser(ProblemReporter problemReporter) {

-	super(problemReporter, false);

+public AssistParser(ProblemReporter problemReporter, boolean assertMode) {

+	super(problemReporter, false, assertMode);

 }

 public abstract char[] assistIdentifier();

 public int bodyEnd(AbstractMethodDeclaration method){

@@ -90,7 +90,8 @@
 			TypeDeclaration type = (TypeDeclaration) referenceContext;

 			for (int i = 0; i < type.fields.length; i++){

 				FieldDeclaration field = type.fields[i];					

-				if (field.declarationSourceStart <= scanner.initialPosition

+				if (!field.isField()

+						&& field.declarationSourceStart <= scanner.initialPosition

 						&& scanner.initialPosition <= field.declarationSourceEnd

 						&& scanner.eofPosition <= field.declarationSourceEnd+1){

 					element = new RecoveredInitializer((Initializer) field, null, 1, this);

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java b/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
index 2e949d9..d6c80ee 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
@@ -16,102 +16,121 @@
 import org.eclipse.jdt.internal.compiler.impl.*;

 

 public abstract class Engine implements ITypeRequestor {

+

 	public LookupEnvironment lookupEnvironment;

-/**

- * Add an additional binary type

- */

 

-public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

-	lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

-}

-/**

- * Add an additional compilation unit.

- */

-

-public void accept(ICompilationUnit sourceUnit) {

-	CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

-	CompilationUnitDeclaration parsedUnit = this.getParser().dietParse(sourceUnit, result);

-

-	lookupEnvironment.buildTypeBindings(parsedUnit);

-	lookupEnvironment.completeTypeBindings(parsedUnit, true);

-}

-/**

- * Add an additional source type

- */

-

-public void accept(ISourceType sourceType, PackageBinding packageBinding) {

-	CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1); // need to hold onto this

-	CompilationUnitDeclaration unit =

-		SourceTypeConverter.buildCompilationUnit(sourceType, true, true, lookupEnvironment.problemReporter, result);

-

-	if (unit != null) {

-		lookupEnvironment.buildTypeBindings(unit);

-		lookupEnvironment.completeTypeBindings(unit, true);

+	/**

+	 * Add an additional binary type

+	 */

+	public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

+		lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

 	}

-}

-/**

- * Answer an array of descriptions for the configurable options.

- * The descriptions may be changed and passed back to a different

- * compiler.

- *

- *  @return ConfigurableOption[] - array of configurable options

- */

-public static ConfigurableOption[] getDefaultOptions(Locale locale) {

-	return Compiler.getDefaultOptions(locale);

-}

-public abstract AssistParser getParser();

-protected void parseMethod(CompilationUnitDeclaration unit, int position) {

-	for (int i = unit.types.length; --i >= 0;) {

-		TypeDeclaration type = unit.types[i];

-		if (type.declarationSourceStart < position && type.declarationSourceEnd >= position) {

-			getParser().scanner.setSourceBuffer(unit.compilationResult.compilationUnit.getContents());

-			parseMethod(type, unit, position);

-			return;

+

+	/**

+	 * Add an additional compilation unit.

+	 */

+	public void accept(ICompilationUnit sourceUnit) {

+		CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

+		CompilationUnitDeclaration parsedUnit =

+			this.getParser().dietParse(sourceUnit, result);

+

+		lookupEnvironment.buildTypeBindings(parsedUnit);

+		lookupEnvironment.completeTypeBindings(parsedUnit, true);

+	}

+

+	/**

+	 * Add additional source types (the first one is the requested type, the rest is formed by the

+	 * secondary types defined in the same compilation unit).

+	 */

+	public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {

+		CompilationResult result =

+			new CompilationResult(sourceTypes[0].getFileName(), 1, 1);

+		CompilationUnitDeclaration unit =

+			SourceTypeConverter.buildCompilationUnit(

+				sourceTypes,

+				true,

+				true,

+				lookupEnvironment.problemReporter,

+				result);

+

+		if (unit != null) {

+			lookupEnvironment.buildTypeBindings(unit);

+			lookupEnvironment.completeTypeBindings(unit, true);

 		}

 	}

-}

-private void parseMethod(TypeDeclaration type, CompilationUnitDeclaration unit, int position) {

-	//members

-	TypeDeclaration[] memberTypes = type.memberTypes;

-	if (memberTypes != null) {

-		for (int i = memberTypes.length; --i >= 0;) {

-			TypeDeclaration memberType = memberTypes[i];

-			if (memberType.bodyStart > position) continue;

-			if (memberType.declarationSourceEnd >= position) {

-				parseMethod(memberType, unit, position);

+

+	/**

+	 * Answer an array of descriptions for the configurable options.

+	 * The descriptions may be changed and passed back to a different

+	 * compiler.

+	 *

+	 *  @return ConfigurableOption[] - array of configurable options

+	 */

+	public static ConfigurableOption[] getDefaultOptions(Locale locale) {

+		return Compiler.getDefaultOptions(locale);

+	}

+	public abstract AssistParser getParser();

+	protected void parseMethod(CompilationUnitDeclaration unit, int position) {

+		for (int i = unit.types.length; --i >= 0;) {

+			TypeDeclaration type = unit.types[i];

+			if (type.declarationSourceStart < position

+				&& type.declarationSourceEnd >= position) {

+				getParser().scanner.setSourceBuffer(

+					unit.compilationResult.compilationUnit.getContents());

+				parseMethod(type, unit, position);

 				return;

 			}

 		}

 	}

 

-	//methods

-	AbstractMethodDeclaration[] methods = type.methods;

-	if (methods != null) {

-		for (int i = methods.length; --i >= 0;) {

-			AbstractMethodDeclaration method = methods[i];

-			if (method.bodyStart > position) continue;

-			if (method.declarationSourceEnd >= position) {

-				getParser().parseBlockStatements(method, unit);

-				return;

+	private void parseMethod(

+		TypeDeclaration type,

+		CompilationUnitDeclaration unit,

+		int position) {

+		//members

+		TypeDeclaration[] memberTypes = type.memberTypes;

+		if (memberTypes != null) {

+			for (int i = memberTypes.length; --i >= 0;) {

+				TypeDeclaration memberType = memberTypes[i];

+				if (memberType.bodyStart > position)

+					continue;

+				if (memberType.declarationSourceEnd >= position) {

+					parseMethod(memberType, unit, position);

+					return;

+				}

+			}

+		}

+		//methods

+		AbstractMethodDeclaration[] methods = type.methods;

+		if (methods != null) {

+			for (int i = methods.length; --i >= 0;) {

+				AbstractMethodDeclaration method = methods[i];

+				if (method.bodyStart > position)

+					continue;

+				if (method.declarationSourceEnd >= position) {

+					getParser().parseBlockStatements(method, unit);

+					return;

+				}

+			}

+		}

+		//initializers

+		FieldDeclaration[] fields = type.fields;

+		if (fields != null) {

+			for (int i = fields.length; --i >= 0;) {

+				if (!(fields[i] instanceof Initializer))

+					continue;

+				Initializer initializer = (Initializer) fields[i];

+				if (initializer.bodyStart > position)

+					continue;

+				if (initializer.declarationSourceEnd >= position) {

+					getParser().parseBlockStatements(initializer, type, unit);

+					return;

+				}

 			}

 		}

 	}

 

-	//initializers

-	FieldDeclaration[] fields = type.fields;

-	if (fields != null) {

-		for (int i = fields.length; --i >= 0;) {

-			if (!(fields[i] instanceof Initializer)) continue;

-			Initializer initializer = (Initializer) fields[i];

-			if (initializer.bodyStart > position) continue;

-			if (initializer.declarationSourceEnd>= position) {

-				getParser().parseBlockStatements(initializer, type, unit);

-				return;

-			}

-		}

+	protected void reset() {

+		lookupEnvironment.reset();

 	}

-}

-protected void reset() {

-	lookupEnvironment.reset();

-}

-}

+}
\ No newline at end of file
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/options.properties b/codeassist/org/eclipse/jdt/internal/codeassist/options.properties
deleted file mode 100644
index f2f2745..0000000
--- a/codeassist/org/eclipse/jdt/internal/codeassist/options.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-show.superHierarchyOverriddenDeclarations.number=1

-show.superHierarchyOverriddenDeclarations.category=Show

-show.superHierarchyOverriddenDeclarations.name=Show super hierarchy overridden methods or fields

-show.superHierarchyOverriddenDeclarations.possibleValues=2|Yes|No

-show.superHierarchyOverriddenDeclarations.description=Show any method or field declared into the super hierarchy even if overridden by a more specialized version.

-

-show.enclosingHierarchyOverriddenDeclarations.number=2

-show.enclosingHierarchyOverriddenDeclarations.category=Show

-show.enclosingHierarchyOverriddenDeclarations.name=Show enslosing hierarchy overridden methods or fields

-show.enclosingHierarchyOverriddenDeclarations.possibleValues=2|Yes|No

-show.enclosingHierarchyOverriddenDeclarations.description=Show any method or field declared into the enclosing hierarchy even if overridden by a more enclosed version.

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java
index c129f32..f092f25 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java
@@ -40,23 +40,23 @@
 }

 public String toString(int tab) {

 	String s = tabString(tab);

-	s += "<SelectOnExplicitConstructorCall:"/*nonNLS*/;

+	s += "<SelectOnExplicitConstructorCall:"; //$NON-NLS-1$

 	if (qualification != null)

-		s = s + qualification.toStringExpression() + "."/*nonNLS*/;

+		s = s + qualification.toStringExpression() + "."; //$NON-NLS-1$

 	if (accessMode == This) {

-		s = s + "this("/*nonNLS*/;

+		s = s + "this("; //$NON-NLS-1$

 	} else {

-		s = s + "super("/*nonNLS*/;

+		s = s + "super("; //$NON-NLS-1$

 	}

 	if (arguments != null) {

 		for (int i = 0; i < arguments.length; i++) {

 			s += arguments[i].toStringExpression();

 			if (i != arguments.length - 1) {

-				s += ", "/*nonNLS*/;

+				s += ", "; //$NON-NLS-1$

 			}

 		};

 	}

-	s += ")>"/*nonNLS*/;

+	s += ")>"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java
index 47688f7..267ffc5 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.java
@@ -41,8 +41,8 @@
 public String toStringExpression(){

 	/* slow code */

 	

-	return 	"<SelectionOnFieldReference:"/*nonNLS*/ 

+	return 	"<SelectionOnFieldReference:"  //$NON-NLS-1$

 			+ super.toStringExpression() 

-			+ ">"/*nonNLS*/;

+			+ ">"; //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java
index fa29b31..fcb222b 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java
@@ -33,14 +33,14 @@
 public String toString(int tab, boolean withOnDemand) {

 

 	StringBuffer buffer = new StringBuffer(tabString(tab));

-	buffer.	append("<SelectOnImport:"/*nonNLS*/);

+	buffer.	append("<SelectOnImport:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java
index 262dfdb..ed685bd 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.java
@@ -38,19 +38,19 @@
 public String toStringExpression() {

 	/*slow code*/

 

-	String s = "<SelectOnMessageSend:"/*nonNLS*/;

+	String s = "<SelectOnMessageSend:"; //$NON-NLS-1$

 	if (receiver != ThisReference.ThisImplicit)

-		s = s + receiver.toStringExpression() + "."/*nonNLS*/;

-	s = s + new String(selector) + "("/*nonNLS*/;

+		s = s + receiver.toStringExpression() + "."; //$NON-NLS-1$

+	s = s + new String(selector) + "("; //$NON-NLS-1$

 	if (arguments != null) {

 		for (int i = 0; i < arguments.length; i++) {

 			s += arguments[i].toStringExpression();

 			if (i != arguments.length - 1) {

-				s += ", "/*nonNLS*/;

+				s += ", "; //$NON-NLS-1$

 			}

 		};

 	}

-	s = s + ")>"/*nonNLS*/;

+	s = s + ")>"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
index 58460d3..fbe5886 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
@@ -31,14 +31,14 @@
 }

 public String toString(int tab, boolean withOnDemand) {

 	StringBuffer buffer = new StringBuffer(tabString(tab));

-	buffer.	append("<SelectOnPackage:"/*nonNLS*/);

+	buffer.	append("<SelectOnPackage:"); //$NON-NLS-1$

 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java
index f590a7d..4c36cce 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java
@@ -57,8 +57,8 @@
 public String toStringExpression(int tab) {

 	return 

 		((this.enclosingInstance == null) ? 

-			"<SelectOnAllocationExpression:"/*nonNLS*/ : 

-			"<SelectOnQualifiedAllocationExpression:"/*nonNLS*/) + 

-		super.toStringExpression(tab) + ">"/*nonNLS*/;

+			"<SelectOnAllocationExpression:" :  //$NON-NLS-1$

+			"<SelectOnQualifiedAllocationExpression:") +  //$NON-NLS-1$

+		super.toStringExpression(tab) + ">"; //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java
index d6cd44f..a233b18 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java
@@ -56,13 +56,13 @@
 }

 public String toStringExpression() {

 

-	StringBuffer buffer = new StringBuffer("<SelectOnName:"/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("<SelectOnName:"); //$NON-NLS-1$

 	for (int i = 0, length = tokens.length; i < length; i++) {

 		buffer.append(tokens[i]);

 		if (i != length - 1)

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java
index d4c9138..60737b0 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.java
@@ -45,9 +45,9 @@
 }

 public String toStringExpression(){

 	

-	StringBuffer buffer = new StringBuffer("<SelectOnQualifiedSuper:"/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("<SelectOnQualifiedSuper:"); //$NON-NLS-1$

 	buffer.append(super.toStringExpression());

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java
index fb94e29..0ca55c7 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java
@@ -42,13 +42,13 @@
 public String toStringExpression(int tab) {

 

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("<SelectOnType:"/*nonNLS*/);

+	buffer.append("<SelectOnType:"); //$NON-NLS-1$

 	for (int i = 0, length = tokens.length; i < length; i++) {

 		buffer.append(tokens[i]);

 		if (i != length - 1)

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 	}

-	buffer.append(">"/*nonNLS*/);

+	buffer.append(">"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java
index f79a4f6..6274c12 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java
@@ -47,6 +47,6 @@
 	throw new SelectionNodeFound(binding);

 }

 public String toStringExpression() {

-	return "<SelectOnName:"/*nonNLS*/ + super.toStringExpression() + ">"/*nonNLS*/;

+	return "<SelectOnName:" + super.toStringExpression() + ">"; //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java
index 2563291..5a1c51b 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java
@@ -46,6 +46,6 @@
 }

 public String toStringExpression(int tab){

 

-	return "<SelectOnType:"/*nonNLS*/ + new String(token) + ">"/*nonNLS*/ ;

+	return "<SelectOnType:" + new String(token) + ">" ; //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java
index ea6450a..28f9f55 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java
@@ -46,7 +46,7 @@
 }

 public String toStringExpression(){

 

-	return "<SelectOnSuper:"/*nonNLS*/+super.toStringExpression()+">"/*nonNLS*/;

+	return "<SelectOnSuper:"+super.toStringExpression()+">"; //$NON-NLS-2$ //$NON-NLS-1$

 	

 }

 }

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
index 2752e8d..2e5545e 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
@@ -30,9 +30,14 @@
 	public int selectionStart, selectionEnd;

 	public AstNode selectionNode;

 

-	public static final char[] SUPER = "super"/*nonNLS*/.toCharArray();

+	public static final char[] SUPER = "super".toCharArray(); //$NON-NLS-1$

+

+/** @deprecated - should use constructor with assertMode */

 public SelectionParser(ProblemReporter problemReporter) {

-	super(problemReporter);

+	this(problemReporter, false/*no assertion by default*/);

+}	

+public SelectionParser(ProblemReporter problemReporter, boolean assertMode) {

+	super(problemReporter, assertMode);

 }

 public char[] assistIdentifier(){

 	return ((SelectionScanner)scanner).selectionIdentifier;

@@ -417,7 +422,7 @@
 	return reference;

 }

 public void initializeScanner(){

-	this.scanner = new SelectionScanner();

+	this.scanner = new SelectionScanner(this.assertMode);

 }

 protected MessageSend newMessageSend() {

 	// '(' ArgumentListopt ')'

diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
index e98bb1d..80541e4 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
@@ -21,6 +21,11 @@
  * on an identifier prefix.

  *

  */

+ 

+public SelectionScanner(boolean assertMode) {

+	super(false, false, false, assertMode);

+}

+

 public char[] getCurrentIdentifierSource() {

 

 	if (selectionIdentifier == null){

diff --git a/compiler/org/eclipse/jdt/internal/compiler/AbstractSyntaxTreeVisitorAdapter.java b/compiler/org/eclipse/jdt/internal/compiler/AbstractSyntaxTreeVisitorAdapter.java
index caef291..553e90e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/AbstractSyntaxTreeVisitorAdapter.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/AbstractSyntaxTreeVisitorAdapter.java
@@ -48,6 +48,8 @@
 	}

 	public void endVisit(Assignment assignment, BlockScope scope) {

 	}

+	public void endVisit(AssertStatement assertStatement, BlockScope scope) {

+	}

 	public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {

 	}

 	public void endVisit(Block block, BlockScope scope) {

@@ -258,6 +260,9 @@
 	public boolean visit(Assignment assignment, BlockScope scope) {

 		return true;

 	}

+	public boolean visit(AssertStatement assertStatement, BlockScope scope) {

+		return true;

+	}

 	public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {

 		return true;

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
index 8b5b98a..c090679 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -4,6 +4,17 @@
  * (c) Copyright IBM Corp. 2000, 2001.

  * All Rights Reserved.

  */

+import java.io.*;

+import java.util.*;

+import org.eclipse.jdt.internal.compiler.Compiler;

+import org.eclipse.jdt.internal.compiler.*;

+import org.eclipse.jdt.internal.compiler.impl.*;

+import org.eclipse.jdt.internal.compiler.ast.*;

+import org.eclipse.jdt.internal.compiler.codegen.*;

+import org.eclipse.jdt.internal.compiler.lookup.*;

+import org.eclipse.jdt.internal.compiler.problem.*;

+import org.eclipse.jdt.internal.compiler.util.*;

+

 /**

  * Represents a class file wrapper on bytes, it is aware of its actual

  * type name.

@@ -21,29 +32,20 @@
  * 		Answer a smaller byte format, which is only contains some structural 

  *      information. Those bytes are decodable with a regular class file reader, 

  *      such as DietClassFileReader

- */ 

-

-import java.io.*;

-import java.util.*;

-import org.eclipse.jdt.internal.compiler.Compiler;

-import org.eclipse.jdt.internal.compiler.*;

-import org.eclipse.jdt.internal.compiler.impl.*;

-import org.eclipse.jdt.internal.compiler.ast.*;

-import org.eclipse.jdt.internal.compiler.codegen.*;

-import org.eclipse.jdt.internal.compiler.lookup.*;

-import org.eclipse.jdt.internal.compiler.problem.*;

-import org.eclipse.jdt.internal.compiler.util.*;

-

-

-public class ClassFile implements AttributeNamesConstants, CompilerModifiers, TypeConstants, TypeIds {

+ */

+public class ClassFile

+	implements AttributeNamesConstants, CompilerModifiers, TypeConstants, TypeIds {

 	public SourceTypeBinding referenceBinding;

 	public ConstantPool constantPool;

-	public ClassFile enclosingClassFile; // used to generate private access methods

+	public ClassFile enclosingClassFile;

+	// used to generate private access methods

 	public int produceDebugAttributes;

 	public ReferenceBinding[] innerClassesBindings;

 	public int numberOfInnerClasses;

-	public byte[] header; // the header contains all the bytes till the end of the constant pool

-	public byte[] contents; // that collection contains all the remaining bytes of the .class file

+	public byte[] header;

+	// the header contains all the bytes till the end of the constant pool

+	public byte[] contents;

+	// that collection contains all the remaining bytes of the .class file

 	public int headerOffset;

 	public int contentsOffset;

 	public int constantPoolOffset;

@@ -54,385 +56,913 @@
 	public static final int INITIAL_HEADER_SIZE = 1000;

 	public static final int INCREMENT_SIZE = 1000;

 	public static final int INNER_CLASSES_SIZE = 5;

-	protected CharArrayCache nameUsage;

+	protected HashtableOfType nameUsage;

 	public CodeStream codeStream;

-	protected int problemLine; // used to create line number attributes for problem methods

-/**

- * INTERNAL USE-ONLY

- * This methods creates a new instance of the receiver.

- */

-public ClassFile() {}

-/**

- * INTERNAL USE-ONLY

- * This methods creates a new instance of the receiver.

- *

- * @param aType org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

- * @param enclosingClassFile org.eclipse.jdt.internal.compiler.ClassFile

- * @param creatingProblemType <CODE>boolean</CODE>

- */

-public ClassFile(SourceTypeBinding aType, ClassFile enclosingClassFile, boolean creatingProblemType) {

-	referenceBinding = aType;

-	header = new byte[INITIAL_HEADER_SIZE];

-	// generate the magic numbers inside the header

-	header[headerOffset++] = (byte) (0xCAFEBABEL >> 24);

-	header[headerOffset++] = (byte) (0xCAFEBABEL >> 16);

-	header[headerOffset++] = (byte) (0xCAFEBABEL >> 8);

-	header[headerOffset++] = (byte) (0xCAFEBABEL >> 0);

-	if (((SourceTypeBinding) referenceBinding).scope.environment().options.targetJDK == CompilerOptions.JDK1_2) {

-		// Compatible with JDK 1.2

-		header[headerOffset++] = 0; // minorVersion = 0 means we just need to offset the current offset by 2

-		header[headerOffset++] = 0;

-		header[headerOffset++] = 0;

-		header[headerOffset++] = 46;

-	} else {

-		// Compatible with JDK 1.1

-		header[headerOffset++] = 0;

-		header[headerOffset++] = 3;

-		header[headerOffset++] = 0;

-		header[headerOffset++] = 45;

-	}

-	constantPoolOffset = headerOffset;

-	headerOffset += 2;

-	constantPool = new ConstantPool(this);

-	int accessFlags = aType.getAccessFlags() | AccSuper;

-	if (aType.isNestedType()) {

-		if (aType.isStatic()) {

-			// clear Acc_Static

-			accessFlags &= ~AccStatic;

-		}

-		if (aType.isPrivate()) {

-			// clear Acc_Private and Acc_Public

-			accessFlags &= ~ (AccPrivate | AccPublic);

-		}

-		if (aType.isProtected()) {

-			// clear Acc_Protected and set Acc_Public

-			accessFlags &= ~AccProtected;

-			accessFlags |= AccPublic;

-		}

-	}

-	// clear all bits that are illegal for a class or an interface

-	accessFlags &= ~(AccStrictfp | AccProtected | AccPrivate | AccStatic | AccSynchronized | AccNative);

+	protected int problemLine;	// used to create line number attributes for problem methods

 

-	this.enclosingClassFile = enclosingClassFile;

-	// innerclasses get their names computed at code gen time

-	if (aType.isLocalType()) {

-		((LocalTypeBinding) aType).constantPoolName(computeConstantPoolName((LocalTypeBinding) aType));

-		ReferenceBinding[] memberTypes = aType.memberTypes();

-		for (int i = 0, max = memberTypes.length; i < max; i++) {

-			((LocalTypeBinding) memberTypes[i]).constantPoolName(computeConstantPoolName((LocalTypeBinding) memberTypes[i]));

-		}

-	}

-	contents = new byte[INITIAL_CONTENTS_SIZE];

-	// now we continue to generate the bytes inside the contents array

-	contents[contentsOffset++] = (byte) (accessFlags >> 8);

-	contents[contentsOffset++] = (byte) accessFlags;

-	int classNameIndex = constantPool.literalIndex(aType);

-	contents[contentsOffset++] = (byte) (classNameIndex >> 8);

-	contents[contentsOffset++] = (byte) classNameIndex;

-	int superclassNameIndex;

-	if (aType.isInterface()) {

-		superclassNameIndex = constantPool.literalIndexForJavaLangObject();

-	} else {

-		superclassNameIndex = (aType.superclass == null ? 0 : constantPool.literalIndex(aType.superclass));

-	}

-	contents[contentsOffset++] = (byte) (superclassNameIndex >> 8);

-	contents[contentsOffset++] = (byte) superclassNameIndex;

-	ReferenceBinding[] superInterfacesBinding = aType.superInterfaces();

-	int interfacesCount = superInterfacesBinding.length;

-	contents[contentsOffset++] = (byte) (interfacesCount >> 8);

-	contents[contentsOffset++] = (byte) interfacesCount;

-	if (superInterfacesBinding != null) {

-		for (int i = 0; i < interfacesCount; i++) {

-			int interfaceIndex = constantPool.literalIndex(superInterfacesBinding[i]);

-			contents[contentsOffset++] = (byte) (interfaceIndex >> 8);

-			contents[contentsOffset++] = (byte) interfaceIndex;

-		}

-	}

-	produceDebugAttributes = ((SourceTypeBinding) referenceBinding).scope.environment().options.produceDebugAttributes;

-	innerClassesBindings = new ReferenceBinding[INNER_CLASSES_SIZE];

-	this.creatingProblemType = creatingProblemType;

-	codeStream = new CodeStream(this);

-

-	// retrieve the enclosing one guaranteed to be the one matching the propagated flow info

-	// 1FF9ZBU: LFCOM:ALL - Local variable attributes busted (Sanity check)

-	ClassFile outermostClassFile = this.outerMostEnclosingClassFile();

-	if (this == outermostClassFile) {

-		codeStream.maxFieldCount = aType.scope.referenceType().maxFieldCount;

-	} else {

-		codeStream.maxFieldCount = outermostClassFile.codeStream.maxFieldCount;

-	}

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a boggus method.

- *

- * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

- */

-public void addAbstractMethod(

-	AbstractMethodDeclaration method,

-	MethodBinding methodBinding) {

-

-	// force the modifiers to be public and abstract

-	methodBinding.modifiers = AccPublic | AccAbstract;

-	

-	this.generateMethodInfoHeader(methodBinding);

-	int methodAttributeOffset = this.contentsOffset;

-	int attributeNumber = this.generateMethodInfoAttribute(methodBinding);

-	this.completeMethodInfo(methodAttributeOffset, attributeNumber);

-}

-/**

- * INTERNAL USE-ONLY

- * This methods generate all the attributes for the receiver.

- * For a class they could be:

- * - source file attribute

- * - inner classes attribute

- * - deprecated attribute

- */

-public void addAttributes() {

-	// update the method count

-	contents[methodCountOffset++] = (byte) (methodCount >> 8);

-	contents[methodCountOffset] = (byte) methodCount;

-	

-	int attributeNumber = 0;

-	// leave two bytes for the number of attributes and store the current offset

-	int attributeOffset = contentsOffset;

-	contentsOffset += 2;

-

-	// source attribute

-	if ((produceDebugAttributes & CompilerOptions.Source) != 0) {

-		String fullFileName = new String(referenceBinding.scope.referenceCompilationUnit().getFileName());

-		fullFileName = fullFileName.replace('\\', '/');

-		int lastIndex = fullFileName.lastIndexOf('/');

-		if (lastIndex != -1) {

-			fullFileName = fullFileName.substring(lastIndex + 1, fullFileName.length());

-		}

-		// check that there is enough space to write all the bytes for the field info corresponding

-		// to the @fieldBinding

-		int contentsLength;

-		if (contentsOffset + 8 >= (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-		}

-		int sourceAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SourceName);

-		contents[contentsOffset++] = (byte) (sourceAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) sourceAttributeNameIndex;

-		// The length of a source file attribute is 2. This is a fixed-length

-		// attribute

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 2;

-		// write the source file name

-		int fileNameIndex = constantPool.literalIndex(fullFileName.toCharArray());

-		contents[contentsOffset++] = (byte) (fileNameIndex >> 8);

-		contents[contentsOffset++] = (byte) fileNameIndex;

-		attributeNumber++;

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods creates a new instance of the receiver.

+	 */

+	public ClassFile() {

 	}

 

-	// Deprecated attribute

-	if (referenceBinding.isDeprecated()) {

-		// check that there is enough space to write all the bytes for the field info corresponding

-		// to the @fieldBinding

-		int contentsLength;

-		if (contentsOffset + 6 >= (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods creates a new instance of the receiver.

+	 *

+	 * @param aType org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

+	 * @param enclosingClassFile org.eclipse.jdt.internal.compiler.ClassFile

+	 * @param creatingProblemType <CODE>boolean</CODE>

+	 */

+	public ClassFile(

+		SourceTypeBinding aType,

+		ClassFile enclosingClassFile,

+		boolean creatingProblemType) {

+		referenceBinding = aType;

+		header = new byte[INITIAL_HEADER_SIZE];

+		// generate the magic numbers inside the header

+		header[headerOffset++] = (byte) (0xCAFEBABEL >> 24);

+		header[headerOffset++] = (byte) (0xCAFEBABEL >> 16);

+		header[headerOffset++] = (byte) (0xCAFEBABEL >> 8);

+		header[headerOffset++] = (byte) (0xCAFEBABEL >> 0);

+		if (((SourceTypeBinding) referenceBinding)

+			.scope

+			.environment()

+			.options

+			.targetJDK

+			== CompilerOptions.JDK1_2) {

+			// Compatible with JDK 1.2

+			header[headerOffset++] = 0;

+			// minorVersion = 0 means we just need to offset the current offset by 2

+			header[headerOffset++] = 0;

+			header[headerOffset++] = 0;

+			header[headerOffset++] = 46;

+		} else {

+			// Compatible with JDK 1.1

+			header[headerOffset++] = 0;

+			header[headerOffset++] = 3;

+			header[headerOffset++] = 0;

+			header[headerOffset++] = 45;

 		}

-		int deprecatedAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

-		contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

-		// the length of a deprecated attribute is equals to 0

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		attributeNumber++;

-	}

-

-	// Inner class attribute

-	if (numberOfInnerClasses != 0) {

-		// Generate the inner class attribute

-		int contentsLength;

-		int exSize;

-		if (contentsOffset + (exSize = (8 * numberOfInnerClasses + 8)) >= (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + (exSize >= INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]), 0, contentsLength);

-		}

-		// Now we now the size of the attribute and the number of entries

-		// attribute name

-		int attributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.InnerClassName);

-		contents[contentsOffset++] = (byte) (attributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) attributeNameIndex;

-		int value = (numberOfInnerClasses << 3) + 2;

-		contents[contentsOffset++] = (byte) (value >> 24);

-		contents[contentsOffset++] = (byte) (value >> 16);

-		contents[contentsOffset++] = (byte) (value >> 8);

-		contents[contentsOffset++] = (byte) value;

-		contents[contentsOffset++] = (byte) (numberOfInnerClasses >> 8);

-		contents[contentsOffset++] = (byte) numberOfInnerClasses;

-		for (int i = 0; i < numberOfInnerClasses; i++) {

-			ReferenceBinding innerClass = innerClassesBindings[i];

-			int accessFlags = innerClass.getAccessFlags();

-			int innerClassIndex = constantPool.literalIndex(innerClass);

-			// inner class index

-			contents[contentsOffset++] = (byte) (innerClassIndex >> 8);

-			contents[contentsOffset++] = (byte) innerClassIndex;

-			// outer class index: anonymous and local have no outer class index

-			if (innerClass.isMemberType()) {

-				// member or member of local

-				int outerClassIndex = constantPool.literalIndex(innerClass.enclosingType());

-				contents[contentsOffset++] = (byte) (outerClassIndex >> 8);

-				contents[contentsOffset++] = (byte) outerClassIndex;

-			} else {

-				// equals to 0 if the innerClass is not a member type

-				contents[contentsOffset++] = 0;

-				contents[contentsOffset++] = 0;

+		constantPoolOffset = headerOffset;

+		headerOffset += 2;

+		constantPool = new ConstantPool(this);

+		int accessFlags = aType.getAccessFlags() | AccSuper;

+		if (aType.isNestedType()) {

+			if (aType.isStatic()) {

+				// clear Acc_Static

+				accessFlags &= ~AccStatic;

 			}

-			// name index

-			if (!innerClass.isAnonymousType()) {

-				int nameIndex = constantPool.literalIndex(innerClass.sourceName());

-				contents[contentsOffset++] = (byte) (nameIndex >> 8);

-				contents[contentsOffset++] = (byte) nameIndex;

-			} else {

-				// equals to 0 if the innerClass is an anonymous type

-				contents[contentsOffset++] = 0;

-				contents[contentsOffset++] = 0;

-			}				

-			// access flag

-			if (innerClass.isAnonymousType()) {

-				accessFlags |= AccPrivate;

-			} else

-				if (innerClass.isLocalType() && !innerClass.isMemberType()) {

-					accessFlags |= AccPrivate;

-				}

-			contents[contentsOffset++] = (byte) (accessFlags >> 8);

-			contents[contentsOffset++] = (byte) accessFlags;

+			if (aType.isPrivate()) {

+				// clear Acc_Private and Acc_Public

+				accessFlags &= ~(AccPrivate | AccPublic);

+			}

+			if (aType.isProtected()) {

+				// clear Acc_Protected and set Acc_Public

+				accessFlags &= ~AccProtected;

+				accessFlags |= AccPublic;

+			}

 		}

-		attributeNumber++;

-	}

-	// update the number of attributes

-	contents[attributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[attributeOffset] = (byte) attributeNumber;

+		// clear all bits that are illegal for a class or an interface

+		accessFlags

+			&= ~(

+				AccStrictfp

+					| AccProtected

+					| AccPrivate

+					| AccStatic

+					| AccSynchronized

+					| AccNative);

 

-	// resynchronize all offsets of the classfile

-	header = constantPool.poolContent;

-	headerOffset = constantPool.currentOffset;

-	int constantPoolCount = constantPool.currentIndex;

-	header[constantPoolOffset++] = (byte) (constantPoolCount >> 8);

-	header[constantPoolOffset] = (byte) constantPoolCount;

-}

-/**

- * INTERNAL USE-ONLY

- * This methods generate all the default abstract method infos that correpond to

- * the abstract methods inherited from superinterfaces.

- */

-public void addDefaultAbstractMethods() { // default abstract methods

-	MethodBinding[] defaultAbstractMethods = referenceBinding.getDefaultAbstractMethods();

-	for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {

-		generateMethodInfoHeader(defaultAbstractMethods[i]);

-		int methodAttributeOffset = contentsOffset;

-		int attributeNumber = generateMethodInfoAttribute(defaultAbstractMethods[i]);

-		completeMethodInfo(methodAttributeOffset, attributeNumber);

+		this.enclosingClassFile = enclosingClassFile;

+		// innerclasses get their names computed at code gen time

+		if (aType.isLocalType()) {

+			((LocalTypeBinding) aType).constantPoolName(

+				computeConstantPoolName((LocalTypeBinding) aType));

+			ReferenceBinding[] memberTypes = aType.memberTypes();

+			for (int i = 0, max = memberTypes.length; i < max; i++) {

+				((LocalTypeBinding) memberTypes[i]).constantPoolName(

+					computeConstantPoolName((LocalTypeBinding) memberTypes[i]));

+			}

+		}

+		contents = new byte[INITIAL_CONTENTS_SIZE];

+		// now we continue to generate the bytes inside the contents array

+		contents[contentsOffset++] = (byte) (accessFlags >> 8);

+		contents[contentsOffset++] = (byte) accessFlags;

+		int classNameIndex = constantPool.literalIndex(aType);

+		contents[contentsOffset++] = (byte) (classNameIndex >> 8);

+		contents[contentsOffset++] = (byte) classNameIndex;

+		int superclassNameIndex;

+		if (aType.isInterface()) {

+			superclassNameIndex = constantPool.literalIndexForJavaLangObject();

+		} else {

+			superclassNameIndex =

+				(aType.superclass == null ? 0 : constantPool.literalIndex(aType.superclass));

+		}

+		contents[contentsOffset++] = (byte) (superclassNameIndex >> 8);

+		contents[contentsOffset++] = (byte) superclassNameIndex;

+		ReferenceBinding[] superInterfacesBinding = aType.superInterfaces();

+		int interfacesCount = superInterfacesBinding.length;

+		contents[contentsOffset++] = (byte) (interfacesCount >> 8);

+		contents[contentsOffset++] = (byte) interfacesCount;

+		if (superInterfacesBinding != null) {

+			for (int i = 0; i < interfacesCount; i++) {

+				int interfaceIndex = constantPool.literalIndex(superInterfacesBinding[i]);

+				contents[contentsOffset++] = (byte) (interfaceIndex >> 8);

+				contents[contentsOffset++] = (byte) interfaceIndex;

+			}

+		}

+		produceDebugAttributes =

+			((SourceTypeBinding) referenceBinding)

+				.scope

+				.environment()

+				.options

+				.produceDebugAttributes;

+		innerClassesBindings = new ReferenceBinding[INNER_CLASSES_SIZE];

+		this.creatingProblemType = creatingProblemType;

+		codeStream = new CodeStream(this);

+

+		// retrieve the enclosing one guaranteed to be the one matching the propagated flow info

+		// 1FF9ZBU: LFCOM:ALL - Local variable attributes busted (Sanity check)

+		ClassFile outermostClassFile = this.outerMostEnclosingClassFile();

+		if (this == outermostClassFile) {

+			codeStream.maxFieldCount = aType.scope.referenceType().maxFieldCount;

+		} else {

+			codeStream.maxFieldCount = outermostClassFile.codeStream.maxFieldCount;

+		}

 	}

-}

-/**

- * INTERNAL USE-ONLY

- * This methods generates the bytes for the field binding passed like a parameter

- * @param fieldBinding org.eclipse.jdt.internal.compiler.lookup.FieldBinding

- */

-public void addFieldInfo(FieldBinding fieldBinding) {

-	int attributeNumber = 0;

-	// check that there is enough space to write all the bytes for the field info corresponding

-	// to the @fieldBinding

-	int contentsLength;

-	if (contentsOffset + 30 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a boggus method.

+	 *

+	 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

+	 */

+	public void addAbstractMethod(

+		AbstractMethodDeclaration method,

+		MethodBinding methodBinding) {

+

+		// force the modifiers to be public and abstract

+		methodBinding.modifiers = AccPublic | AccAbstract;

+

+		this.generateMethodInfoHeader(methodBinding);

+		int methodAttributeOffset = this.contentsOffset;

+		int attributeNumber = this.generateMethodInfoAttribute(methodBinding);

+		this.completeMethodInfo(methodAttributeOffset, attributeNumber);

 	}

-	// Generate two attribute: constantValueAttribute and SyntheticAttribute

-	// Now we can generate all entries into the byte array

-	// First the accessFlags

-	int accessFlags = fieldBinding.getAccessFlags();

-	contents[contentsOffset++] = (byte) (accessFlags >> 8);

-	contents[contentsOffset++] = (byte) accessFlags;

-	// Then the nameIndex

-	int nameIndex = constantPool.literalIndex(fieldBinding.name);

-	contents[contentsOffset++] = (byte) (nameIndex >> 8);

-	contents[contentsOffset++] = (byte) nameIndex;

-	// Then the descriptorIndex

-	int descriptorIndex = constantPool.literalIndex(fieldBinding.type.signature());

-	contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

-	contents[contentsOffset++] = (byte) descriptorIndex;

-	// leave some space for the number of attributes

-	int fieldAttributeOffset = contentsOffset;

-	contentsOffset += 2;

-	// 4.7.2 only static constant fields get a ConstantAttribute

-	if (fieldBinding.isStatic() 

-		&& fieldBinding.constant != Constant.NotAConstant 

-		&& fieldBinding.constant.typeID() != T_null) {

-		// Now we generate the constant attribute corresponding to the fieldBinding

-		int constantValueNameIndex = constantPool.literalIndex(AttributeNamesConstants.ConstantValueName);

-		contents[contentsOffset++] = (byte) (constantValueNameIndex >> 8);

-		contents[contentsOffset++] = (byte) constantValueNameIndex;

-		// The attribute length = 2 in case of a constantValue attribute

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 2;

-		attributeNumber++;

-		// Need to add the constant_value_index

-		switch (fieldBinding.constant.typeID()) {

-			case T_boolean :

-				int booleanValueIndex = constantPool.literalIndex(fieldBinding.constant.booleanValue() ? 1 : 0);

-				contents[contentsOffset++] = (byte) (booleanValueIndex >> 8);

-				contents[contentsOffset++] = (byte) booleanValueIndex;

-				break;

-			case T_byte :

-			case T_char :

-			case T_int :

-			case T_short :

-				int integerValueIndex = constantPool.literalIndex(fieldBinding.constant.intValue());

-				contents[contentsOffset++] = (byte) (integerValueIndex >> 8);

-				contents[contentsOffset++] = (byte) integerValueIndex;

-				break;

-			case T_float :

-				int floatValueIndex = constantPool.literalIndex(fieldBinding.constant.floatValue());

-				contents[contentsOffset++] = (byte) (floatValueIndex >> 8);

-				contents[contentsOffset++] = (byte) floatValueIndex;

-				break;

-			case T_double :

-				int doubleValueIndex = constantPool.literalIndex(fieldBinding.constant.doubleValue());

-				contents[contentsOffset++] = (byte) (doubleValueIndex >> 8);

-				contents[contentsOffset++] = (byte) doubleValueIndex;

-				break;

-			case T_long :

-				int longValueIndex = constantPool.literalIndex(fieldBinding.constant.longValue());

-				contents[contentsOffset++] = (byte) (longValueIndex >> 8);

-				contents[contentsOffset++] = (byte) longValueIndex;

-				break;

-			case T_String :

-				int stringValueIndex = constantPool.literalIndex(((StringConstant) fieldBinding.constant).stringValue());

-				if (stringValueIndex == -1) {

-					if (!creatingProblemType) {

-						// report an error and abort: will lead to a problem type classfile creation

-						TypeDeclaration typeDeclaration = referenceBinding.scope.referenceContext;

-						FieldDeclaration[] fieldDecls = typeDeclaration.fields;

-						for (int i = 0, max = fieldDecls.length; i < max; i++) {

-							if (fieldDecls[i].binding == fieldBinding) {

-								// problem should abort

-								typeDeclaration.scope.problemReporter().stringConstantIsExceedingUtf8Limit(fieldDecls[i]);

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods generate all the attributes for the receiver.

+	 * For a class they could be:

+	 * - source file attribute

+	 * - inner classes attribute

+	 * - deprecated attribute

+	 */

+	public void addAttributes() {

+		// update the method count

+		contents[methodCountOffset++] = (byte) (methodCount >> 8);

+		contents[methodCountOffset] = (byte) methodCount;

+

+		int attributeNumber = 0;

+		// leave two bytes for the number of attributes and store the current offset

+		int attributeOffset = contentsOffset;

+		contentsOffset += 2;

+

+		// source attribute

+		if ((produceDebugAttributes & CompilerOptions.Source) != 0) {

+			String fullFileName =

+				new String(referenceBinding.scope.referenceCompilationUnit().getFileName());

+			fullFileName = fullFileName.replace('\\', '/');

+			int lastIndex = fullFileName.lastIndexOf('/');

+			if (lastIndex != -1) {

+				fullFileName = fullFileName.substring(lastIndex + 1, fullFileName.length());

+			}

+			// check that there is enough space to write all the bytes for the field info corresponding

+			// to the @fieldBinding

+			int contentsLength;

+			if (contentsOffset + 8 >= (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

+			}

+			int sourceAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.SourceName);

+			contents[contentsOffset++] = (byte) (sourceAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) sourceAttributeNameIndex;

+			// The length of a source file attribute is 2. This is a fixed-length

+			// attribute

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 2;

+			// write the source file name

+			int fileNameIndex = constantPool.literalIndex(fullFileName.toCharArray());

+			contents[contentsOffset++] = (byte) (fileNameIndex >> 8);

+			contents[contentsOffset++] = (byte) fileNameIndex;

+			attributeNumber++;

+		}

+		// Deprecated attribute

+		if (referenceBinding.isDeprecated()) {

+			// check that there is enough space to write all the bytes for the field info corresponding

+			// to the @fieldBinding

+			int contentsLength;

+			if (contentsOffset + 6 >= (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

+			}

+			int deprecatedAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

+			contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

+			// the length of a deprecated attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			attributeNumber++;

+		}

+		// Inner class attribute

+		if (numberOfInnerClasses != 0) {

+			// Generate the inner class attribute

+			int contentsLength;

+			int exSize;

+			if (contentsOffset + (exSize = (8 * numberOfInnerClasses + 8))

+				>= (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents =

+						new byte[contentsLength

+							+ (exSize >= INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]),

+					0,

+					contentsLength);

+			}

+			// Now we now the size of the attribute and the number of entries

+			// attribute name

+			int attributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.InnerClassName);

+			contents[contentsOffset++] = (byte) (attributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) attributeNameIndex;

+			int value = (numberOfInnerClasses << 3) + 2;

+			contents[contentsOffset++] = (byte) (value >> 24);

+			contents[contentsOffset++] = (byte) (value >> 16);

+			contents[contentsOffset++] = (byte) (value >> 8);

+			contents[contentsOffset++] = (byte) value;

+			contents[contentsOffset++] = (byte) (numberOfInnerClasses >> 8);

+			contents[contentsOffset++] = (byte) numberOfInnerClasses;

+			for (int i = 0; i < numberOfInnerClasses; i++) {

+				ReferenceBinding innerClass = innerClassesBindings[i];

+				int accessFlags = innerClass.getAccessFlags();

+				int innerClassIndex = constantPool.literalIndex(innerClass);

+				// inner class index

+				contents[contentsOffset++] = (byte) (innerClassIndex >> 8);

+				contents[contentsOffset++] = (byte) innerClassIndex;

+				// outer class index: anonymous and local have no outer class index

+				if (innerClass.isMemberType()) {

+					// member or member of local

+					int outerClassIndex = constantPool.literalIndex(innerClass.enclosingType());

+					contents[contentsOffset++] = (byte) (outerClassIndex >> 8);

+					contents[contentsOffset++] = (byte) outerClassIndex;

+				} else {

+					// equals to 0 if the innerClass is not a member type

+					contents[contentsOffset++] = 0;

+					contents[contentsOffset++] = 0;

+				}

+				// name index

+				if (!innerClass.isAnonymousType()) {

+					int nameIndex = constantPool.literalIndex(innerClass.sourceName());

+					contents[contentsOffset++] = (byte) (nameIndex >> 8);

+					contents[contentsOffset++] = (byte) nameIndex;

+				} else {

+					// equals to 0 if the innerClass is an anonymous type

+					contents[contentsOffset++] = 0;

+					contents[contentsOffset++] = 0;

+				}

+				// access flag

+				if (innerClass.isAnonymousType()) {

+					accessFlags |= AccPrivate;

+				} else

+					if (innerClass.isLocalType() && !innerClass.isMemberType()) {

+						accessFlags |= AccPrivate;

+					}

+				contents[contentsOffset++] = (byte) (accessFlags >> 8);

+				contents[contentsOffset++] = (byte) accessFlags;

+			}

+			attributeNumber++;

+		}

+		// update the number of attributes

+		contents[attributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[attributeOffset] = (byte) attributeNumber;

+

+		// resynchronize all offsets of the classfile

+		header = constantPool.poolContent;

+		headerOffset = constantPool.currentOffset;

+		int constantPoolCount = constantPool.currentIndex;

+		header[constantPoolOffset++] = (byte) (constantPoolCount >> 8);

+		header[constantPoolOffset] = (byte) constantPoolCount;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods generate all the default abstract method infos that correpond to

+	 * the abstract methods inherited from superinterfaces.

+	 */

+	public void addDefaultAbstractMethods() { // default abstract methods

+		MethodBinding[] defaultAbstractMethods =

+			referenceBinding.getDefaultAbstractMethods();

+		for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {

+			generateMethodInfoHeader(defaultAbstractMethods[i]);

+			int methodAttributeOffset = contentsOffset;

+			int attributeNumber = generateMethodInfoAttribute(defaultAbstractMethods[i]);

+			completeMethodInfo(methodAttributeOffset, attributeNumber);

+		}

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods generates the bytes for the field binding passed like a parameter

+	 * @param fieldBinding org.eclipse.jdt.internal.compiler.lookup.FieldBinding

+	 */

+	public void addFieldInfo(FieldBinding fieldBinding) {

+		int attributeNumber = 0;

+		// check that there is enough space to write all the bytes for the field info corresponding

+		// to the @fieldBinding

+		int contentsLength;

+		if (contentsOffset + 30 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		// Generate two attribute: constantValueAttribute and SyntheticAttribute

+		// Now we can generate all entries into the byte array

+		// First the accessFlags

+		int accessFlags = fieldBinding.getAccessFlags();

+		contents[contentsOffset++] = (byte) (accessFlags >> 8);

+		contents[contentsOffset++] = (byte) accessFlags;

+		// Then the nameIndex

+		int nameIndex = constantPool.literalIndex(fieldBinding.name);

+		contents[contentsOffset++] = (byte) (nameIndex >> 8);

+		contents[contentsOffset++] = (byte) nameIndex;

+		// Then the descriptorIndex

+		int descriptorIndex = constantPool.literalIndex(fieldBinding.type.signature());

+		contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

+		contents[contentsOffset++] = (byte) descriptorIndex;

+		// leave some space for the number of attributes

+		int fieldAttributeOffset = contentsOffset;

+		contentsOffset += 2;

+		// 4.7.2 only static constant fields get a ConstantAttribute

+		if (fieldBinding.isStatic()

+			&& fieldBinding.constant != Constant.NotAConstant

+			&& fieldBinding.constant.typeID() != T_null) {

+			// Now we generate the constant attribute corresponding to the fieldBinding

+			int constantValueNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.ConstantValueName);

+			contents[contentsOffset++] = (byte) (constantValueNameIndex >> 8);

+			contents[contentsOffset++] = (byte) constantValueNameIndex;

+			// The attribute length = 2 in case of a constantValue attribute

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 2;

+			attributeNumber++;

+			// Need to add the constant_value_index

+			switch (fieldBinding.constant.typeID()) {

+				case T_boolean :

+					int booleanValueIndex =

+						constantPool.literalIndex(fieldBinding.constant.booleanValue() ? 1 : 0);

+					contents[contentsOffset++] = (byte) (booleanValueIndex >> 8);

+					contents[contentsOffset++] = (byte) booleanValueIndex;

+					break;

+				case T_byte :

+				case T_char :

+				case T_int :

+				case T_short :

+					int integerValueIndex =

+						constantPool.literalIndex(fieldBinding.constant.intValue());

+					contents[contentsOffset++] = (byte) (integerValueIndex >> 8);

+					contents[contentsOffset++] = (byte) integerValueIndex;

+					break;

+				case T_float :

+					int floatValueIndex =

+						constantPool.literalIndex(fieldBinding.constant.floatValue());

+					contents[contentsOffset++] = (byte) (floatValueIndex >> 8);

+					contents[contentsOffset++] = (byte) floatValueIndex;

+					break;

+				case T_double :

+					int doubleValueIndex =

+						constantPool.literalIndex(fieldBinding.constant.doubleValue());

+					contents[contentsOffset++] = (byte) (doubleValueIndex >> 8);

+					contents[contentsOffset++] = (byte) doubleValueIndex;

+					break;

+				case T_long :

+					int longValueIndex =

+						constantPool.literalIndex(fieldBinding.constant.longValue());

+					contents[contentsOffset++] = (byte) (longValueIndex >> 8);

+					contents[contentsOffset++] = (byte) longValueIndex;

+					break;

+				case T_String :

+					int stringValueIndex =

+						constantPool.literalIndex(

+							((StringConstant) fieldBinding.constant).stringValue());

+					if (stringValueIndex == -1) {

+						if (!creatingProblemType) {

+							// report an error and abort: will lead to a problem type classfile creation

+							TypeDeclaration typeDeclaration = referenceBinding.scope.referenceContext;

+							FieldDeclaration[] fieldDecls = typeDeclaration.fields;

+							for (int i = 0, max = fieldDecls.length; i < max; i++) {

+								if (fieldDecls[i].binding == fieldBinding) {

+									// problem should abort

+									typeDeclaration.scope.problemReporter().stringConstantIsExceedingUtf8Limit(

+										fieldDecls[i]);

+								}

 							}

+						} else {

+							// already inside a problem type creation : no constant for this field

+							contentsOffset = fieldAttributeOffset + 2;

+							// +2 is necessary to keep the two byte space for the attribute number

+							attributeNumber--;

 						}

 					} else {

-						// already inside a problem type creation : no constant for this field

-						contentsOffset = fieldAttributeOffset + 2; // +2 is necessary to keep the two byte space for the attribute number

-						attributeNumber--;

+						contents[contentsOffset++] = (byte) (stringValueIndex >> 8);

+						contents[contentsOffset++] = (byte) stringValueIndex;

 					}

-				} else {

-					contents[contentsOffset++] = (byte) (stringValueIndex >> 8);

-					contents[contentsOffset++] = (byte) stringValueIndex;

-				}

+			}

+		}

+		if (fieldBinding.isSynthetic()) {

+			int syntheticAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+			contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

+			// the length of a synthetic attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			attributeNumber++;

+		}

+		if (fieldBinding.isDeprecated()) {

+			int deprecatedAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

+			contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

+			// the length of a deprecated attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			attributeNumber++;

+		}

+		contents[fieldAttributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[fieldAttributeOffset] = (byte) attributeNumber;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods generate all the fields infos for the receiver.

+	 * This includes:

+	 * - a field info for each defined field of that class

+	 * - a field info for each synthetic field (e.g. this$0)

+	 */

+	public void addFieldInfos() {

+		SourceTypeBinding currentBinding = referenceBinding;

+		FieldBinding[] syntheticFields = currentBinding.syntheticFields();

+		int fieldCount =

+			currentBinding.fieldCount()

+				+ (syntheticFields == null ? 0 : syntheticFields.length);

+

+		// write the number of fields

+		contents[contentsOffset++] = (byte) (fieldCount >> 8);

+		contents[contentsOffset++] = (byte) fieldCount;

+

+		FieldBinding[] fieldBindings = currentBinding.fields();

+		for (int i = 0, max = fieldBindings.length; i < max; i++) {

+			addFieldInfo(fieldBindings[i]);

+		}

+		if (syntheticFields != null) {

+			for (int i = 0, max = syntheticFields.length; i < max; i++) {

+				addFieldInfo(syntheticFields[i]);

+			}

 		}

 	}

-	if (fieldBinding.isSynthetic()) {

-		int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods stores the bindings for each inner class. They will be used to know which entries

+	 * have to be generated for the inner classes attributes.

+	 * @param referenceBinding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding 

+	 */

+	public void addInnerClasses(ReferenceBinding referenceBinding) {

+		// check first if that reference binding is there

+		for (int i = 0; i < numberOfInnerClasses; i++) {

+			if (innerClassesBindings[i] == referenceBinding)

+				return;

+		}

+		int length = innerClassesBindings.length;

+		if (numberOfInnerClasses == length) {

+			System.arraycopy(

+				innerClassesBindings,

+				0,

+				(innerClassesBindings = new ReferenceBinding[length * 2]),

+				0,

+				length);

+		}

+		innerClassesBindings[numberOfInnerClasses++] = referenceBinding;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem clinit method info that correspond to a boggus method.

+	 *

+	 * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

+	 */

+	public void addProblemClinit(IProblem[] problems) {

+		generateMethodInfoHeaderForClinit();

+		// leave two spaces for the number of attributes

+		contentsOffset -= 2;

+		int attributeOffset = contentsOffset;

+		contentsOffset += 2;

+		ReferenceBinding[] thrownsExceptions;

+		int attributeNumber = 0;

+		int contentsLength;

+

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		codeStream.resetForProblemClinit(this);

+		String problemString = "" ; //$NON-NLS-1$

+		if (problems != null) {

+			int max = problems.length;

+			StringBuffer buffer = new StringBuffer(25);

+			int count = 0;

+			for (int i = 0; i < max; i++) {

+				IProblem problem = problems[i];

+				if ((problem != null) && (problem.isError())) {

+					buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$

+					count++;

+					if (problemLine == 0) {

+						problemLine = problem.getSourceLineNumber();

+					}

+					problems[i] = null;

+				}

+			} // insert the top line afterwards, once knowing how many problems we have to consider

+			if (count > 1) {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblems" )); //$NON-NLS-1$

+			} else {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblem" )); //$NON-NLS-1$

+			}

+			problemString = buffer.toString();

+		}

+

+		// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

+		int[] exceptionHandler =

+			codeStream.generateCodeAttributeForProblemMethod(

+				referenceBinding

+					.scope

+					.problemReporter()

+					.options

+					.runtimeExceptionNameForCompileError,

+				problemString);

+		attributeNumber++; // code attribute

+		completeCodeAttributeForClinit(

+			codeAttributeOffset,

+			exceptionHandler,

+			referenceBinding

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		contents[attributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[attributeOffset] = (byte) attributeNumber;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a boggus constructor.

+	 *

+	 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

+	 * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

+	 */

+	public void addProblemConstructor(

+		AbstractMethodDeclaration method,

+		MethodBinding methodBinding,

+		IProblem[] problems) {

+

+		// always clear the strictfp/native/abstract bit for a problem method

+		methodBinding.modifiers &= ~(AccStrictfp | AccNative | AccAbstract);

+

+		generateMethodInfoHeader(methodBinding);

+		// We know that we won't get more than 1 attribute: the code attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 1; // Code attribute

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		final ProblemReporter problemReporter = method.scope.problemReporter();

+		codeStream.reset(method, this);

+		String problemString = "" ; //$NON-NLS-1$

+		if (problems != null) {

+			int max = problems.length;

+			StringBuffer buffer = new StringBuffer(25);

+			int count = 0;

+			for (int i = 0; i < max; i++) {

+				IProblem problem = problems[i];

+				if ((problem != null) && (problem.isError())) {

+					buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$

+					count++;

+					if (problemLine == 0) {

+						problemLine = problem.getSourceLineNumber();

+					}

+				}

+			} // insert the top line afterwards, once knowing how many problems we have to consider

+			if (count > 1) {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblems" )); //$NON-NLS-1$

+			} else {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblem" )); //$NON-NLS-1$

+			}

+			problemString = buffer.toString();

+		}

+

+		// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

+		int[] exceptionHandler =

+			codeStream.generateCodeAttributeForProblemMethod(

+				problemReporter.options.runtimeExceptionNameForCompileError,

+				problemString);

+		completeCodeAttributeForProblemMethod(

+			method,

+			methodBinding,

+			codeAttributeOffset,

+			exceptionHandler,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a boggus constructor.

+	 * Reset the position inside the contents byte array to the savedOffset.

+	 *

+	 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

+	 * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

+	 * @param savedOffset <CODE>int</CODE>

+	 */

+	public void addProblemConstructor(

+		AbstractMethodDeclaration method,

+		MethodBinding methodBinding,

+		IProblem[] problems,

+		int savedOffset) {

+		// we need to move back the contentsOffset to the value at the beginning of the method

+		contentsOffset = savedOffset;

+		methodCount--; // we need to remove the method that causes the problem

+		addProblemConstructor(method, methodBinding, problems);

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a boggus method.

+	 *

+	 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

+	 * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

+	 */

+	public void addProblemMethod(

+		AbstractMethodDeclaration method,

+		MethodBinding methodBinding,

+		IProblem[] problems) {

+		if (methodBinding.isAbstract() && methodBinding.declaringClass.isInterface()) {

+			method.abort(AbstractMethodDeclaration.AbortType);

+		}

+		// always clear the strictfp/native/abstract bit for a problem method

+		methodBinding.modifiers &= ~(AccStrictfp | AccNative | AccAbstract);

+

+		generateMethodInfoHeader(methodBinding);

+		// leave two spaces for the number of attributes

+		int attributeOffset = contentsOffset;

+		contentsOffset += 2;

+		ReferenceBinding[] thrownsExceptions;

+		int attributeNumber = 0;

+		int contentsLength;

+

+		if ((thrownsExceptions = methodBinding.thrownExceptions) != NoExceptions) {

+			// The method has a throw clause. So we need to add an exception attribute

+			// check that there is enough space to write all the bytes for the exception attribute

+			int length = thrownsExceptions.length;

+			if (contentsOffset + (8 + length * 2) >= (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents =

+						new byte[contentsLength + Math.max(INCREMENT_SIZE, (8 + length * 2))]),

+					0,

+					contentsLength);

+			}

+			int exceptionNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.ExceptionsName);

+			contents[contentsOffset++] = (byte) (exceptionNameIndex >> 8);

+			contents[contentsOffset++] = (byte) exceptionNameIndex;

+			// The attribute length = length * 2 + 2 in case of a exception attribute

+			int attributeLength = length * 2 + 2;

+			contents[contentsOffset++] = (byte) (attributeLength >> 24);

+			contents[contentsOffset++] = (byte) (attributeLength >> 16);

+			contents[contentsOffset++] = (byte) (attributeLength >> 8);

+			contents[contentsOffset++] = (byte) attributeLength;

+			contents[contentsOffset++] = (byte) (length >> 8);

+			contents[contentsOffset++] = (byte) length;

+			for (int i = 0; i < length; i++) {

+				int exceptionIndex = constantPool.literalIndex(thrownsExceptions[i]);

+				contents[contentsOffset++] = (byte) (exceptionIndex >> 8);

+				contents[contentsOffset++] = (byte) exceptionIndex;

+			}

+			attributeNumber++;

+		}

+

+		// Deprecated attribute

+		// Check that there is enough space to write the deprecated attribute

+		if (contentsOffset + 6 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		if (methodBinding.isDeprecated()) {

+			int deprecatedAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

+			contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

+			// the length of a deprecated attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+

+			attributeNumber++;

+		}

+

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		final ProblemReporter problemReporter = method.scope.problemReporter();

+		codeStream.reset(method, this);

+		String problemString = "" ; //$NON-NLS-1$

+		if (problems != null) {

+			int max = problems.length;

+			StringBuffer buffer = new StringBuffer(25);

+			int count = 0;

+			for (int i = 0; i < max; i++) {

+				IProblem problem = problems[i];

+				if ((problem != null)

+					&& (problem.isError())

+					&& (problem.getSourceStart() >= method.declarationSourceStart)

+					&& (problem.getSourceEnd() <= method.declarationSourceEnd)) {

+					buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$

+					count++;

+					if (problemLine == 0) {

+						problemLine = problem.getSourceLineNumber();

+					}

+					problems[i] = null;

+				}

+			} // insert the top line afterwards, once knowing how many problems we have to consider

+			if (count > 1) {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblems" )); //$NON-NLS-1$

+			} else {

+				buffer.insert(0, Util.bind("compilation.unresolvedProblem" )); //$NON-NLS-1$

+			}

+			problemString = buffer.toString();

+		}

+

+		// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

+		int[] exceptionHandler =

+			codeStream.generateCodeAttributeForProblemMethod(

+				problemReporter.options.runtimeExceptionNameForCompileError,

+				problemString);

+		attributeNumber++; // code attribute

+		completeCodeAttributeForProblemMethod(

+			method,

+			methodBinding,

+			codeAttributeOffset,

+			exceptionHandler,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		contents[attributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[attributeOffset] = (byte) attributeNumber;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a boggus method.

+	 * Reset the position inside the contents byte array to the savedOffset.

+	 *

+	 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

+	 * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

+	 * @param savedOffset <CODE>int</CODE>

+	 */

+	public void addProblemMethod(

+		AbstractMethodDeclaration method,

+		MethodBinding methodBinding,

+		IProblem[] problems,

+		int savedOffset) {

+		// we need to move back the contentsOffset to the value at the beginning of the method

+		contentsOffset = savedOffset;

+		methodCount--; // we need to remove the method that causes the problem

+		addProblemMethod(method, methodBinding, problems);

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for all the special method infos.

+	 * They are:

+	 * - synthetic access methods

+	 * - default abstract methods

+	 */

+	public void addSpecialMethods() {

+		// add all methods (default abstract methods and synthetic)

+

+		// default abstract methods

+		SourceTypeBinding currentBinding = referenceBinding;

+		MethodBinding[] defaultAbstractMethods =

+			currentBinding.getDefaultAbstractMethods();

+		for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {

+			generateMethodInfoHeader(defaultAbstractMethods[i]);

+			int methodAttributeOffset = contentsOffset;

+			int attributeNumber = generateMethodInfoAttribute(defaultAbstractMethods[i]);

+			completeMethodInfo(methodAttributeOffset, attributeNumber);

+		}

+		// add synthetic methods infos

+		SyntheticAccessMethodBinding[] syntheticAccessMethods =

+			currentBinding.syntheticAccessMethods();

+		if (syntheticAccessMethods != null) {

+			for (int i = 0, max = syntheticAccessMethods.length; i < max; i++) {

+				SyntheticAccessMethodBinding accessMethodBinding = syntheticAccessMethods[i];

+				switch (accessMethodBinding.accessType) {

+					case SyntheticAccessMethodBinding.FieldReadAccess :

+						// generate a method info to emulate an reading access to

+						// a private field

+						addSyntheticFieldReadAccessMethod(syntheticAccessMethods[i]);

+						break;

+					case SyntheticAccessMethodBinding.FieldWriteAccess :

+						// generate a method info to emulate an writing access to

+						// a private field

+						addSyntheticFieldWriteAccessMethod(syntheticAccessMethods[i]);

+						break;

+					case SyntheticAccessMethodBinding.MethodAccess :

+						// generate a method info to emulate an access to a private method

+						addSyntheticMethodAccessMethod(syntheticAccessMethods[i]);

+						break;

+					case SyntheticAccessMethodBinding.ConstructorAccess :

+						// generate a method info to emulate an access to a private method

+						addSyntheticConstructorAccessMethod(syntheticAccessMethods[i]);

+				}

+			}

+		}

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a synthetic method that

+	 * generate an access to a private constructor.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

+	 */

+	public void addSyntheticConstructorAccessMethod(SyntheticAccessMethodBinding methodBinding) {

+		generateMethodInfoHeader(methodBinding);

+		// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 2;

+		// Code attribute

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		codeStream.init(this);

+		codeStream.generateSyntheticBodyForConstructorAccess(methodBinding);

+		completeCodeAttributeForSyntheticAccessMethod(

+			methodBinding,

+			codeAttributeOffset,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		// add the synthetic attribute

+		int syntheticAttributeNameIndex =

+			constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

 		contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

 		contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

 		// the length of a synthetic attribute is equals to 0

@@ -440,977 +970,444 @@
 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

-		attributeNumber++;

 	}

-	if (fieldBinding.isDeprecated()) {

-		int deprecatedAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

-		contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

-		// the length of a deprecated attribute is equals to 0

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a synthetic method that

+	 * generate an read access to a private field.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

+	 */

+	public void addSyntheticFieldReadAccessMethod(SyntheticAccessMethodBinding methodBinding) {

+		generateMethodInfoHeader(methodBinding);

+		// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 2;

+		// Code attribute

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		codeStream.init(this);

+		codeStream.generateSyntheticBodyForFieldReadAccess(methodBinding);

+		completeCodeAttributeForSyntheticAccessMethod(

+			methodBinding,

+			codeAttributeOffset,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		// add the synthetic attribute

+		int syntheticAttributeNameIndex =

+			constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+		contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

+		contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

+		// the length of a synthetic attribute is equals to 0

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

-		attributeNumber++;

-	}

-	contents[fieldAttributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[fieldAttributeOffset] = (byte) attributeNumber;

-}

-/**

- * INTERNAL USE-ONLY

- * This methods generate all the fields infos for the receiver.

- * This includes:

- * - a field info for each defined field of that class

- * - a field info for each synthetic field (e.g. this$0)

- */

-public void addFieldInfos() {

-	SourceTypeBinding currentBinding = referenceBinding;

-	FieldBinding[] syntheticFields = currentBinding.syntheticFields();

-	int fieldCount = currentBinding.fieldCount() + (syntheticFields == null ? 0 : syntheticFields.length);

-

-	// write the number of fields

-	contents[contentsOffset++] = (byte) (fieldCount >> 8);

-	contents[contentsOffset++] = (byte) fieldCount;

-

-	FieldBinding[] fieldBindings = currentBinding.fields();

-	for (int i = 0, max = fieldBindings.length; i < max; i++) {

-		addFieldInfo(fieldBindings[i]);

-	}

-	if (syntheticFields != null) {

-		for (int i = 0, max = syntheticFields.length; i < max; i++) {

-			addFieldInfo(syntheticFields[i]);

-		}

-	}

-}

-/**

- * INTERNAL USE-ONLY

- * This methods stores the bindings for each inner class. They will be used to know which entries

- * have to be generated for the inner classes attributes.

- * @param referenceBinding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding 

- */

-public void addInnerClasses(ReferenceBinding referenceBinding) {

-	// check first if that reference binding is there

-	for (int i = 0; i < numberOfInnerClasses; i++) {

-		if (innerClassesBindings[i] == referenceBinding)

-			return;

-	}

-	int length = innerClassesBindings.length;

-	if (numberOfInnerClasses == length) {

-		System.arraycopy(innerClassesBindings, 0, (innerClassesBindings = new ReferenceBinding[length * 2]), 0, length);

-	}

-	innerClassesBindings[numberOfInnerClasses++] = referenceBinding;

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem clinit method info that correspond to a boggus method.

- *

- * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

- */

-public void addProblemClinit(IProblem[] problems) {

-	generateMethodInfoHeaderForClinit();

-	// leave two spaces for the number of attributes

-	contentsOffset -= 2;

-	int attributeOffset = contentsOffset;

-	contentsOffset += 2;

-	ReferenceBinding[] thrownsExceptions;

-	int attributeNumber = 0;

-	int contentsLength;

-

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	codeStream.resetForProblemClinit(this);

-	String problemString = ""/*nonNLS*/;

-	if (problems != null) {

-		int max = problems.length;

-		StringBuffer buffer = new StringBuffer(25);

-		int count = 0;

-		for (int i = 0; i < max; i++) {

-			IProblem problem = problems[i];

-			if ((problem != null) && (problem.isError())) {

-				buffer.append("\t"/*nonNLS*/ + problem.getMessage() + "\n"/*nonNLS*/);

-				count++;

-				if (problemLine == 0) {

-					problemLine = problem.getSourceLineNumber();

-				}

-				problems[i] = null;

-			}

-		} // insert the top line afterwards, once knowing how many problems we have to consider

-		if (count > 1) {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblems"/*nonNLS*/));

-		} else {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblem"/*nonNLS*/));

-		}

-		problemString = buffer.toString();

 	}

 

-	// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

-	int[] exceptionHandler = codeStream.generateCodeAttributeForProblemMethod(referenceBinding.scope.problemReporter().options.runtimeExceptionNameForCompileError, problemString);

-	attributeNumber++; // code attribute

-	completeCodeAttributeForClinit(

-		codeAttributeOffset,

-		exceptionHandler,

-		referenceBinding

-			.scope

-			.referenceCompilationUnit()

-			.compilationResult

-			.lineSeparatorPositions);

-	contents[attributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[attributeOffset] = (byte) attributeNumber;

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a boggus constructor.

- *

- * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

- * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

- */

-public void addProblemConstructor(

-	AbstractMethodDeclaration method, 

-	MethodBinding methodBinding, 

-	IProblem[] problems) {

-

-	// always clear the strictfp/native/abstract bit for a problem method

-	methodBinding.modifiers &= ~(AccStrictfp | AccNative | AccAbstract);

-		

-	generateMethodInfoHeader(methodBinding); 

-	// We know that we won't get more than 1 attribute: the code attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 1; // Code attribute

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	final ProblemReporter problemReporter = method.scope.problemReporter();

-	codeStream.reset(method, this);

-	String problemString = ""/*nonNLS*/;

-	if (problems != null) {

-		int max = problems.length;

-		StringBuffer buffer = new StringBuffer(25);

-		int count = 0;

-		for (int i = 0; i < max; i++) {

-			IProblem problem = problems[i];

-			if ((problem != null) && (problem.isError())) {

-				buffer.append("\t"/*nonNLS*/ + problem.getMessage() + "\n"/*nonNLS*/);

-				count++;

-				if (problemLine == 0) {

-					problemLine = problem.getSourceLineNumber();

-				}

-			}

-		} // insert the top line afterwards, once knowing how many problems we have to consider

-		if (count > 1) {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblems"/*nonNLS*/));

-		} else {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblem"/*nonNLS*/));

-		}

-		problemString = buffer.toString();

-	}

-	

-	// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

-	int[] exceptionHandler = 

-		codeStream.generateCodeAttributeForProblemMethod(

-			problemReporter.options.runtimeExceptionNameForCompileError, 

-			problemString);

-	completeCodeAttributeForProblemMethod(

-		method,

-		methodBinding, 

-		codeAttributeOffset, 

-		exceptionHandler, 

-		((SourceTypeBinding) methodBinding.declaringClass)

-			.scope

-			.referenceCompilationUnit()

-			.compilationResult

-			.lineSeparatorPositions); 

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a boggus constructor.

- * Reset the position inside the contents byte array to the savedOffset.

- *

- * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

- * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

- * @param savedOffset <CODE>int</CODE>

- */

-public void addProblemConstructor(AbstractMethodDeclaration method, MethodBinding methodBinding,IProblem[] problems, int savedOffset) {

-	// we need to move back the contentsOffset to the value at the beginning of the method

-	contentsOffset = savedOffset;

-	methodCount--; // we need to remove the method that causes the problem

-	addProblemConstructor(method, methodBinding, problems);

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a boggus method.

- *

- * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

- * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

- */

-public void addProblemMethod(

-	AbstractMethodDeclaration method, 

-	MethodBinding methodBinding, 

-	IProblem[] problems) {

-	if (methodBinding.isAbstract() && methodBinding.declaringClass.isInterface()) {

-		method.abort(AbstractMethodDeclaration.AbortType);

-	}	

-	// always clear the strictfp/native/abstract bit for a problem method

-	methodBinding.modifiers &= ~(AccStrictfp | AccNative | AccAbstract);

-	

-	generateMethodInfoHeader(methodBinding);

-	// leave two spaces for the number of attributes

-	int attributeOffset = contentsOffset;

-	contentsOffset += 2;

-	ReferenceBinding[] thrownsExceptions;

-	int attributeNumber = 0;

-	int contentsLength;

-	

-	if ((thrownsExceptions = methodBinding.thrownExceptions) != NoExceptions) {

-		// The method has a throw clause. So we need to add an exception attribute

-		// check that there is enough space to write all the bytes for the exception attribute

-		int length = thrownsExceptions.length;

-		if (contentsOffset + (8 + length * 2) >= (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + Math.max(INCREMENT_SIZE, (8 + length * 2))]), 0, contentsLength);

-		}

-		int exceptionNameIndex = constantPool.literalIndex(AttributeNamesConstants.ExceptionsName);

-		contents[contentsOffset++] = (byte) (exceptionNameIndex >> 8);

-		contents[contentsOffset++] = (byte) exceptionNameIndex;

-		// The attribute length = length * 2 + 2 in case of a exception attribute

-		int attributeLength = length * 2 + 2;

-		contents[contentsOffset++] = (byte) (attributeLength >> 24);

-		contents[contentsOffset++] = (byte) (attributeLength >> 16);

-		contents[contentsOffset++] = (byte) (attributeLength >> 8);

-		contents[contentsOffset++] = (byte) attributeLength;

-		contents[contentsOffset++] = (byte) (length >> 8);

-		contents[contentsOffset++] = (byte) length;

-		for (int i = 0; i < length; i++) {

-			int exceptionIndex = constantPool.literalIndex(thrownsExceptions[i]);

-			contents[contentsOffset++] = (byte) (exceptionIndex >> 8);

-			contents[contentsOffset++] = (byte) exceptionIndex;

-		}

-		attributeNumber++;

-	}

-

-	// Deprecated attribute

-	// Check that there is enough space to write the deprecated attribute

-	if (contentsOffset + 6 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	if (methodBinding.isDeprecated()) {

-		int deprecatedAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

-		contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

-		// the length of a deprecated attribute is equals to 0

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a synthetic method that

+	 * generate an write access to a private field.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

+	 */

+	public void addSyntheticFieldWriteAccessMethod(SyntheticAccessMethodBinding methodBinding) {

+		generateMethodInfoHeader(methodBinding);

+		// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 2;

+		// Code attribute

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		codeStream.init(this);

+		codeStream.generateSyntheticBodyForFieldWriteAccess(methodBinding);

+		completeCodeAttributeForSyntheticAccessMethod(

+			methodBinding,

+			codeAttributeOffset,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		// add the synthetic attribute

+		int syntheticAttributeNameIndex =

+			constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+		contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

+		contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

+		// the length of a synthetic attribute is equals to 0

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

 		contents[contentsOffset++] = 0;

-

-		attributeNumber++;

-	}

-	

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	final ProblemReporter problemReporter = method.scope.problemReporter();

-	codeStream.reset(method, this);

-	String problemString = ""/*nonNLS*/;

-	if (problems != null) {

-		int max = problems.length;

-		StringBuffer buffer = new StringBuffer(25);

-		int count = 0;

-		for (int i = 0; i < max; i++) {

-			IProblem problem = problems[i];

-			if ((problem != null)

-				&& (problem.isError())

-				&& (problem.getSourceStart() >= method.declarationSourceStart)

-				&& (problem.getSourceEnd() <= method.declarationSourceEnd)) {

-				buffer.append("\t"/*nonNLS*/ + problem.getMessage() + "\n"/*nonNLS*/);

-				count++;

-				if (problemLine == 0) {

-					problemLine = problem.getSourceLineNumber();

-				}

-				problems[i] = null;

-			}

-		} // insert the top line afterwards, once knowing how many problems we have to consider

-		if (count > 1) {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblems"/*nonNLS*/));

-		} else {

-			buffer.insert(0, Util.bind("compilation.unresolvedProblem"/*nonNLS*/));

-		}

-		problemString = buffer.toString();

 	}

 

-	// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")

-	int[] exceptionHandler = 

-		codeStream.generateCodeAttributeForProblemMethod(

-			problemReporter.options.runtimeExceptionNameForCompileError, 

-			problemString);

-	attributeNumber++; // code attribute

-	completeCodeAttributeForProblemMethod(

-		method, 

-		methodBinding, 

-		codeAttributeOffset, 

-		exceptionHandler, 

-		((SourceTypeBinding) methodBinding.declaringClass)

-			.scope

-			.referenceCompilationUnit()

-			.compilationResult

-			.lineSeparatorPositions);

-	contents[attributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[attributeOffset] = (byte) attributeNumber;	

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a boggus method.

- * Reset the position inside the contents byte array to the savedOffset.

- *

- * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding

- * @param problem org.eclipse.jdt.internal.compiler.problem.Problem[]

- * @param savedOffset <CODE>int</CODE>

- */

-public void addProblemMethod(AbstractMethodDeclaration method, MethodBinding methodBinding,IProblem[] problems, int savedOffset) {

-	// we need to move back the contentsOffset to the value at the beginning of the method

-	contentsOffset = savedOffset;

-	methodCount--; // we need to remove the method that causes the problem

-	addProblemMethod(method, methodBinding, problems);

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for all the special method infos.

- * They are:

- * - synthetic access methods

- * - default abstract methods

- */

-public void addSpecialMethods() {

-	// add all methods (default abstract methods and synthetic)

-

-	// default abstract methods

-	SourceTypeBinding currentBinding = referenceBinding;

-	MethodBinding[] defaultAbstractMethods = currentBinding.getDefaultAbstractMethods();

-	for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {

-		generateMethodInfoHeader(defaultAbstractMethods[i]);

-		int methodAttributeOffset = contentsOffset;

-		int attributeNumber = generateMethodInfoAttribute(defaultAbstractMethods[i]);

-		completeMethodInfo(methodAttributeOffset, attributeNumber);

+	/**

+	 * INTERNAL USE-ONLY

+	 * Generate the byte for a problem method info that correspond to a synthetic method that

+	 * generate an access to a private method.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

+	 */

+	public void addSyntheticMethodAccessMethod(SyntheticAccessMethodBinding methodBinding) {

+		generateMethodInfoHeader(methodBinding);

+		// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 2;

+		// Code attribute

+		int codeAttributeOffset = contentsOffset;

+		generateCodeAttributeHeader();

+		codeStream.init(this);

+		codeStream.generateSyntheticBodyForMethodAccess(methodBinding);

+		completeCodeAttributeForSyntheticAccessMethod(

+			methodBinding,

+			codeAttributeOffset,

+			((SourceTypeBinding) methodBinding.declaringClass)

+				.scope

+				.referenceCompilationUnit()

+				.compilationResult

+				.lineSeparatorPositions);

+		// add the synthetic attribute

+		int syntheticAttributeNameIndex =

+			constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+		contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

+		contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

+		// the length of a synthetic attribute is equals to 0

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 0;

 	}

 

-	// add synthetic methods infos

-	SyntheticAccessMethodBinding[] syntheticAccessMethods = currentBinding.syntheticAccessMethods();

-	if (syntheticAccessMethods != null) {

-		for (int i = 0, max = syntheticAccessMethods.length; i < max; i++) {

-			SyntheticAccessMethodBinding accessMethodBinding = syntheticAccessMethods[i];

-			switch (accessMethodBinding.accessType) {

-				case SyntheticAccessMethodBinding.FieldReadAccess :

-					// generate a method info to emulate an reading access to

-					// a private field

-					addSyntheticFieldReadAccessMethod(syntheticAccessMethods[i]);

-					break;

-				case SyntheticAccessMethodBinding.FieldWriteAccess :

-					// generate a method info to emulate an writing access to

-					// a private field

-					addSyntheticFieldWriteAccessMethod(syntheticAccessMethods[i]);

-					break;

-				case SyntheticAccessMethodBinding.MethodAccess :

-					// generate a method info to emulate an access to a private method

-					addSyntheticMethodAccessMethod(syntheticAccessMethods[i]);

-					break;

-				case SyntheticAccessMethodBinding.ConstructorAccess :

-					// generate a method info to emulate an access to a private method

-					addSyntheticConstructorAccessMethod(syntheticAccessMethods[i]);

-			}

+	/**

+	 * INTERNAL USE-ONLY

+	 * Build all the directories and subdirectories corresponding to the packages names

+	 * into the directory specified in parameters.

+	 *

+	 * outputPath is formed like:

+	 *	   c:\temp\ the last character is a file separator

+	 * relativeFileName is formed like:

+	 *     java\lang\String.class *

+	 * 

+	 * @param outputPath java.lang.String

+	 * @param relativeFileName java.lang.String

+	 * @return java.lang.String

+	 */

+	public static String buildAllDirectoriesInto(

+		String outputPath,

+		String relativeFileName)

+		throws IOException {

+		char fileSeparatorChar = File.separatorChar;

+		String fileSeparator = File.separator;

+		File f;

+		// First we ensure that the outputPath exists

+		outputPath = outputPath.replace('/', fileSeparatorChar);

+		// To be able to pass the mkdirs() method we need to remove the extra file separator at the end of the outDir name

+		if (outputPath.endsWith(fileSeparator)) {

+			outputPath = outputPath.substring(0, outputPath.length() - 1);

 		}

-	}

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a synthetic method that

- * generate an access to a private constructor.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

- */

-public void addSyntheticConstructorAccessMethod(SyntheticAccessMethodBinding methodBinding) {

-	generateMethodInfoHeader(methodBinding);

-	// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 2;	

-	// Code attribute

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	codeStream.init(this);

-	codeStream.generateSyntheticBodyForConstructorAccess(methodBinding);

-	completeCodeAttributeForSyntheticAccessMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions);

-	// add the synthetic attribute

-	int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

-	contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

-	contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

-	// the length of a synthetic attribute is equals to 0

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a synthetic method that

- * generate an read access to a private field.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

- */

-public void addSyntheticFieldReadAccessMethod(SyntheticAccessMethodBinding methodBinding) {

-	generateMethodInfoHeader(methodBinding);

-	// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 2;

-	// Code attribute

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	codeStream.init(this);

-	codeStream.generateSyntheticBodyForFieldReadAccess(methodBinding);

-	completeCodeAttributeForSyntheticAccessMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions);

-	// add the synthetic attribute

-	int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

-	contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

-	contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

-	// the length of a synthetic attribute is equals to 0

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;	

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a synthetic method that

- * generate an write access to a private field.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

- */

-public void addSyntheticFieldWriteAccessMethod(SyntheticAccessMethodBinding methodBinding) {

-	generateMethodInfoHeader(methodBinding);

-	// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 2;	

-	// Code attribute

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	codeStream.init(this);

-	codeStream.generateSyntheticBodyForFieldWriteAccess(methodBinding);

-	completeCodeAttributeForSyntheticAccessMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions);

-	// add the synthetic attribute

-	int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

-	contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

-	contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

-	// the length of a synthetic attribute is equals to 0

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;	

-}

-/**

- * INTERNAL USE-ONLY

- * Generate the byte for a problem method info that correspond to a synthetic method that

- * generate an access to a private method.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

- */

-public void addSyntheticMethodAccessMethod(SyntheticAccessMethodBinding methodBinding) {

-	generateMethodInfoHeader(methodBinding);

-	// We know that we won't get more than 2 attribute: the code attribute + synthetic attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 2;	

-	// Code attribute

-	int codeAttributeOffset = contentsOffset;

-	generateCodeAttributeHeader();

-	codeStream.init(this);

-	codeStream.generateSyntheticBodyForMethodAccess(methodBinding);

-	completeCodeAttributeForSyntheticAccessMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions);

-	// add the synthetic attribute

-	int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

-	contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

-	contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

-	// the length of a synthetic attribute is equals to 0

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 0;	

-}

-/**

- * INTERNAL USE-ONLY

- * Build all the directories and subdirectories corresponding to the packages names

- * into the directory specified in parameters.

- *

- * outputPath is formed like:

- *	   c:\temp\ the last character is a file separator

- * relativeFileName is formed like:

- *     java\lang\String.class *

- * 

- * @param outputPath java.lang.String

- * @param relativeFileName java.lang.String

- * @return java.lang.String

- */

-public static String buildAllDirectoriesInto(String outputPath, String relativeFileName) throws IOException {

-	char fileSeparatorChar = File.separatorChar;

-	String fileSeparator = File.separator;

-	File f;

-	// First we ensure that the outputPath exists

-	outputPath = outputPath.replace('/', fileSeparatorChar);

-	// To be able to pass the mkdirs() method we need to remove the extra file separator at the end of the outDir name

-	if (outputPath.endsWith(fileSeparator)) {

-		outputPath = outputPath.substring(0, outputPath.length() - 1);

-	}

-	f = new File(outputPath);

-	if (f.exists()) {

-		if (!f.isDirectory()) {

-			System.out.println(Util.bind("output.isFile"/*nonNLS*/,f.getAbsolutePath()));

-			throw new IOException(Util.bind("output.isFileNotDirectory"/*nonNLS*/));

-		}

-	} else {

-		// we have to create that directory

-		if (!f.mkdirs()) {

-			System.out.println(Util.bind("output.dirName"/*nonNLS*/,f.getAbsolutePath()));

-			throw new IOException(Util.bind("output.notValidAll"/*nonNLS*/));

-		}

-	}

-	StringBuffer outDir = new StringBuffer(outputPath);

-	outDir.append(fileSeparator);

-	StringTokenizer tokenizer = new StringTokenizer(relativeFileName, fileSeparator);

-	String token = tokenizer.nextToken();

-	while (tokenizer.hasMoreTokens()) {

-		f = new File(outDir.append(token).append(fileSeparator).toString());

+		f = new File(outputPath);

 		if (f.exists()) {

-			// The outDir already exists, so we proceed the next entry

-			// System.out.println("outDir: " + outDir + " already exists.");

+			if (!f.isDirectory()) {

+				System.out.println(Util.bind("output.isFile" , f.getAbsolutePath())); //$NON-NLS-1$

+				throw new IOException(Util.bind("output.isFileNotDirectory" )); //$NON-NLS-1$

+			}

 		} else {

-			// Need to add the outDir

-			if (!f.mkdir()) {

-				System.out.println(Util.bind("output.fileName"/*nonNLS*/,f.getName()));

-				throw new IOException(Util.bind("output.notValid"/*nonNLS*/));

+			// we have to create that directory

+			if (!f.mkdirs()) {

+				System.out.println(Util.bind("output.dirName" , f.getAbsolutePath())); //$NON-NLS-1$

+				throw new IOException(Util.bind("output.notValidAll" )); //$NON-NLS-1$

 			}

 		}

-		token = tokenizer.nextToken();

-	}

-	// token contains the last one

-	return outDir.append(token).toString();

-}

-/**

- * INTERNAL USE-ONLY

- * That method completes the creation of the code attribute by setting

- * - the attribute_length

- * - max_stack

- * - max_locals

- * - code_length

- * - exception table

- * - and debug attributes if necessary.

- *

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- * @param codeAttributeOffset <CODE>int</CODE>

- */

-public void completeCodeAttribute(int codeAttributeOffset) {

-	// reinitialize the localContents with the byte modified by the code stream

-	byte[] localContents = contents = codeStream.bCodeStream;

-	int localContentsOffset = codeStream.classFileOffset;

-	// codeAttributeOffset is the position inside localContents byte array before we started to write

-	// any information about the codeAttribute

-	// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

-	// to get the right position, 6 for the max_stack etc...

-	int contentsLength;

-	int code_length = codeStream.position;

-	if (code_length > 65535) {

-		codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(codeStream.methodDeclaration);

-	}

-	if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	int max_stack = codeStream.stackMax;

-	localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

-	localContents[codeAttributeOffset + 7] = (byte) max_stack;

-	int max_locals = codeStream.maxLocals;

-	localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

-	localContents[codeAttributeOffset + 9] = (byte) max_locals;

-	localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

-	localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

-	localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

-	localContents[codeAttributeOffset + 13] = (byte) code_length;

-

-	// write the exception table

-	int exceptionHandlersNumber = codeStream.exceptionHandlersNumber;

-	ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers;

-	int exSize;

-	if (localContentsOffset + (exSize = (exceptionHandlersNumber * 8 + 2)) >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + (exSize > INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]), 0, contentsLength);

-	}

-	// there is no exception table, so we need to offset by 2 the current offset and move 

-	// on the attribute generation

-	localContents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8);

-	localContents[localContentsOffset++] = (byte) exceptionHandlersNumber;

-	for (int i = 0; i < exceptionHandlersNumber; i++) {

-		ExceptionLabel exceptionHandler = exceptionHandlers[i];

-		int start = exceptionHandler.start;

-		localContents[localContentsOffset++] = (byte) (start >> 8);

-		localContents[localContentsOffset++] = (byte) start;

-		int end = exceptionHandler.end;

-		localContents[localContentsOffset++] = (byte) (end >> 8);

-		localContents[localContentsOffset++] = (byte) end;

-		int handlerPC = exceptionHandler.position;

-		localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

-		localContents[localContentsOffset++] = (byte) handlerPC;

-		if (exceptionHandler.exceptionType == null) {

-			// any exception handler

-			localContents[localContentsOffset++] = 0;

-			localContents[localContentsOffset++] = 0;

-		} else {

-			int nameIndex;

-			if (exceptionHandler.exceptionType == TypeBinding.NullBinding) {

-				/* represents ClassNotFoundException, see class literal access*/

-				nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException();

+		StringBuffer outDir = new StringBuffer(outputPath);

+		outDir.append(fileSeparator);

+		StringTokenizer tokenizer =

+			new StringTokenizer(relativeFileName, fileSeparator);

+		String token = tokenizer.nextToken();

+		while (tokenizer.hasMoreTokens()) {

+			f = new File(outDir.append(token).append(fileSeparator).toString());

+			if (f.exists()) {

+				// The outDir already exists, so we proceed the next entry

+				// System.out.println("outDir: " + outDir + " already exists.");

 			} else {

-				nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType);

+				// Need to add the outDir

+				if (!f.mkdir()) {

+					System.out.println(Util.bind("output.fileName" , f.getName())); //$NON-NLS-1$

+					throw new IOException(Util.bind("output.notValid" )); //$NON-NLS-1$

+				}

 			}

-			localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) nameIndex;

+			token = tokenizer.nextToken();

 		}

+		// token contains the last one

+		return outDir.append(token).toString();

 	}

 

-	// debug attributes

-	int codeAttributeAttributeOffset = localContentsOffset;

-	int attributeNumber = 0;

-	// leave two bytes for the attribute_length

-	localContentsOffset += 2;

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method completes the creation of the code attribute by setting

+	 * - the attribute_length

+	 * - max_stack

+	 * - max_locals

+	 * - code_length

+	 * - exception table

+	 * - and debug attributes if necessary.

+	 *

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 * @param codeAttributeOffset <CODE>int</CODE>

+	 */

+	public void completeCodeAttribute(int codeAttributeOffset) {

+		// reinitialize the localContents with the byte modified by the code stream

+		byte[] localContents = contents = codeStream.bCodeStream;

+		int localContentsOffset = codeStream.classFileOffset;

+		// codeAttributeOffset is the position inside localContents byte array before we started to write

+		// any information about the codeAttribute

+		// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

+		// to get the right position, 6 for the max_stack etc...

+		int contentsLength;

+		int code_length = codeStream.position;

+		if (code_length > 65535) {

+			codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(

+				codeStream.methodDeclaration);

+		}

+		if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		int max_stack = codeStream.stackMax;

+		localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

+		localContents[codeAttributeOffset + 7] = (byte) max_stack;

+		int max_locals = codeStream.maxLocals;

+		localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

+		localContents[codeAttributeOffset + 9] = (byte) max_locals;

+		localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

+		localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

+		localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

+		localContents[codeAttributeOffset + 13] = (byte) code_length;

 

-	// first we handle the linenumber attribute

-	if (codeStream.generateLineNumberAttributes) {

-		/* Create and add the line number attribute (used for debugging) 

-		 * Build the pairs of:

-		 * 	(bytecodePC lineNumber)

-		 * according to the table of start line indexes and the pcToSourceMap table

-		 * contained into the codestream

-		 */

-		/** OLD CODE

-				int[][] pcToSourceMapTable;

-		int previousLineNumber;

-		int[] flatTable;

-		int index;

-		int startLineIndexes[] = codeStream.methodDeclaration.scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions;

-		int max = startLineIndexes.length;

-		*/ 

-		int[] pcToSourceMapTable;

-		if (((pcToSourceMapTable = codeStream.pcToSourceMap) != null) && (codeStream.pcToSourceMapSize != 0)) {

-			int lineNumberNameIndex = constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

-			if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-				System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+		// write the exception table

+		int exceptionHandlersNumber = codeStream.exceptionHandlersNumber;

+		ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers;

+		int exSize;

+		if (localContentsOffset + (exSize = (exceptionHandlersNumber * 8 + 2))

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents =

+					contents =

+						new byte[contentsLength + (exSize > INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]),

+				0,

+				contentsLength);

+		}

+		// there is no exception table, so we need to offset by 2 the current offset and move 

+		// on the attribute generation

+		localContents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8);

+		localContents[localContentsOffset++] = (byte) exceptionHandlersNumber;

+		for (int i = 0; i < exceptionHandlersNumber; i++) {

+			ExceptionLabel exceptionHandler = exceptionHandlers[i];

+			int start = exceptionHandler.start;

+			localContents[localContentsOffset++] = (byte) (start >> 8);

+			localContents[localContentsOffset++] = (byte) start;

+			int end = exceptionHandler.end;

+			localContents[localContentsOffset++] = (byte) (end >> 8);

+			localContents[localContentsOffset++] = (byte) end;

+			int handlerPC = exceptionHandler.position;

+			localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

+			localContents[localContentsOffset++] = (byte) handlerPC;

+			if (exceptionHandler.exceptionType == null) {

+				// any exception handler

+				localContents[localContentsOffset++] = 0;

+				localContents[localContentsOffset++] = 0;

+			} else {

+				int nameIndex;

+				if (exceptionHandler.exceptionType == TypeBinding.NullBinding) {

+					/* represents ClassNotFoundException, see class literal access*/

+					nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException();

+				} else {

+					nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType);

+				}

+				localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) nameIndex;

 			}

-			localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

-			int lineNumberTableOffset = localContentsOffset;

-			localContentsOffset += 6; // leave space for attribute_length and line_number_table_length

+		}

+		// debug attributes

+		int codeAttributeAttributeOffset = localContentsOffset;

+		int attributeNumber = 0;

+		// leave two bytes for the attribute_length

+		localContentsOffset += 2;

+

+		// first we handle the linenumber attribute

+		if (codeStream.generateLineNumberAttributes) {

+			/* Create and add the line number attribute (used for debugging) 

+			 * Build the pairs of:

+			 * 	(bytecodePC lineNumber)

+			 * according to the table of start line indexes and the pcToSourceMap table

+			 * contained into the codestream

+			 */

 			/** OLD CODE

-			previousLineNumber = 0;

-

-			// Seems like do would be better, but this preserves the existing behavior.

-

-			flatTable = new int[code_length];

-			for (int i = codeStream.pcToSourceMapSize - 1; i >= 0; i--) {

-				// entry contains the following structure:

-				// position 1: startPC

-				// position 2: endPC

-				// position 3: sourceStart

-				// position 4: sourceEnd

-				// Compute the line number for a given source position

-				index = searchLineNumber(startLineIndexes, pcToSourceMapTable[i][2]);

-				for (int j = pcToSourceMapTable[i][0]; j < pcToSourceMapTable[i][1]; j++)

-					flatTable[j] = index;

-			}

-			previousLineNumber = -1;

-			

+					int[][] pcToSourceMapTable;

+			int previousLineNumber;

+			int[] flatTable;

+			int index;

+			int startLineIndexes[] = codeStream.methodDeclaration.scope.referenceCompilationUnit().compilationResult.lineSeparatorPositions;

+			int max = startLineIndexes.length;

 			*/

-			int numberOfEntries = 0;

-			int length = codeStream.pcToSourceMapSize;

-			/** OLD CODE

-				int length = flatTable.length;

-						for (int i = 0; i < length; i++) {

-				if (flatTable[i] != previousLineNumber) {

-					previousLineNumber = flatTable[i];

+			int[] pcToSourceMapTable;

+			if (((pcToSourceMapTable = codeStream.pcToSourceMap) != null)

+				&& (codeStream.pcToSourceMapSize != 0)) {

+				int lineNumberNameIndex =

+					constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

+				if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

+					System.arraycopy(

+						contents,

+						0,

+						(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+						0,

+						contentsLength);

+				}

+				localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

+				int lineNumberTableOffset = localContentsOffset;

+				localContentsOffset += 6;

+				// leave space for attribute_length and line_number_table_length

+				/** OLD CODE

+				previousLineNumber = 0;

+				

+				// Seems like do would be better, but this preserves the existing behavior.

+				

+				flatTable = new int[code_length];

+				for (int i = codeStream.pcToSourceMapSize - 1; i >= 0; i--) {

+					// entry contains the following structure:

+					// position 1: startPC

+					// position 2: endPC

+					// position 3: sourceStart

+					// position 4: sourceEnd

+					// Compute the line number for a given source position

+					index = searchLineNumber(startLineIndexes, pcToSourceMapTable[i][2]);

+					for (int j = pcToSourceMapTable[i][0]; j < pcToSourceMapTable[i][1]; j++)

+						flatTable[j] = index;

+				}

+				previousLineNumber = -1;

+				

+				*/

+				int numberOfEntries = 0;

+				int length = codeStream.pcToSourceMapSize;

+				/** OLD CODE

+					int length = flatTable.length;

+							for (int i = 0; i < length; i++) {

+					if (flatTable[i] != previousLineNumber) {

+						previousLineNumber = flatTable[i];

+						// write the entry

+						if (localContentsOffset + 4 >= (contentsLength = localContents.length)) {

+							System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+						}

+						localContents[localContentsOffset++] = (byte) (i >> 8);

+						localContents[localContentsOffset++] = (byte) i;

+						localContents[localContentsOffset++] = (byte) (previousLineNumber >> 8);

+						localContents[localContentsOffset++] = (byte) previousLineNumber;

+						numberOfEntries++;

+					}

+				}

+				*/

+				for (int i = 0; i < length;) {

 					// write the entry

 					if (localContentsOffset + 4 >= (contentsLength = localContents.length)) {

-						System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+						System.arraycopy(

+							contents,

+							0,

+							(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+							0,

+							contentsLength);

 					}

-					localContents[localContentsOffset++] = (byte) (i >> 8);

-					localContents[localContentsOffset++] = (byte) i;

-					localContents[localContentsOffset++] = (byte) (previousLineNumber >> 8);

-					localContents[localContentsOffset++] = (byte) previousLineNumber;

+					int pc = pcToSourceMapTable[i++];

+					localContents[localContentsOffset++] = (byte) (pc >> 8);

+					localContents[localContentsOffset++] = (byte) pc;

+					int lineNumber = pcToSourceMapTable[i++];

+					localContents[localContentsOffset++] = (byte) (lineNumber >> 8);

+					localContents[localContentsOffset++] = (byte) lineNumber;

 					numberOfEntries++;

 				}

-			}

-			*/			

-			for (int i = 0; i < length;) {

-				// write the entry

-				if (localContentsOffset + 4 >= (contentsLength = localContents.length)) {

-					System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-				}

-				int pc = pcToSourceMapTable[i++];

-				localContents[localContentsOffset++] = (byte) (pc >> 8);

-				localContents[localContentsOffset++] = (byte) pc;

-				int lineNumber = pcToSourceMapTable[i++];

-				localContents[localContentsOffset++] = (byte) (lineNumber >> 8);

-				localContents[localContentsOffset++] = (byte) lineNumber;

-				numberOfEntries++;

-			}

-			// now we change the size of the line number attribute

-			int lineNumberAttr_length = numberOfEntries * 4 + 2;

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 24);

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 16);

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 8);

-			localContents[lineNumberTableOffset++] = (byte) lineNumberAttr_length;

-			localContents[lineNumberTableOffset++] = (byte) (numberOfEntries >> 8);

-			localContents[lineNumberTableOffset++] = (byte) numberOfEntries;

-			attributeNumber++;

-		}

-	}

-

-

-

-	// then we do the local variable attribute

-	if (codeStream.generateLocalVariableTableAttributes) {

-		int localVariableTableOffset = localContentsOffset;

-		int numberOfEntries = 0;

-		int localVariableNameIndex = constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

-		if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-			System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-		}

-		localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

-		localContents[localContentsOffset++] = (byte) localVariableNameIndex;

-		localContentsOffset += 6; // leave space for attribute_length and local_variable_table_length

-		int nameIndex;

-		int descriptorIndex;

-		if (!codeStream.methodDeclaration.isStatic()) {

-			numberOfEntries++;

-			if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-				System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-			}

-			localContentsOffset += 2; // the startPC for this is always 0

-			localContents[localContentsOffset++] = (byte) (code_length >> 8);

-			localContents[localContentsOffset++] = (byte) code_length;

-			nameIndex = constantPool.literalIndex(QualifiedNamesConstants.This);

-			localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) nameIndex;

-			descriptorIndex = constantPool.literalIndex(codeStream.methodDeclaration.binding.declaringClass.signature());

-			localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

-			localContents[localContentsOffset++] = (byte) descriptorIndex;

-			localContentsOffset += 2; // the resolved position for this is always 0

-		}

-		for (int i = 0; i < codeStream.allLocalsCounter; i++) {

-			LocalVariableBinding localVariable = codeStream.locals[i];

-			for (int j = 0; j < localVariable.initializationCount; j++) {

-				int startPC = localVariable.initializationPCs[j << 1];

-				int endPC = localVariable.initializationPCs[(j << 1) + 1];

-				if (startPC != endPC) { // only entries for non zero length

-					int currentLength;

-					if (endPC == -1) {

-						localVariable.declaringScope.problemReporter().abortDueToInternalError(Util.bind("abort.invalidAttribute"/*nonNLS*/,new String(localVariable.name)), (AstNode) localVariable.declaringScope.methodScope().referenceContext);

-					}

-					if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-						System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-					}

-					// now we can safely add the local entry

-					numberOfEntries++;

-					localContents[localContentsOffset++] = (byte) (startPC >> 8);

-					localContents[localContentsOffset++] = (byte) startPC;

-					int length = endPC - startPC;

-					localContents[localContentsOffset++] = (byte) (length >> 8);

-					localContents[localContentsOffset++] = (byte) length;

-					nameIndex = constantPool.literalIndex(localVariable.name);

-					localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-					localContents[localContentsOffset++] = (byte) nameIndex;

-					descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

-					localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

-					localContents[localContentsOffset++] = (byte) descriptorIndex;

-					int resolvedPosition = localVariable.resolvedPosition;

-					localContents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

-					localContents[localContentsOffset++] = (byte) resolvedPosition;

-				}

+				// now we change the size of the line number attribute

+				int lineNumberAttr_length = numberOfEntries * 4 + 2;

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 24);

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 16);

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 8);

+				localContents[lineNumberTableOffset++] = (byte) lineNumberAttr_length;

+				localContents[lineNumberTableOffset++] = (byte) (numberOfEntries >> 8);

+				localContents[lineNumberTableOffset++] = (byte) numberOfEntries;

+				attributeNumber++;

 			}

 		}

-		int value = numberOfEntries * 10 + 2;

-		localVariableTableOffset += 2;

-		localContents[localVariableTableOffset++] = (byte) (value >> 24);

-		localContents[localVariableTableOffset++] = (byte) (value >> 16);

-		localContents[localVariableTableOffset++] = (byte) (value >> 8);

-		localContents[localVariableTableOffset++] = (byte) value;

-		localContents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

-		localContents[localVariableTableOffset] = (byte) numberOfEntries;

-		attributeNumber++;

-	}

-	// update the number of attributes

-	// ensure first that there is enough space available inside the localContents array

-	if (codeAttributeAttributeOffset + 2 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

-	localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

-

-	// update the attribute length

-	int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

-	localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

-	localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

-	localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

-	localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

-	contentsOffset = localContentsOffset;

-}

-/**

- * INTERNAL USE-ONLY

- * That method completes the creation of the code attribute by setting

- * - the attribute_length

- * - max_stack

- * - max_locals

- * - code_length

- * - exception table

- * - and debug attributes if necessary.

- *

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- * @param codeAttributeOffset <CODE>int</CODE>

- */

-public void completeCodeAttributeForClinit(int codeAttributeOffset) {

-	// reinitialize the contents with the byte modified by the code stream

-	byte[] localContents = contents = codeStream.bCodeStream;

-	int localContentsOffset = codeStream.classFileOffset;

-	// codeAttributeOffset is the position inside contents byte array before we started to write

-	// any information about the codeAttribute

-	// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

-	// to get the right position, 6 for the max_stack etc...

-	int contentsLength;

-	int code_length = codeStream.position;

-	if (code_length > 65535) {

-		codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(codeStream.methodDeclaration.scope.referenceType());

-	}

-	if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	int max_stack = codeStream.stackMax;

-	localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

-	localContents[codeAttributeOffset + 7] = (byte) max_stack;

-	int max_locals = codeStream.maxLocals;

-	localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

-	localContents[codeAttributeOffset + 9] = (byte) max_locals;

-	localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

-	localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

-	localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

-	localContents[codeAttributeOffset + 13] = (byte) code_length;

-

-	// write the exception table

-	int exceptionHandlersNumber = codeStream.exceptionHandlersNumber;

-	ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers;

-	int exSize;

-	if (localContentsOffset + (exSize = (exceptionHandlersNumber * 8 + 2)) >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + (exSize > INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]), 0, contentsLength);

-	}

-	// there is no exception table, so we need to offset by 2 the current offset and move 

-	// on the attribute generation

-	localContents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8);

-	localContents[localContentsOffset++] = (byte) exceptionHandlersNumber;

-	for (int i = 0; i < exceptionHandlersNumber; i++) {

-		ExceptionLabel exceptionHandler = exceptionHandlers[i];

-		int start = exceptionHandler.start;

-		localContents[localContentsOffset++] = (byte) (start >> 8);

-		localContents[localContentsOffset++] = (byte) start;

-		int end = exceptionHandler.end;

-		localContents[localContentsOffset++] = (byte) (end >> 8);

-		localContents[localContentsOffset++] = (byte) end;

-		int handlerPC = exceptionHandler.position;

-		localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

-		localContents[localContentsOffset++] = (byte) handlerPC;

-		if (exceptionHandler.exceptionType == null) {

-			// any exception handler

-			localContentsOffset += 2;

-		} else {

-			int nameIndex;

-			if (exceptionHandler.exceptionType == TypeBinding.NullBinding) {

-				/* represents denote ClassNotFoundException, see class literal access*/

-				nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException();

-			} else {

-				nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType);

-			}

-			localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) nameIndex;

-		}

-	}

-

-	// debug attributes

-	int codeAttributeAttributeOffset = localContentsOffset;

-	int attributeNumber = 0;

-	// leave two bytes for the attribute_length

-	localContentsOffset += 2;

-

-	// first we handle the linenumber attribute

-	if (codeStream.generateLineNumberAttributes) {

-		/* Create and add the line number attribute (used for debugging) 

-		 * Build the pairs of:

-		 * 	(bytecodePC lineNumber)

-		 * according to the table of start line indexes and the pcToSourceMap table

-		 * contained into the codestream

-		 */

-		int[] pcToSourceMapTable;

-		if (((pcToSourceMapTable = codeStream.pcToSourceMap) != null) && (codeStream.pcToSourceMapSize != 0)) {

-			int lineNumberNameIndex = constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

-			if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-				System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-			}

-			localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

-			int lineNumberTableOffset = localContentsOffset;

-			localContentsOffset += 6; // leave space for attribute_length and line_number_table_length

+		// then we do the local variable attribute

+		if (codeStream.generateLocalVariableTableAttributes) {

+			int localVariableTableOffset = localContentsOffset;

 			int numberOfEntries = 0;

-			int length = codeStream.pcToSourceMapSize;

-			for (int i = 0; i < length;) {

-				// write the entry

-				if (localContentsOffset + 4 >= (contentsLength = localContents.length)) {

-					System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-				}

-				int pc = pcToSourceMapTable[i++];

-				localContents[localContentsOffset++] = (byte) (pc >> 8);

-				localContents[localContentsOffset++] = (byte) pc;

-				int lineNumber = pcToSourceMapTable[i++];

-				localContents[localContentsOffset++] = (byte) (lineNumber >> 8);

-				localContents[localContentsOffset++] = (byte) lineNumber;

-				numberOfEntries++;

-			}

-			// now we change the size of the line number attribute

-			int lineNumberAttr_length = numberOfEntries * 4 + 2;

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 24);

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 16);

-			localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 8);

-			localContents[lineNumberTableOffset++] = (byte) lineNumberAttr_length;

-			localContents[lineNumberTableOffset++] = (byte) (numberOfEntries >> 8);

-			localContents[lineNumberTableOffset++] = (byte) numberOfEntries;

-			attributeNumber++;

-		}

-	}

-

-

-

-	// then we do the local variable attribute

-	if (codeStream.generateLocalVariableTableAttributes) {

-		int localVariableTableOffset = localContentsOffset;

-		int numberOfEntries = 0;

-		//		codeAttribute.addLocalVariableTableAttribute(this);

-		if ((codeStream.pcToSourceMap != null) && (codeStream.pcToSourceMapSize != 0)) {

-			int localVariableNameIndex = constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

+			int localVariableNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

 			if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-				System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+				System.arraycopy(

+					contents,

+					0,

+					(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

 			}

 			localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

 			localContents[localContentsOffset++] = (byte) localVariableNameIndex;

-			localContentsOffset += 6; // leave space for attribute_length and local_variable_table_length

+			localContentsOffset += 6;

+			// leave space for attribute_length and local_variable_table_length

 			int nameIndex;

 			int descriptorIndex;

+			if (!codeStream.methodDeclaration.isStatic()) {

+				numberOfEntries++;

+				if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

+					System.arraycopy(

+						contents,

+						0,

+						(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+						0,

+						contentsLength);

+				}

+				localContentsOffset += 2; // the startPC for this is always 0

+				localContents[localContentsOffset++] = (byte) (code_length >> 8);

+				localContents[localContentsOffset++] = (byte) code_length;

+				nameIndex = constantPool.literalIndex(QualifiedNamesConstants.This);

+				localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) nameIndex;

+				descriptorIndex =

+					constantPool.literalIndex(

+						codeStream.methodDeclaration.binding.declaringClass.signature());

+				localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

+				localContents[localContentsOffset++] = (byte) descriptorIndex;

+				localContentsOffset += 2; // the resolved position for this is always 0

+			}

 			for (int i = 0; i < codeStream.allLocalsCounter; i++) {

 				LocalVariableBinding localVariable = codeStream.locals[i];

 				for (int j = 0; j < localVariable.initializationCount; j++) {

 					int startPC = localVariable.initializationPCs[j << 1];

-					int endPC = localVariable.initializationPCs[ (j << 1) + 1];

+					int endPC = localVariable.initializationPCs[(j << 1) + 1];

 					if (startPC != endPC) { // only entries for non zero length

 						int currentLength;

 						if (endPC == -1) {

-							localVariable.declaringScope.problemReporter().abortDueToInternalError(Util.bind("abort.invalidAttribute"/*nonNLS*/,new String(localVariable.name)), (AstNode) localVariable.declaringScope.methodScope().referenceContext);

+							localVariable.declaringScope.problemReporter().abortDueToInternalError(

+								Util.bind("abort.invalidAttribute" , new String(localVariable.name)), //$NON-NLS-1$

+								(AstNode) localVariable.declaringScope.methodScope().referenceContext);

 						}

 						if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-							System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+							System.arraycopy(

+								contents,

+								0,

+								(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+								0,

+								contentsLength);

 						}

 						// now we can safely add the local entry

 						numberOfEntries++;

@@ -1441,271 +1438,616 @@
 			localContents[localVariableTableOffset] = (byte) numberOfEntries;

 			attributeNumber++;

 		}

-	}

-	// update the number of attributes

-	// ensure first that there is enough space available inside the contents array

-	if (codeAttributeAttributeOffset + 2 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

-	localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

-	// update the attribute length

-	int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

-	localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

-	localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

-	localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

-	localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

-	contentsOffset = localContentsOffset;

-}

-/**

- * INTERNAL USE-ONLY

- * That method completes the creation of the code attribute by setting

- * - the attribute_length

- * - max_stack

- * - max_locals

- * - code_length

- * - exception table

- * - and debug attributes if necessary.

- *

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- * @param codeAttributeOffset <CODE>int</CODE>

- * @param exceptionHandler int[]

- * @param startIndexes int[]

- */

-public void completeCodeAttributeForClinit(int codeAttributeOffset, int[] exceptionHandler, int[] startLineIndexes) {

-	// reinitialize the contents with the byte modified by the code stream

-	byte[] localContents = contents = codeStream.bCodeStream;

-	int localContentsOffset = codeStream.classFileOffset;

-	// codeAttributeOffset is the position inside contents byte array before we started to write

-	// any information about the codeAttribute

-	// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

-	// to get the right position, 6 for the max_stack etc...

-	int contentsLength;

-	int code_length = codeStream.position;

-	if (code_length > 65535) {

-		codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(codeStream.methodDeclaration.scope.referenceType());

-	}

-	if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	int max_stack = codeStream.stackMax;

-	localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

-	localContents[codeAttributeOffset + 7] = (byte) max_stack;

-	int max_locals = codeStream.maxLocals;

-	localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

-	localContents[codeAttributeOffset + 9] = (byte) max_locals;

-	localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

-	localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

-	localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

-	localContents[codeAttributeOffset + 13] = (byte) code_length;

-

-	// write the exception table

-	localContents[localContentsOffset++] = 0;

-	localContents[localContentsOffset++] = 1;

-	int start = exceptionHandler[0];

-	localContents[localContentsOffset++] = (byte) (start >> 8);

-	localContents[localContentsOffset++] = (byte) start;

-	int end = exceptionHandler[1];

-	localContents[localContentsOffset++] = (byte) (end >> 8);

-	localContents[localContentsOffset++] = (byte) end;

-	int handlerPC = exceptionHandler[2];

-	localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

-	localContents[localContentsOffset++] = (byte) handlerPC;

-	int nameIndex = constantPool.literalIndexForJavaLangException();

-	localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-	localContents[localContentsOffset++] = (byte) nameIndex;

-	

-	// debug attributes

-	int codeAttributeAttributeOffset = localContentsOffset;

-	int attributeNumber = 0; // leave two bytes for the attribute_length

-	localContentsOffset += 2; // first we handle the linenumber attribute

-

-	// first we handle the linenumber attribute

-	if (codeStream.generateLineNumberAttributes) {

-		/* Create and add the line number attribute (used for debugging) 

-		    * Build the pairs of:

-		    * (bytecodePC lineNumber)

-		    * according to the table of start line indexes and the pcToSourceMap table

-		    * contained into the codestream

-		    */

-		int index = 0, max = startLineIndexes.length;

-		int lineNumberNameIndex = constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

-		localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

-		localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 6;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 1;

-		// first entry at pc = 0

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = (byte) (problemLine >> 8);

-		localContents[localContentsOffset++] = (byte) problemLine;

-		// now we change the size of the line number attribute

-		attributeNumber++;

-	}

-

-	// then we do the local variable attribute

-	if (codeStream.generateLocalVariableTableAttributes) {

-		int localVariableNameIndex = constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

-		if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-			System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+		// update the number of attributes

+		// ensure first that there is enough space available inside the localContents array

+		if (codeAttributeAttributeOffset + 2

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

 		}

-		localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

-		localContents[localContentsOffset++] = (byte) localVariableNameIndex;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 2;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		attributeNumber++;

-	}

-	

-	// update the number of attributes

-	// ensure first that there is enough space available inside the contents array

-	if (codeAttributeAttributeOffset + 2 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

-	localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

-	// update the attribute length

-	int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

-	localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

-	localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

-	localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

-	localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

-	contentsOffset = localContentsOffset;

-}

-/**

- * INTERNAL USE-ONLY

- * That method completes the creation of the code attribute by setting

- * - the attribute_length

- * - max_stack

- * - max_locals

- * - code_length

- * - exception table

- * - and debug attributes if necessary.

- *

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- * @param codeAttributeOffset <CODE>int</CODE>

- * @param exceptionHandler int[] 

- */

-public void completeCodeAttributeForProblemMethod(AbstractMethodDeclaration method, MethodBinding binding, int codeAttributeOffset, int[] exceptionHandler, int[] startLineIndexes) {

-	// reinitialize the localContents with the byte modified by the code stream

-	byte[] localContents = contents = codeStream.bCodeStream;

-	int localContentsOffset = codeStream.classFileOffset;

-	// codeAttributeOffset is the position inside localContents byte array before we started to write// any information about the codeAttribute// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset// to get the right position, 6 for the max_stack etc...

-	int max_stack = codeStream.stackMax;

-	localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

-	localContents[codeAttributeOffset + 7] = (byte) max_stack;

-	int max_locals = codeStream.maxLocals;

-	localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

-	localContents[codeAttributeOffset + 9] = (byte) max_locals;

-	int code_length = codeStream.position;

-	localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

-	localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

-	localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

-	localContents[codeAttributeOffset + 13] = (byte) code_length;

-	// write the exception table

-	int contentsLength;

-	if (localContentsOffset + 50 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	localContents[localContentsOffset++] = 0;

-	localContents[localContentsOffset++] = 1;

-	int start = exceptionHandler[0];

-	localContents[localContentsOffset++] = (byte) (start >> 8);

-	localContents[localContentsOffset++] = (byte) start;

-	int end = exceptionHandler[1];

-	localContents[localContentsOffset++] = (byte) (end >> 8);

-	localContents[localContentsOffset++] = (byte) end;

-	int handlerPC = exceptionHandler[2];

-	localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

-	localContents[localContentsOffset++] = (byte) handlerPC;

-	int nameIndex = constantPool.literalIndexForJavaLangException();

-	localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-	localContents[localContentsOffset++] = (byte) nameIndex; // debug attributes

-	int codeAttributeAttributeOffset = localContentsOffset;

-	int attributeNumber = 0; // leave two bytes for the attribute_length

-	localContentsOffset += 2; // first we handle the linenumber attribute

+		localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

+		localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

 

-	if (codeStream.generateLineNumberAttributes) {

-		/* Create and add the line number attribute (used for debugging) 

-		    * Build the pairs of:

-		    * (bytecodePC lineNumber)

-		    * according to the table of start line indexes and the pcToSourceMap table

-		    * contained into the codestream

-		    */

-		int lineNumberNameIndex = constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

-		localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

-		localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 6;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 1;

-		if (problemLine == 0) {

-			problemLine = searchLineNumber(startLineIndexes, binding.sourceStart());

-		}

-		// first entry at pc = 0

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = 0;

-		localContents[localContentsOffset++] = (byte) (problemLine >> 8);

-		localContents[localContentsOffset++] = (byte) problemLine;

-		// now we change the size of the line number attribute

-		attributeNumber++;

+		// update the attribute length

+		int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

+		localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

+		localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

+		localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

+		localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

+		contentsOffset = localContentsOffset;

 	}

 

-	// then we do the local variable attribute

-	if (codeStream.generateLocalVariableTableAttributes) {

-		// compute the resolved position for the arguments of the method

-		int argSize;

-		int localVariableTableOffset = localContentsOffset;

-		int numberOfEntries = 0;

-		//		codeAttribute.addLocalVariableTableAttribute(this);

-		int localVariableNameIndex = constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

-		if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

-			System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method completes the creation of the code attribute by setting

+	 * - the attribute_length

+	 * - max_stack

+	 * - max_locals

+	 * - code_length

+	 * - exception table

+	 * - and debug attributes if necessary.

+	 *

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 * @param codeAttributeOffset <CODE>int</CODE>

+	 */

+	public void completeCodeAttributeForClinit(int codeAttributeOffset) {

+		// reinitialize the contents with the byte modified by the code stream

+		byte[] localContents = contents = codeStream.bCodeStream;

+		int localContentsOffset = codeStream.classFileOffset;

+		// codeAttributeOffset is the position inside contents byte array before we started to write

+		// any information about the codeAttribute

+		// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

+		// to get the right position, 6 for the max_stack etc...

+		int contentsLength;

+		int code_length = codeStream.position;

+		if (code_length > 65535) {

+			codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(

+				codeStream.methodDeclaration.scope.referenceType());

 		}

-		localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

-		localContents[localContentsOffset++] = (byte) localVariableNameIndex;

-		localContentsOffset += 6; // leave space for attribute_length and local_variable_table_length

-		int descriptorIndex;

-		if (!codeStream.methodDeclaration.isStatic()) {

-			numberOfEntries++;

-			if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-				System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+		if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		int max_stack = codeStream.stackMax;

+		localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

+		localContents[codeAttributeOffset + 7] = (byte) max_stack;

+		int max_locals = codeStream.maxLocals;

+		localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

+		localContents[codeAttributeOffset + 9] = (byte) max_locals;

+		localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

+		localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

+		localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

+		localContents[codeAttributeOffset + 13] = (byte) code_length;

+

+		// write the exception table

+		int exceptionHandlersNumber = codeStream.exceptionHandlersNumber;

+		ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers;

+		int exSize;

+		if (localContentsOffset + (exSize = (exceptionHandlersNumber * 8 + 2))

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents =

+					contents =

+						new byte[contentsLength + (exSize > INCREMENT_SIZE ? exSize : INCREMENT_SIZE)]),

+				0,

+				contentsLength);

+		}

+		// there is no exception table, so we need to offset by 2 the current offset and move 

+		// on the attribute generation

+		localContents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8);

+		localContents[localContentsOffset++] = (byte) exceptionHandlersNumber;

+		for (int i = 0; i < exceptionHandlersNumber; i++) {

+			ExceptionLabel exceptionHandler = exceptionHandlers[i];

+			int start = exceptionHandler.start;

+			localContents[localContentsOffset++] = (byte) (start >> 8);

+			localContents[localContentsOffset++] = (byte) start;

+			int end = exceptionHandler.end;

+			localContents[localContentsOffset++] = (byte) (end >> 8);

+			localContents[localContentsOffset++] = (byte) end;

+			int handlerPC = exceptionHandler.position;

+			localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

+			localContents[localContentsOffset++] = (byte) handlerPC;

+			if (exceptionHandler.exceptionType == null) {

+				// any exception handler

+				localContentsOffset += 2;

+			} else {

+				int nameIndex;

+				if (exceptionHandler.exceptionType == TypeBinding.NullBinding) {

+					/* represents denote ClassNotFoundException, see class literal access*/

+					nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException();

+				} else {

+					nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType);

+				}

+				localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) nameIndex;

 			}

-			localContents[localContentsOffset++] = 0;

-			localContents[localContentsOffset++] = 0;

-			localContents[localContentsOffset++] = (byte) (code_length >> 8);

-			localContents[localContentsOffset++] = (byte) code_length;

-			nameIndex = constantPool.literalIndex(QualifiedNamesConstants.This);

-			localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-			localContents[localContentsOffset++] = (byte) nameIndex;

-			descriptorIndex = constantPool.literalIndex(codeStream.methodDeclaration.binding.declaringClass.signature());

-			localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

-			localContents[localContentsOffset++] = (byte) descriptorIndex;

-			// the resolved position for this is always 0

-			localContents[localContentsOffset++] = 0;

-			localContents[localContentsOffset++] = 0;

 		}

-		if (binding.isConstructor()) {

-			ReferenceBinding declaringClass = binding.declaringClass;

-			if (declaringClass.isNestedType()) {

-				NestedTypeBinding methodDeclaringClass = (NestedTypeBinding) declaringClass;

-				argSize = methodDeclaringClass.syntheticArgumentsOffset;

-				SyntheticArgumentBinding[] syntheticArguments;

-				if ((syntheticArguments = methodDeclaringClass.syntheticEnclosingInstances()) != null) {

-					for (int i = 0, max = syntheticArguments.length; i < max; i++) {

-						LocalVariableBinding localVariable = syntheticArguments[i];

+		// debug attributes

+		int codeAttributeAttributeOffset = localContentsOffset;

+		int attributeNumber = 0;

+		// leave two bytes for the attribute_length

+		localContentsOffset += 2;

+

+		// first we handle the linenumber attribute

+		if (codeStream.generateLineNumberAttributes) {

+			/* Create and add the line number attribute (used for debugging) 

+			 * Build the pairs of:

+			 * 	(bytecodePC lineNumber)

+			 * according to the table of start line indexes and the pcToSourceMap table

+			 * contained into the codestream

+			 */

+			int[] pcToSourceMapTable;

+			if (((pcToSourceMapTable = codeStream.pcToSourceMap) != null)

+				&& (codeStream.pcToSourceMapSize != 0)) {

+				int lineNumberNameIndex =

+					constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

+				if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

+					System.arraycopy(

+						contents,

+						0,

+						(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+						0,

+						contentsLength);

+				}

+				localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

+				int lineNumberTableOffset = localContentsOffset;

+				localContentsOffset += 6;

+				// leave space for attribute_length and line_number_table_length

+				int numberOfEntries = 0;

+				int length = codeStream.pcToSourceMapSize;

+				for (int i = 0; i < length;) {

+					// write the entry

+					if (localContentsOffset + 4 >= (contentsLength = localContents.length)) {

+						System.arraycopy(

+							contents,

+							0,

+							(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+							0,

+							contentsLength);

+					}

+					int pc = pcToSourceMapTable[i++];

+					localContents[localContentsOffset++] = (byte) (pc >> 8);

+					localContents[localContentsOffset++] = (byte) pc;

+					int lineNumber = pcToSourceMapTable[i++];

+					localContents[localContentsOffset++] = (byte) (lineNumber >> 8);

+					localContents[localContentsOffset++] = (byte) lineNumber;

+					numberOfEntries++;

+				}

+				// now we change the size of the line number attribute

+				int lineNumberAttr_length = numberOfEntries * 4 + 2;

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 24);

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 16);

+				localContents[lineNumberTableOffset++] = (byte) (lineNumberAttr_length >> 8);

+				localContents[lineNumberTableOffset++] = (byte) lineNumberAttr_length;

+				localContents[lineNumberTableOffset++] = (byte) (numberOfEntries >> 8);

+				localContents[lineNumberTableOffset++] = (byte) numberOfEntries;

+				attributeNumber++;

+			}

+		}

+		// then we do the local variable attribute

+		if (codeStream.generateLocalVariableTableAttributes) {

+			int localVariableTableOffset = localContentsOffset;

+			int numberOfEntries = 0;

+			//		codeAttribute.addLocalVariableTableAttribute(this);

+			if ((codeStream.pcToSourceMap != null)

+				&& (codeStream.pcToSourceMapSize != 0)) {

+				int localVariableNameIndex =

+					constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

+				if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

+					System.arraycopy(

+						contents,

+						0,

+						(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+						0,

+						contentsLength);

+				}

+				localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) localVariableNameIndex;

+				localContentsOffset += 6;

+				// leave space for attribute_length and local_variable_table_length

+				int nameIndex;

+				int descriptorIndex;

+				for (int i = 0; i < codeStream.allLocalsCounter; i++) {

+					LocalVariableBinding localVariable = codeStream.locals[i];

+					for (int j = 0; j < localVariable.initializationCount; j++) {

+						int startPC = localVariable.initializationPCs[j << 1];

+						int endPC = localVariable.initializationPCs[(j << 1) + 1];

+						if (startPC != endPC) { // only entries for non zero length

+							int currentLength;

+							if (endPC == -1) {

+								localVariable.declaringScope.problemReporter().abortDueToInternalError(

+									Util.bind("abort.invalidAttribute" , new String(localVariable.name)), //$NON-NLS-1$

+									(AstNode) localVariable.declaringScope.methodScope().referenceContext);

+							}

+							if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

+								System.arraycopy(

+									contents,

+									0,

+									(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+									0,

+									contentsLength);

+							}

+							// now we can safely add the local entry

+							numberOfEntries++;

+							localContents[localContentsOffset++] = (byte) (startPC >> 8);

+							localContents[localContentsOffset++] = (byte) startPC;

+							int length = endPC - startPC;

+							localContents[localContentsOffset++] = (byte) (length >> 8);

+							localContents[localContentsOffset++] = (byte) length;

+							nameIndex = constantPool.literalIndex(localVariable.name);

+							localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+							localContents[localContentsOffset++] = (byte) nameIndex;

+							descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

+							localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

+							localContents[localContentsOffset++] = (byte) descriptorIndex;

+							int resolvedPosition = localVariable.resolvedPosition;

+							localContents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

+							localContents[localContentsOffset++] = (byte) resolvedPosition;

+						}

+					}

+				}

+				int value = numberOfEntries * 10 + 2;

+				localVariableTableOffset += 2;

+				localContents[localVariableTableOffset++] = (byte) (value >> 24);

+				localContents[localVariableTableOffset++] = (byte) (value >> 16);

+				localContents[localVariableTableOffset++] = (byte) (value >> 8);

+				localContents[localVariableTableOffset++] = (byte) value;

+				localContents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

+				localContents[localVariableTableOffset] = (byte) numberOfEntries;

+				attributeNumber++;

+			}

+		}

+		// update the number of attributes

+		// ensure first that there is enough space available inside the contents array

+		if (codeAttributeAttributeOffset + 2

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

+		localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

+		// update the attribute length

+		int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

+		localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

+		localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

+		localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

+		localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

+		contentsOffset = localContentsOffset;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method completes the creation of the code attribute by setting

+	 * - the attribute_length

+	 * - max_stack

+	 * - max_locals

+	 * - code_length

+	 * - exception table

+	 * - and debug attributes if necessary.

+	 *

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 * @param codeAttributeOffset <CODE>int</CODE>

+	 * @param exceptionHandler int[]

+	 * @param startIndexes int[]

+	 */

+	public void completeCodeAttributeForClinit(

+		int codeAttributeOffset,

+		int[] exceptionHandler,

+		int[] startLineIndexes) {

+		// reinitialize the contents with the byte modified by the code stream

+		byte[] localContents = contents = codeStream.bCodeStream;

+		int localContentsOffset = codeStream.classFileOffset;

+		// codeAttributeOffset is the position inside contents byte array before we started to write

+		// any information about the codeAttribute

+		// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

+		// to get the right position, 6 for the max_stack etc...

+		int contentsLength;

+		int code_length = codeStream.position;

+		if (code_length > 65535) {

+			codeStream.methodDeclaration.scope.problemReporter().bytecodeExceeds64KLimit(

+				codeStream.methodDeclaration.scope.referenceType());

+		}

+		if (localContentsOffset + 20 >= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		int max_stack = codeStream.stackMax;

+		localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

+		localContents[codeAttributeOffset + 7] = (byte) max_stack;

+		int max_locals = codeStream.maxLocals;

+		localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

+		localContents[codeAttributeOffset + 9] = (byte) max_locals;

+		localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

+		localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

+		localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

+		localContents[codeAttributeOffset + 13] = (byte) code_length;

+

+		// write the exception table

+		localContents[localContentsOffset++] = 0;

+		localContents[localContentsOffset++] = 1;

+		int start = exceptionHandler[0];

+		localContents[localContentsOffset++] = (byte) (start >> 8);

+		localContents[localContentsOffset++] = (byte) start;

+		int end = exceptionHandler[1];

+		localContents[localContentsOffset++] = (byte) (end >> 8);

+		localContents[localContentsOffset++] = (byte) end;

+		int handlerPC = exceptionHandler[2];

+		localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

+		localContents[localContentsOffset++] = (byte) handlerPC;

+		int nameIndex = constantPool.literalIndexForJavaLangException();

+		localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+		localContents[localContentsOffset++] = (byte) nameIndex;

+

+		// debug attributes

+		int codeAttributeAttributeOffset = localContentsOffset;

+		int attributeNumber = 0; // leave two bytes for the attribute_length

+		localContentsOffset += 2; // first we handle the linenumber attribute

+

+		// first we handle the linenumber attribute

+		if (codeStream.generateLineNumberAttributes) {

+			/* Create and add the line number attribute (used for debugging) 

+			    * Build the pairs of:

+			    * (bytecodePC lineNumber)

+			    * according to the table of start line indexes and the pcToSourceMap table

+			    * contained into the codestream

+			    */

+			int index = 0, max = startLineIndexes.length;

+			int lineNumberNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

+			localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

+			localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 6;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 1;

+			// first entry at pc = 0

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = (byte) (problemLine >> 8);

+			localContents[localContentsOffset++] = (byte) problemLine;

+			// now we change the size of the line number attribute

+			attributeNumber++;

+		}

+		// then we do the local variable attribute

+		if (codeStream.generateLocalVariableTableAttributes) {

+			int localVariableNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

+			if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

+			}

+			localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

+			localContents[localContentsOffset++] = (byte) localVariableNameIndex;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 2;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			attributeNumber++;

+		}

+		// update the number of attributes

+		// ensure first that there is enough space available inside the contents array

+		if (codeAttributeAttributeOffset + 2

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

+		localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

+		// update the attribute length

+		int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

+		localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

+		localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

+		localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

+		localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

+		contentsOffset = localContentsOffset;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method completes the creation of the code attribute by setting

+	 * - the attribute_length

+	 * - max_stack

+	 * - max_locals

+	 * - code_length

+	 * - exception table

+	 * - and debug attributes if necessary.

+	 *

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 * @param codeAttributeOffset <CODE>int</CODE>

+	 * @param exceptionHandler int[] 

+	 */

+	public void completeCodeAttributeForProblemMethod(

+		AbstractMethodDeclaration method,

+		MethodBinding binding,

+		int codeAttributeOffset,

+		int[] exceptionHandler,

+		int[] startLineIndexes) {

+		// reinitialize the localContents with the byte modified by the code stream

+		byte[] localContents = contents = codeStream.bCodeStream;

+		int localContentsOffset = codeStream.classFileOffset;

+		// codeAttributeOffset is the position inside localContents byte array before we started to write// any information about the codeAttribute// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset// to get the right position, 6 for the max_stack etc...

+		int max_stack = codeStream.stackMax;

+		localContents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

+		localContents[codeAttributeOffset + 7] = (byte) max_stack;

+		int max_locals = codeStream.maxLocals;

+		localContents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

+		localContents[codeAttributeOffset + 9] = (byte) max_locals;

+		int code_length = codeStream.position;

+		localContents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

+		localContents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

+		localContents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

+		localContents[codeAttributeOffset + 13] = (byte) code_length;

+		// write the exception table

+		int contentsLength;

+		if (localContentsOffset + 50 >= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		localContents[localContentsOffset++] = 0;

+		localContents[localContentsOffset++] = 1;

+		int start = exceptionHandler[0];

+		localContents[localContentsOffset++] = (byte) (start >> 8);

+		localContents[localContentsOffset++] = (byte) start;

+		int end = exceptionHandler[1];

+		localContents[localContentsOffset++] = (byte) (end >> 8);

+		localContents[localContentsOffset++] = (byte) end;

+		int handlerPC = exceptionHandler[2];

+		localContents[localContentsOffset++] = (byte) (handlerPC >> 8);

+		localContents[localContentsOffset++] = (byte) handlerPC;

+		int nameIndex = constantPool.literalIndexForJavaLangException();

+		localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+		localContents[localContentsOffset++] = (byte) nameIndex; // debug attributes

+		int codeAttributeAttributeOffset = localContentsOffset;

+		int attributeNumber = 0; // leave two bytes for the attribute_length

+		localContentsOffset += 2; // first we handle the linenumber attribute

+

+		if (codeStream.generateLineNumberAttributes) {

+			/* Create and add the line number attribute (used for debugging) 

+			    * Build the pairs of:

+			    * (bytecodePC lineNumber)

+			    * according to the table of start line indexes and the pcToSourceMap table

+			    * contained into the codestream

+			    */

+			int lineNumberNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

+			localContents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

+			localContents[localContentsOffset++] = (byte) lineNumberNameIndex;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 6;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 1;

+			if (problemLine == 0) {

+				problemLine = searchLineNumber(startLineIndexes, binding.sourceStart());

+			}

+			// first entry at pc = 0

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = 0;

+			localContents[localContentsOffset++] = (byte) (problemLine >> 8);

+			localContents[localContentsOffset++] = (byte) problemLine;

+			// now we change the size of the line number attribute

+			attributeNumber++;

+		}

+		// then we do the local variable attribute

+		if (codeStream.generateLocalVariableTableAttributes) {

+			// compute the resolved position for the arguments of the method

+			int argSize;

+			int localVariableTableOffset = localContentsOffset;

+			int numberOfEntries = 0;

+			//		codeAttribute.addLocalVariableTableAttribute(this);

+			int localVariableNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

+			if (localContentsOffset + 8 >= (contentsLength = localContents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

+			}

+			localContents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

+			localContents[localContentsOffset++] = (byte) localVariableNameIndex;

+			localContentsOffset += 6;

+			// leave space for attribute_length and local_variable_table_length

+			int descriptorIndex;

+			if (!codeStream.methodDeclaration.isStatic()) {

+				numberOfEntries++;

+				if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

+					System.arraycopy(

+						contents,

+						0,

+						(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+						0,

+						contentsLength);

+				}

+				localContents[localContentsOffset++] = 0;

+				localContents[localContentsOffset++] = 0;

+				localContents[localContentsOffset++] = (byte) (code_length >> 8);

+				localContents[localContentsOffset++] = (byte) code_length;

+				nameIndex = constantPool.literalIndex(QualifiedNamesConstants.This);

+				localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+				localContents[localContentsOffset++] = (byte) nameIndex;

+				descriptorIndex =

+					constantPool.literalIndex(

+						codeStream.methodDeclaration.binding.declaringClass.signature());

+				localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

+				localContents[localContentsOffset++] = (byte) descriptorIndex;

+				// the resolved position for this is always 0

+				localContents[localContentsOffset++] = 0;

+				localContents[localContentsOffset++] = 0;

+			}

+			if (binding.isConstructor()) {

+				ReferenceBinding declaringClass = binding.declaringClass;

+				if (declaringClass.isNestedType()) {

+					NestedTypeBinding methodDeclaringClass = (NestedTypeBinding) declaringClass;

+					argSize = methodDeclaringClass.syntheticArgumentsOffset;

+					SyntheticArgumentBinding[] syntheticArguments;

+					if ((syntheticArguments = methodDeclaringClass.syntheticEnclosingInstances())

+						!= null) {

+						for (int i = 0, max = syntheticArguments.length; i < max; i++) {

+							LocalVariableBinding localVariable = syntheticArguments[i];

+							int currentLength;

+							if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

+								System.arraycopy(

+									contents,

+									0,

+									(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+									0,

+									contentsLength);

+							}

+							// now we can safely add the local entry

+							numberOfEntries++;

+							localContents[localContentsOffset++] = 0;

+							localContents[localContentsOffset++] = 0;

+							localContents[localContentsOffset++] = (byte) (code_length >> 8);

+							localContents[localContentsOffset++] = (byte) code_length;

+							nameIndex = constantPool.literalIndex(localVariable.name);

+							localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

+							localContents[localContentsOffset++] = (byte) nameIndex;

+							descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

+							localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

+							localContents[localContentsOffset++] = (byte) descriptorIndex;

+							int resolvedPosition = localVariable.resolvedPosition;

+							localContents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

+							localContents[localContentsOffset++] = (byte) resolvedPosition;

+						}

+					}

+				} else {

+					argSize = 1;

+				}

+			} else {

+				argSize = binding.isStatic() ? 0 : 1;

+			}

+			if (method.binding != null) {

+				TypeBinding[] parameters = method.binding.parameters;

+				Argument[] arguments = method.arguments;

+				if ((parameters != null) && (arguments != null)) {

+					for (int i = 0, max = parameters.length; i < max; i++) {

+						TypeBinding argumentBinding = parameters[i];

 						int currentLength;

 						if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-							System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+							System.arraycopy(

+								contents,

+								0,

+								(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+								0,

+								contentsLength);

 						}

 						// now we can safely add the local entry

 						numberOfEntries++;

@@ -1713,722 +2055,808 @@
 						localContents[localContentsOffset++] = 0;

 						localContents[localContentsOffset++] = (byte) (code_length >> 8);

 						localContents[localContentsOffset++] = (byte) code_length;

-						nameIndex = constantPool.literalIndex(localVariable.name);

+						nameIndex = constantPool.literalIndex(arguments[i].name);

 						localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

 						localContents[localContentsOffset++] = (byte) nameIndex;

-						descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

+						descriptorIndex = constantPool.literalIndex(argumentBinding.signature());

 						localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

 						localContents[localContentsOffset++] = (byte) descriptorIndex;

-						int resolvedPosition = localVariable.resolvedPosition;

+						int resolvedPosition = argSize;

+						if ((argumentBinding == TypeBinding.LongBinding)

+							|| (argumentBinding == TypeBinding.DoubleBinding))

+							argSize += 2;

+						else

+							argSize++;

 						localContents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

 						localContents[localContentsOffset++] = (byte) resolvedPosition;

 					}

 				}

+			}

+			int value = numberOfEntries * 10 + 2;

+			localVariableTableOffset += 2;

+			localContents[localVariableTableOffset++] = (byte) (value >> 24);

+			localContents[localVariableTableOffset++] = (byte) (value >> 16);

+			localContents[localVariableTableOffset++] = (byte) (value >> 8);

+			localContents[localVariableTableOffset++] = (byte) value;

+			localContents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

+			localContents[localVariableTableOffset] = (byte) numberOfEntries;

+			attributeNumber++;

+		}

+		// update the number of attributes// ensure first that there is enough space available inside the localContents array

+		if (codeAttributeAttributeOffset + 2

+			>= (contentsLength = localContents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(localContents = contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

+		localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

+		// update the attribute length

+		int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

+		localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

+		localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

+		localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

+		localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

+		contentsOffset = localContentsOffset;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method completes the creation of the code attribute by setting

+	 * - the attribute_length

+	 * - max_stack

+	 * - max_locals

+	 * - code_length

+	 * - exception table

+	 * - and debug attributes if necessary.

+	 *

+	 * @param binding org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 * @param codeAttributeOffset <CODE>int</CODE>

+	 */

+	public void completeCodeAttributeForSyntheticAccessMethod(

+		SyntheticAccessMethodBinding binding,

+		int codeAttributeOffset,

+		int[] startLineIndexes) {

+		// reinitialize the contents with the byte modified by the code stream

+		contents = codeStream.bCodeStream;

+		int localContentsOffset = codeStream.classFileOffset;

+		// codeAttributeOffset is the position inside contents byte array before we started to write

+		// any information about the codeAttribute

+		// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

+		// to get the right position, 6 for the max_stack etc...

+		int max_stack = codeStream.stackMax;

+		contents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

+		contents[codeAttributeOffset + 7] = (byte) max_stack;

+		int max_locals = codeStream.maxLocals;

+		contents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

+		contents[codeAttributeOffset + 9] = (byte) max_locals;

+		int code_length = codeStream.position;

+		contents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

+		contents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

+		contents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

+		contents[codeAttributeOffset + 13] = (byte) code_length;

+		int contentsLength;

+		if ((localContentsOffset + 40) >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		// there is no exception table, so we need to offset by 2 the current offset and move 

+		// on the attribute generation

+		localContentsOffset += 2;

+		// debug attributes

+		int codeAttributeAttributeOffset = localContentsOffset;

+		int attributeNumber = 0;

+		// leave two bytes for the attribute_length

+		localContentsOffset += 2;

+

+		// first we handle the linenumber attribute

+		if (codeStream.generateLineNumberAttributes) {

+			int index = 0, max = startLineIndexes.length;

+			int lineNumberNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

+			contents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

+			contents[localContentsOffset++] = (byte) lineNumberNameIndex;

+			int lineNumberTableOffset = localContentsOffset;

+			localContentsOffset += 6;

+			// leave space for attribute_length and line_number_table_length

+			// Seems like do would be better, but this preserves the existing behavior.

+			index = searchLineNumber(startLineIndexes, binding.sourceStart);

+			contents[localContentsOffset++] = 0;

+			contents[localContentsOffset++] = 0;

+			contents[localContentsOffset++] = (byte) (index >> 8);

+			contents[localContentsOffset++] = (byte) index;

+			// now we change the size of the line number attribute

+			contents[lineNumberTableOffset++] = 0;

+			contents[lineNumberTableOffset++] = 0;

+			contents[lineNumberTableOffset++] = 0;

+			contents[lineNumberTableOffset++] = 6;

+			contents[lineNumberTableOffset++] = 0;

+			contents[lineNumberTableOffset++] = 1;

+			attributeNumber++;

+		}

+		// then we do the local variable attribute

+		if (codeStream.generateLocalVariableTableAttributes) {

+			int localVariableTableOffset = localContentsOffset;

+			int numberOfEntries = 0;

+			int localVariableNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

+			if (localContentsOffset + 8 > (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents = new byte[contentsLength + INCREMENT_SIZE]),

+					0,

+					contentsLength);

+			}

+			contents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

+			contents[localContentsOffset++] = (byte) localVariableNameIndex;

+			localContentsOffset += 6;

+			// leave space for attribute_length and local_variable_table_length

+			int nameIndex;

+			int descriptorIndex;

+			for (int i = 0; i < codeStream.allLocalsCounter; i++) {

+				LocalVariableBinding localVariable = codeStream.locals[i];

+				for (int j = 0; j < localVariable.initializationCount; j++) {

+					int startPC = localVariable.initializationPCs[j << 1];

+					int endPC = localVariable.initializationPCs[(j << 1) + 1];

+					if (startPC != endPC) { // only entries for non zero length

+						int currentLength;

+						if (endPC == -1) {

+							localVariable.declaringScope.problemReporter().abortDueToInternalError(

+								Util.bind("abort.invalidAttribute" , new String(localVariable.name)), //$NON-NLS-1$

+								(AstNode) localVariable.declaringScope.methodScope().referenceContext);

+						}

+						if (localContentsOffset + 10 > (contentsLength = contents.length)) {

+							System.arraycopy(

+								contents,

+								0,

+								(contents = new byte[contentsLength + INCREMENT_SIZE]),

+								0,

+								contentsLength);

+						}

+						// now we can safely add the local entry

+						numberOfEntries++;

+						contents[localContentsOffset++] = (byte) (startPC >> 8);

+						contents[localContentsOffset++] = (byte) startPC;

+						int length = endPC - startPC;

+						contents[localContentsOffset++] = (byte) (length >> 8);

+						contents[localContentsOffset++] = (byte) length;

+						nameIndex = constantPool.literalIndex(localVariable.name);

+						contents[localContentsOffset++] = (byte) (nameIndex >> 8);

+						contents[localContentsOffset++] = (byte) nameIndex;

+						descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

+						contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

+						contents[localContentsOffset++] = (byte) descriptorIndex;

+						int resolvedPosition = localVariable.resolvedPosition;

+						contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

+						contents[localContentsOffset++] = (byte) resolvedPosition;

+					}

+				}

+			}

+			int value = numberOfEntries * 10 + 2;

+			localVariableTableOffset += 2;

+			contents[localVariableTableOffset++] = (byte) (value >> 24);

+			contents[localVariableTableOffset++] = (byte) (value >> 16);

+			contents[localVariableTableOffset++] = (byte) (value >> 8);

+			contents[localVariableTableOffset++] = (byte) value;

+			contents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

+			contents[localVariableTableOffset] = (byte) numberOfEntries;

+			attributeNumber++;

+		}

+		// update the number of attributes

+		// ensure first that there is enough space available inside the contents array

+		if (codeAttributeAttributeOffset + 2 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		contents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[codeAttributeAttributeOffset] = (byte) attributeNumber;

+

+		// update the attribute length

+		int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

+		contents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

+		contents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

+		contents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

+		contents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

+		contentsOffset = localContentsOffset;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Complete the creation of a method info by setting up the number of attributes at the right offset.

+	 *

+	 * @param methodAttributeOffset <CODE>int</CODE>

+	 * @param attributeNumber <CODE>int</CODE> 

+	 */

+	public void completeMethodInfo(

+		int methodAttributeOffset,

+		int attributeNumber) {

+		// update the number of attributes

+		contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);

+		contents[methodAttributeOffset] = (byte) attributeNumber;

+	}

+

+	/*

+	 * INTERNAL USE-ONLY

+	 * Innerclasses get their name computed as they are generated, since some may not

+	 * be actually outputed if sitting inside unreachable code.

+	 *

+	 * @param localType org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding

+	 */

+	public char[] computeConstantPoolName(LocalTypeBinding localType) {

+		if (localType.constantPoolName() != null) {

+			return localType.constantPoolName();

+		}

+		// delegates to the outermost enclosing classfile, since it is the only one with a global vision of its innertypes.

+		if (enclosingClassFile != null) {

+			return this.outerMostEnclosingClassFile().computeConstantPoolName(localType);

+		}

+		if (nameUsage == null)

+			nameUsage = new HashtableOfType();

+

+		// ensure there is not already such a local type name defined by the user

+		int index = 0;

+		char[] candidateName;

+		while(true) {

+			if (localType.isMemberType()){

+				if (index == 0){

+					candidateName = CharOperation.concat(

+						localType.enclosingType().constantPoolName(),

+						localType.sourceName,

+						'$');

+				} else {

+					// in case of collision, then member name gets extra $1 inserted

+					// e.g. class X { { class L{} new X(){ class L{} } } }

+					candidateName = CharOperation.concat(

+						localType.enclosingType().constantPoolName(),

+						'$',

+						String.valueOf(index).toCharArray(),

+						'$',

+						localType.sourceName);

+				}

+			} else if (localType.isAnonymousType()){

+					candidateName = CharOperation.concat(

+						referenceBinding.constantPoolName(),

+						String.valueOf(index+1).toCharArray(),

+						'$');

 			} else {

-				argSize = 1;

+					candidateName = CharOperation.concat(

+						referenceBinding.constantPoolName(),

+						'$',

+						String.valueOf(index+1).toCharArray(),

+						'$',

+						localType.sourceName);

+			}						

+			if (nameUsage.get(candidateName) != null) {

+				index ++;

+			} else {

+				nameUsage.put(candidateName, localType);

+				break;

 			}

+		}

+		return candidateName;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Request the creation of a ClassFile compatible representation of a problematic type

+	 *

+	 * @param typeDeclaration org.eclipse.jdt.internal.compiler.ast.TypeDeclaration

+	 * @param unitResult org.eclipse.jdt.internal.compiler.CompilationUnitResult

+	 */

+	public static void createProblemType(

+		TypeDeclaration typeDeclaration,

+		CompilationResult unitResult) {

+		SourceTypeBinding typeBinding = typeDeclaration.binding;

+		ClassFile classFile = new ClassFile(typeBinding, null, true);

+

+		// inner attributes

+		if (typeBinding.isMemberType())

+			classFile.recordEnclosingTypeAttributes(typeBinding);

+

+		// add its fields

+		FieldBinding[] fields = typeBinding.fields;

+		if ((fields != null) && (fields != NoFields)) {

+			for (int i = 0, max = fields.length; i < max; i++) {

+				if (fields[i].constant == null) {

+					FieldReference.getConstantFor(fields[i], false, null, 0);

+				}

+			}

+			classFile.addFieldInfos();

 		} else {

-			argSize = binding.isStatic() ? 0 : 1;

+			// we have to set the number of fields to be equals to 0

+			classFile.contents[classFile.contentsOffset++] = 0;

+			classFile.contents[classFile.contentsOffset++] = 0;

 		}

-		if (method.binding != null) {

-			TypeBinding[] parameters = method.binding.parameters;

-			Argument[] arguments = method.arguments;

-			if ((parameters != null) && (arguments != null)) {

-				for (int i = 0, max = parameters.length; i < max; i++) {

-					TypeBinding argumentBinding = parameters[i];

-					int currentLength;

-					if (localContentsOffset + 10 >= (contentsLength = localContents.length)) {

-						System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-					}

-					// now we can safely add the local entry

-					numberOfEntries++;

-					localContents[localContentsOffset++] = 0;

-					localContents[localContentsOffset++] = 0;

-					localContents[localContentsOffset++] = (byte) (code_length >> 8);

-					localContents[localContentsOffset++] = (byte) code_length;

-					nameIndex = constantPool.literalIndex(arguments[i].name);

-					localContents[localContentsOffset++] = (byte) (nameIndex >> 8);

-					localContents[localContentsOffset++] = (byte) nameIndex;

-					descriptorIndex = constantPool.literalIndex(argumentBinding.signature());

-					localContents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

-					localContents[localContentsOffset++] = (byte) descriptorIndex;

-					int resolvedPosition = argSize;

-					if ((argumentBinding == TypeBinding.LongBinding) || (argumentBinding == TypeBinding.DoubleBinding))

-						argSize += 2;

-					else

-						argSize++;

-					localContents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

-					localContents[localContentsOffset++] = (byte) resolvedPosition;

-				}

-			}

+		// leave some space for the methodCount

+		classFile.setForMethodInfos();

+		// add its user defined methods

+		MethodBinding[] methods = typeBinding.methods;

+		AbstractMethodDeclaration[] methodDeclarations = typeDeclaration.methods;

+		int maxMethodDecl = methodDeclarations == null ? 0 : methodDeclarations.length;

+		int problemsLength;

+		IProblem[] problems = unitResult.getProblems();

+		if (problems == null) {

+			problems = new IProblem[0];

 		}

-		int value = numberOfEntries * 10 + 2;

-		localVariableTableOffset += 2;

-		localContents[localVariableTableOffset++] = (byte) (value >> 24);

-		localContents[localVariableTableOffset++] = (byte) (value >> 16);

-		localContents[localVariableTableOffset++] = (byte) (value >> 8);

-		localContents[localVariableTableOffset++] = (byte) value;

-		localContents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

-		localContents[localVariableTableOffset] = (byte) numberOfEntries;

-		attributeNumber++;

-	}

-

-	// update the number of attributes// ensure first that there is enough space available inside the localContents array

-	if (codeAttributeAttributeOffset + 2 >= (contentsLength = localContents.length)) {

-		System.arraycopy(contents, 0, (localContents = contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	localContents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

-	localContents[codeAttributeAttributeOffset] = (byte) attributeNumber;

-	// update the attribute length

-	int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

-	localContents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

-	localContents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

-	localContents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

-	localContents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

-	contentsOffset = localContentsOffset;

-}

-/**

- * INTERNAL USE-ONLY

- * That method completes the creation of the code attribute by setting

- * - the attribute_length

- * - max_stack

- * - max_locals

- * - code_length

- * - exception table

- * - and debug attributes if necessary.

- *

- * @param binding org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- * @param codeAttributeOffset <CODE>int</CODE>

- */

-public void completeCodeAttributeForSyntheticAccessMethod(SyntheticAccessMethodBinding binding, int codeAttributeOffset, int[] startLineIndexes) {

-	// reinitialize the contents with the byte modified by the code stream

-	contents = codeStream.bCodeStream;

-	int localContentsOffset = codeStream.classFileOffset;

-	// codeAttributeOffset is the position inside contents byte array before we started to write

-	// any information about the codeAttribute

-	// That means that to write the attribute_length you need to offset by 2 the value of codeAttributeOffset

-	// to get the right position, 6 for the max_stack etc...

-	int max_stack = codeStream.stackMax;

-	contents[codeAttributeOffset + 6] = (byte) (max_stack >> 8);

-	contents[codeAttributeOffset + 7] = (byte) max_stack;

-	int max_locals = codeStream.maxLocals;

-	contents[codeAttributeOffset + 8] = (byte) (max_locals >> 8);

-	contents[codeAttributeOffset + 9] = (byte) max_locals;

-	int code_length = codeStream.position;

-	contents[codeAttributeOffset + 10] = (byte) (code_length >> 24);

-	contents[codeAttributeOffset + 11] = (byte) (code_length >> 16);

-	contents[codeAttributeOffset + 12] = (byte) (code_length >> 8);

-	contents[codeAttributeOffset + 13] = (byte) code_length;

-	int contentsLength;

-	if ((localContentsOffset + 40) >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	// there is no exception table, so we need to offset by 2 the current offset and move 

-	// on the attribute generation

-	localContentsOffset += 2;

-	// debug attributes

-	int codeAttributeAttributeOffset = localContentsOffset;

-	int attributeNumber = 0;

-	// leave two bytes for the attribute_length

-	localContentsOffset += 2;

-

-	// first we handle the linenumber attribute

-	if (codeStream.generateLineNumberAttributes) {

-		int index = 0, max = startLineIndexes.length;

-		int lineNumberNameIndex = constantPool.literalIndex(AttributeNamesConstants.LineNumberTableName);

-		contents[localContentsOffset++] = (byte) (lineNumberNameIndex >> 8);

-		contents[localContentsOffset++] = (byte) lineNumberNameIndex;

-		int lineNumberTableOffset = localContentsOffset;

-		localContentsOffset += 6; // leave space for attribute_length and line_number_table_length

-		// Seems like do would be better, but this preserves the existing behavior.

-		index = searchLineNumber(startLineIndexes, binding.sourceStart);

-		contents[localContentsOffset++] = 0;

-		contents[localContentsOffset++] = 0;

-		contents[localContentsOffset++] = (byte) (index >> 8);

-		contents[localContentsOffset++] = (byte) index;

-		// now we change the size of the line number attribute

-		contents[lineNumberTableOffset++] = 0;

-		contents[lineNumberTableOffset++] = 0;

-		contents[lineNumberTableOffset++] = 0;

-		contents[lineNumberTableOffset++] = 6;

-		contents[lineNumberTableOffset++] = 0;

-		contents[lineNumberTableOffset++] = 1;

-		attributeNumber++;

-	}

-

-	// then we do the local variable attribute

-	if (codeStream.generateLocalVariableTableAttributes) {

-		int localVariableTableOffset = localContentsOffset;

-		int numberOfEntries = 0;

-		int localVariableNameIndex = constantPool.literalIndex(AttributeNamesConstants.LocalVariableTableName);

-		if (localContentsOffset + 8 > (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-		}

-		contents[localContentsOffset++] = (byte) (localVariableNameIndex >> 8);

-		contents[localContentsOffset++] = (byte) localVariableNameIndex;

-		localContentsOffset += 6; // leave space for attribute_length and local_variable_table_length

-		int nameIndex;

-		int descriptorIndex;

-		for (int i = 0; i < codeStream.allLocalsCounter; i++) {

-			LocalVariableBinding localVariable = codeStream.locals[i];

-			for (int j = 0; j < localVariable.initializationCount; j++) {

-				int startPC = localVariable.initializationPCs[j << 1];

-				int endPC = localVariable.initializationPCs[(j << 1) + 1];

-				if (startPC != endPC) { // only entries for non zero length

-					int currentLength;

-					if (endPC == -1) {

-						localVariable.declaringScope.problemReporter().abortDueToInternalError(Util.bind("abort.invalidAttribute"/*nonNLS*/,new String(localVariable.name)), (AstNode) localVariable.declaringScope.methodScope().referenceContext);

-					}

-					if (localContentsOffset + 10 > (contentsLength = contents.length)) {

-						System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-					}

-					// now we can safely add the local entry

-					numberOfEntries++;

-					contents[localContentsOffset++] = (byte) (startPC >> 8);

-					contents[localContentsOffset++] = (byte) startPC;

-					int length = endPC - startPC;

-					contents[localContentsOffset++] = (byte) (length >> 8);

-					contents[localContentsOffset++] = (byte) length;

-					nameIndex = constantPool.literalIndex(localVariable.name);

-					contents[localContentsOffset++] = (byte) (nameIndex >> 8);

-					contents[localContentsOffset++] = (byte) nameIndex;

-					descriptorIndex = constantPool.literalIndex(localVariable.type.signature());

-					contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);

-					contents[localContentsOffset++] = (byte) descriptorIndex;

-					int resolvedPosition = localVariable.resolvedPosition;

-					contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);

-					contents[localContentsOffset++] = (byte) resolvedPosition;

-				}

-			}

-		}

-		int value = numberOfEntries * 10 + 2;

-		localVariableTableOffset += 2;

-		contents[localVariableTableOffset++] = (byte) (value >> 24);

-		contents[localVariableTableOffset++] = (byte) (value >> 16);

-		contents[localVariableTableOffset++] = (byte) (value >> 8);

-		contents[localVariableTableOffset++] = (byte) value;

-		contents[localVariableTableOffset++] = (byte) (numberOfEntries >> 8);

-		contents[localVariableTableOffset] = (byte) numberOfEntries;

-		attributeNumber++;

-	}

-

-	// update the number of attributes

-	// ensure first that there is enough space available inside the contents array

-	if (codeAttributeAttributeOffset + 2 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	contents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[codeAttributeAttributeOffset] = (byte) attributeNumber;

-

-	// update the attribute length

-	int codeAttributeLength = localContentsOffset - (codeAttributeOffset + 6);

-	contents[codeAttributeOffset + 2] = (byte) (codeAttributeLength >> 24);

-	contents[codeAttributeOffset + 3] = (byte) (codeAttributeLength >> 16);

-	contents[codeAttributeOffset + 4] = (byte) (codeAttributeLength >> 8);

-	contents[codeAttributeOffset + 5] = (byte) codeAttributeLength;

-	contentsOffset = localContentsOffset;

-}

-/**

- * INTERNAL USE-ONLY

- * Complete the creation of a method info by setting up the number of attributes at the right offset.

- *

- * @param methodAttributeOffset <CODE>int</CODE>

- * @param attributeNumber <CODE>int</CODE> 

- */

-public void completeMethodInfo(int methodAttributeOffset, int attributeNumber) {

-	// update the number of attributes

-	contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);

-	contents[methodAttributeOffset] = (byte) attributeNumber;

-}

-/*

- * INTERNAL USE-ONLY

- * Innerclasses get their name computed as they are generated, since some may not

- * be actually outputed if sitting inside unreachable code.

- *

- * @param localType org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding

- */

-public char[] computeConstantPoolName(LocalTypeBinding localType) {

-	if (localType.constantPoolName() != null) {

-		return localType.constantPoolName();

-	}

-

-	// delegates to the outermost enclosing classfile, since it is the only one with a global vision of its innertypes.

-	if (enclosingClassFile != null) {

-		return this.outerMostEnclosingClassFile().computeConstantPoolName(localType);

-	}

-

-	if (nameUsage == null) {

-		nameUsage = new CharArrayCache();

-	}

-	if (localType.isMemberType()) { // catches member types of local types

-		return CharOperation.concat(

-			localType.enclosingType().constantPoolName(),

-			localType.sourceName,

-			'$');

-	} else {

-		char[][] compoundName =  (char[][]) referenceBinding.compoundName.clone();

-		int last = compoundName.length - 1;

-		StringBuffer nameBuffer = new StringBuffer().append(compoundName[last]);

-		// retrieve the number of use of the combination

-		char[] simpleName = localType.sourceName;

-		//if (simpleName == null) simpleName = new char[]{}; // for anonymous

-		int nameCount = nameUsage.get(simpleName); // -1 if not found

-		nameCount =  nameCount == -1 ? 1 : nameCount + 1;

-		nameBuffer.append('$').append(nameCount);

-		nameUsage.put(simpleName, nameCount);

-		if (!localType.isAnonymousType()) { // named local type

-			nameBuffer.append('$').append(simpleName);

-		}

-		compoundName[last] = nameBuffer.toString().toCharArray();

-		return CharOperation.concatWith(compoundName, '/');

-	}

-}

-/**

- * INTERNAL USE-ONLY

- * Request the creation of a ClassFile compatible representation of a problematic type

- *

- * @param typeDeclaration org.eclipse.jdt.internal.compiler.ast.TypeDeclaration

- * @param unitResult org.eclipse.jdt.internal.compiler.CompilationUnitResult

- */

-public static void createProblemType(TypeDeclaration typeDeclaration, CompilationResult unitResult) {

-	SourceTypeBinding typeBinding = typeDeclaration.binding;

-	ClassFile classFile = new ClassFile(typeBinding, null, true);

-

-	// inner attributes

-	if (typeBinding.isMemberType())

-		classFile.recordEnclosingTypeAttributes(typeBinding);

-

-	// add its fields

-	FieldBinding[] fields = typeBinding.fields;

-	if ((fields != null) && (fields != NoFields)) {

-		for (int i = 0, max = fields.length; i < max; i++) {

-			if (fields[i].constant == null) {

-				FieldReference.getConstantFor(fields[i], false, null, 0);

-			}

-		}

-		classFile.addFieldInfos();

-	} else {

-		// we have to set the number of fields to be equals to 0

-		classFile.contents[classFile.contentsOffset++] = 0;

-		classFile.contents[classFile.contentsOffset++] = 0;

-	}

-	// leave some space for the methodCount

-	classFile.setForMethodInfos();

-	// add its user defined methods

-	MethodBinding[] methods = typeBinding.methods;

-	AbstractMethodDeclaration[] methodDeclarations = typeDeclaration.methods;

-	int maxMethodDecl = methodDeclarations == null ? 0 : methodDeclarations.length;

-	int problemsLength;

-	IProblem[] problems = unitResult.getProblems();

-	if (problems == null) {

-		problems = new IProblem[0];

-	}

-	IProblem[] problemsCopy = new IProblem[problemsLength = problems.length];

-	System.arraycopy(problems, 0, problemsCopy, 0, problemsLength);

-	if (methods != null) {

-		if (typeBinding.isInterface()) {

-			// we cannot create problem methods for an interface. So we have to generate a clinit

-			// which should contain all the problem

-			classFile.addProblemClinit(problemsCopy);

-			for (int i = 0, max = methods.length; i < max; i++) {

-				MethodBinding methodBinding;

-				if ((methodBinding = methods[i]) != null) {

-					// find the corresponding method declaration

-					for (int j = 0; j < maxMethodDecl; j++) {

-						if ((methodDeclarations[j] != null) && (methodDeclarations[j].binding == methods[i])) {

-							if (!methodBinding.isConstructor()) {

-								classFile.addAbstractMethod(methodDeclarations[j], methodBinding);

+		IProblem[] problemsCopy = new IProblem[problemsLength = problems.length];

+		System.arraycopy(problems, 0, problemsCopy, 0, problemsLength);

+		if (methods != null) {

+			if (typeBinding.isInterface()) {

+				// we cannot create problem methods for an interface. So we have to generate a clinit

+				// which should contain all the problem

+				classFile.addProblemClinit(problemsCopy);

+				for (int i = 0, max = methods.length; i < max; i++) {

+					MethodBinding methodBinding;

+					if ((methodBinding = methods[i]) != null) {

+						// find the corresponding method declaration

+						for (int j = 0; j < maxMethodDecl; j++) {

+							if ((methodDeclarations[j] != null)

+								&& (methodDeclarations[j].binding == methods[i])) {

+								if (!methodBinding.isConstructor()) {

+									classFile.addAbstractMethod(methodDeclarations[j], methodBinding);

+								}

+								break;

 							}

-							break;

 						}

 					}

 				}

-			}			

-		} else {

-			for (int i = 0, max = methods.length; i < max; i++) {

-				MethodBinding methodBinding;

-				if ((methodBinding = methods[i]) != null) {

-					// find the corresponding method declaration

-					for (int j = 0; j < maxMethodDecl; j++) {

-						if ((methodDeclarations[j] != null) && (methodDeclarations[j].binding == methods[i])) {

-							AbstractMethodDeclaration methodDecl;

-							if ((methodDecl = methodDeclarations[j]).isConstructor()) {

-								classFile.addProblemConstructor(methodDecl, methodBinding, problemsCopy);

-							} else {

-								classFile.addProblemMethod(methodDecl, methodBinding, problemsCopy);

+			} else {

+				for (int i = 0, max = methods.length; i < max; i++) {

+					MethodBinding methodBinding;

+					if ((methodBinding = methods[i]) != null) {

+						// find the corresponding method declaration

+						for (int j = 0; j < maxMethodDecl; j++) {

+							if ((methodDeclarations[j] != null)

+								&& (methodDeclarations[j].binding == methods[i])) {

+								AbstractMethodDeclaration methodDecl;

+								if ((methodDecl = methodDeclarations[j]).isConstructor()) {

+									classFile.addProblemConstructor(methodDecl, methodBinding, problemsCopy);

+								} else {

+									classFile.addProblemMethod(methodDecl, methodBinding, problemsCopy);

+								}

+								break;

 							}

-							break;

 						}

 					}

 				}

 			}

+			// add abstract methods

+			classFile.addDefaultAbstractMethods();

 		}

-		// add abstract methods

-		classFile.addDefaultAbstractMethods();

-	}

-	// propagate generation of (problem) member types

-	if (typeDeclaration.memberTypes != null) {

-		CompilationResult result = typeDeclaration.scope.referenceCompilationUnit().compilationResult;

-		for (int i = 0, max = typeDeclaration.memberTypes.length; i < max; i++) {

-			TypeDeclaration memberType = typeDeclaration.memberTypes[i];

-			if (memberType.binding != null) {

-				classFile.recordNestedMemberAttribute(memberType.binding);

-				ClassFile.createProblemType(memberType, unitResult);

+		// propagate generation of (problem) member types

+		if (typeDeclaration.memberTypes != null) {

+			CompilationResult result =

+				typeDeclaration.scope.referenceCompilationUnit().compilationResult;

+			for (int i = 0, max = typeDeclaration.memberTypes.length; i < max; i++) {

+				TypeDeclaration memberType = typeDeclaration.memberTypes[i];

+				if (memberType.binding != null) {

+					classFile.recordNestedMemberAttribute(memberType.binding);

+					ClassFile.createProblemType(memberType, unitResult);

+				}

 			}

 		}

+		classFile.addAttributes();

+		unitResult.record(typeBinding.constantPoolName(), classFile);

 	}

-	classFile.addAttributes();

-	unitResult.record(typeBinding.constantPoolName(), classFile);

-}

-/**

- * INTERNAL USE-ONLY

- * This methods returns a char[] representing the file name of the receiver

- *

- * @return char[]

- */

-public char[] fileName() {

-	return constantPool.UTF8Cache.returnKeyFor(1);

-}

-/**

- * INTERNAL USE-ONLY

- * That method generates the header of a code attribute.

- * - the index inside the constant pool for the attribute name (i.e. Code)

- * - leave some space for attribute_length(4), max_stack(2), max_locals(2), code_length(4).

- */

-public void generateCodeAttributeHeader() {

-	int contentsLength;

-	if (contentsOffset + 20 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	int constantValueNameIndex = constantPool.literalIndex(AttributeNamesConstants.CodeName);

-	contents[contentsOffset++] = (byte) (constantValueNameIndex >> 8);

-	contents[contentsOffset++] = (byte) constantValueNameIndex;

-	// leave space for attribute_length(4), max_stack(2), max_locals(2), code_length(4)

-	contentsOffset += 12;

-}

-/**

- * INTERNAL USE-ONLY

- * That method generates the attributes of a code attribute.

- * They could be:

- * - an exception attribute for each try/catch found inside the method

- * - a deprecated attribute

- * - a synthetic attribute for synthetic access methods

- *

- * It returns the number of attributes created for the code attribute.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

- * @return <CODE>int</CODE>

- */

-public int generateMethodInfoAttribute(MethodBinding methodBinding) {

-	// leave two bytes for the attribute_number

-	contentsOffset += 2;

-	// now we can handle all the attribute for that method info:

-	// it could be:

-	// - a CodeAttribute

-	// - a ExceptionAttribute

-	// - a DeprecatedAttribute

-	// - a SyntheticAttribute

 

-	// Exception attribute

-	ReferenceBinding[] thrownsExceptions;

-	int contentsLength;

-	int attributeNumber = 0;

-	if ((thrownsExceptions = methodBinding.thrownExceptions) != NoExceptions) {

-		// The method has a throw clause. So we need to add an exception attribute

-		// check that there is enough space to write all the bytes for the exception attribute

-		int length = thrownsExceptions.length;

-		if (contentsOffset + (8 + length * 2) >= (contentsLength = contents.length)) {

-			System.arraycopy(contents, 0, (contents = new byte[contentsLength + Math.max(INCREMENT_SIZE, (8 + length * 2))]), 0, contentsLength);

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods returns a char[] representing the file name of the receiver

+	 *

+	 * @return char[]

+	 */

+	public char[] fileName() {

+		return constantPool.UTF8Cache.returnKeyFor(1);

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method generates the header of a code attribute.

+	 * - the index inside the constant pool for the attribute name (i.e. Code)

+	 * - leave some space for attribute_length(4), max_stack(2), max_locals(2), code_length(4).

+	 */

+	public void generateCodeAttributeHeader() {

+		int contentsLength;

+		if (contentsOffset + 20 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

 		}

-		int exceptionNameIndex = constantPool.literalIndex(AttributeNamesConstants.ExceptionsName);

-		contents[contentsOffset++] = (byte) (exceptionNameIndex >> 8);

-		contents[contentsOffset++] = (byte) exceptionNameIndex;

-		// The attribute length = length * 2 + 2 in case of a exception attribute

-		int attributeLength = length * 2 + 2;

-		contents[contentsOffset++] = (byte) (attributeLength >> 24);

-		contents[contentsOffset++] = (byte) (attributeLength >> 16);

-		contents[contentsOffset++] = (byte) (attributeLength >> 8);

-		contents[contentsOffset++] = (byte) attributeLength;

-		contents[contentsOffset++] = (byte) (length >> 8);

-		contents[contentsOffset++] = (byte) length;

-		for (int i = 0; i < length; i++) {

-			int exceptionIndex = constantPool.literalIndex(thrownsExceptions[i]);

-			contents[contentsOffset++] = (byte) (exceptionIndex >> 8);

-			contents[contentsOffset++] = (byte) exceptionIndex;

+		int constantValueNameIndex =

+			constantPool.literalIndex(AttributeNamesConstants.CodeName);

+		contents[contentsOffset++] = (byte) (constantValueNameIndex >> 8);

+		contents[contentsOffset++] = (byte) constantValueNameIndex;

+		// leave space for attribute_length(4), max_stack(2), max_locals(2), code_length(4)

+		contentsOffset += 12;

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method generates the attributes of a code attribute.

+	 * They could be:

+	 * - an exception attribute for each try/catch found inside the method

+	 * - a deprecated attribute

+	 * - a synthetic attribute for synthetic access methods

+	 *

+	 * It returns the number of attributes created for the code attribute.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

+	 * @return <CODE>int</CODE>

+	 */

+	public int generateMethodInfoAttribute(MethodBinding methodBinding) {

+		// leave two bytes for the attribute_number

+		contentsOffset += 2;

+		// now we can handle all the attribute for that method info:

+		// it could be:

+		// - a CodeAttribute

+		// - a ExceptionAttribute

+		// - a DeprecatedAttribute

+		// - a SyntheticAttribute

+

+		// Exception attribute

+		ReferenceBinding[] thrownsExceptions;

+		int contentsLength;

+		int attributeNumber = 0;

+		if ((thrownsExceptions = methodBinding.thrownExceptions) != NoExceptions) {

+			// The method has a throw clause. So we need to add an exception attribute

+			// check that there is enough space to write all the bytes for the exception attribute

+			int length = thrownsExceptions.length;

+			if (contentsOffset + (8 + length * 2) >= (contentsLength = contents.length)) {

+				System.arraycopy(

+					contents,

+					0,

+					(contents =

+						new byte[contentsLength + Math.max(INCREMENT_SIZE, (8 + length * 2))]),

+					0,

+					contentsLength);

+			}

+			int exceptionNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.ExceptionsName);

+			contents[contentsOffset++] = (byte) (exceptionNameIndex >> 8);

+			contents[contentsOffset++] = (byte) exceptionNameIndex;

+			// The attribute length = length * 2 + 2 in case of a exception attribute

+			int attributeLength = length * 2 + 2;

+			contents[contentsOffset++] = (byte) (attributeLength >> 24);

+			contents[contentsOffset++] = (byte) (attributeLength >> 16);

+			contents[contentsOffset++] = (byte) (attributeLength >> 8);

+			contents[contentsOffset++] = (byte) attributeLength;

+			contents[contentsOffset++] = (byte) (length >> 8);

+			contents[contentsOffset++] = (byte) length;

+			for (int i = 0; i < length; i++) {

+				int exceptionIndex = constantPool.literalIndex(thrownsExceptions[i]);

+				contents[contentsOffset++] = (byte) (exceptionIndex >> 8);

+				contents[contentsOffset++] = (byte) exceptionIndex;

+			}

+			attributeNumber++;

 		}

-		attributeNumber++;

+		// Deprecated attribute

+		// Check that there is enough space to write the deprecated attribute

+		if (contentsOffset + 6 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		if (methodBinding.isDeprecated()) {

+			int deprecatedAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

+			contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

+			// the length of a deprecated attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+

+			attributeNumber++;

+		}

+		// Synthetic attribute

+		// Check that there is enough space to write the deprecated attribute

+		if (contentsOffset + 6 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		if (methodBinding.isSynthetic()) {

+			int syntheticAttributeNameIndex =

+				constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

+			contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

+			contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

+			// the length of a synthetic attribute is equals to 0

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+			contents[contentsOffset++] = 0;

+

+			attributeNumber++;

+		}

+		return attributeNumber;

 	}

 

-	// Deprecated attribute

-	// Check that there is enough space to write the deprecated attribute

-	if (contentsOffset + 6 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

-	}

-	if (methodBinding.isDeprecated()) {

-		int deprecatedAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.DeprecatedName);

-		contents[contentsOffset++] = (byte) (deprecatedAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) deprecatedAttributeNameIndex;

-		// the length of a deprecated attribute is equals to 0

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-

-		attributeNumber++;

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method generates the header of a method info:

+	 * The header consists in:

+	 * - the access flags

+	 * - the name index of the method name inside the constant pool

+	 * - the descriptor index of the signature of the method inside the constant pool.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

+	 */

+	public void generateMethodInfoHeader(MethodBinding methodBinding) {

+		// check that there is enough space to write all the bytes for the method info corresponding

+		// to the @methodBinding

+		int contentsLength;

+		methodCount++; // add one more method

+		if (contentsOffset + 10 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		int accessFlags = methodBinding.getAccessFlags();

+		if (methodBinding.isRequiredToClearPrivateModifier()) {

+			accessFlags &= ~AccPrivate;

+		}

+		contents[contentsOffset++] = (byte) (accessFlags >> 8);

+		contents[contentsOffset++] = (byte) accessFlags;

+		int nameIndex = constantPool.literalIndex(methodBinding.selector);

+		contents[contentsOffset++] = (byte) (nameIndex >> 8);

+		contents[contentsOffset++] = (byte) nameIndex;

+		int descriptorIndex = constantPool.literalIndex(methodBinding.signature());

+		contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

+		contents[contentsOffset++] = (byte) descriptorIndex;

 	}

 

-	// Synthetic attribute

-	// Check that there is enough space to write the deprecated attribute

-	if (contentsOffset + 6 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+	/**

+	 * INTERNAL USE-ONLY

+	 * That method generates the method info header of a clinit:

+	 * The header consists in:

+	 * - the access flags (always default access + static)

+	 * - the name index of the method name (always <clinit>) inside the constant pool 

+	 * - the descriptor index of the signature (always ()V) of the method inside the constant pool.

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

+	 */

+	public void generateMethodInfoHeaderForClinit() {

+		// check that there is enough space to write all the bytes for the method info corresponding

+		// to the @methodBinding

+		int contentsLength;

+		methodCount++; // add one more method

+		if (contentsOffset + 10 >= (contentsLength = contents.length)) {

+			System.arraycopy(

+				contents,

+				0,

+				(contents = new byte[contentsLength + INCREMENT_SIZE]),

+				0,

+				contentsLength);

+		}

+		contents[contentsOffset++] = (byte) ((AccDefault | AccStatic) >> 8);

+		contents[contentsOffset++] = (byte) (AccDefault | AccStatic);

+		int nameIndex = constantPool.literalIndex(QualifiedNamesConstants.Clinit);

+		contents[contentsOffset++] = (byte) (nameIndex >> 8);

+		contents[contentsOffset++] = (byte) nameIndex;

+		int descriptorIndex =

+			constantPool.literalIndex(QualifiedNamesConstants.ClinitSignature);

+		contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

+		contents[contentsOffset++] = (byte) descriptorIndex;

+		// We know that we won't get more than 1 attribute: the code attribute

+		contents[contentsOffset++] = 0;

+		contents[contentsOffset++] = 1;

 	}

-	if (methodBinding.isSynthetic()) {

-		int syntheticAttributeNameIndex = constantPool.literalIndex(AttributeNamesConstants.SyntheticName);

-		contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8);

-		contents[contentsOffset++] = (byte) syntheticAttributeNameIndex;

-		// the length of a synthetic attribute is equals to 0

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

-		contents[contentsOffset++] = 0;

 

-		attributeNumber++;

+	/**

+	 * EXTERNAL API

+	 * Answer the actual bytes of the class file

+	 *

+	 * This method encodes the receiver structure into a byte array which is the content of the classfile.

+	 * Returns the byte array that represents the encoded structure of the receiver.

+	 *

+	 * @return byte[]

+	 */

+	public byte[] getBytes() {

+		byte[] fullContents = new byte[headerOffset + contentsOffset];

+		System.arraycopy(header, 0, fullContents, 0, headerOffset);

+		System.arraycopy(contents, 0, fullContents, headerOffset, contentsOffset);

+		return fullContents;

 	}

-	return attributeNumber;

-}

-/**

- * INTERNAL USE-ONLY

- * That method generates the header of a method info:

- * The header consists in:

- * - the access flags

- * - the name index of the method name inside the constant pool

- * - the descriptor index of the signature of the method inside the constant pool.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

- */

-public void generateMethodInfoHeader(MethodBinding methodBinding) {

-	// check that there is enough space to write all the bytes for the method info corresponding

-	// to the @methodBinding

-	int contentsLength;

-	methodCount++; // add one more method

-	if (contentsOffset + 10 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+

+	/**

+	 * EXTERNAL API

+	 * Answer the compound name of the class file.

+	 * @return char[][]

+	 * e.g. {{java}, {util}, {Hashtable}}.

+	 */

+	public char[][] getCompoundName() {

+		return CharOperation.splitOn('/', fileName());

 	}

-	int accessFlags = methodBinding.getAccessFlags();

-	if (methodBinding.isRequiredToClearPrivateModifier()) {

-		accessFlags &= ~AccPrivate;

+

+	/**

+	 * EXTERNAL API

+	 * Answer a smaller byte format, which is only contains some structural information.

+	 *

+	 * Those bytes are decodable with a regular class file reader, such as:

+	 * DietClassFileReader

+	 */

+	public byte[] getReducedBytes() {

+		return getBytes(); // might be improved

 	}

-	contents[contentsOffset++] = (byte) (accessFlags >> 8);

-	contents[contentsOffset++] = (byte) accessFlags;

-	int nameIndex = constantPool.literalIndex(methodBinding.selector);

-	contents[contentsOffset++] = (byte) (nameIndex >> 8);

-	contents[contentsOffset++] = (byte) nameIndex;

-	int descriptorIndex = constantPool.literalIndex(methodBinding.signature());

-	contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

-	contents[contentsOffset++] = (byte) descriptorIndex;

-}

-/**

- * INTERNAL USE-ONLY

- * That method generates the method info header of a clinit:

- * The header consists in:

- * - the access flags (always default access + static)

- * - the name index of the method name (always <clinit>) inside the constant pool 

- * - the descriptor index of the signature (always ()V) of the method inside the constant pool.

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding

- */

-public void generateMethodInfoHeaderForClinit() {

-	// check that there is enough space to write all the bytes for the method info corresponding

-	// to the @methodBinding

-	int contentsLength;

-	methodCount++; // add one more method

-	if (contentsOffset + 10 >= (contentsLength = contents.length)) {

-		System.arraycopy(contents, 0, (contents = new byte[contentsLength + INCREMENT_SIZE]), 0, contentsLength);

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Returns the most enclosing classfile of the receiver. This is used know to store the constant pool name

+	 * for all inner types of the receiver.

+	 * @return org.eclipse.jdt.internal.compiler.codegen.ClassFile

+	 */

+	public ClassFile outerMostEnclosingClassFile() {

+		ClassFile current = this;

+		while (current.enclosingClassFile != null)

+			current = current.enclosingClassFile;

+		return current;

 	}

-	contents[contentsOffset++] = (byte) ((AccDefault | AccStatic) >> 8);

-	contents[contentsOffset++] = (byte) (AccDefault | AccStatic);

-	int nameIndex = constantPool.literalIndex(QualifiedNamesConstants.Clinit);

-	contents[contentsOffset++] = (byte) (nameIndex >> 8);

-	contents[contentsOffset++] = (byte) nameIndex;

-	int descriptorIndex = constantPool.literalIndex(QualifiedNamesConstants.ClinitSignature);

-	contents[contentsOffset++] = (byte) (descriptorIndex >> 8);

-	contents[contentsOffset++] = (byte) descriptorIndex;

-	// We know that we won't get more than 1 attribute: the code attribute

-	contents[contentsOffset++] = 0;

-	contents[contentsOffset++] = 1;

-}

-/**

- * EXTERNAL API

- * Answer the actual bytes of the class file

- *

- * This method encodes the receiver structure into a byte array which is the content of the classfile.

- * Returns the byte array that represents the encoded structure of the receiver.

- *

- * @return byte[]

- */

-public byte[] getBytes() {

-	byte[] fullContents = new byte[headerOffset + contentsOffset];

-	System.arraycopy(header, 0, fullContents, 0, headerOffset);

-	System.arraycopy(contents, 0, fullContents, headerOffset, contentsOffset);

-	return fullContents;

-}

-/**

- * EXTERNAL API

- * Answer the compound name of the class file.

- * @return char[][]

- * e.g. {{java}, {util}, {Hashtable}}.

- */

-public char[][] getCompoundName() {

-	return CharOperation.splitOn('/', fileName());

-}

-/**

- * EXTERNAL API

- * Answer a smaller byte format, which is only contains some structural information.

- *

- * Those bytes are decodable with a regular class file reader, such as:

- * DietClassFileReader

- */

- 

-public byte[] getReducedBytes() {

-	return getBytes(); // might be improved

-}

-/**

- * INTERNAL USE-ONLY

- * Returns the most enclosing classfile of the receiver. This is used know to store the constant pool name

- * for all inner types of the receiver.

- * @return org.eclipse.jdt.internal.compiler.codegen.ClassFile

- */

-public ClassFile outerMostEnclosingClassFile() {

-	ClassFile current = this;

-	while (current.enclosingClassFile != null)

-		current = current.enclosingClassFile;

-	return current;

-}

-/**

- * INTERNAL USE-ONLY

- * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

- * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

- *

- * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

- */

-public void recordEnclosingTypeAttributes(ReferenceBinding binding) {

-	// add all the enclosing types

-	ReferenceBinding enclosingType = referenceBinding.enclosingType();

-	int depth = 0;

-	while (enclosingType != null) {

-		depth++;

-		enclosingType = enclosingType.enclosingType();

-	}

-	enclosingType = referenceBinding;

-	ReferenceBinding enclosingTypes[];

-	if (depth >= 2) {

-		enclosingTypes = new ReferenceBinding[depth];

-		for (int i = depth - 1; i >= 0; i--) {

-			enclosingTypes[i] = enclosingType;

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

+	 * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

+	 *

+	 * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

+	 */

+	public void recordEnclosingTypeAttributes(ReferenceBinding binding) {

+		// add all the enclosing types

+		ReferenceBinding enclosingType = referenceBinding.enclosingType();

+		int depth = 0;

+		while (enclosingType != null) {

+			depth++;

 			enclosingType = enclosingType.enclosingType();

 		}

-		for (int i = 0; i < depth; i++) {

-			addInnerClasses(enclosingTypes[i]);

+		enclosingType = referenceBinding;

+		ReferenceBinding enclosingTypes[];

+		if (depth >= 2) {

+			enclosingTypes = new ReferenceBinding[depth];

+			for (int i = depth - 1; i >= 0; i--) {

+				enclosingTypes[i] = enclosingType;

+				enclosingType = enclosingType.enclosingType();

+			}

+			for (int i = 0; i < depth; i++) {

+				addInnerClasses(enclosingTypes[i]);

+			}

+		} else {

+			addInnerClasses(referenceBinding);

 		}

-	} else {

-		addInnerClasses(referenceBinding);

 	}

-}

-/**

- * INTERNAL USE-ONLY

- * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

- * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

- *

- * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

- */

-public void recordNestedLocalAttribute(ReferenceBinding binding) {

-	// add all the enclosing types

-	ReferenceBinding enclosingType = referenceBinding.enclosingType();

-	int depth = 0;

-	while (enclosingType != null) {

-		depth++;

-		enclosingType = enclosingType.enclosingType();

-	}

-	enclosingType = referenceBinding;

-	ReferenceBinding enclosingTypes[];

-	if (depth >= 2) {

-		enclosingTypes = new ReferenceBinding[depth];

-		for (int i = depth - 1; i >= 0; i--) {

-			enclosingTypes[i] = enclosingType;

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

+	 * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

+	 *

+	 * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

+	 */

+	public void recordNestedLocalAttribute(ReferenceBinding binding) {

+		// add all the enclosing types

+		ReferenceBinding enclosingType = referenceBinding.enclosingType();

+		int depth = 0;

+		while (enclosingType != null) {

+			depth++;

 			enclosingType = enclosingType.enclosingType();

 		}

-		for (int i = 0; i < depth; i++)

-			addInnerClasses(enclosingTypes[i]);

-	} else {

+		enclosingType = referenceBinding;

+		ReferenceBinding enclosingTypes[];

+		if (depth >= 2) {

+			enclosingTypes = new ReferenceBinding[depth];

+			for (int i = depth - 1; i >= 0; i--) {

+				enclosingTypes[i] = enclosingType;

+				enclosingType = enclosingType.enclosingType();

+			}

+			for (int i = 0; i < depth; i++)

+				addInnerClasses(enclosingTypes[i]);

+		} else {

+			addInnerClasses(binding);

+		}

+	}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

+	 * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

+	 *

+	 * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

+	 */

+	public void recordNestedMemberAttribute(ReferenceBinding binding) {

 		addInnerClasses(binding);

 	}

-}

-/**

- * INTERNAL USE-ONLY

- * This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the

- * collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.

- *

- * @param binding org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding

- */

-public void recordNestedMemberAttribute(ReferenceBinding binding) {

-	addInnerClasses(binding);

-}

-/**

- * INTERNAL USE-ONLY

- * Search the line number corresponding to a specific position

- *

- * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

- */

-public static final int searchLineNumber(int[] startLineIndexes, int position) {

-	// this code is completely useless, but it is the same implementation than

-	// org.eclipse.jdt.internal.compiler.problem.ProblemHandler.searchLineNumber(int[], int)

-	// if (startLineIndexes == null)

-	//	return 1;

-	int length = startLineIndexes.length;

-	if (length == 0)

-		return 1;

-	int g = 0, d = length - 1;

-	int m = 0;

-	while (g <= d) {

-		m = (g + d) /2;

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * Search the line number corresponding to a specific position

+	 *

+	 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding

+	 */

+	public static final int searchLineNumber(

+		int[] startLineIndexes,

+		int position) {

+		// this code is completely useless, but it is the same implementation than

+		// org.eclipse.jdt.internal.compiler.problem.ProblemHandler.searchLineNumber(int[], int)

+		// if (startLineIndexes == null)

+		//	return 1;

+		int length = startLineIndexes.length;

+		if (length == 0)

+			return 1;

+		int g = 0, d = length - 1;

+		int m = 0;

+		while (g <= d) {

+			m = (g + d) / 2;

+			if (position < startLineIndexes[m]) {

+				d = m - 1;

+			} else

+				if (position > startLineIndexes[m]) {

+					g = m + 1;

+				} else {

+					return m + 1;

+				}

+		}

 		if (position < startLineIndexes[m]) {

-			d = m-1;

-		} else if (position > startLineIndexes[m]) {

-			g = m+1;

-		} else {

 			return m + 1;

 		}

+		return m + 2;

 	}

-	if (position < startLineIndexes[m]) {

-		return m+1;

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * This methods leaves the space for method counts recording.

+	 */

+	public void setForMethodInfos() {

+		// leave some space for the methodCount

+		methodCountOffset = contentsOffset;

+		contentsOffset += 2;

 	}

-	return m+2;

-}

-/**

- * INTERNAL USE-ONLY

- * This methods leaves the space for method counts recording.

- */

-public void setForMethodInfos() {

-	// leave some space for the methodCount

-	methodCountOffset = contentsOffset;

-	contentsOffset += 2;

-}

-/**

- * INTERNAL USE-ONLY

- * outputPath is formed like:

- *	   c:\temp\ the last character is a file separator

- * relativeFileName is formed like:

- *     java\lang\String.class

- * @param fileName java.lang.String

- * @param content byte[]

- */

-public static void writeToDisk(String outputPath, String relativeFileName, byte[] contents) throws IOException {

-	String fileName;

-	File file;

-	FileOutputStream output = new FileOutputStream(file = new File((fileName = buildAllDirectoriesInto(outputPath, relativeFileName))));

-	output.write(contents);

-	output.flush();

-	output.close();

-}

-}

+

+	/**

+	 * INTERNAL USE-ONLY

+	 * outputPath is formed like:

+	 *	   c:\temp\ the last character is a file separator

+	 * relativeFileName is formed like:

+	 *     java\lang\String.class

+	 * @param fileName java.lang.String

+	 * @param content byte[]

+	 */

+	public static void writeToDisk(

+		String outputPath,

+		String relativeFileName,

+		byte[] contents)

+		throws IOException {

+		String fileName;

+		File file;

+		FileOutputStream output =

+			new FileOutputStream(

+				file =

+					new File((fileName = buildAllDirectoriesInto(outputPath, relativeFileName))));

+		output.write(contents);

+		output.flush();

+		output.close();

+	}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/Compiler.java b/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
index f7cf45e..7c708fc 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/Compiler.java
@@ -18,11 +18,11 @@
 import java.util.*;

 

 public class Compiler implements ITypeRequestor, ProblemSeverities {

-	public Parser parser;	

+	public Parser parser;

 	ICompilerRequestor requestor;

 	public CompilerOptions options;

 	public ProblemReporter problemReporter;

-	

+

 	// management of unit to be processed

 	//public CompilationUnitResult currentCompilationUnitResult;

 	CompilationUnitDeclaration[] unitsToProcess;

@@ -32,407 +32,481 @@
 	public LookupEnvironment lookupEnvironment;

 

 	// ONCE STABILIZED, THESE SHOULD RETURN TO A FINAL FIELD

-	public static final boolean DEBUG = false; 

-	public int parseThreshold = -1; // number of initial units parsed at once (-1: none)

-/**

- * Answer a new compiler using the given name environment and compiler options.

- * The environment and options will be in effect for the lifetime of the compiler.

- * When the compiler is run, compilation results are sent to the given requestor.

- *

- *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment

- *      Environment used by the compiler in order to resolve type and package

- *      names. The name environment implements the actual connection of the compiler

- *      to the outside world (e.g. in batch mode the name environment is performing

- *      pure file accesses, reuse previous build state or connection to repositories).

- *      Note: the name environment is responsible for implementing the actual classpath

- *            rules.

- *

- *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy

- *      Configurable part for problem handling, allowing the compiler client to

- *      specify the rules for handling problems (stop on first error or accumulate

- *      them all) and at the same time perform some actions such as opening a dialog

- *      in UI when compiling interactively.

- *      @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies

- *      

- *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor

- *      Component which will receive and persist all compilation results and is intended

- *      to consume them as they are produced. Typically, in a batch compiler, it is 

- *      responsible for writing out the actual .class files to the file system.

- *      @see org.eclipse.jdt.internal.compiler.api.CompilationResult

- *

- *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory

- *      Factory used inside the compiler to create problem descriptors. It allows the

- *      compiler client to supply its own representation of compilation problems in

- *      order to avoid object conversions. Note that the factory is not supposed

- *      to accumulate the created problems, the compiler will gather them all and hand

- *      them back as part of the compilation unit result.

- */

-public Compiler(

-	INameEnvironment environment, 

-	IErrorHandlingPolicy policy, 

-	ConfigurableOption[] settings, 

-	ICompilerRequestor requestor, 

-	IProblemFactory problemFactory) {

+	public static final boolean DEBUG = false;

+	public int parseThreshold = -1;

+	// number of initial units parsed at once (-1: none)

+	/**

+	 * Answer a new compiler using the given name environment and compiler options.

+	 * The environment and options will be in effect for the lifetime of the compiler.

+	 * When the compiler is run, compilation results are sent to the given requestor.

+	 *

+	 *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment

+	 *      Environment used by the compiler in order to resolve type and package

+	 *      names. The name environment implements the actual connection of the compiler

+	 *      to the outside world (e.g. in batch mode the name environment is performing

+	 *      pure file accesses, reuse previous build state or connection to repositories).

+	 *      Note: the name environment is responsible for implementing the actual classpath

+	 *            rules.

+	 *

+	 *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy

+	 *      Configurable part for problem handling, allowing the compiler client to

+	 *      specify the rules for handling problems (stop on first error or accumulate

+	 *      them all) and at the same time perform some actions such as opening a dialog

+	 *      in UI when compiling interactively.

+	 *      @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies

+	 *      

+	 *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor

+	 *      Component which will receive and persist all compilation results and is intended

+	 *      to consume them as they are produced. Typically, in a batch compiler, it is 

+	 *      responsible for writing out the actual .class files to the file system.

+	 *      @see org.eclipse.jdt.internal.compiler.api.CompilationResult

+	 *

+	 *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory

+	 *      Factory used inside the compiler to create problem descriptors. It allows the

+	 *      compiler client to supply its own representation of compilation problems in

+	 *      order to avoid object conversions. Note that the factory is not supposed

+	 *      to accumulate the created problems, the compiler will gather them all and hand

+	 *      them back as part of the compilation unit result.

+	 */

+	public Compiler(

+		INameEnvironment environment,

+		IErrorHandlingPolicy policy,

+		ConfigurableOption[] settings,

+		ICompilerRequestor requestor,

+		IProblemFactory problemFactory) {

 

-	// create a problem handler given a handling policy

-	this.options = new CompilerOptions(settings);

-	this.requestor = requestor;

-	this.problemReporter = 

-		new ProblemReporter(

-			policy, 

-			this.options, 

-			problemFactory);

-	this.lookupEnvironment = new LookupEnvironment(this, options, problemReporter, environment);

-	this.parser = 

-		new Parser(problemReporter, this.options.parseLiteralExpressionsAsConstants); 

-}

-/**

- * Add an additional binary type

- */

-

-public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

-	lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

-}

-/**

- * Add an additional compilation unit into the loop

- *  ->  build compilation unit declarations, their bindings and record their results.

- */

-

-public void accept(ICompilationUnit sourceUnit) {

-	// Switch the current policy and compilation result for this unit to the requested one.

-	CompilationResult unitResult = 

-		new CompilationResult(sourceUnit, totalUnits, totalUnits); 

-	try {

-		// diet parsing for large collection of unit

-		CompilationUnitDeclaration parsedUnit;

-		if (totalUnits < parseThreshold) {

-			parsedUnit = parser.parse(sourceUnit, unitResult);

-		} else {

-			parsedUnit = parser.dietParse(sourceUnit, unitResult);

-		}

-

-		if (options.verbose) {

-			System.out.println(Util.bind("compilation.request"/*nonNLS*/,new String[]{String.valueOf(totalUnits + 1),String.valueOf(totalUnits + 1),new String(sourceUnit.getFileName())})); 

-		}

-

-		// initial type binding creation

-		lookupEnvironment.buildTypeBindings(parsedUnit);

-		this.addCompilationUnit(sourceUnit, parsedUnit);

-

-		// binding resolution

-		lookupEnvironment.completeTypeBindings(parsedUnit);

-	} catch (AbortCompilationUnit e) {

-		// at this point, currentCompilationUnitResult may not be sourceUnit, but some other

-		// one requested further along to resolve sourceUnit.

-		if (unitResult.compilationUnit == sourceUnit) { // only report once

-			requestor.acceptResult(unitResult.tagAsAccepted());

-		} else {

-			throw e; // want to abort enclosing request to compile

-		}

+		// create a problem handler given a handling policy

+		this.options = new CompilerOptions(settings);

+		this.requestor = requestor;

+		this.problemReporter =

+			new ProblemReporter(policy, this.options, problemFactory);

+		this.lookupEnvironment =

+			new LookupEnvironment(this, options, problemReporter, environment);

+		this.parser =

+			new Parser(

+				problemReporter, 

+				this.options.parseLiteralExpressionsAsConstants, 

+				this.options.getAssertMode());

 	}

-}

-/**

- * Add an additional source type

- */

+	

+	/**

+	 * Add an additional binary type

+	 */

+	public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

+		lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

+	}

 

-public void accept(ISourceType sourceType, PackageBinding packageBinding) {

-	problemReporter.abortDueToInternalError(Util.bind("abort.againstSourceModel "/*nonNLS*/,String.valueOf(sourceType.getName()),String.valueOf(sourceType.getFileName())));

-}

-protected void addCompilationUnit(ICompilationUnit sourceUnit, CompilationUnitDeclaration parsedUnit) {

-

-	// append the unit to the list of ones to process later on

-	int size = unitsToProcess.length;

-	if (totalUnits == size)	// when growing reposition units starting at position 0

-		System.arraycopy(unitsToProcess, 0, (unitsToProcess = new CompilationUnitDeclaration[size * 2]), 0, totalUnits);

-	unitsToProcess[totalUnits++] = parsedUnit;

-}

-/**

- * Add the initial set of compilation units into the loop

- *  ->  build compilation unit declarations, their bindings and record their results.

- */

-protected void beginToCompile(ICompilationUnit[] sourceUnits) {

-	int maxUnits = sourceUnits.length;

-	totalUnits = 0; 

-	unitsToProcess = new CompilationUnitDeclaration[maxUnits];

-

-	// Switch the current policy and compilation result for this unit to the requested one.

-	for (int i = 0; i < maxUnits; i++) {

-		CompilationUnitDeclaration parsedUnit;

-		CompilationResult unitResult = new CompilationResult(sourceUnits[i], i, maxUnits);

+	/**

+	 * Add an additional compilation unit into the loop

+	 *  ->  build compilation unit declarations, their bindings and record their results.

+	 */

+	public void accept(ICompilationUnit sourceUnit) {

+		// Switch the current policy and compilation result for this unit to the requested one.

+		CompilationResult unitResult =

+			new CompilationResult(sourceUnit, totalUnits, totalUnits);

 		try {

-			// diet parsing for large collection of units

-			if (totalUnits < parseThreshold)

-			{	parsedUnit = parser.parse(sourceUnits[i], unitResult);}

-			else

-			{	parsedUnit = parser.dietParse(sourceUnits[i], unitResult);}

-			if (options.verbose) {

-				System.out.println(Util.bind("compilation.request"/*nonNLS*/,new String[]{String.valueOf(i+1),String.valueOf(maxUnits),new String(sourceUnits[i].getFileName())}));

+			// diet parsing for large collection of unit

+			CompilationUnitDeclaration parsedUnit;

+			if (totalUnits < parseThreshold) {

+				parsedUnit = parser.parse(sourceUnit, unitResult);

+			} else {

+				parsedUnit = parser.dietParse(sourceUnit, unitResult);

 			}

+

+			if (options.verbose) {

+				System.out.println(

+					Util.bind(

+						"compilation.request" , //$NON-NLS-1$

+						new String[] {

+							String.valueOf(totalUnits + 1),

+							String.valueOf(totalUnits + 1),

+							new String(sourceUnit.getFileName())}));

+			}

+

 			// initial type binding creation

 			lookupEnvironment.buildTypeBindings(parsedUnit);

-			this.addCompilationUnit(sourceUnits[i], parsedUnit);

-		//} catch (AbortCompilationUnit e) {

-		//	requestor.acceptResult(unitResult.tagAsAccepted());

-		} finally {

-			sourceUnits[i] = null; // no longer hold onto the unit

-		}

-	}

-	// binding resolution

-	lookupEnvironment.completeTypeBindings();

-}

-/**

- * General API

- * -> compile each of supplied files

- * -> recompile any required types for which we have an incomplete principle structure

- */

+			this.addCompilationUnit(sourceUnit, parsedUnit);

 

-public void compile(ICompilationUnit[] sourceUnits) {

-	CompilationUnitDeclaration unit = null;

-	int i = 0;

-	try {

-		// build and record parsed units

-

-		beginToCompile(sourceUnits);

-

-		// process all units (some more could be injected in the loop by the lookup environment)

-		for (; i < totalUnits; i++) {

-			unit = unitsToProcess[i];

-			try {

-				if (options.verbose) System.out.println(Util.bind("compilation.process"/*nonNLS*/,new String[]{String.valueOf(i + 1),String.valueOf(totalUnits),new String(unitsToProcess[i].getFileName())})); 

-				process(unit, i);

-			} finally {

-				// cleanup compilation unit result

-				unit.cleanUp();

-				if (options.verbose) 

-					System.out.println(Util.bind("compilation.done"/*nonNLS*/,new String[]{String.valueOf(i + 1),String.valueOf(totalUnits),new String(unitsToProcess[i].getFileName())}));  

+			// binding resolution

+			lookupEnvironment.completeTypeBindings(parsedUnit);

+		} catch (AbortCompilationUnit e) {

+			// at this point, currentCompilationUnitResult may not be sourceUnit, but some other

+			// one requested further along to resolve sourceUnit.

+			if (unitResult.compilationUnit == sourceUnit) { // only report once

+				requestor.acceptResult(unitResult.tagAsAccepted());

+			} else {

+				throw e; // want to abort enclosing request to compile

 			}

-			unitsToProcess[i] = null; // release reference to processed unit declaration

-			requestor.acceptResult(unit.compilationResult.tagAsAccepted());

-		}

-	} catch (AbortCompilation e) {

-		this.handleInternalException(e, unit);

-	} catch (Error e) {

-		this.handleInternalException(e, unit, null);

-		throw e; // rethrow

-	} catch (RuntimeException e) {

-		this.handleInternalException(e, unit, null);

-		throw e; // rethrow

-	} finally {

-		this.reset();

-	}

-	if (options.verbose) {

-		if (totalUnits > 1) {

-			System.out.println(Util.bind("compilation.units"/*nonNLS*/,String.valueOf(totalUnits)));

-		} else {

-			System.out.println(Util.bind("compilation.unit"/*nonNLS*/,String.valueOf(totalUnits)));

 		}

 	}

-}

-/**

- * Answer an array of descriptions for the configurable options.

- * The descriptions may be changed and passed back to a different

- * compiler.

- *

- *  @return ConfigurableOption[] - array of configurable options

- */

-public static ConfigurableOption[] getDefaultOptions(Locale locale) {

-	return new CompilerOptions().getConfigurableOptions(locale);

-}

-protected void getMethodBodies(CompilationUnitDeclaration unit, int place) {

-	//fill the methods bodies in order for the code to be generated

-	

-	if (unit.ignoreMethodBodies) {

-		unit.ignoreFurtherInvestigation = true;

-		return; // if initial diet parse did not work, no need to dig into method bodies.

+

+	/**

+	 * Add additional source types

+	 */

+	public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {

+		problemReporter.abortDueToInternalError(

+			Util.bind(

+				"abort.againstSourceModel " , //$NON-NLS-1$

+				String.valueOf(sourceTypes[0].getName()),

+				String.valueOf(sourceTypes[0].getFileName())));

 	}

-	

-	if (place < parseThreshold)

-		return; //work already done ...

 

-	//real parse of the method....

-	parser.scanner.setSourceBuffer(unit.compilationResult.compilationUnit.getContents());

-	if (unit.types != null) {

-		for (int i = unit.types.length; --i >= 0;)

-			unit.types[i].parseMethod(parser, unit);

+	protected void addCompilationUnit(

+		ICompilationUnit sourceUnit,

+		CompilationUnitDeclaration parsedUnit) {

+

+		// append the unit to the list of ones to process later on

+		int size = unitsToProcess.length;

+		if (totalUnits == size)

+			// when growing reposition units starting at position 0

+			System.arraycopy(

+				unitsToProcess,

+				0,

+				(unitsToProcess = new CompilationUnitDeclaration[size * 2]),

+				0,

+				totalUnits);

+		unitsToProcess[totalUnits++] = parsedUnit;

 	}

-}

-/*

- * Compiler crash recovery in case of unexpected runtime exceptions

- */

-protected void handleInternalException(Throwable internalException, CompilationUnitDeclaration unit, CompilationResult result) {

 

-	/* dump a stack trace to the console */

-	internalException.printStackTrace(); 

-		

-	/* find a compilation result */

-	if ((unit != null)) // basing result upon the current unit if available

-		result = unit.compilationResult; // current unit being processed ?

-	if ((result == null) && (unitsToProcess != null) && (totalUnits > 0))

-		result = unitsToProcess[totalUnits - 1].compilationResult; // last unit in beginToCompile ?

-		

-	if (result != null) {

-		/* create and record a compilation problem */

-		StringWriter stringWriter = new StringWriter();

-		PrintWriter writer = new PrintWriter(stringWriter);

-		internalException.printStackTrace(writer);

-		StringBuffer buffer = stringWriter.getBuffer();

+	/**

+	 * Add the initial set of compilation units into the loop

+	 *  ->  build compilation unit declarations, their bindings and record their results.

+	 */

+	protected void beginToCompile(ICompilationUnit[] sourceUnits) {

+		int maxUnits = sourceUnits.length;

+		totalUnits = 0;

+		unitsToProcess = new CompilationUnitDeclaration[maxUnits];

 

-		result.record(

-			problemReporter.createProblem(

-				result.getFileName(), 

-				ProblemIrritants.UnclassifiedProblem, 

-				new String[] {Util.bind("compilation.internalError"/*nonNLS*/)+"\n"/*nonNLS*/ + buffer.toString()},

-				Error, // severity

+		// Switch the current policy and compilation result for this unit to the requested one.

+		for (int i = 0; i < maxUnits; i++) {

+			CompilationUnitDeclaration parsedUnit;

+			CompilationResult unitResult =

+				new CompilationResult(sourceUnits[i], i, maxUnits);

+			try {

+				// diet parsing for large collection of units

+				if (totalUnits < parseThreshold) {

+					parsedUnit = parser.parse(sourceUnits[i], unitResult);

+				} else {

+					parsedUnit = parser.dietParse(sourceUnits[i], unitResult);

+				}

+				if (options.verbose) {

+					System.out.println(

+						Util.bind(

+							"compilation.request" , //$NON-NLS-1$

+							new String[] {

+								String.valueOf(i + 1),

+								String.valueOf(maxUnits),

+								new String(sourceUnits[i].getFileName())}));

+				}

+				// initial type binding creation

+				lookupEnvironment.buildTypeBindings(parsedUnit);

+				this.addCompilationUnit(sourceUnits[i], parsedUnit);

+				//} catch (AbortCompilationUnit e) {

+				//	requestor.acceptResult(unitResult.tagAsAccepted());

+			} finally {

+				sourceUnits[i] = null; // no longer hold onto the unit

+			}

+		}

+		// binding resolution

+		lookupEnvironment.completeTypeBindings();

+	}

+

+	/**

+	 * General API

+	 * -> compile each of supplied files

+	 * -> recompile any required types for which we have an incomplete principle structure

+	 */

+	public void compile(ICompilationUnit[] sourceUnits) {

+		CompilationUnitDeclaration unit = null;

+		int i = 0;

+		try {

+			// build and record parsed units

+

+			beginToCompile(sourceUnits);

+

+			// process all units (some more could be injected in the loop by the lookup environment)

+			for (; i < totalUnits; i++) {

+				unit = unitsToProcess[i];

+				try {

+					if (options.verbose)

+						System.out.println(

+							Util.bind(

+								"compilation.process" , //$NON-NLS-1$

+								new String[] {

+									String.valueOf(i + 1),

+									String.valueOf(totalUnits),

+									new String(unitsToProcess[i].getFileName())}));

+					process(unit, i);

+				} finally {

+					// cleanup compilation unit result

+					unit.cleanUp();

+					if (options.verbose)

+						System.out.println(Util.bind("compilation.done", //$NON-NLS-1$

+					new String[] {

+						String.valueOf(i + 1),

+						String.valueOf(totalUnits),

+						new String(unitsToProcess[i].getFileName())}));

+				}

+				unitsToProcess[i] = null; // release reference to processed unit declaration

+				requestor.acceptResult(unit.compilationResult.tagAsAccepted());

+			}

+		} catch (AbortCompilation e) {

+			this.handleInternalException(e, unit);

+		} catch (Error e) {

+			this.handleInternalException(e, unit, null);

+			throw e; // rethrow

+		} catch (RuntimeException e) {

+			this.handleInternalException(e, unit, null);

+			throw e; // rethrow

+		} finally {

+			this.reset();

+		}

+		if (options.verbose) {

+			if (totalUnits > 1) {

+				System.out.println(

+					Util.bind("compilation.units" , String.valueOf(totalUnits))); //$NON-NLS-1$

+			} else {

+				System.out.println(

+					Util.bind("compilation.unit" , String.valueOf(totalUnits))); //$NON-NLS-1$

+			}

+		}

+	}

+

+	protected void getMethodBodies(CompilationUnitDeclaration unit, int place) {

+		//fill the methods bodies in order for the code to be generated

+

+		if (unit.ignoreMethodBodies) {

+			unit.ignoreFurtherInvestigation = true;

+			return;

+			// if initial diet parse did not work, no need to dig into method bodies.

+		}

+

+		if (place < parseThreshold)

+			return; //work already done ...

+

+		//real parse of the method....

+		parser.scanner.setSourceBuffer(

+			unit.compilationResult.compilationUnit.getContents());

+		if (unit.types != null) {

+			for (int i = unit.types.length; --i >= 0;)

+				unit.types[i].parseMethod(parser, unit);

+		}

+	}

+

+	/*

+	 * Compiler crash recovery in case of unexpected runtime exceptions

+	 */

+	protected void handleInternalException(

+		Throwable internalException,

+		CompilationUnitDeclaration unit,

+		CompilationResult result) {

+

+		/* dump a stack trace to the console */

+		internalException.printStackTrace();

+

+		/* find a compilation result */

+		if ((unit != null)) // basing result upon the current unit if available

+			result = unit.compilationResult; // current unit being processed ?

+		if ((result == null) && (unitsToProcess != null) && (totalUnits > 0))

+			result = unitsToProcess[totalUnits - 1].compilationResult;

+		// last unit in beginToCompile ?

+

+		if (result != null) {

+			/* create and record a compilation problem */

+			StringWriter stringWriter = new StringWriter();

+			PrintWriter writer = new PrintWriter(stringWriter);

+			internalException.printStackTrace(writer);

+			StringBuffer buffer = stringWriter.getBuffer();

+

+			result

+				.record(

+					problemReporter

+					.createProblem(

+						result.getFileName(),

+						ProblemIrritants.UnclassifiedProblem,

+						new String[] {

+							Util.bind("compilation.internalError" ) //$NON-NLS-1$

+								+ "\n"  //$NON-NLS-1$

+								+ buffer.toString()},

+						Error,

+			// severity

+			0, // source start

+			0, // source end

+			0)); // line number		

+

+			/* hand back the compilation result */

+			if (!result.hasBeenAccepted) {

+				requestor.acceptResult(result.tagAsAccepted());

+			}

+		}

+	}

+

+	/*

+	 * Compiler recovery in case of internal AbortCompilation event

+	 */

+	protected void handleInternalException(

+		AbortCompilation abortException,

+		CompilationUnitDeclaration unit) {

+

+		/* special treatment for SilentAbort: silently cancelling the compilation process */

+		if (abortException.isSilent) {

+			if (abortException.silentException == null) {

+				return;

+			} else {

+				throw abortException.silentException;

+			}

+		}

+

+		/* uncomment following line to see where the abort came from */

+		// abortException.printStackTrace(); 

+

+		// Exception may tell which compilation result it is related, and which problem caused it

+		CompilationResult result = abortException.compilationResult;

+		if ((result == null) && (unit != null))

+			result = unit.compilationResult; // current unit being processed ?

+		if ((result == null) && (unitsToProcess != null) && (totalUnits > 0))

+			result = unitsToProcess[totalUnits - 1].compilationResult;

+		// last unit in beginToCompile ?

+		if (result != null && !result.hasBeenAccepted) {

+			/* distant problem which could not be reported back there */

+			if (abortException.problemId != 0) {

+				result

+					.record(

+						problemReporter

+						.createProblem(

+							result.getFileName(),

+							abortException.problemId,

+							abortException.problemArguments,

+							Error,

+				// severity

 				0, // source start

 				0, // source end

-				0)); // line number		

-

-		/* hand back the compilation result */

-		if (!result.hasBeenAccepted) {

-			requestor.acceptResult(result.tagAsAccepted());

+				0)); // line number

+			} else {

+				/* distant internal exception which could not be reported back there */

+				if (abortException.exception != null) {

+					this.handleInternalException(abortException.exception, null, result);

+					return;

+				}

+			}

+			/* hand back the compilation result */

+			if (!result.hasBeenAccepted) {

+				requestor.acceptResult(result.tagAsAccepted());

+			}

+		} else {

+			/*

+			if (abortException.problemId != 0){ 

+				IProblem problem =

+					problemReporter.createProblem(

+						"???".toCharArray(),

+						abortException.problemId, 

+						abortException.problemArguments, 

+						Error, // severity

+						0, // source start

+						0, // source end

+						0); // line number

+				System.out.println(problem.getMessage());

+			}

+			*/

+			abortException.printStackTrace();

 		}

 	}

-}

-/*

- * Compiler recovery in case of internal AbortCompilation event

- */

-protected void handleInternalException(AbortCompilation abortException, CompilationUnitDeclaration unit){

 

-	/* special treatment for SilentAbort: silently cancelling the compilation process */

-	if (abortException.isSilent){

-		if (abortException.silentException == null) {

-			return;

-		} else {

-			throw abortException.silentException;

+	/**

+	 * Process a compilation unit already parsed and build.

+	 */

+	private void process(CompilationUnitDeclaration unit, int i) {

+

+		getMethodBodies(unit, i);

+

+		// fault in fields & methods

+		if (unit.scope != null)

+			unit.scope.faultInTypes();

+

+		// verify inherited methods

+		if (unit.scope != null)

+			unit.scope.verifyMethods(lookupEnvironment.methodVerifier());

+

+		// type checking

+		long startTime = System.currentTimeMillis();

+		unit.resolve();

+

+		// flow analysis

+		startTime = System.currentTimeMillis();

+		unit.analyseCode();

+

+		// code generation

+		startTime = System.currentTimeMillis();

+		unit.generateCode();

+

+		// reference info

+		if (options.produceReferenceInfo && unit.scope != null)

+			unit.scope.storeDependencyInfo();

+

+		// refresh the total number of units known at this stage

+		unit.compilationResult.totalUnitsKnown = totalUnits;

+	}

+	public void reset() {

+		lookupEnvironment.reset();

+		parser.scanner.source = null;

+		unitsToProcess = null;

+	}

+

+	/**

+	 * Internal API used to resolve a compilation unit minimally for code assist engine

+	 */

+	public CompilationUnitDeclaration resolve(ICompilationUnit sourceUnit) {

+		CompilationUnitDeclaration unit = null;

+		try {

+			// build and record parsed units

+			parseThreshold = 1; // will request a full parse

+			beginToCompile(new ICompilationUnit[] { sourceUnit });

+			// process all units (some more could be injected in the loop by the lookup environment)

+			unit = unitsToProcess[0];

+			//getMethodBodies(unit,i);

+			if (unit.scope != null) {

+				// fault in fields & methods

+				unit.scope.faultInTypes();

+				// type checking

+				unit.resolve();

+			}

+			unitsToProcess[0] = null; // release reference to processed unit declaration

+			requestor.acceptResult(unit.compilationResult.tagAsAccepted());

+			return unit;

+		} catch (AbortCompilation e) {

+			this.handleInternalException(e, unit);

+			return unit == null ? unitsToProcess[0] : unit;

+		} catch (Error e) {

+			this.handleInternalException(e, unit, null);

+			throw e; // rethrow

+		} catch (RuntimeException e) {

+			this.handleInternalException(e, unit, null);

+			throw e; // rethrow

+		} finally {

+			// No reset is performed there anymore since,

+			// within the CodeAssist (or related tools),

+			// the compiler may be called *after* a call

+			// to this resolve(...) method. And such a call

+			// needs to have a compiler with a non-empty

+			// environment.

+			// this.reset();

 		}

 	}

 	

-	/* uncomment following line to see where the abort came from */

-	// abortException.printStackTrace(); 

+	/**

+	 * Returns all the options of the compiler to be shown by the UI

+	 *

+	 * @param locale java.util.Locale

+	 * @return org.eclipse.jdt.internal.compiler.ConfigurableOption[]

+	 */

+	public static ConfigurableOption[] getDefaultOptions(Locale locale) {

+		String[] ids = ConfigurableOption.getIDs(Compiler.class.getName(),locale);

+	

+		ConfigurableOption[] result = new ConfigurableOption[ids.length];

+		for(int i = 0 ; i < ids.length ; i++){

+			result[i] = new ConfigurableOption(ids[i],locale);

+		}

 		

-	// Exception may tell which compilation result it is related, and which problem caused it

-	CompilationResult result = abortException.compilationResult; 

-	if ((result == null) && (unit != null)) result = unit.compilationResult; // current unit being processed ?

-	if ((result == null) && (unitsToProcess != null) && (totalUnits > 0)) result = unitsToProcess[totalUnits - 1].compilationResult; // last unit in beginToCompile ?

-	if (result != null && !result.hasBeenAccepted){

-		/* distant problem which could not be reported back there */

-		if (abortException.problemId != 0){ 

-			result.record(

-				problemReporter.createProblem(

-					result.getFileName(),

-					abortException.problemId, 

-					abortException.problemArguments, 

-					Error, // severity

-					0, // source start

-					0, // source end

-					0)); // line number

-		} else {

-			/* distant internal exception which could not be reported back there */

-			if (abortException.exception != null){

-				this.handleInternalException(abortException.exception, 	null, result);

-				return;

-			}

-		}

-		/* hand back the compilation result */

-		if (!result.hasBeenAccepted) { 

-			requestor.acceptResult(result.tagAsAccepted());

-		}

-	} else {

-		/*

-		if (abortException.problemId != 0){ 

-			IProblem problem =

-				problemReporter.createProblem(

-					"???".toCharArray(),

-					abortException.problemId, 

-					abortException.problemArguments, 

-					Error, // severity

-					0, // source start

-					0, // source end

-					0); // line number

-			System.out.println(problem.getMessage());

-		}

-		*/

-		abortException.printStackTrace();

+		return result;

 	}

-}

-/**

- * Process a compilation unit already parsed and build.

- */

-private void process(CompilationUnitDeclaration unit,int i) {

-

-	getMethodBodies(unit,i);

-

-	// fault in fields & methods

-	if (unit.scope != null)

-		unit.scope.faultInTypes();

-

-	// verify inherited methods

-	if (unit.scope != null)

-		unit.scope.verifyMethods(lookupEnvironment.methodVerifier());

-

-	// type checking

-	long startTime = System.currentTimeMillis();

-	unit.resolve();

-

-	// flow analysis

-	startTime = System.currentTimeMillis();

-	unit.analyseCode();

-

-	// code generation

-	startTime = System.currentTimeMillis();

-	unit.generateCode();

-

-	// reference info

-	if (options.produceReferenceInfo && unit.scope != null)

-		unit.scope.storeDependencyInfo();

-

-	// refresh the total number of units known at this stage

-	unit.compilationResult.totalUnitsKnown = totalUnits;

-}

-public void reset(){

-	lookupEnvironment.reset();

-	parser.scanner.source = null;

-	unitsToProcess	 = null;

-}

-/**

- * Internal API used to resolve a compilation unit minimally for code assist engine

- */

-

-public CompilationUnitDeclaration resolve(ICompilationUnit sourceUnit) {

-	CompilationUnitDeclaration unit = null;

-	try {

-		// build and record parsed units

-		parseThreshold = 1; // will request a full parse

-		beginToCompile(new ICompilationUnit[] { sourceUnit });

-		// process all units (some more could be injected in the loop by the lookup environment)

-		unit = unitsToProcess[0];

-		//getMethodBodies(unit,i);

-		if (unit.scope != null) {

-			// fault in fields & methods

-			unit.scope.faultInTypes();

-			// type checking

-			unit.resolve();

-		}

-		unitsToProcess[0] = null; // release reference to processed unit declaration

-		requestor.acceptResult(unit.compilationResult.tagAsAccepted());

-		return unit;

-	} catch (AbortCompilation e) {

-		this.handleInternalException(e, unit);

-		return unit == null ? unitsToProcess[0] : unit;

-	} catch (Error e) {

-		this.handleInternalException(e, unit, null);

-		throw e; // rethrow

-	} catch (RuntimeException e) {

-		this.handleInternalException(e, unit, null);

-		throw e; // rethrow

-	} finally {

-		// No reset is performed there anymore since,

-		// within the CodeAssist (or related tools),

-		// the compiler may be called *after* a call

-		// to this resolve(...) method. And such a call

-		// needs to have a compiler with a non-empty

-		// environment.

-		// this.reset();

-	}

-}

-}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/ConfigurableOption.java b/compiler/org/eclipse/jdt/internal/compiler/ConfigurableOption.java
index e8b27b9..632250a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ConfigurableOption.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ConfigurableOption.java
@@ -7,206 +7,502 @@
 /**

  * Generic option description, which can be modified independently from the

  * component it belongs to.

+ * 

+ * File to modify when adding an option :

+ * Add option in option file of component

+ * Modify setOption method of component option class

+ * 

+ * Option file syntax

+ * <code>

+ * com.foo.Bar.optionOne.category=Category One

+ * com.foo.Bar.optionOne.name=Option One

+ * com.foo.Bar.optionOne.possibleValues=2|Value 1|Value 2

+ * com.foo.Bar.optionOne.description=Description of Option One

+ * com.foo.Bar.optionOne.default=0

+ * 

+ * com.foo.Bar.optionTwo.category=Category One

+ * com.foo.Bar.optionTwo.name=Option Two

+ * com.foo.Bar.optionTwo.possibleValues=-1|string

+ * com.foo.Bar.optionTwo.description=Description of Option Two

+ * com.foo.Bar.optionTwo.default=Value

+ *  

+ * com.foo.Bar.optionThree.category=Category Two

+ * com.foo.Bar.optionThree.name=Option Three

+ * com.foo.Bar.optionThree.possibleValues=-1|int|0|no

+ * com.foo.Bar.optionThree.description=Description of Option Three

+ * com.foo.Bar.optionThree.default=4

+ * </code>

+ * 

+ * possibleValues values :

+ * - A positive number and the list of the value

+ * - Value -1 following by type. If type is a number

+ * there is min and max value (with value no if there is no max or min

+ * 

+ * e.g.

+ * 2|Value 1|Value 2

+ * 3|Value 1|Value 2|Value 3

+ * -1|string

+ * -1|int|0|20

+ * -1|int|no|20

+ * -1|int|-10|no

+ * -1|int|no|no

+ * -1|int

+ * -1|float|0.0|20.0

+ * -1|float|no|20.0

+ * -1|float|-10.0|no

+ * -1|float|no|no

+ * -1|float

+ * 

  */

-

 import java.util.*;

 

 public class ConfigurableOption {

-	private String componentName;

-	private int id;

+	public final static String STRING = "string"; //$NON-NLS-1$

+	public final static String INT = "int"; //$NON-NLS-1$

+	public final static String FLOAT = "float"; //$NON-NLS-1$

+	public final static String DISCRETE = "discrete"; //$NON-NLS-1$

+	

+	// special value for <possibleValues> indicating that 

+	// the <currentValueIndex> is the actual value

+	public final static String[] NoDiscreteValue = {};

 

+	private String id;

+	private String value;

+	private int valueIndex = -1;

+	private String defaultValue;

+	private int defaultValueIndex = -1;

 	private String category;

 	private String name;

 	private String description;

-	private int currentValueIndex;

-	private int defaultValueIndex;

 	private String[] possibleValues;

+	private int order;

+	

+	private String type;

+	private boolean maxExisting = false;

+	private boolean minExisting = false;

+	private int maxInt;

+	private int minInt;

+	private float maxFloat;

+	private float minFloat;

+	

+	

+	private Locale loc;

 

-	// special value for <possibleValues> indicating that 

-	// the <currentValueIndex> is the actual value

-	public final static String[] NoDiscreteValue = {}; 

-/**

- * INTERNAL USE ONLY

- *

- * Initialize an instance of this class according to a specific locale

- *

- * @param loc java.util.Locale

- */

-public ConfigurableOption(

-	String componentName, 

-	String optionName, 

-	Locale loc, 

-	int currentValueIndex) {

+	private String componentName;

+	private String missing;

 

-	this.componentName = componentName;

-	this.currentValueIndex = currentValueIndex;

-		

-	ResourceBundle resource = null;

-	try {

-		String location = componentName.substring(0, componentName.lastIndexOf('.'));

-		resource = ResourceBundle.getBundle(location + ".options"/*nonNLS*/, loc); 

-	} catch (MissingResourceException e) {

-		category = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-		name = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-		description = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-		possibleValues = new String[0];

-		id = -1;

-	}

-	if (resource == null) return;

-	try {

-		id = Integer.parseInt(resource.getString(optionName + ".number"/*nonNLS*/)); 

-	} catch (MissingResourceException e) {

-		id = -1;

-	} catch (NumberFormatException e) {

-		id = -1;

-	}

-	try {

-		category = resource.getString(optionName + ".category"/*nonNLS*/); 

-	} catch (MissingResourceException e) {

-		category = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-	}

-	try {

-		name = resource.getString(optionName + ".name"/*nonNLS*/); 

-	} catch (MissingResourceException e) {

-		name = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-	}

-	try {

-		StringTokenizer tokenizer = new StringTokenizer(resource.getString(optionName + ".possibleValues"/*nonNLS*/), "|"/*nonNLS*/);

-		int numberOfValues = Integer.parseInt(tokenizer.nextToken());

-		if(numberOfValues == -1){

+	public ConfigurableOption(String id, Locale loc) {

+		this.id = id;

+		this.value = value;

+		this.loc = loc;

+

+		this.componentName = id.substring(0,id.lastIndexOf('.'));

+

+		ResourceBundle bundle = null;

+		missing = "Missing ressources entries for" + componentName + " options"; //$NON-NLS-2$ //$NON-NLS-1$

+		try {

+			bundle = ResourceBundle.getBundle(componentName,loc); 

+		} catch (MissingResourceException e) {

+			id = missing;

+			defaultValue = missing;

+			category = missing;

+			name = missing;

+			description = missing;

 			possibleValues = NoDiscreteValue;

-		} else {

-			possibleValues = new String[numberOfValues];

-			int index = 0;

-			while (tokenizer.hasMoreTokens()) {

-				possibleValues[index] = tokenizer.nextToken();

-				index++;

+		}

+		if (bundle == null) return;

+		try{

+			StringTokenizer tokenizer =

+				new StringTokenizer(

+					bundle.getString(id + ".possibleValues"), //$NON-NLS-1$

+					"|"); //$NON-NLS-1$

+			int numberOfValues = Integer.parseInt(tokenizer.nextToken());

+			if (numberOfValues == -1) {

+				// the possible value are not discrete

+				possibleValues = NoDiscreteValue;

+				

+				String token = tokenizer.nextToken();

+				type = token;

+				if(token.equals(STRING)){

+

+				}

+				else if(token.equals(INT) && tokenizer.hasMoreTokens()){

+					token = tokenizer.nextToken();

+					if(!token.equals("no")){ //$NON-NLS-1$

+						minExisting = true;

+						minInt = Integer.parseInt(token);

+					}

+					token = tokenizer.nextToken();

+					if(!token.equals("no")){ //$NON-NLS-1$

+						maxExisting = true;

+						maxInt = Integer.parseInt(token);

+					}

+				}

+				else if(token.equals(FLOAT) && tokenizer.hasMoreTokens()){

+					token = tokenizer.nextToken();

+					if(!token.equals("no")){ //$NON-NLS-1$

+						minExisting = true;

+						minFloat = Float.parseFloat(token);

+					}

+					token = tokenizer.nextToken();

+					if(!token.equals("no")){ //$NON-NLS-1$

+						maxExisting = true;

+						maxFloat = Float.parseFloat(token);

+					}

+				}			

+			} else {

+				// possible value are discrete

+				type = DISCRETE;

+				possibleValues = new String[numberOfValues];

+				int index = 0;

+				while (tokenizer.hasMoreTokens()) {

+					possibleValues[index] = tokenizer.nextToken();

+					index++;

+				}

+			}

+			

+		} catch (MissingResourceException e) {

+			possibleValues = NoDiscreteValue;

+			type = missing;

+		} catch (NoSuchElementException e) {

+			possibleValues = NoDiscreteValue;

+			type = missing;

+		} catch (NumberFormatException e) {

+			possibleValues = NoDiscreteValue;

+			type = missing;

+		}

+		try{

+			if(possibleValues == NoDiscreteValue){

+				defaultValue = bundle.getString(id + ".default"); //$NON-NLS-1$

+			}

+			else{

+				defaultValueIndex = Integer.parseInt(bundle.getString(id + ".default")); //$NON-NLS-1$

+			}

+		} catch (MissingResourceException e) {

+			defaultValue = missing;

+		} catch (NumberFormatException e) {

+			defaultValueIndex = -1;

+		}

+		try{

+			order = Integer.parseInt(bundle.getString(id + ".order")); //$NON-NLS-1$

+		} catch (NumberFormatException e) {

+			order = -1;

+		} catch (MissingResourceException e) {

+			order = -1;

+		}

+		try{

+			category = bundle.getString(id + ".category"); //$NON-NLS-1$

+		} catch (MissingResourceException e) {

+			category = missing;

+		}

+		try{

+			name = bundle.getString(id + ".name"); //$NON-NLS-1$

+		} catch (MissingResourceException e) {

+			name = missing;

+		}

+		try{

+			description = bundle.getString(id + ".description"); //$NON-NLS-1$

+		} catch (MissingResourceException e) {

+			description = missing;

+		}

+	}

+	

+	/**

+	* Internal ID which allows the configurable component to identify this particular option.

+	*

+	* @return String

+	*/

+	public String getID() {

+		return id;

+	}

+	

+	/**

+	* Answer the value of the current setting for this particular option.

+	*

+	* @return String

+	*/

+	public String getValue() {

+		if(possibleValues == NoDiscreteValue){

+			if (value == null)

+				return getDefaultValue();

+			return value;

+		}

+		else {

+			if (valueIndex == -1)

+				return getDefaultValue();

+			return possibleValues[valueIndex];

+		}

+	}

+	

+	/**

+	* Change the value of the current setting for this particular option.

+	*

+	* @param value String

+	*/

+	public void setValue(String value) {

+		if(possibleValues == NoDiscreteValue){

+			this.value = value;

+		}

+		else{

+			for(int i = 0 ; i < possibleValues.length ; i++){

+				if(possibleValues[i].equals(value)){

+					this.valueIndex = i;

+					break;

+				}

 			}

 		}

-	} catch (MissingResourceException e) {

-		possibleValues = new String[0];

-	} catch (NoSuchElementException e) {

-		possibleValues = new String[0];

-	} catch (NumberFormatException e) {

-		possibleValues = new String[0];

 	}

-	try {

-		description = resource.getString(optionName + ".description"/*nonNLS*/); 

-	} catch (MissingResourceException e) {

-		description = "Missing ressources entries for"/*nonNLS*/ + componentName + " options"/*nonNLS*/;

-	}

-}

-/**

- * Return a String that represents the localized category of the receiver.

- * @return java.lang.String

- */

-public String getCategory() {

-	return category;

-}

-/**

- * Return a String that identifies the component owner (typically the qualified

- *	type name of the class which it corresponds to).

- *

- * e.g. "org.eclipse.jdt.internal.compiler.api.Compiler"

- *

- * @return java.lang.String

- */

-public String getComponentName() {

-	return componentName;

-}

-/**

- * Answer the index (in possibleValues array) of the current setting for this

- * particular option.

- *

- * In case the set of possibleValues is NoDiscreteValue, then this index is the

- * actual value (e.g. max line lenght set to 80).

- *

- * @return int

- */

-public int getCurrentValueIndex() {

-	return currentValueIndex;

-}

-/**

- * Answer the index (in possibleValues array) of the default setting for this

- * particular option.

- *

- * In case the set of possibleValues is NoDiscreteValue, then this index is the

- * actual value (e.g. max line lenght set to 80).

- *

- * @return int

- */

-public int getDefaultValueIndex() {

-	return defaultValueIndex;

-}

-/**

- * Return an String that represents the localized description of the receiver.

- *

- * @return java.lang.String

- */

-public String getDescription() {

-	return description;

-}

-/**

- * Internal ID which allows the configurable component to identify this particular option.

- *

- * @return int

- */

-public int getID() {

-	return id;

-}

-/**

- * Return a String that represents the localized name of the receiver.

- * @return java.lang.String

- */

-public String getName() {

-	return name;

-}

-/**

- * Return an array of String that represents the localized possible values of the receiver.

- * @return java.lang.String[]

- */

-public String[] getPossibleValues() {

-	return possibleValues;

-}

-/**

- * Change the index (in possibleValues array) of the current setting for this

- * particular option.

- *

- * In case the set of possibleValues is NoDiscreteValue, then this index is the

- * actual value (e.g. max line lenght set to 80).

- *

- * @return int

- */

-public void setValueIndex(int newIndex) {

-	currentValueIndex = newIndex;

-}

-public String toString() {

-	StringBuffer buffer = new StringBuffer();

-	buffer.append("Configurable option for "/*nonNLS*/);

-	buffer.append(this.componentName).append("\n"/*nonNLS*/);

-	buffer.append("- category:			"/*nonNLS*/).append(this.category).append("\n"/*nonNLS*/);

-	buffer.append("- name:				"/*nonNLS*/).append(this.name).append("\n"/*nonNLS*/);

-	/* display current value */

-	buffer.append("- current value:	"/*nonNLS*/);

-	if (possibleValues == NoDiscreteValue){

-		buffer.append(this.currentValueIndex);

-	} else {

-		buffer.append(this.possibleValues[this.currentValueIndex]);

-	}

-	buffer.append("\n"/*nonNLS*/);

 	

-	/* display possible values */

-	if (possibleValues != NoDiscreteValue){

-		buffer.append("- possible values:	["/*nonNLS*/);

-		for (int i = 0, max = possibleValues.length; i < max; i++) {

-			if (i != 0)

-				buffer.append(", "/*nonNLS*/);

-			buffer.append(possibleValues[i]);

-		}

-		buffer.append("]\n"/*nonNLS*/);

-		buffer.append("- curr. val. index:	"/*nonNLS*/).append(currentValueIndex).append("\n"/*nonNLS*/);

+	/**

+	 * Gets the valueIndex

+	 * @return Returns a int

+	 */

+	public int getValueIndex() {

+		if(possibleValues == NoDiscreteValue)

+			return -1;

+		if (valueIndex == -1)

+			return getDefaultValueIndex();

+		return valueIndex;

 	}

-	buffer.append("- description:		"/*nonNLS*/).append(description).append("\n"/*nonNLS*/);

-	return buffer.toString();

-}

-}

+	/**

+	 * Sets the valueIndex

+	 * @param valueIndex The valueIndex to set

+	 */

+	public void setValueIndex(int valueIndex) {

+		if(valueIndex < 0 || valueIndex >= possibleValues.length){

+			this.valueIndex = -1;

+		}

+		else {

+			this.valueIndex = valueIndex;

+		}

+	}

+

+	/**

+	* Answer the value of the default setting for this particular option.

+	*

+	* @return String

+	*/

+	public String getDefaultValue() {

+		if(possibleValues != NoDiscreteValue){

+			if(defaultValueIndex == -1)

+				return missing;

+			return possibleValues[defaultValueIndex];

+		}

+		return defaultValue;

+	}

+	

+	/**

+	* Change the value of the default setting for this particular option.

+	*

+	* @param value String

+	*/

+	public void setDefaultValue(String defaultValue) {		

+		if(possibleValues == NoDiscreteValue){

+			this.defaultValue = defaultValue;

+		}

+		else{

+			for(int i = 0 ; i < possibleValues.length ; i++){

+				if(possibleValues[i].equals(defaultValue)){

+					this.defaultValueIndex = i;

+					break;

+				}

+			}

+		}

+	}

+	

+	public void setToDefault(){

+		value = null;

+		valueIndex = -1;

+	}

+	

+	/**

+	 * Gets the defaultValueIndex

+	 * @return Returns a int

+	 */

+	public int getDefaultValueIndex() {

+		if(possibleValues == NoDiscreteValue)

+			return -1;

+		

+		return defaultValueIndex;

+	}

+	/**

+	 * Sets the defaultValueIndex

+	 * @param defaultValueIndex The defaultValueIndex to set

+	 */

+	public void setDefaultValueIndex(int defaultValueIndex) {

+		if(defaultValueIndex < 0 || defaultValueIndex >= possibleValues.length){

+			this.defaultValueIndex = -1;

+		}

+		else {

+			this.defaultValueIndex = defaultValueIndex;

+		}

+	}

+	/**

+ 	* Return a String that represents the localized category of the receiver.

+ 	* @return java.lang.String

+ 	*/

+	public String getCategory() {

+		return category;

+	}

+

+	/**

+	* Return a String that represents the localized name of the receiver.

+	* @return java.lang.String

+	*/

+	public String getName() {

+		return name;

+	}

+	

+	/**

+	* Return an String that represents the localized description of the receiver.

+	*

+	* @return java.lang.String

+	*/

+	public String getDescription() {

+		return description;

+	}

+

+	/**

+	* Return an array of String that represents the localized possible values of the receiver.

+	*

+	* @return java.lang.String[]

+	*/

+	public String[] getPossibleValues() {

+		return possibleValues;

+	}

+

+	/**

+	* Return a String that identifies the component owner (typically the qualified

+	*	type name of the class which it corresponds to).

+	*

+	* e.g. "org.eclipse.jdt.internal.compiler.api.Compiler"

+	*

+	* @return java.lang.String

+	*/

+	public String getComponentName() {

+		return componentName;

+	}

+	

+	/**

+	 * Gets the type

+	 * @return Returns a int

+	 */

+	public String getType() {

+		return type;

+	}

+

+	/**

+	 * Gets the max

+	 * @return Returns a Number

+	 */

+	public Number getMax() {

+		if(possibleValues == NoDiscreteValue){

+			if(type.equals(INT)){

+				if(maxExisting){

+					return new Integer(maxInt);

+				}

+				else {

+					return new Integer(Integer.MAX_VALUE);

+				}

+			}

+			else if(type.equals(FLOAT)){

+				if(maxExisting){

+					return new Float(maxFloat);

+				}

+				else {

+					return new Float(Float.MAX_VALUE);

+				}

+			}

+		}

+		return null;

+	}

+

+	/**

+	 * Gets the min

+	 * @return Returns a Number

+	 */

+	public Number getMin() {

+		if(possibleValues == NoDiscreteValue){

+			if(type.equals(INT)){

+				if(minExisting){

+					return new Integer(minInt);

+				}

+				else {

+					return new Integer(Integer.MIN_VALUE);

+				}

+			}

+			else if(type.equals(FLOAT)){

+				if(minExisting){

+					return new Float(minFloat);

+				}

+				else {

+					return new Float(Float.MIN_VALUE);

+				}

+			}

+		}

+		return null;

+	}

+	

+	public String toString() {

+		StringBuffer buffer = new StringBuffer();

+		buffer.append("Configurable option for "); //$NON-NLS-1$

+		buffer.append(this.componentName).append("\n"); //$NON-NLS-1$

+		buffer.append("- category:			").append(this.category).append("\n"); //$NON-NLS-2$ //$NON-NLS-1$

+		buffer.append("- name:				").append(this.name).append("\n"); //$NON-NLS-2$ //$NON-NLS-1$

+		/* display current value */

+		buffer.append("- current value:	    ").append(this.value).append("\n"); //$NON-NLS-2$ //$NON-NLS-1$

+		/* display possible values */

+		if (possibleValues != NoDiscreteValue){

+			buffer.append("- possible values:	["); //$NON-NLS-1$

+			for (int i = 0, max = possibleValues.length; i < max; i++) {

+				if (i != 0)

+					buffer.append(", "); //$NON-NLS-1$

+				buffer.append(possibleValues[i]);

+			}

+			buffer.append("]\n"); //$NON-NLS-1$

+		}

+		buffer.append("- description:		").append(description).append("\n"); //$NON-NLS-2$ //$NON-NLS-1$

+		return buffer.toString();

+	}

+	

+	public static String[] getIDs(String componentName,Locale locale){

+		try {

+			ResourceBundle bundle = ResourceBundle.getBundle(componentName,locale);

+			Enumeration bundleKeys = bundle.getKeys();

+			

+			String partialResult[] = new String[100];

+			int resultCount = 0;

+

+			while(bundleKeys.hasMoreElements()){

+				String bundleKey = (String)bundleKeys.nextElement();

+				if(bundleKey.endsWith("order")){ //$NON-NLS-1$

+					int order;

+					try{

+						order = Integer.parseInt(bundle.getString(bundleKey));

+					

+						String id = bundleKey.substring(0,bundleKey.lastIndexOf('.'));

+						int length = partialResult.length;

+						if(length <= order)

+							System.arraycopy(partialResult,0,partialResult = new String[order+1],0,length);

+						partialResult[order]= id;

+						resultCount++;

+					} catch (NumberFormatException e) {

+						//if order can not be read, option is not add

+					}

+				}

+			}

+			String[] result = new String[resultCount];

+			resultCount = 0;

+			for(int i = 0; i < partialResult.length;i++){

+				if(partialResult[i]!= null){

+					result[resultCount++]=partialResult[i];

+					

+				}

+			}

+			return result;

+			

+		} catch (MissingResourceException e) {

+			return new String[0];

+		}

+	}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java b/compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
index d49cd5c..89e34b5 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
@@ -27,6 +27,8 @@
 import org.eclipse.jdt.internal.compiler.parser.*;

 import org.eclipse.jdt.internal.compiler.problem.*;

 import org.eclipse.jdt.internal.compiler.util.*;

+

+import java.util.Locale;

  

 public class DocumentElementParser extends Parser {

 	IDocumentElementRequestor requestor;

@@ -44,18 +46,27 @@
 	int intArrayPtr;

 public DocumentElementParser(

 	final IDocumentElementRequestor requestor, 

-	IProblemFactory problemFactory) {

+	IProblemFactory problemFactory,

+	CompilerOptions options) {

 	super(new ProblemReporter(

 		DefaultErrorHandlingPolicies.exitAfterAllProblems(), 

-		new CompilerOptions(), 

+		options, 

 		problemFactory) {

 		public void record(IProblem problem, CompilationResult unitResult) {

 			requestor.acceptProblem(problem);

 		}

-	}, false);

+	},

+	false,

+	options.getAssertMode());

 	this.requestor = requestor;

 	intArrayStack = new int[30][];

 }

+

+public DocumentElementParser(

+	final IDocumentElementRequestor requestor, 

+	IProblemFactory problemFactory) {

+		this(requestor, problemFactory, new CompilerOptions(Compiler.getDefaultOptions(Locale.getDefault())));

+}

 /**

  *

  * INTERNAL USE-ONLY

@@ -1259,7 +1270,7 @@
 }

 public String toString() {

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("intArrayPtr = "/*nonNLS*/ + intArrayPtr + "\n"/*nonNLS*/);

+	buffer.append("intArrayPtr = " + intArrayPtr + "\n"); //$NON-NLS-1$ //$NON-NLS-2$

 	buffer.append(super.toString());

 	return buffer.toString();

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/HierarchyResolver.java b/compiler/org/eclipse/jdt/internal/compiler/HierarchyResolver.java
index 0ff225f..15af316 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/HierarchyResolver.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/HierarchyResolver.java
@@ -25,6 +25,8 @@
 import org.eclipse.jdt.internal.compiler.problem.*;

 import org.eclipse.jdt.internal.compiler.util.*;

 

+import java.util.Locale;

+

 public class HierarchyResolver implements ITypeRequestor {

 	IHierarchyRequestor requestor;

 	LookupEnvironment lookupEnvironment;

@@ -32,6 +34,8 @@
 	private int typeIndex;

 	private IGenericType[] typeModels;

 	private ReferenceBinding[] typeBindings;

+	private ReferenceBinding focusType;

+	

 public HierarchyResolver(

 	INameEnvironment nameEnvironment,

 	IErrorHandlingPolicy policy,

@@ -72,28 +76,32 @@
 public void accept(ICompilationUnit sourceUnit) {

 	//System.out.println("Cannot accept compilation units inside the HierarchyResolver.");

 	lookupEnvironment.problemReporter.abortDueToInternalError(

-		new StringBuffer(Util.bind("accept.cannot"/*nonNLS*/))

+		new StringBuffer(Util.bind("accept.cannot")) //$NON-NLS-1$

 			.append(sourceUnit.getFileName())

 			.toString());

 }

 /**

- * Add an additional source type

+ * Add additional source types

  */

 

-public void accept(ISourceType sourceType, PackageBinding packageBinding) {

-	CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1);

+public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {

+	CompilationResult result = new CompilationResult(sourceTypes[0].getFileName(), 1, 1);

 	CompilationUnitDeclaration unit =

-		SourceTypeConverter.buildCompilationUnit(sourceType, false, true, lookupEnvironment.problemReporter, result);

+		SourceTypeConverter.buildCompilationUnit(sourceTypes, false, true, lookupEnvironment.problemReporter, result);

 

 	if (unit != null) {

 		lookupEnvironment.buildTypeBindings(unit);

-		rememberWithMemberTypes(sourceType, unit.types[0].binding);

+		rememberWithMemberTypes(sourceTypes[0], unit.types[0].binding);

 

 		lookupEnvironment.completeTypeBindings(unit, false);

 	}

 }

 private void remember(IGenericType suppliedType, ReferenceBinding typeBinding) {

 	if (typeBinding == null) return;

+	

+	if (!subOrSuperOfFocus(typeBinding)) {

+		return; // ignore types outside of hierarchy

+	}

 

 	if (++typeIndex == typeModels.length) {

 		System.arraycopy(typeModels, 0, typeModels = new IGenericType[typeIndex * 2], 0, typeIndex);

@@ -225,11 +233,11 @@
 		int suppliedLength = suppliedTypes == null ? 0 : suppliedTypes.length;

 		int sourceLength = sourceUnits == null ? 0 : sourceUnits.length;

 		CompilationUnitDeclaration[] units = new CompilationUnitDeclaration[suppliedLength + sourceLength];

-		int count = -1;

+		

+		// build type bindings

 		for (int i = 0; i < suppliedLength; i++) {

 			if (suppliedTypes[i].isBinaryType()) {

 				IBinaryType binaryType = (IBinaryType) suppliedTypes[i];

-				suppliedTypes[i] = null; // no longer needed pass this point

 				try {

 					remember(binaryType, lookupEnvironment.cacheBinaryType(binaryType, false));

 				} catch (AbortCompilation e) {

@@ -238,18 +246,13 @@
 			} else {

 				// must start with the top level type

 				ISourceType topLevelType = (ISourceType) suppliedTypes[i];

-				suppliedTypes[i] = null; // no longer needed pass this point				

 				while (topLevelType.getEnclosingType() != null)

 					topLevelType = topLevelType.getEnclosingType();

 				CompilationResult result = new CompilationResult(topLevelType.getFileName(), i, suppliedLength);

-				units[++count] = SourceTypeConverter.buildCompilationUnit(topLevelType, false, true, lookupEnvironment.problemReporter, result);

-

-				if (units[count] == null) {

-					count--;

-				} else {

+				units[i] = SourceTypeConverter.buildCompilationUnit(new ISourceType[]{topLevelType}, false, true, lookupEnvironment.problemReporter, result);

+				if (units[i] != null) {

 					try {

-						lookupEnvironment.buildTypeBindings(units[count]);

-						rememberWithMemberTypes(topLevelType, units[count].types[0].binding);

+						lookupEnvironment.buildTypeBindings(units[i]);

 					} catch (AbortCompilation e) {

 						// classpath problem for this type: ignore

 					}

@@ -258,21 +261,47 @@
 		}

 		for (int i = 0; i < sourceLength; i++){

 			ICompilationUnit sourceUnit = sourceUnits[i];

-			sourceUnits[i] = null; // no longer needed pass this point

 			CompilationResult unitResult = new CompilationResult(sourceUnit, suppliedLength+i, suppliedLength+sourceLength); 

-			Parser parser = new Parser(lookupEnvironment.problemReporter);

+			CompilerOptions options = new CompilerOptions(Compiler.getDefaultOptions(Locale.getDefault()));

+			Parser parser = new Parser(lookupEnvironment.problemReporter, false, options.getAssertMode());

 			CompilationUnitDeclaration parsedUnit = parser.dietParse(sourceUnit, unitResult);

 			if (parsedUnit != null) {

-				units[++count] = parsedUnit;

-				lookupEnvironment.buildTypeBindings(units[count]);

+				units[suppliedLength+i] = parsedUnit;

+				lookupEnvironment.buildTypeBindings(parsedUnit);

+			}

+		}

+		

+		// complete type bindings (ie. connect super types) and remember them

+		for (int i = 0; i < suppliedLength; i++) {

+			if (!suppliedTypes[i].isBinaryType()) { // note that binary types have already been remembered above

+				CompilationUnitDeclaration parsedUnit = units[i];

+				if (parsedUnit != null) {

+					// must start with the top level type

+					ISourceType topLevelType = (ISourceType) suppliedTypes[i];

+					suppliedTypes[i] = null; // no longer needed pass this point				

+					while (topLevelType.getEnclosingType() != null)

+						topLevelType = topLevelType.getEnclosingType();

+					try {

+						lookupEnvironment.completeTypeBindings(parsedUnit, false);

+						rememberWithMemberTypes(topLevelType, parsedUnit.types[0].binding);

+					} catch (AbortCompilation e) {

+						// classpath problem for this type: ignore

+					}

+				}

+			}

+		}

+		for (int i = 0; i < sourceLength; i++) {

+			CompilationUnitDeclaration parsedUnit = units[suppliedLength+i];

+			if (parsedUnit != null) {

+				lookupEnvironment.completeTypeBindings(parsedUnit, false);

 				int typeCount = parsedUnit.types == null ? 0 : parsedUnit.types.length;

+				ICompilationUnit sourceUnit = sourceUnits[i];

+				sourceUnits[i] = null; // no longer needed pass this point

 				for (int j = 0; j < typeCount; j++){

 					rememberWithMemberTypes(parsedUnit.types[j], null, sourceUnit);

 				}

 			}

 		}

-		for (int i = 0; i <= count; i++)

-			lookupEnvironment.completeTypeBindings(units[i], false);

 

 		reportHierarchy();

 		

@@ -299,7 +328,7 @@
 				topLevelType = topLevelType.getEnclosingType();

 			CompilationResult result = new CompilationResult(topLevelType.getFileName(), 1, 1);

 			CompilationUnitDeclaration unit =

-				SourceTypeConverter.buildCompilationUnit(topLevelType, false, true, lookupEnvironment.problemReporter, result);

+				SourceTypeConverter.buildCompilationUnit(new ISourceType[]{topLevelType}, false, true, lookupEnvironment.problemReporter, result);

 

 			if (unit != null) {

 				lookupEnvironment.buildTypeBindings(unit);

@@ -314,4 +343,30 @@
 		reset();

 	}

 }

+/**

+ * Set the focus type (ie. the type that this resolver is computing the hierarch for.

+ */

+public void setFocusType(char[][] compoundName) {

+	if (compoundName == null || this.lookupEnvironment == null) return;

+	this.focusType = this.lookupEnvironment.askForType(compoundName);

+	

+}

+private boolean subOrSuperOfFocus(ReferenceBinding typeBinding) {

+	if (this.focusType == null) return true; // accept all types (case of hierarchy in a region)

+	if (this.subTypeOfType(this.focusType, typeBinding)) return true;

+	if (this.subTypeOfType(typeBinding, this.focusType)) return true;

+	return false;

+}

+private boolean subTypeOfType(ReferenceBinding subType, ReferenceBinding typeBinding) {

+	if (typeBinding == null || subType == null) return false;

+	if (subType == typeBinding) return true;

+	if (this.subTypeOfType(subType.superclass(), typeBinding)) return true;

+	ReferenceBinding[] superInterfaces = subType.superInterfaces();

+	if (superInterfaces != null) {

+		for (int i = 0, length = superInterfaces.length; i < length; i++) {

+			if (this.subTypeOfType(superInterfaces[i], typeBinding)) return true;

+		} 

+	}

+	return false;

+}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/IAbstractSyntaxTreeVisitor.java b/compiler/org/eclipse/jdt/internal/compiler/IAbstractSyntaxTreeVisitor.java
index cee2764..a47f273 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/IAbstractSyntaxTreeVisitor.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/IAbstractSyntaxTreeVisitor.java
@@ -23,6 +23,7 @@
 	void endVisit(ArrayReference arrayReference, BlockScope scope);

 	void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope);

 	void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope);

+	void endVisit(AssertStatement assertStatement, BlockScope scope);

 	void endVisit(Assignment assignment, BlockScope scope);

 	void endVisit(BinaryExpression binaryExpression, BlockScope scope);

 	void endVisit(Block block, BlockScope scope);

@@ -98,6 +99,7 @@
 	boolean visit(ArrayReference arrayReference, BlockScope scope);

 	boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope);

 	boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope);

+	boolean visit(AssertStatement assertStatement, BlockScope scope);

 	boolean visit(Assignment assignment, BlockScope scope);

 	boolean visit(BinaryExpression binaryExpression, BlockScope scope);

 	boolean visit(Block block, BlockScope scope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java
index 4529056..9a130fb 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java
@@ -31,6 +31,7 @@
 import org.eclipse.jdt.internal.compiler.parser.*;

 import org.eclipse.jdt.internal.compiler.problem.*;

 import org.eclipse.jdt.internal.compiler.util.*;

+import java.util.Locale;

 

 public class SourceElementParser extends Parser {

 	ISourceElementRequestor requestor;

@@ -42,26 +43,36 @@
 	private char[][] typeNames;

 	private char[][] superTypeNames;

 	private int nestedTypeIndex;

-	private static final char[] JAVA_LANG_OBJECT = "java.lang.Object"/*nonNLS*/.toCharArray();

+	private static final char[] JAVA_LANG_OBJECT = "java.lang.Object".toCharArray(); //$NON-NLS-1$

 public SourceElementParser(

 	final ISourceElementRequestor requestor, 

-	IProblemFactory problemFactory) {

+	IProblemFactory problemFactory,

+	CompilerOptions options) {

 	// we want to notify all syntax error with the acceptProblem API

 	// To do so, we define the record method of the ProblemReporter

 	super(new ProblemReporter(

-		DefaultErrorHandlingPolicies.exitAfterAllProblems(), 

-		new CompilerOptions(), 

+		DefaultErrorHandlingPolicies.exitAfterAllProblems(),

+		options, 

 		problemFactory) {

 		public void record(IProblem problem, CompilationResult unitResult) {

 			unitResult.record(problem);

 			requestor.acceptProblem(problem);

 		}

-	}, false);

+	},

+	false,

+	options.getAssertMode());

 	this.requestor = requestor;

 	typeNames = new char[4][];

 	superTypeNames = new char[4][];

 	nestedTypeIndex = 0;

 }

+

+public SourceElementParser(

+	final ISourceElementRequestor requestor, 

+	IProblemFactory problemFactory) {

+		this(requestor, problemFactory, new CompilerOptions(Compiler.getDefaultOptions(Locale.getDefault())));

+}

+

 protected void classInstanceCreation(boolean alwaysQualified) {

 

 	boolean previousFlag = reportReferenceInfo;

@@ -824,7 +835,7 @@
 

 		CompilationUnitDeclaration unit = 

 			SourceTypeConverter.buildCompilationUnit(

-				sourceType, 

+				new ISourceType[]{sourceType}, 

 				false,

 				false, 

 				problemReporter(), 

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 14e6800..d867c09 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -29,7 +29,7 @@
 	public boolean ignoreFurtherInvestigation = false;

 	public boolean needFreeReturn = false;

 	public LocalVariableBinding secretReturnValue;

-	static final char[] SecretLocalDeclarationName = " returnValue"/*nonNLS*/.toCharArray();

+	static final char[] SecretLocalDeclarationName = " returnValue".toCharArray(); //$NON-NLS-1$

 

 	public int bodyStart;

 	public int bodyEnd = -1;

@@ -249,7 +249,7 @@
 public String returnTypeToString(int tab) {

 	/*slow code */

 

-	return ""/*nonNLS*/;

+	return ""; //$NON-NLS-1$

 }

 public void tagAsHavingErrors() {

 	ignoreFurtherInvestigation = true;

@@ -264,21 +264,21 @@
 

 	s += returnTypeToString(0);

 

-	s += new String(selector) + "("/*nonNLS*/;

+	s += new String(selector) + "("; //$NON-NLS-1$

 	if (arguments != null) {

 		for (int i = 0; i < arguments.length; i++) {

 			s += arguments[i].toString(0);

 			if (i != (arguments.length - 1))

-				s = s + ", "/*nonNLS*/;

+				s = s + ", "; //$NON-NLS-1$

 		};

 	};

-	s += ")"/*nonNLS*/;

+	s += ")"; //$NON-NLS-1$

 	if (thrownExceptions != null) {

-		s += " throws "/*nonNLS*/;

+		s += " throws "; //$NON-NLS-1$

 		for (int i = 0; i < thrownExceptions.length; i++) {

 			s += thrownExceptions[i].toString(0);

 			if (i != (thrownExceptions.length - 1))

-				s = s + ", "/*nonNLS*/;

+				s = s + ", "; //$NON-NLS-1$

 		};

 	};

 

@@ -289,18 +289,18 @@
 public String toStringStatements(int tab) {

 	/* slow code */

 

-	if (isAbstract() || (this.modifiers & AccSemicolonBody) != 0) return ";"/*nonNLS*/;

+	if (isAbstract() || (this.modifiers & AccSemicolonBody) != 0) return ";"; //$NON-NLS-1$

 	

-	String s = " {"/*nonNLS*/;

+	String s = " {"; //$NON-NLS-1$

 	if (statements != null) {

 		for (int i = 0; i < statements.length; i++){

-			s = s + "\n"/*nonNLS*/ + statements[i].toString(tab);

+			s = s + "\n" + statements[i].toString(tab); //$NON-NLS-1$

 			if (!(statements[i] instanceof Block)){

-				s += ";"/*nonNLS*/;

+				s += ";"; //$NON-NLS-1$

 			}

 		}

 	}

-	s += "\n"/*nonNLS*/ + tabString(tab == 0 ? 0 : tab - 1) + "}"/*nonNLS*/;

+	s += "\n" + tabString(tab == 0 ? 0 : tab - 1) + "}"; //$NON-NLS-2$ //$NON-NLS-1$

 	return s;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
index 8539431..0f2b24b 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
@@ -21,7 +21,7 @@
 public AbstractVariableDeclaration(){}

 public String name(){

 

-	return "anonymous storage box"/*nonNLS*/; }

+	return "anonymous storage box"; } //$NON-NLS-1$

 public String toString(int tab) {

 	/*slow code*/

 

@@ -29,9 +29,9 @@
 	if (modifiers != AccDefault) {

 		s += modifiersString(modifiers);

 	}

-	s += type.toString(0) + " "/*nonNLS*/ + new String(name());

+	s += type.toString(0) + " " + new String(name()); //$NON-NLS-1$

 	if (initialization != null)

-		s += " = "/*nonNLS*/ + initialization.toStringExpression(tab);

+		s += " = " + initialization.toStringExpression(tab); //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index 4ae4b54..9261fd4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -139,21 +139,21 @@
 			if ((argumentTypes[i] = arguments[i].resolveType(scope)) == null)

 				argHasError = true;

 		if (argHasError)

-			return null;

+			return typeBinding;

 	}

 	if (typeBinding == null)

 		return null;

 

 	if (!typeBinding.canBeInstantiated()) {

 		scope.problemReporter().cannotInstantiate(type, typeBinding);

-		return null;

+		return typeBinding;

 	}

 	ReferenceBinding allocatedType = (ReferenceBinding) typeBinding;

 	if (!(binding = scope.getConstructor(allocatedType, argumentTypes, this)).isValidBinding()) {

 		if (binding.declaringClass == null)

 			binding.declaringClass = allocatedType;

 		scope.problemReporter().invalidConstructor(this, binding);

-		return null;

+		return typeBinding;

 	}

 	if (isMethodUseDeprecated(binding, scope))

 		scope.problemReporter().deprecatedMethod(binding, this);

@@ -172,17 +172,17 @@
 public String toStringExpression() {

 	/* slow code */

 

-	String s = "new "/*nonNLS*/ + type.toString(0);

+	String s = "new " + type.toString(0); //$NON-NLS-1$

 	if (arguments == null)

-		s = s + "()"/*nonNLS*/ ;

+		s = s + "()" ; //$NON-NLS-1$

 	else

-	{	s = s + "("/*nonNLS*/;

+	{	s = s + "("; //$NON-NLS-1$

 		for (int i = 0 ; i < arguments.length ; i++)

 		{	s = s + arguments[i].toStringExpression();

 			if (i == (arguments.length-1))

-				s = s + ")"/*nonNLS*/ ;

+				s = s + ")" ; //$NON-NLS-1$

 			else

-				s = s + ", "/*nonNLS*/; };};

+				s = s + ", "; };}; //$NON-NLS-1$

 	return s ;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AnonymousLocalTypeDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AnonymousLocalTypeDeclaration.java
index aaa8ee6..62067ca 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AnonymousLocalTypeDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AnonymousLocalTypeDeclaration.java
@@ -23,7 +23,7 @@
 	//Add to method'set, the default constuctor that just recall the

 	//super constructor with the same arguments

 

-	String baseName = "$anonymous"/*nonNLS*/;

+	String baseName = "$anonymous"; //$NON-NLS-1$

 	TypeBinding[] argumentTypes = inheritedConstructorBinding.parameters;

 	int argumentsLength = argumentTypes.length;

 	//the constructor

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
index 0b3a7cb..d78048d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -42,14 +42,14 @@
 public String toString(int tab){

 	/* slow code */

 	

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if (modifiers != AccDefault){

 		s += modifiersString(modifiers);

 	}

 	if (type == null){

-		s += "<no type> "/*nonNLS*/;

+		s += "<no type> "; //$NON-NLS-1$

 	} else {

-		s += type.toString(tab) + " "/*nonNLS*/;

+		s += type.toString(tab) + " "; //$NON-NLS-1$

 	}

 	s += new String(name);

 	return s;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
index d50691d..0196dab 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
@@ -134,12 +134,12 @@
 public String toStringExpression() {

 	/* slow code */

 

-	String s = "new "/*nonNLS*/ + type.toString(0);

+	String s = "new " + type.toString(0); //$NON-NLS-1$

 	for (int i = 0 ; i < dimensions.length ; i++)

 	{	if (dimensions[i] == null)

-			s = s + "[]"/*nonNLS*/;

+			s = s + "[]"; //$NON-NLS-1$

 		else

-			s = s + "["/*nonNLS*/ + dimensions[i].toStringExpression() + "]"/*nonNLS*/ ;}

+			s = s + "[" + dimensions[i].toStringExpression() + "]" ;} //$NON-NLS-2$ //$NON-NLS-1$

 	if (initializer != null)

 		s = s + initializer.toStringExpression();

 	return s;}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
index 3a24fb1..83ac306 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
@@ -139,15 +139,15 @@
 public String toStringExpression() {

 	/* slow code */

 

-	String s = "{"/*nonNLS*/ ;

+	String s = "{" ; //$NON-NLS-1$

 	if (expressions != null)

 	{ 	int j = 20 ; 

 		for (int i = 0 ; i < expressions.length ; i++)

-		{	s = s + expressions[i].toStringExpression() + ","/*nonNLS*/ ;

+		{	s = s + expressions[i].toStringExpression() + "," ; //$NON-NLS-1$

 			j -- ;

 			if (j == 0)

-			{	s = s + "\n                "/*nonNLS*/; j = 20;}}};

-	s = s + "}"/*nonNLS*/;

+			{	s = s + "\n                "; j = 20;}}}; //$NON-NLS-1$

+	s = s + "}"; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
index 7553690..0efc107 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
@@ -30,9 +30,9 @@
 	/* slow speed */

 

 	String s = super.toStringExpression(tab)  ;

-	if (dimensions == 1 ) return s + "[]"/*nonNLS*/ ;

+	if (dimensions == 1 ) return s + "[]" ; //$NON-NLS-1$

 	for (int i=1 ; i <= dimensions ; i++)

-		s = s + "[]"/*nonNLS*/ ;

+		s = s + "[]" ; //$NON-NLS-1$

 	return s ;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
index e3491a0..8532c8c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
@@ -122,9 +122,9 @@
 	/* slow code */

 	

 	return 	receiver.toStringExpression()

-			+ "["/*nonNLS*/ 

+			+ "["  //$NON-NLS-1$

 			+ position.toStringExpression()

-			+ "]"/*nonNLS*/ ;}

+			+ "]" ;} //$NON-NLS-1$

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

 		receiver.traverse(visitor, scope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
index 6776245..67b3a11 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
@@ -35,9 +35,9 @@
 	/* slow speed */

 

 	String s = super.toStringExpression(tab)  ;

-	if (dimensions == 1 ) return s + "[]"/*nonNLS*/ ;

+	if (dimensions == 1 ) return s + "[]" ; //$NON-NLS-1$

 	for (int i=1 ; i <= dimensions ; i++)

-		s = s + "[]"/*nonNLS*/ ;

+		s = s + "[]" ; //$NON-NLS-1$

 	return s ;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
index 1d142c9..e3d89aa 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
@@ -101,15 +101,15 @@
 

 	//subclass redefine toStringExpressionNoParenthesis()

 	

-	return	"("/*nonNLS*/ + toStringExpressionNoParenthesis() + ")"/*nonNLS*/; }

+	return	"(" + toStringExpressionNoParenthesis() + ")"; } //$NON-NLS-2$ //$NON-NLS-1$

 public String toStringExpressionNoParenthesis() {

 

-	return 	lhs.toStringExpression() + " "/*nonNLS*/ +

-			"="/*nonNLS*/ + 

+	return 	lhs.toStringExpression() + " " + //$NON-NLS-1$

+			"=" +  //$NON-NLS-1$

 			

 			( (expression.constant != null ) && (expression.constant != NotAConstant) ?

-			 	" /*cst:"/*nonNLS*/+expression.constant.toString()+"*/ "/*nonNLS*/ :

-			 	" "/*nonNLS*/ ) +

+			 	" /*cst:"+expression.constant.toString()+"*/ " : //$NON-NLS-1$ //$NON-NLS-2$

+			 	" " ) + //$NON-NLS-1$

 				

 			expression.toStringExpression() ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AstNode.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AstNode.java
index c7ce48f..8b1bb65 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AstNode.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AstNode.java
@@ -63,27 +63,27 @@
 }

 public static String modifiersString(int modifiers) {

 	

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if ((modifiers & AccPublic) != 0)

-		s = s + "public "/*nonNLS*/;

+		s = s + "public "; //$NON-NLS-1$

 	if ((modifiers & AccPrivate) != 0)

-		s = s + "private "/*nonNLS*/;

+		s = s + "private "; //$NON-NLS-1$

 	if ((modifiers & AccProtected) != 0)

-		s = s + "protected "/*nonNLS*/;

+		s = s + "protected "; //$NON-NLS-1$

 	if ((modifiers & AccStatic) != 0)

-		s = s + "static "/*nonNLS*/;

+		s = s + "static "; //$NON-NLS-1$

 	if ((modifiers & AccFinal) != 0)

-		s = s + "final "/*nonNLS*/;

+		s = s + "final "; //$NON-NLS-1$

 	if ((modifiers & AccSynchronized) != 0)

-		s = s + "synchronized "/*nonNLS*/;

+		s = s + "synchronized "; //$NON-NLS-1$

 	if ((modifiers & AccVolatile) != 0)

-		s = s + "volatile "/*nonNLS*/;

+		s = s + "volatile "; //$NON-NLS-1$

 	if ((modifiers & AccTransient) != 0)

-		s = s + "transient "/*nonNLS*/;

+		s = s + "transient "; //$NON-NLS-1$

 	if ((modifiers & AccNative) != 0)

-		s = s + "native "/*nonNLS*/;

+		s = s + "native "; //$NON-NLS-1$

 	if ((modifiers & AccAbstract) != 0)

-		s = s + "abstract "/*nonNLS*/;

+		s = s + "abstract "; //$NON-NLS-1$

 	return s;

 }

 /** @Deprecated

@@ -97,8 +97,8 @@
 public static String tabString(int tab){

 	/*slow code*/

 

-	String s = ""/*nonNLS*/ ;

-	for (int i = tab ; i > 0 ; i--) s = s + "  "/*nonNLS*/ ;

+	String s = "" ; //$NON-NLS-1$

+	for (int i = tab ; i > 0 ; i--) s = s + "  " ; //$NON-NLS-1$

 	return s;}

 public String toString() {

 	/* low speed */

@@ -109,7 +109,7 @@
 	/* low speed */

 

 	/*If reach here fetchs the default display*/

-	return "****"/*nonNLS*/+ super.toString()+ "****"/*nonNLS*/;}

+	return "****"+ super.toString()+ "****";} //$NON-NLS-2$ //$NON-NLS-1$

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope){

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
index c3d772b..c33b663 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
@@ -1402,8 +1402,8 @@
 public String toStringExpressionNoParenthesis(){

 	/* slow code*/

 	

-	return	left.toStringExpression() + " "/*nonNLS*/ +

-			operatorToString() + " "/*nonNLS*/ +

+	return	left.toStringExpression() + " " + //$NON-NLS-1$

+			operatorToString() + " " + //$NON-NLS-1$

 			right.toStringExpression() ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java
index 2443f2b..68af753 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java
@@ -86,9 +86,9 @@
 

 	String s = tabString(tab);

 	if (this.statements == null) {

-		s += "{\n"/*nonNLS*/;

+		s += "{\n"; //$NON-NLS-1$

 		s += tabString(tab);

-		s += "}"/*nonNLS*/;

+		s += "}"; //$NON-NLS-1$

 		return s;

 	}

 

@@ -96,22 +96,22 @@
 	//				? " { // ---scope needed for "+String.valueOf(explicitDeclarations) +" locals------------ \n"

 	//				: "{// ---NO scope needed------ \n") ;

 

-	s += "{\n"/*nonNLS*/;

+	s += "{\n"; //$NON-NLS-1$

 	s += this.toStringStatements(tab);

 	s += tabString(tab);

-	s += "}"/*nonNLS*/;

+	s += "}"; //$NON-NLS-1$

 	return s;

 }

 public String toStringStatements(int tab) {

 	/* slow code */

- 	if (this.statements == null) return ""/*nonNLS*/;

+ 	if (this.statements == null) return ""; //$NON-NLS-1$

 	StringBuffer buffer = new StringBuffer();

 	for (int i = 0; i < statements.length; i++) {

 		buffer.append(statements[i].toString(tab + 1));

 		if (statements[i] instanceof Block){

-			buffer.append("\n"/*nonNLS*/);

+			buffer.append("\n"); //$NON-NLS-1$

 		} else {

-			buffer.append(";\n"/*nonNLS*/);

+			buffer.append(";\n"); //$NON-NLS-1$

 		}

 	};

 	return buffer.toString();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Break.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Break.java
index 1a1786e..7bd0d7d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Break.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Break.java
@@ -65,7 +65,7 @@
 	/* slow code */

 

 	String s = tabString(tab) ;

-	s = s + "break "/*nonNLS*/;

+	s = s + "break "; //$NON-NLS-1$

 	if (label != null )

 		s = s + new String(label) ;

 	return s;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Case.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Case.java
index fadea5a..09fabb4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Case.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Case.java
@@ -27,7 +27,8 @@
 		currentScope.referenceType().recordReferenceTo(binding);

 	}

 	*/

-	

+	if (constantExpression.constant == NotAConstant) 

+		currentScope.problemReporter().caseExpressionMustBeConstant(constantExpression);

 	return flowInfo;

 }

 /**

@@ -53,8 +54,6 @@
 	// add into the collection of cases of the associated switch statement

 	switchStatement.cases[switchStatement.caseCount++] = this;

 	TypeBinding caseTb = constantExpression.resolveType(scope);

-	if (constantExpression.constant == NotAConstant) 

-		scope.problemReporter().caseExpressionMustBeConstant(constantExpression);

 	if (caseTb == null || testTb == null)

 		return null;

 	if (constantExpression.isConstantValueOfTypeAssignableToType(caseTb, testTb))

@@ -68,7 +67,7 @@
 	/* slow code */

 

 	String s = tabString(tab);

-	s = s + "case "/*nonNLS*/ + constantExpression.toStringExpression() + " : "/*nonNLS*/ ;

+	s = s + "case " + constantExpression.toStringExpression() + " : " ; //$NON-NLS-1$ //$NON-NLS-2$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
index 6ceaa8d..5597138 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
@@ -234,7 +234,7 @@
 public String toStringExpression(){

 	/*slow code*/

 	

-	return "("/*nonNLS*/ + type.toString(0)+ ") "/*nonNLS*/ +

+	return "(" + type.toString(0)+ ") " + //$NON-NLS-2$ //$NON-NLS-1$

 			expression.toStringExpression() ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java
index 4521446..9b7d333 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java
@@ -59,8 +59,8 @@
 public String toStringExpression(){

 	/*slow code*/

 	

-	String s = ""/*nonNLS*/;

-	s = s + type.toString(0) + ".class"/*nonNLS*/ ;

+	String s = ""; //$NON-NLS-1$

+	s = s + type.toString(0) + ".class" ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
index a8ff9ec..b0771d8 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
@@ -14,136 +14,193 @@
 import org.eclipse.jdt.internal.compiler.problem.*;

 

 public class Clinit extends AbstractMethodDeclaration {

-	public final static char[] ConstantPoolName = "<clinit>"/*nonNLS*/.toCharArray();

-public Clinit() {

-	modifiers = 0;

-	selector = ConstantPoolName;

-}

-public void analyseCode(ClassScope classScope, InitializationFlowContext staticInitializerFlowContext, FlowInfo flowInfo){

+	public final static char[] ConstantPoolName = "<clinit>" .toCharArray(); //$NON-NLS-1$

+

+	private FieldBinding assertionSyntheticFieldBinding = null;

+	private FieldBinding classLiteralSyntheticField = null;

+

+	public Clinit() {

+		modifiers = 0;

+		selector = ConstantPoolName;

+	}

 	

-	if (ignoreFurtherInvestigation)

-		return;

-	try {

-		ExceptionHandlingFlowContext clinitContext = new ExceptionHandlingFlowContext(

-			staticInitializerFlowContext.parent, 

-			this, 

-			NoExceptions, 

-			scope,

-			FlowInfo.DeadEnd);

+	public void analyseCode(

+		ClassScope classScope,

+		InitializationFlowContext staticInitializerFlowContext,

+		FlowInfo flowInfo) {

 

-		// check for missing returning path

-		needFreeReturn = !((flowInfo == FlowInfo.DeadEnd) || flowInfo.isFakeReachable());

+		if (ignoreFurtherInvestigation)

+			return;

+		try {

+			ExceptionHandlingFlowContext clinitContext =

+				new ExceptionHandlingFlowContext(

+					staticInitializerFlowContext.parent,

+					this,

+					NoExceptions,

+					scope,

+					FlowInfo.DeadEnd);

 

-		// check missing blank final field initializations

-		flowInfo = flowInfo.mergedWith(staticInitializerFlowContext.initsOnReturn);

-		FieldBinding[] fields = scope.enclosingSourceType().fields();

-		for (int i = 0, count = fields.length; i < count; i++) {

-			FieldBinding field;

-			if ((field = fields[i]).isStatic()

-				&& field.isFinal()

-				&& (!flowInfo.isDefinitelyAssigned(fields[i]))) {

-				scope.problemReporter().uninitializedBlankFinalField(field, scope.referenceType().declarationOf(field)); // can complain against the field decl, since only one <clinit>

-			}

-		}

-		// check static initializers thrown exceptions

-		staticInitializerFlowContext.checkInitializerExceptions(scope, clinitContext, flowInfo);

-	} catch (AbortMethod e) {

-		this.ignoreFurtherInvestigation = true;		

-	}

-}

-/**

- * Bytecode generation for a <clinit> method

- *

- * @param classScope org.eclipse.jdt.internal.compiler.lookup.ClassScope

- * @param classFile org.eclipse.jdt.internal.compiler.codegen.ClassFile

- */

-public void generateCode(ClassScope classScope, ClassFile classFile) {

-	int clinitOffset = 0;

-	if (ignoreFurtherInvestigation) {

-		// should never have to add any <clinit> problem method

-		return;

-	}

-	try {

-		clinitOffset = classFile.contentsOffset;

-		ConstantPool constantPool = classFile.constantPool;

-		int constantPoolOffset = constantPool.currentOffset;

-		int constantPoolIndex = constantPool.currentIndex;

-		classFile.generateMethodInfoHeaderForClinit();

-		int codeAttributeOffset = classFile.contentsOffset;

-		classFile.generateCodeAttributeHeader();

-		CodeStream codeStream = classFile.codeStream;

-		codeStream.reset(this, classFile);

-		TypeDeclaration declaringType = classScope.referenceContext;

+			// check for missing returning path

+			needFreeReturn =

+				!((flowInfo == FlowInfo.DeadEnd) || flowInfo.isFakeReachable());

 

-		// initialize local positions - including initializer scope.

-		scope.computeLocalVariablePositions(0, codeStream); // should not be necessary

-		MethodScope staticInitializerScope = declaringType.staticInitializerScope;

-		staticInitializerScope.computeLocalVariablePositions(0, codeStream); // offset by the argument size

-

-		// generate initializers

-		if (declaringType.fields != null) {

-			for (int i = 0, max = declaringType.fields.length; i < max; i++) {

-				FieldDeclaration fieldDecl;

-				if ((fieldDecl = declaringType.fields[i]).isStatic()) {

-					fieldDecl.generateCode(staticInitializerScope, codeStream);

+			// check missing blank final field initializations

+			flowInfo = flowInfo.mergedWith(staticInitializerFlowContext.initsOnReturn);

+			FieldBinding[] fields = scope.enclosingSourceType().fields();

+			for (int i = 0, count = fields.length; i < count; i++) {

+				FieldBinding field;

+				if ((field = fields[i]).isStatic()

+					&& field.isFinal()

+					&& (!flowInfo.isDefinitelyAssigned(fields[i]))) {

+					scope.problemReporter().uninitializedBlankFinalField(

+						field,

+						scope.referenceType().declarationOf(field));

+					// can complain against the field decl, since only one <clinit>

 				}

 			}

+			// check static initializers thrown exceptions

+			staticInitializerFlowContext.checkInitializerExceptions(

+				scope,

+				clinitContext,

+				flowInfo);

+		} catch (AbortMethod e) {

+			this.ignoreFurtherInvestigation = true;

 		}

-		if (codeStream.position == 0) {

-			// do not need to output a Clinit if no bytecodes

-			// so we reset the offset inside the byte array contents.

-			classFile.contentsOffset = clinitOffset;

-			// like we don't addd a method we need to undo the increment on the method count

-			classFile.methodCount--;

-			// reset the constant pool to its state before the clinit

-			constantPool.resetForClinit(constantPoolIndex, constantPoolOffset);

-		} else {

-			if (needFreeReturn) {

-				int oldPosition = codeStream.position;

-				codeStream.return_();

-				codeStream.updateLocalVariablesAttribute(oldPosition);

-			}

-			// Record the end of the clinit: point to the declaration of the class

-			codeStream.recordPositionsFrom(0, declaringType);

-			classFile.completeCodeAttributeForClinit(codeAttributeOffset);

-		}

-	} catch (AbortMethod e) {

-		// should never occur

-		// the clinit referenceContext is the type declaration

-		// All clinit problems will be reported against the type: AbortType instead of AbortMethod

-		// reset the contentsOffset to the value before generating the clinit code

-		// decrement the number of method info as well.

-		// This is done in the addProblemMethod and addProblemConstructor for other

-		// cases.

-		classFile.contentsOffset = clinitOffset;

-		classFile.methodCount--;	

 	}

-}

-public boolean isClinit() {

-	return true;

-}

-public boolean isInitializationMethod(){

-	return true;

-}

-public boolean isStatic() {

-	return true;

-}

-public void parseStatements(Parser parser, CompilationUnitDeclaration unit){

-	//the clinit is filled by hand .... 

-}

-public void resolve(ClassScope scope) {

-	this.scope = new MethodScope(scope, scope.referenceContext, true);

-}

-public String toString(int tab){

-	/* slow code */

+	

+	/**

+	 * Bytecode generation for a <clinit> method

+	 *

+	 * @param classScope org.eclipse.jdt.internal.compiler.lookup.ClassScope

+	 * @param classFile org.eclipse.jdt.internal.compiler.codegen.ClassFile

+	 */

+	public void generateCode(ClassScope classScope, ClassFile classFile) {

+		int clinitOffset = 0;

+		if (ignoreFurtherInvestigation) {

+			// should never have to add any <clinit> problem method

+			return;

+		}

+		try {

+			clinitOffset = classFile.contentsOffset;

+			ConstantPool constantPool = classFile.constantPool;

+			int constantPoolOffset = constantPool.currentOffset;

+			int constantPoolIndex = constantPool.currentIndex;

+			classFile.generateMethodInfoHeaderForClinit();

+			int codeAttributeOffset = classFile.contentsOffset;

+			classFile.generateCodeAttributeHeader();

+			CodeStream codeStream = classFile.codeStream;

+			this.resolve(classScope);

 

-	String s = ""/*nonNLS*/ ;

-	s = s + tabString(tab);

-	s = s + "<clinit>()"/*nonNLS*/ ;

-	s = s + toStringStatements(tab + 1);

-	return s ;}

-public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {

-	visitor.visit(this, classScope);

-	visitor.endVisit(this, classScope);

-}

-}

+			codeStream.reset(this, classFile);

+			TypeDeclaration declaringType = classScope.referenceContext;

+

+			// initialize local positions - including initializer scope.

+			scope.computeLocalVariablePositions(0, codeStream); // should not be necessary

+			MethodScope staticInitializerScope = declaringType.staticInitializerScope;

+			staticInitializerScope.computeLocalVariablePositions(0, codeStream);

+			// offset by the argument size

+

+			// 1.4 feature

+			// This has to be done before any other initialization

+			if (this.assertionSyntheticFieldBinding != null) {

+				// generate code related to the activation of assertion for this class

+				codeStream.generateClassLiteralAccessForType(

+					classScope.enclosingSourceType(),

+					classLiteralSyntheticField);

+				codeStream.invokeJavaLangClassDesiredAssertionStatus();

+				Label falseLabel = new Label(codeStream);

+				codeStream.ifne(falseLabel);

+				codeStream.iconst_1();

+				Label jumpLabel = new Label(codeStream);

+				codeStream.goto_(jumpLabel);

+				falseLabel.place();

+				codeStream.iconst_0();

+				jumpLabel.place();

+				codeStream.putstatic(this.assertionSyntheticFieldBinding);

+			}

+			// generate initializers

+			if (declaringType.fields != null) {

+				for (int i = 0, max = declaringType.fields.length; i < max; i++) {

+					FieldDeclaration fieldDecl;

+					if ((fieldDecl = declaringType.fields[i]).isStatic()) {

+						fieldDecl.generateCode(staticInitializerScope, codeStream);

+					}

+				}

+			}

+			if (codeStream.position == 0) {

+				// do not need to output a Clinit if no bytecodes

+				// so we reset the offset inside the byte array contents.

+				classFile.contentsOffset = clinitOffset;

+				// like we don't addd a method we need to undo the increment on the method count

+				classFile.methodCount--;

+				// reset the constant pool to its state before the clinit

+				constantPool.resetForClinit(constantPoolIndex, constantPoolOffset);

+			} else {

+				if (needFreeReturn) {

+					int oldPosition = codeStream.position;

+					codeStream.return_();

+					codeStream.updateLocalVariablesAttribute(oldPosition);

+				}

+				// Record the end of the clinit: point to the declaration of the class

+				codeStream.recordPositionsFrom(0, declaringType);

+				classFile.completeCodeAttributeForClinit(codeAttributeOffset);

+			}

+		} catch (AbortMethod e) {

+			// should never occur

+			// the clinit referenceContext is the type declaration

+			// All clinit problems will be reported against the type: AbortType instead of AbortMethod

+			// reset the contentsOffset to the value before generating the clinit code

+			// decrement the number of method info as well.

+			// This is done in the addProblemMethod and addProblemConstructor for other

+			// cases.

+			classFile.contentsOffset = clinitOffset;

+			classFile.methodCount--;

+		}

+	}

+

+	public boolean isClinit() {

+		return true;

+	}

+

+	public boolean isInitializationMethod() {

+		return true;

+	}

+

+	public boolean isStatic() {

+		return true;

+	}

+	public void parseStatements(Parser parser, CompilationUnitDeclaration unit) {

+		//the clinit is filled by hand .... 

+	}

+	public void resolve(ClassScope scope) {

+		this.scope = new MethodScope(scope, scope.referenceContext, true);

+	}

+

+	public String toString(int tab) {

+		/* slow code */

+		String s = "" ; //$NON-NLS-1$

+		s = s + tabString(tab);

+		s = s + "<clinit>()" ; //$NON-NLS-1$

+		s = s + toStringStatements(tab + 1);

+		return s;

+	}

+

+	public void traverse(

+		IAbstractSyntaxTreeVisitor visitor,

+		ClassScope classScope) {

+		visitor.visit(this, classScope);

+		visitor.endVisit(this, classScope);

+	}

+

+	// 1.4 feature

+	public void addSupportForAssertion(FieldBinding assertionSyntheticFieldBinding) {

+		this.assertionSyntheticFieldBinding = assertionSyntheticFieldBinding;

+

+		// we need to add the field right now, because the field infos are generated before the methods

+		SourceTypeBinding sourceType =

+			this.scope.outerMostMethodScope().enclosingSourceType();

+		this.classLiteralSyntheticField =

+			sourceType.addSyntheticField(sourceType, scope);

+	}

+

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 5fe113f..a152f7b 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -197,18 +197,18 @@
 public String toString(int tab) {

 	/*very slow code*/

 

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if (currentPackage != null)

-		s = tabString(tab) + "package "/*nonNLS*/ + currentPackage.toString(0, false) + ";\n"/*nonNLS*/;

+		s = tabString(tab) + "package " + currentPackage.toString(0, false) + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$

 

 	if (imports != null)

 		for (int i = 0; i < imports.length; i++) {

-			s += tabString(tab) + "import "/*nonNLS*/ + imports[i].toString() + ";\n"/*nonNLS*/;

+			s += tabString(tab) + "import " + imports[i].toString() + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$

 		};

 

 	if (types != null)

 		for (int i = 0; i < types.length; i++) {

-			s +=  types[i].toString(tab) + "\n"/*nonNLS*/;

+			s +=  types[i].toString(tab) + "\n"; //$NON-NLS-1$

 		}

 	return s;

 }

@@ -228,6 +228,7 @@
 					types[i].traverse(visitor, scope);

 			}

 		}

+		visitor.endVisit(this, scope);

 	} catch (AbortCompilationUnit e) {

 	}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java b/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
index 8f3df73..fec4e8c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
@@ -48,29 +48,29 @@
 public String operatorToString() {

 	switch (operator) {

 		case PLUS :

-			return "+="/*nonNLS*/;

+			return "+="; //$NON-NLS-1$

 		case MINUS :

-			return "-="/*nonNLS*/;

+			return "-="; //$NON-NLS-1$

 		case MULTIPLY :

-			return "*="/*nonNLS*/;

+			return "*="; //$NON-NLS-1$

 		case DIVIDE :

-			return "/="/*nonNLS*/;

+			return "/="; //$NON-NLS-1$

 		case AND :

-			return "&="/*nonNLS*/;

+			return "&="; //$NON-NLS-1$

 		case OR :

-			return "|="/*nonNLS*/;

+			return "|="; //$NON-NLS-1$

 		case XOR :

-			return "^="/*nonNLS*/;

+			return "^="; //$NON-NLS-1$

 		case REMAINDER :

-			return "%="/*nonNLS*/;

+			return "%="; //$NON-NLS-1$

 		case LEFT_SHIFT :

-			return "<<="/*nonNLS*/;

+			return "<<="; //$NON-NLS-1$

 		case RIGHT_SHIFT :

-			return ">>="/*nonNLS*/;

+			return ">>="; //$NON-NLS-1$

 		case UNSIGNED_RIGHT_SHIFT :

-			return ">>>="/*nonNLS*/;

+			return ">>>="; //$NON-NLS-1$

 	};

-	return "unknown operator"/*nonNLS*/;

+	return "unknown operator"; //$NON-NLS-1$

 }

 public TypeBinding resolveType(BlockScope scope) {

 	constant = NotAConstant;

@@ -119,8 +119,8 @@
 	return false ;}

 public String toStringExpressionNoParenthesis() {

 

-	return 	lhs.toStringExpression() + " "/*nonNLS*/ +

-			operatorToString() + " "/*nonNLS*/ +

+	return 	lhs.toStringExpression() + " " + //$NON-NLS-1$

+			operatorToString() + " " + //$NON-NLS-1$

 			expression.toStringExpression() ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index da05963..70a97df 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -254,8 +254,8 @@
 public String toStringExpressionNoParenthesis(){

 	/* slow code*/

 

-	return	condition.toStringExpression() + " ? "/*nonNLS*/ +

-			valueIfTrue.toStringExpression() + " : "/*nonNLS*/ +

+	return	condition.toStringExpression() + " ? " + //$NON-NLS-1$

+			valueIfTrue.toStringExpression() + " : " + //$NON-NLS-1$

 			valueIfFalse.toStringExpression() ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
index 78f8785..911fda0 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
@@ -15,7 +15,7 @@
 

 public class ConstructorDeclaration extends AbstractMethodDeclaration {

 	public ExplicitConstructorCall constructorCall;

-	public final static char[] ConstantPoolName = "<init>"/*nonNLS*/.toCharArray();

+	public final static char[] ConstantPoolName = "<init>".toCharArray(); //$NON-NLS-1$

 	public boolean isDefaultConstructor = false;

 

 	public int referenceCount = 0; // count how many times this constructor is referenced from other local constructors

@@ -257,19 +257,19 @@
 public String toStringStatements(int tab) {

 	/* slow code */

 

-	String s = " {"/*nonNLS*/;

+	String s = " {"; //$NON-NLS-1$

 	if (constructorCall != null) {

-		s = s + "\n"/*nonNLS*/ + constructorCall.toString(tab) + ";"/*nonNLS*/;

+		s = s + "\n" + constructorCall.toString(tab) + ";"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 	if (statements != null){

 		for (int i = 0; i < statements.length; i++){

-			s = s + "\n"/*nonNLS*/ + statements[i].toString(tab);

+			s = s + "\n" + statements[i].toString(tab); //$NON-NLS-1$

 			if (!(statements[i] instanceof Block)){

-				s += ";"/*nonNLS*/;

+				s += ";"; //$NON-NLS-1$

 			}

 		}

 	}

-	s+="\n"/*nonNLS*/+tabString(tab == 0 ? 0 : tab - 1)+"}"/*nonNLS*/;

+	s+="\n"+tabString(tab == 0 ? 0 : tab - 1)+"}"; //$NON-NLS-2$ //$NON-NLS-1$

 	return s;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Continue.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Continue.java
index 56b5dd7..2d08037 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Continue.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Continue.java
@@ -69,7 +69,7 @@
 	/* slow code */

 

 	String s = tabString(tab) ;

-	s = s + "continue "/*nonNLS*/;

+	s = s + "continue "; //$NON-NLS-1$

 	if (label != null )

 		s = s + new String(label) ;

 	return s;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/DefaultCase.java b/compiler/org/eclipse/jdt/internal/compiler/ast/DefaultCase.java
index b691359..b2c7d59 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/DefaultCase.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/DefaultCase.java
@@ -53,7 +53,7 @@
 	/* slow code */

 

 	String s = tabString(tab);

-	s = s + "default : "/*nonNLS*/ ;

+	s = s + "default : " ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	visitor.visit(this, blockScope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
index f69a0ba..efac89d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
@@ -125,15 +125,15 @@
 

 	String inFront, s = tabString(tab);

 	inFront = s;

-	s = s + "do"/*nonNLS*/;

+	s = s + "do"; //$NON-NLS-1$

 	if (action == null)

-		s = s + " {}\n"/*nonNLS*/;

+		s = s + " {}\n"; //$NON-NLS-1$

 	else

 		if (action instanceof Block)

-			s = s + "\n"/*nonNLS*/ + action.toString(tab + 1) + "\n"/*nonNLS*/;

+			s = s + "\n" + action.toString(tab + 1) + "\n"; //$NON-NLS-2$ //$NON-NLS-1$

 		else

-			s = s + " {\n"/*nonNLS*/ + action.toString(tab + 1) + ";}\n"/*nonNLS*/;

-	s = s + inFront + "while ("/*nonNLS*/ + condition.toStringExpression() + ")"/*nonNLS*/;

+			s = s + " {\n" + action.toString(tab + 1) + ";}\n"; //$NON-NLS-1$ //$NON-NLS-2$

+	s = s + inFront + "while (" + condition.toStringExpression() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	return s;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 8df5881..ec468b1 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -224,17 +224,17 @@
 

 	String s = tabString(tab);

 	if (qualification != null) 

-		s = s + qualification.toStringExpression() + "."/*nonNLS*/ ;

+		s = s + qualification.toStringExpression() + "." ; //$NON-NLS-1$

 	if (accessMode == This){

-		s = s + "this("/*nonNLS*/;

+		s = s + "this("; //$NON-NLS-1$

 	} else {

-		s = s + "super("/*nonNLS*/;

+		s = s + "super("; //$NON-NLS-1$

 	}

 	if (arguments != null)

 		for (int i=0 ; i < arguments.length ; i++)

 		{	s = s + arguments[i].toStringExpression();

-			if (i != arguments.length-1) s = s + ", "/*nonNLS*/;};;

-	s = s+")"/*nonNLS*/ ;

+			if (i != arguments.length-1) s = s + ", ";};; //$NON-NLS-1$

+	s = s+")" ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 8595400..45627ee 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -155,7 +155,7 @@
 		codeStream.recordPositionsFrom(pc, this);

 	} else {

 		// actual non-constant code generation

-		throw new ShouldNotImplement(Util.bind("ast.missingCode"/*nonNLS*/));

+		throw new ShouldNotImplement(Util.bind("ast.missingCode")); //$NON-NLS-1$

 	}

 }

 /**

@@ -344,7 +344,7 @@
 		//before TC has runned

 		if (constant != NotAConstant)

 			//after the TC has runned

-			s += " /*cst:"/*nonNLS*/ + constant.toString() + "*/ "/*nonNLS*/;

+			s += " /*cst:" + constant.toString() + "*/ "; //$NON-NLS-1$ //$NON-NLS-2$

 	return s + toStringExpression(tab);

 }

 public String toStringExpression() {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java
index be9c90d..99ffa5d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java
@@ -46,7 +46,7 @@
 public String toStringExpression() {

 	/* slow code */

 

-	String str = "ExtendedStringLiteral{"/*nonNLS*/+ new String(source) +"}"/*nonNLS*/;

+	String str = "ExtendedStringLiteral{"+ new String(source) +"}"; //$NON-NLS-2$ //$NON-NLS-1$

 	return str;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index c2f044e..304055f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -147,5 +147,6 @@
 		type.traverse(visitor, scope);

 		if (initialization != null) initialization.traverse(visitor, scope);

 	}

+	visitor.endVisit(this, scope);

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
index 144cdec..1eb5c7c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
@@ -365,7 +365,7 @@
 	/* slow code */

 	

 	return 	receiver.toString()

-			+ "."/*nonNLS*/ 

+			+ "."  //$NON-NLS-1$

 			+ new String(token);}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
index 37e6887..16ef556 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
@@ -208,32 +208,32 @@
 public String toString(int tab ){

 	/* slow code */

 	

-	String s = tabString(tab) + "for ("/*nonNLS*/;

+	String s = tabString(tab) + "for ("; //$NON-NLS-1$

 	if (!neededScope)

-		s = s + " //--NO upperscope scope needed\n"/*nonNLS*/ + tabString(tab) + "     "/*nonNLS*/ ;

+		s = s + " //--NO upperscope scope needed\n" + tabString(tab) + "     " ; //$NON-NLS-2$ //$NON-NLS-1$

 	//inits

 	if (initializations != null)

 	{	for (int i = 0 ; i < initializations.length ; i++){

 			//nice only with expressions

 			s = s + initializations[i].toString(0);

-			if (i != (initializations.length -1)) s = s + " , "/*nonNLS*/ ;}};

-	s = s + "; "/*nonNLS*/ ;

+			if (i != (initializations.length -1)) s = s + " , " ;}}; //$NON-NLS-1$

+	s = s + "; " ; //$NON-NLS-1$

 	//cond

 	if (condition != null)

 		s = s + condition.toStringExpression() ;

-	s = s + "; "/*nonNLS*/ ;

+	s = s + "; " ; //$NON-NLS-1$

 	//updates

 	if (increments != null)

 	{	for (int i = 0 ; i < increments.length ; i++){

 			//nice only with expressions

 			s = s + increments[i].toString(0);

-			if (i != (increments.length -1)) s = s + " , "/*nonNLS*/ ;}};

-	s = s + ") "/*nonNLS*/ ;

+			if (i != (increments.length -1)) s = s + " , " ;}}; //$NON-NLS-1$

+	s = s + ") " ; //$NON-NLS-1$

 	//block

 	if (action == null)

-		s = s + "{}"/*nonNLS*/ ;

+		s = s + "{}" ; //$NON-NLS-1$

 	else

-		s = s + "\n"/*nonNLS*/+ action.toString(tab+1) ;

+		s = s + "\n"+ action.toString(tab+1) ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
index 48a5d34..3b66dcd 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
@@ -187,10 +187,10 @@
 

 	String inFront , s = tabString(tab) ;

 	inFront = s ;

-	s = s + "if ("/*nonNLS*/+ condition.toStringExpression()+") \n"/*nonNLS*/;

-	s = s + thenStatement.toString(tab+2) + ";"/*nonNLS*/ ;

+	s = s + "if ("+ condition.toStringExpression()+") \n"; //$NON-NLS-1$ //$NON-NLS-2$

+	s = s + thenStatement.toString(tab+2) + ";" ; //$NON-NLS-1$

 	if (elseStatement != null)

-		s = s + "\n"/*nonNLS*/ + inFront + "else\n"/*nonNLS*/ + elseStatement.toString(tab+2) + ";"/*nonNLS*/;

+		s = s + "\n" + inFront + "else\n" + elseStatement.toString(tab+2) + ";"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 	return s ;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
index af82fee..97d7b42 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
@@ -38,15 +38,16 @@
 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

 	if (withOnDemand && onDemand) {

-		buffer.append(".*"/*nonNLS*/);

+		buffer.append(".*"); //$NON-NLS-1$

 	}

 	return buffer.toString();

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, CompilationUnitScope scope) {

 	visitor.visit(this, scope);

+	visitor.endVisit(this, scope);

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
index b796c10..5c8d8ee 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
@@ -72,17 +72,19 @@
 		StringBuffer buffer = new StringBuffer();

 		buffer.append(tabString(tab));

 		buffer.append(modifiersString(modifiers));

-		buffer.append("{\n"/*nonNLS*/);

+		buffer.append("{\n"); //$NON-NLS-1$

 		buffer.append(block.toStringStatements(tab));

 		buffer.append(tabString(tab));

-		buffer.append("}"/*nonNLS*/);

+		buffer.append("}"); //$NON-NLS-1$

 		return buffer.toString();

 	} else {

 		return block.toString(tab);

 	}

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, MethodScope scope) {

+	if (visitor.visit(this, scope)) {

+		block.traverse(visitor, scope);

+	}

 	visitor.visit(this, scope);

-	block.traverse(visitor, scope);

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
index fbf019b..bf5fda1 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
@@ -199,7 +199,7 @@
 public String toStringExpressionNoParenthesis(){

 	/* slow code*/

 

-	return	expression.toStringExpression() + " instanceof "/*nonNLS*/ +

+	return	expression.toStringExpression() + " instanceof " + //$NON-NLS-1$

 			type.toString(0) ; }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
index 436ded9..b4e3c5a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
@@ -77,7 +77,7 @@
 	/* slow code */

 

 	String s = tabString(tab);

-	s += new String(label) + ": "/*nonNLS*/ + statement.toString(0);

+	s += new String(label) + ": " + statement.toString(0); //$NON-NLS-1$

 	return s;

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index 656ea2a..08786d2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -239,15 +239,15 @@
 public String toStringExpression(){

 	/*slow code*/

 	

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if (receiver != ThisReference.ThisImplicit)

-		s = s + receiver.toStringExpression()+"."/*nonNLS*/;

-	s = s + new String(selector) + "("/*nonNLS*/ ;

+		s = s + receiver.toStringExpression()+"."; //$NON-NLS-1$

+	s = s + new String(selector) + "(" ; //$NON-NLS-1$

 	if (arguments != null)

 		for (int i = 0; i < arguments.length ; i ++)

 		{	s = s + arguments[i].toStringExpression();

-			if ( i != arguments.length -1 ) s = s + " , "/*nonNLS*/ ;};;

-	s =s + ")"/*nonNLS*/ ;

+			if ( i != arguments.length -1 ) s = s + " , " ;};; //$NON-NLS-1$

+	s =s + ")" ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index 4fa13eb..d6a2bee 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -70,8 +70,8 @@
 	/*slow code */

 

 	if (returnType == null)

-		return ""/*nonNLS*/;

-	return returnType.toString(tab)+" "/*nonNLS*/;

+		return ""; //$NON-NLS-1$

+	return returnType.toString(tab)+" "; //$NON-NLS-1$

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {

 	if (visitor.visit(this, classScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java
index 2b674f6..6dc6975 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java
@@ -53,80 +53,80 @@
 	class Decode {

 		public  final String constant(int code){

 			switch(code){ 

-				case T_boolean 	: return "true"/*nonNLS*/ ;

-				case T_byte		: return "((byte) 3)"/*nonNLS*/ ;

-				case T_char		: return "'A'"/*nonNLS*/ ;

-				case T_double	: return "300.0d"/*nonNLS*/ ;

-				case T_float	: return "100.0f"/*nonNLS*/ ;

-				case T_int		: return "1"/*nonNLS*/ ;

-				case T_long		: return "7L"/*nonNLS*/ ;

-				case T_String	: return "\"hello-world\""/*nonNLS*/ ;

-				case T_null		: return "null"/*nonNLS*/;

-				case T_short	: return "((short) 5)"/*nonNLS*/;

-				case T_Object	: return "null"/*nonNLS*/;}

-			return ""/*nonNLS*/;}

+				case T_boolean 	: return "true" ; //$NON-NLS-1$

+				case T_byte		: return "((byte) 3)" ; //$NON-NLS-1$

+				case T_char		: return "'A'" ; //$NON-NLS-1$

+				case T_double	: return "300.0d" ; //$NON-NLS-1$

+				case T_float	: return "100.0f" ; //$NON-NLS-1$

+				case T_int		: return "1" ; //$NON-NLS-1$

+				case T_long		: return "7L" ; //$NON-NLS-1$

+				case T_String	: return "\"hello-world\"" ; //$NON-NLS-1$

+				case T_null		: return "null"; //$NON-NLS-1$

+				case T_short	: return "((short) 5)"; //$NON-NLS-1$

+				case T_Object	: return "null";} //$NON-NLS-1$

+			return "";} //$NON-NLS-1$

 

 		public  final String type(int code){

 			switch(code){ 

-				case T_boolean 	: return "z"/*nonNLS*/ ;

-				case T_byte		: return "b"/*nonNLS*/ ;

-				case T_char		: return "c"/*nonNLS*/ ;

-				case T_double	: return "d"/*nonNLS*/ ;

-				case T_float	: return "f"/*nonNLS*/ ;

-				case T_int		: return "i"/*nonNLS*/ ;

-				case T_long		: return "l"/*nonNLS*/ ;

-				case T_String	: return "str"/*nonNLS*/ ;

-				case T_null		: return "null"/*nonNLS*/;

-				case T_short	: return "s"/*nonNLS*/;

-				case T_Object	: return "obj"/*nonNLS*/;}

-			return "xxx"/*nonNLS*/;}

+				case T_boolean 	: return "z" ; //$NON-NLS-1$

+				case T_byte		: return "b" ; //$NON-NLS-1$

+				case T_char		: return "c" ; //$NON-NLS-1$

+				case T_double	: return "d" ; //$NON-NLS-1$

+				case T_float	: return "f" ; //$NON-NLS-1$

+				case T_int		: return "i" ; //$NON-NLS-1$

+				case T_long		: return "l" ; //$NON-NLS-1$

+				case T_String	: return "str" ; //$NON-NLS-1$

+				case T_null		: return "null"; //$NON-NLS-1$

+				case T_short	: return "s"; //$NON-NLS-1$

+				case T_Object	: return "obj";} //$NON-NLS-1$

+			return "xxx";} //$NON-NLS-1$

 		

 		public  final String operator(int operator){

 				switch (operator) {

-				case EQUAL_EQUAL :	return "=="/*nonNLS*/;

-				case LESS_EQUAL :	return "<="/*nonNLS*/;

-				case GREATER_EQUAL :return ">="/*nonNLS*/;

-				case LEFT_SHIFT :	return "<<"/*nonNLS*/;

-				case RIGHT_SHIFT :	return ">>"/*nonNLS*/;

-				case UNSIGNED_RIGHT_SHIFT :	return ">>>"/*nonNLS*/;

-				case OR_OR :return "||"/*nonNLS*/;

-				case AND_AND :		return "&&"/*nonNLS*/;

-				case PLUS :			return "+"/*nonNLS*/;

-				case MINUS :		return "-"/*nonNLS*/;

-				case NOT :			return "!"/*nonNLS*/;

-				case REMAINDER :	return "%"/*nonNLS*/;

-				case XOR :			return "^"/*nonNLS*/;

-				case AND :			return "&"/*nonNLS*/;

-				case MULTIPLY :		return "*"/*nonNLS*/;

-				case OR :			return "|"/*nonNLS*/;

-				case TWIDDLE :		return "~"/*nonNLS*/;

-				case DIVIDE :		return "/"/*nonNLS*/;

-				case GREATER :		return ">"/*nonNLS*/;

-				case LESS :			return "<"/*nonNLS*/;	};

-			return "????"/*nonNLS*/;}

+				case EQUAL_EQUAL :	return "=="; //$NON-NLS-1$

+				case LESS_EQUAL :	return "<="; //$NON-NLS-1$

+				case GREATER_EQUAL :return ">="; //$NON-NLS-1$

+				case LEFT_SHIFT :	return "<<"; //$NON-NLS-1$

+				case RIGHT_SHIFT :	return ">>"; //$NON-NLS-1$

+				case UNSIGNED_RIGHT_SHIFT :	return ">>>"; //$NON-NLS-1$

+				case OR_OR :return "||"; //$NON-NLS-1$

+				case AND_AND :		return "&&"; //$NON-NLS-1$

+				case PLUS :			return "+"; //$NON-NLS-1$

+				case MINUS :		return "-"; //$NON-NLS-1$

+				case NOT :			return "!"; //$NON-NLS-1$

+				case REMAINDER :	return "%"; //$NON-NLS-1$

+				case XOR :			return "^"; //$NON-NLS-1$

+				case AND :			return "&"; //$NON-NLS-1$

+				case MULTIPLY :		return "*"; //$NON-NLS-1$

+				case OR :			return "|"; //$NON-NLS-1$

+				case TWIDDLE :		return "~"; //$NON-NLS-1$

+				case DIVIDE :		return "/"; //$NON-NLS-1$

+				case GREATER :		return ">"; //$NON-NLS-1$

+				case LESS :			return "<";	}; //$NON-NLS-1$

+			return "????";} //$NON-NLS-1$

 	}

 

 		

 	Decode decode = new Decode();

 	String s ;

-	s = "\tpublic static void binaryOperationTablesTestCase(){\n"/*nonNLS*/ +

+	s = "\tpublic static void binaryOperationTablesTestCase(){\n" + //$NON-NLS-1$

 

-		"\t\t//TC test : all binary operation (described in tables)\n"/*nonNLS*/+

-		"\t\t//method automatically generated by\n"/*nonNLS*/+

-		"\t\t//org.eclipse.jdt.internal.compiler.ast.OperatorExpression.generateTableTestCase();\n"/*nonNLS*/+

+		"\t\t//TC test : all binary operation (described in tables)\n"+ //$NON-NLS-1$

+		"\t\t//method automatically generated by\n"+ //$NON-NLS-1$

+		"\t\t//org.eclipse.jdt.internal.compiler.ast.OperatorExpression.generateTableTestCase();\n"+ //$NON-NLS-1$

 	

-		"\t\tString str0 ;\t String str\t= "/*nonNLS*/+decode.constant(T_String)+";\n"/*nonNLS*/+

-		"\t\tint i0 ;\t int i\t= "/*nonNLS*/+decode.constant(T_int)+" ;\n"/*nonNLS*/+

-		"\t\tboolean z0;\t boolean z\t= "/*nonNLS*/+decode.constant(T_boolean)+";\n"/*nonNLS*/+

-		"\t\tchar c0; \t char  c\t= "/*nonNLS*/+decode.constant(T_char)+" ;\n"/*nonNLS*/+

-		"\t\tfloat f0; \t float f\t= "/*nonNLS*/+decode.constant(T_float)+" ;\n"/*nonNLS*/+

-		"\t\tdouble d0;\t double d\t= "/*nonNLS*/+decode.constant(T_double)+" ;\n"/*nonNLS*/+

-		"\t\tbyte b0; \t byte b\t= "/*nonNLS*/+decode.constant(T_byte)+";\n"/*nonNLS*/+

-		"\t\tshort s0; \t short s\t= "/*nonNLS*/+decode.constant(T_short)+";\n"/*nonNLS*/+

-		"\t\tlong l0; \t long l\t= "/*nonNLS*/+decode.constant(T_long)+" ;\n"/*nonNLS*/+

-		"\t\tObject obj0; \t Object obj\t= "/*nonNLS*/+decode.constant(T_Object)+" ;\n"/*nonNLS*/+

+		"\t\tString str0 ;\t String str\t= "+decode.constant(T_String)+";\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tint i0 ;\t int i\t= "+decode.constant(T_int)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tboolean z0;\t boolean z\t= "+decode.constant(T_boolean)+";\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tchar c0; \t char  c\t= "+decode.constant(T_char)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tfloat f0; \t float f\t= "+decode.constant(T_float)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tdouble d0;\t double d\t= "+decode.constant(T_double)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tbyte b0; \t byte b\t= "+decode.constant(T_byte)+";\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tshort s0; \t short s\t= "+decode.constant(T_short)+";\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tlong l0; \t long l\t= "+decode.constant(T_long)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

+		"\t\tObject obj0; \t Object obj\t= "+decode.constant(T_Object)+" ;\n"+ //$NON-NLS-1$ //$NON-NLS-2$

 

-		"\n"/*nonNLS*/;

+		"\n"; //$NON-NLS-1$

 

 	int error = 0;		

 	for (int i=0; i < operators.length ; i++)

@@ -142,19 +142,19 @@
 				//	if ( z0 != (((short) 5) >= ((short) 5)))

 				//		System.out.println(155);

 

-			{	s += "\t\t"/*nonNLS*/+decode.type(result)+"0"/*nonNLS*/+" = "/*nonNLS*/+decode.type(left);

-				s += " "/*nonNLS*/+decode.operator(operator)+" "/*nonNLS*/+decode.type(right)+";\n"/*nonNLS*/;

-				String begin = result == T_String ? "\t\tif (! "/*nonNLS*/ : "\t\tif ( "/*nonNLS*/;

-				String test = result == T_String ? ".equals("/*nonNLS*/ : " != ("/*nonNLS*/ ;

-				s += begin	+decode.type(result)+"0"/*nonNLS*/+test

-							+decode.constant(left)+" "/*nonNLS*/

-							+decode.operator(operator)+" "/*nonNLS*/

-							+decode.constant(right)+"))\n"/*nonNLS*/;

-				s += "\t\t\tSystem.out.println("/*nonNLS*/+ (++error) +");\n"/*nonNLS*/;

+			{	s += "\t\t"+decode.type(result)+"0"+" = "+decode.type(left); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$

+				s += " "+decode.operator(operator)+" "+decode.type(right)+";\n"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

+				String begin = result == T_String ? "\t\tif (! " : "\t\tif ( "; //$NON-NLS-2$ //$NON-NLS-1$

+				String test = result == T_String ? ".equals(" : " != (" ; //$NON-NLS-2$ //$NON-NLS-1$

+				s += begin	+decode.type(result)+"0"+test //$NON-NLS-1$

+							+decode.constant(left)+" " //$NON-NLS-1$

+							+decode.operator(operator)+" " //$NON-NLS-1$

+							+decode.constant(right)+"))\n"; //$NON-NLS-1$

+				s += "\t\t\tSystem.out.println("+ (++error) +");\n"; //$NON-NLS-1$ //$NON-NLS-2$

 								

 				}}}

 		

-	return s += "\n\t\tSystem.out.println(\"binary tables test : done\");}"/*nonNLS*/ ;

+	return s += "\n\t\tSystem.out.println(\"binary tables test : done\");}" ; //$NON-NLS-1$

 		}

 public static final int[] get_AND(){

 

@@ -1539,60 +1539,60 @@
 public String operatorToString() {

 	switch ((bits & OperatorMASK) >> OperatorSHIFT) {

 		case EQUAL_EQUAL :

-			return "=="/*nonNLS*/;

+			return "=="; //$NON-NLS-1$

 		case LESS_EQUAL :

-			return "<="/*nonNLS*/;

+			return "<="; //$NON-NLS-1$

 		case GREATER_EQUAL :

-			return ">="/*nonNLS*/;

+			return ">="; //$NON-NLS-1$

 		case NOT_EQUAL :

-			return "!="/*nonNLS*/;

+			return "!="; //$NON-NLS-1$

 		case LEFT_SHIFT :

-			return "<<"/*nonNLS*/;

+			return "<<"; //$NON-NLS-1$

 		case RIGHT_SHIFT :

-			return ">>"/*nonNLS*/;

+			return ">>"; //$NON-NLS-1$

 		case UNSIGNED_RIGHT_SHIFT :

-			return ">>>"/*nonNLS*/;

+			return ">>>"; //$NON-NLS-1$

 		case OR_OR :

-			return "||"/*nonNLS*/;

+			return "||"; //$NON-NLS-1$

 		case AND_AND :

-			return "&&"/*nonNLS*/;

+			return "&&"; //$NON-NLS-1$

 		case PLUS :

-			return "+"/*nonNLS*/;

+			return "+"; //$NON-NLS-1$

 		case MINUS :

-			return "-"/*nonNLS*/;

+			return "-"; //$NON-NLS-1$

 		case NOT :

-			return "!"/*nonNLS*/;

+			return "!"; //$NON-NLS-1$

 		case REMAINDER :

-			return "%"/*nonNLS*/;

+			return "%"; //$NON-NLS-1$

 		case XOR :

-			return "^"/*nonNLS*/;

+			return "^"; //$NON-NLS-1$

 		case AND :

-			return "&"/*nonNLS*/;

+			return "&"; //$NON-NLS-1$

 		case MULTIPLY :

-			return "*"/*nonNLS*/;

+			return "*"; //$NON-NLS-1$

 		case OR :

-			return "|"/*nonNLS*/;

+			return "|"; //$NON-NLS-1$

 		case TWIDDLE :

-			return "~"/*nonNLS*/;

+			return "~"; //$NON-NLS-1$

 		case DIVIDE :

-			return "/"/*nonNLS*/;

+			return "/"; //$NON-NLS-1$

 		case GREATER :

-			return ">"/*nonNLS*/;

+			return ">"; //$NON-NLS-1$

 		case LESS :

-			return "<"/*nonNLS*/;

+			return "<"; //$NON-NLS-1$

 		case QUESTIONCOLON :

-			return "?:"/*nonNLS*/;

+			return "?:"; //$NON-NLS-1$

 		case EQUAL :

-			return "="/*nonNLS*/;

+			return "="; //$NON-NLS-1$

 	};

-	return "unknown operator"/*nonNLS*/;

+	return "unknown operator"; //$NON-NLS-1$

 }

 public String toStringExpression(){

 	/* slow code*/

 

 	//subclass redefine toStringExpressionNoParenthesis()

 	

-	return	"("/*nonNLS*/ + toStringExpressionNoParenthesis() + ")"/*nonNLS*/; 

+	return	"(" + toStringExpressionNoParenthesis() + ")";  //$NON-NLS-2$ //$NON-NLS-1$

 }

 

 public abstract String toStringExpressionNoParenthesis();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java
index 008c712..75dc122 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java
@@ -39,17 +39,17 @@
 public String operatorToString() {

 	switch (operator) {

 		case PLUS :

-			return "++"/*nonNLS*/;

+			return "++"; //$NON-NLS-1$

 		case MINUS :

-			return "--"/*nonNLS*/;}

-	return "unknown operator"/*nonNLS*/;

+			return "--";} //$NON-NLS-1$

+	return "unknown operator"; //$NON-NLS-1$

 }

 public boolean restrainUsageToNumericTypes(){

 	return true ;}

 public String toStringExpressionNoParenthesis(){

 	/* slow code*/

 

-	return	lhs.toStringExpression() + " "/*nonNLS*/ + operatorToString(); }

+	return	lhs.toStringExpression() + " " + operatorToString(); } //$NON-NLS-1$

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

 	if (visitor.visit(this, scope)) {

 		lhs.traverse(visitor, scope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java
index 7912487..df18a47 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java
@@ -23,17 +23,17 @@
 public String operatorToString() {

 	switch (operator) {

 		case PLUS :

-			return "++"/*nonNLS*/;

+			return "++"; //$NON-NLS-1$

 		case MINUS :

-			return "--"/*nonNLS*/;}

-	return "unknown operator"/*nonNLS*/;

+			return "--";} //$NON-NLS-1$

+	return "unknown operator"; //$NON-NLS-1$

 }

 public boolean restrainUsageToNumericTypes(){

 	return true ;}

 public String toStringExpressionNoParenthesis(){

 	/* slow code */

 	

-	return operatorToString() + " "/*nonNLS*/ + lhs.toStringExpression() ;

+	return operatorToString() + " " + lhs.toStringExpression() ; //$NON-NLS-1$

 

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index fc7d922..f799256 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
@@ -238,9 +238,9 @@
 public String toStringExpression(int tab) {

 	/*slow code */

 

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if (enclosingInstance != null)

-		s += enclosingInstance.toString() + "."/*nonNLS*/;

+		s += enclosingInstance.toString() + "."; //$NON-NLS-1$

 	s += super.toStringExpression(tab);

 	if (anonymousType != null) {

 		s += anonymousType.toString(tab);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
index 9114662..0a4f3a9 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
@@ -597,7 +597,7 @@
 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

 	return buffer.toString();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
index 7b40115..c95539e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
@@ -36,7 +36,7 @@
 public String toStringExpression(){

 	/* slow code */

 	

-	return qualification.toString(0)+".super"/*nonNLS*/ ;

+	return qualification.toString(0)+".super" ; //$NON-NLS-1$

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
index 45987d1..f06e40f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java
@@ -119,7 +119,7 @@
 public String toStringExpression(){

 	/* slow code */

 	

-	return qualification.toString(0)+".this"/*nonNLS*/ ;

+	return qualification.toString(0)+".this" ; //$NON-NLS-1$

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
index cb2ccca..c7006e5 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
@@ -41,7 +41,7 @@
 	for (int i = 0; i < tokens.length; i++) {

 		buffer.append(tokens[i]);

 		if (i < (tokens.length - 1)) {

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 		}

 	}

 	return buffer.toString();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
index 04a336f..1bbc0d3 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Reference.java
@@ -19,7 +19,7 @@
 	super();

 }

 public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound) {

-	throw new ShouldNotImplement(Util.bind("ast.variableShouldProvide"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("ast.variableShouldProvide")); //$NON-NLS-1$

 }

 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {

 	return flowInfo;

@@ -61,13 +61,13 @@
 	}

 }

 public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {

-	throw new ShouldNotImplement(Util.bind("ast.compoundPreShouldProvide"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("ast.compoundPreShouldProvide")); //$NON-NLS-1$

 }

 public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {

-	throw new ShouldNotImplement(Util.bind("ast.compoundVariableShouldProvide"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("ast.compoundVariableShouldProvide")); //$NON-NLS-1$

 }

 public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {

-	throw new ShouldNotImplement(Util.bind("ast.postIncrShouldProvide"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("ast.postIncrShouldProvide")); //$NON-NLS-1$

 }

 public boolean isFieldReference() {

 

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
index e76ddc8..041b3a0 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
@@ -225,7 +225,7 @@
 	/* slow code */

 

 	String s = tabString(tab) ;

-	s = s + "return "/*nonNLS*/;

+	s = s + "return "; //$NON-NLS-1$

 	if (expression != null )

 		s = s + expression.toStringExpression() ;

 	return s;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
index 5060063..08f540c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -33,6 +33,9 @@
 

 	// for statements only

 	public static final int IsReachableMASK = 0x80000000; // highest bit

+	

+	// for type declaration only

+	public static final int AddAssertionMASK = 1; // highest bit

 

 	/*

 	public final static int BitMask1= 0x1; // decimal 1

@@ -78,7 +81,7 @@
 	return flowInfo;

 }

 public void generateCode(BlockScope currentScope, CodeStream codeStream){

-	throw new ShouldNotImplement(Util.bind("ast.missingStatement"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("ast.missingStatement")); //$NON-NLS-1$

 }

 public boolean isEmptyBlock(){

 	return false;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java b/compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
index 4f4b257..fb3002d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
@@ -57,38 +57,38 @@
 public String toStringExpression() {

 

 	// handle some special char.....

-	StringBuffer result = new StringBuffer("\""/*nonNLS*/);

+	StringBuffer result = new StringBuffer("\""); //$NON-NLS-1$

 	for (int i = 0; i < source.length; i++) {

 		switch (source[i]) {

 			case '\b' :

-				result.append("\\b"/*nonNLS*/);

+				result.append("\\b"); //$NON-NLS-1$

 				break;

 			case '\t' :

-				result.append("\\t"/*nonNLS*/);

+				result.append("\\t"); //$NON-NLS-1$

 				break;

 			case '\n' :

-				result.append("\\n"/*nonNLS*/);

+				result.append("\\n"); //$NON-NLS-1$

 				break;

 			case '\f' :

-				result.append("\\f"/*nonNLS*/);

+				result.append("\\f"); //$NON-NLS-1$

 				break;

 			case '\r' :

-				result.append("\\r"/*nonNLS*/);

+				result.append("\\r"); //$NON-NLS-1$

 				break;

 			case '\"' :

-				result.append("\\\""/*nonNLS*/);

+				result.append("\\\""); //$NON-NLS-1$

 				break;

 			case '\'' :

-				result.append("\\'"/*nonNLS*/);

+				result.append("\\'"); //$NON-NLS-1$

 				break;

 			case '\\' : //take care not to display the escape as a potential real char

-				result.append("\\\\"/*nonNLS*/);

+				result.append("\\\\"); //$NON-NLS-1$

 				break;

 			default :

 				result.append(source[i]);

 		}

 	}

-	result.append("\""/*nonNLS*/);

+	result.append("\""); //$NON-NLS-1$

 	return result.toString();

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
index 83e55fe..88f0ced 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/SuperReference.java
@@ -46,7 +46,7 @@
 }

 public String toStringExpression(){

 

-	return "super"/*nonNLS*/;

+	return "super"; //$NON-NLS-1$

 	

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index 61c0776..904357b 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -193,7 +193,6 @@
 			if ((cst = statements[i].resolveCase(scope, testType, this)) != null) {

 				//----check for duplicate case statement------------

 				if (cst != NotAConstant) {

-					// a case with a welled typed constant, so intValue() is valid

 					int key = cst.intValue();

 					for (int j = 0; j < counter; j++) {

 						if (casesValues[j] == key) {

@@ -211,41 +210,41 @@
 	

 	String inFront , s = tabString(tab) ;

 	inFront = s ;

-	s = s + "switch ("/*nonNLS*/ + testExpression.toStringExpression() + ") "/*nonNLS*/;

+	s = s + "switch (" + testExpression.toStringExpression() + ") "; //$NON-NLS-1$ //$NON-NLS-2$

 	if (statements == null)

-	{ 	s = s + "{}"/*nonNLS*/ ; 

+	{ 	s = s + "{}" ;  //$NON-NLS-1$

 		return s;}

 	else

-		s = s + "{"/*nonNLS*/;

+		s = s + "{"; //$NON-NLS-1$

 

 	s = s + (explicitDeclarations != 0

-				? "// ---scope needed for "/*nonNLS*/+String.valueOf(explicitDeclarations) +" locals------------ \n"/*nonNLS*/

-				: "// ---NO scope needed------ \n"/*nonNLS*/) ;

+				? "// ---scope needed for "+String.valueOf(explicitDeclarations) +" locals------------ \n" //$NON-NLS-2$ //$NON-NLS-1$

+				: "// ---NO scope needed------ \n") ; //$NON-NLS-1$

 		

 	int i = 0;

-	String tabulation = "  "/*nonNLS*/;

+	String tabulation = "  "; //$NON-NLS-1$

 	try	{while(true){

 		//use instanceof in order not to polluate classes with behavior only needed for printing purpose.

 		if ( statements[i]  instanceof Expression)

-			s = s + "\n"/*nonNLS*/ + inFront + tabulation;

+			s = s + "\n" + inFront + tabulation; //$NON-NLS-1$

 		if ( statements[i]  instanceof Break)

 			s = s + statements[i].toString(0) ;

 		else	

-			s = s + "\n"/*nonNLS*/ + statements[i].toString(tab+2) ;

+			s = s + "\n" + statements[i].toString(tab+2) ; //$NON-NLS-1$

 		//=============	

 		if ( (statements[i] instanceof Case) || (statements[i] instanceof DefaultCase))

 		{	i++;

 			while(! ((statements[i] instanceof Case) || (statements[i] instanceof DefaultCase)))

 			{	if ( (statements[i] instanceof Expression) || (statements[i] instanceof Break))

-					s = s +  statements[i].toString(0) +" ; "/*nonNLS*/;

+					s = s +  statements[i].toString(0) +" ; "; //$NON-NLS-1$

 				else

-					s = s + "\n"/*nonNLS*/ + statements[i].toString(tab+6) + " ; "/*nonNLS*/;

+					s = s + "\n" + statements[i].toString(tab+6) + " ; "; //$NON-NLS-1$ //$NON-NLS-2$

 				i++;}}

 		else

-		{	s = s + " ;"/*nonNLS*/ ;

+		{	s = s + " ;" ; //$NON-NLS-1$

 			i++;}}}

 	catch(IndexOutOfBoundsException e){};

-	s = s + "}"/*nonNLS*/;

+	s = s + "}"; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
index dc7cbe9..37d2ab7 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
@@ -17,7 +17,7 @@
 

 	boolean blockExit;

 	public LocalVariableBinding synchroVariable;

-	static final char[] SecretLocalDeclarationName = " syncValue"/*nonNLS*/.toCharArray();

+	static final char[] SecretLocalDeclarationName = " syncValue".toCharArray(); //$NON-NLS-1$

 

 public SynchronizedStatement(Expression expression , Block statement, int s, int e) {

 	this.expression = expression;

@@ -73,7 +73,6 @@
 		// generate  the body of the synchronized block

 		ExceptionLabel anyExceptionHandler = new ExceptionLabel(codeStream, null); //'null' denotes any kind of exception

 		block.generateCode(scope, codeStream);

-		anyExceptionHandler.placeEnd();

 		Label endLabel = new Label(codeStream);

 		if (!blockExit) {

 			codeStream.load(synchroVariable);

@@ -81,6 +80,7 @@
 			codeStream.goto_(endLabel);

 		}

 		// generate the body of the exception handler

+		anyExceptionHandler.placeEnd();

 		anyExceptionHandler.place();

 		codeStream.incrStackSize(1);

 		codeStream.load(synchroVariable);

@@ -128,8 +128,8 @@
 	/* slow code */

 

 	String s = tabString(tab) ;

-	s = s + "synchronized ("/*nonNLS*/ + expression.toStringExpression() + ")"/*nonNLS*/;

-	s = s + "\n"/*nonNLS*/ + block.toString(tab+1) ;

+	s = s + "synchronized (" + expression.toStringExpression() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

+	s = s + "\n" + block.toString(tab+1) ; //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
index e9cf7e2..366c46a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
@@ -56,8 +56,8 @@
 }

 public String toStringExpression(){

 

-	if (this == ThisImplicit) return ""/*nonNLS*/ ;

-	return "this"/*nonNLS*/;

+	if (this == ThisImplicit) return "" ; //$NON-NLS-1$

+	return "this"; //$NON-NLS-1$

 }

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	visitor.visit(this, blockScope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
index f1adeb7..3ff90d5 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
@@ -13,57 +13,54 @@
 public class ThrowStatement extends Statement {

 	public Expression exception;

 	public TypeBinding exceptionType;

-public ThrowStatement(Expression exception,int startPosition) {

-	this.exception = exception;

-	this.sourceStart = startPosition ;

-	this.sourceEnd = exception.sourceEnd ;

-}

-public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {

 

-	// need to check that exception thrown is actually caught somewhere

-

-	exception.analyseCode(currentScope, flowContext, flowInfo);

-	flowContext.checkExceptionHandlers(exceptionType, this, flowInfo, currentScope);

-	return FlowInfo.DeadEnd;

-}

-/**

- * Throw code generation

- *

- * @param currentScope org.eclipse.jdt.internal.compiler.lookup.BlockScope

- * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

- */ 

-public void generateCode(BlockScope currentScope, CodeStream codeStream) {

-

-	if ((bits & IsReachableMASK) == 0) {

-		return;

+	public ThrowStatement(Expression exception, int startPosition) {

+		this.exception = exception;

+		this.sourceStart = startPosition;

+		this.sourceEnd = exception.sourceEnd;

 	}

-	int pc = codeStream.position;

-	exception.generateCode(currentScope, codeStream, true);

-	codeStream.athrow();

-	codeStream.recordPositionsFrom(pc, this);

-	

-}

-public void resolve(BlockScope scope) {

-	exceptionType = exception.resolveTypeExpecting(scope, scope.getJavaLangThrowable());

-	if (exceptionType == NullBinding)

-		scope.problemReporter().cannotThrowNull(this);

-	exception.implicitWidening(exceptionType, exceptionType);

-}

-/* SHOULDN'T IT RATHER DO -

-scope.checkThrowable(exceptionType = expression.resolveType(scope)); 

-*/

-public String toString(int tab){

-	/* slow code */

 

-	String s = tabString(tab) ;

-	s = s + "throw "/*nonNLS*/;

-	s = s + exception.toStringExpression() ;

-	return s;

-}

-public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

-	if (visitor.visit(this, blockScope)) {

-		exception.traverse(visitor, blockScope);

+	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {

+

+		exception.analyseCode(currentScope, flowContext, flowInfo);

+		// need to check that exception thrown is actually caught somewhere

+		flowContext.checkExceptionHandlers(exceptionType, this, flowInfo, currentScope);

+		return FlowInfo.DeadEnd;

 	}

-	visitor.endVisit(this, blockScope);

-}

-}

+

+	/**

+	 * Throw code generation

+	 *

+	 * @param currentScope org.eclipse.jdt.internal.compiler.lookup.BlockScope

+	 * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream

+	 */

+	public void generateCode(BlockScope currentScope, CodeStream codeStream) {

+

+		if ((bits & IsReachableMASK) == 0)

+			return;

+		int pc = codeStream.position;

+		exception.generateCode(currentScope, codeStream, true);

+		codeStream.athrow();

+		codeStream.recordPositionsFrom(pc, this);

+	}

+

+	public void resolve(BlockScope scope) {

+		exceptionType = exception.resolveTypeExpecting(scope, scope.getJavaLangThrowable());

+		if (exceptionType == NullBinding)

+			scope.problemReporter().cannotThrowNull(this);

+		exception.implicitWidening(exceptionType, exceptionType);

+	}

+

+	public String toString(int tab) {

+		String s = tabString(tab);

+		s = s + "throw "; //$NON-NLS-1$

+		s = s + exception.toStringExpression();

+		return s;

+	}

+

+	public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

+		if (visitor.visit(this, blockScope))

+			exception.traverse(visitor, blockScope);

+		visitor.endVisit(this, blockScope);

+	}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
index f2f4815..7531da2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
@@ -29,8 +29,8 @@
 	Label subRoutineStartLabel;

 	LocalVariableBinding anyExceptionVariable, returnAddressVariable;

 

-	final static char[] SecretReturnName = " returnAddress"/*nonNLS*/.toCharArray() ;

-	final static char[] SecretAnyHandlerName = " anyExceptionHandler"/*nonNLS*/.toCharArray();

+	final static char[] SecretReturnName = " returnAddress".toCharArray() ; //$NON-NLS-1$

+	final static char[] SecretAnyHandlerName = " anyExceptionHandler".toCharArray(); //$NON-NLS-1$

 

 	// for local variables table attributes

 	int preTryInitStateIndex = -1;

@@ -374,24 +374,24 @@
 

 	String s = tabString(tab) ;

 	//try

-	s = s + "try "/*nonNLS*/ ;

+	s = s + "try " ; //$NON-NLS-1$

 	if (tryBlock == Block.None)

-		s =s + "{}"/*nonNLS*/ ;

+		s =s + "{}" ; //$NON-NLS-1$

 	else

-		s = s + "\n"/*nonNLS*/ + tryBlock.toString(tab+1) ;

+		s = s + "\n" + tryBlock.toString(tab+1) ; //$NON-NLS-1$

 	

 	//catches

 	if (catchBlocks != null)

 		for (int i = 0; i < catchBlocks.length ; i++)

-			s = s 	+ "\n"/*nonNLS*/ + tabString(tab) + "catch ("/*nonNLS*/ 

-					+ catchArguments[i].toString(0) + ") "/*nonNLS*/

+			s = s 	+ "\n" + tabString(tab) + "catch ("  //$NON-NLS-2$ //$NON-NLS-1$

+					+ catchArguments[i].toString(0) + ") " //$NON-NLS-1$

 					+ catchBlocks[i].toString(tab+1) ;

 	//finally

 	if (finallyBlock != null)

 	{	if (finallyBlock == Block.None) 

-			s = s + "\n"/*nonNLS*/ + tabString(tab)+ "finally {}"/*nonNLS*/ ;

+			s = s + "\n" + tabString(tab)+ "finally {}" ; //$NON-NLS-2$ //$NON-NLS-1$

 		else

-			s = s + "\n"/*nonNLS*/ + tabString(tab)+ "finally\n"/*nonNLS*/ + 

+			s = s + "\n" + tabString(tab)+ "finally\n" +  //$NON-NLS-2$ //$NON-NLS-1$

 				finallyBlock.toString(tab+1) ;}

 	

 	return s ;}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 38705e1..8bc813f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -33,6 +33,7 @@
 	public int declarationSourceStart ;

 	public int declarationSourceEnd ;

 	public int bodyStart;

+	

 /*

  *	We cause the compilation task to abort to a given extent.

  */

@@ -650,6 +651,9 @@
 	

 	return false ;}

 	----------------------------------------------------*/

+	if ((this.bits & AddAssertionMASK) != 0) {

+		return true;

+	}

 	if (fields == null)

 		return false;

 	if (isInterface()) return true; // fields are implicitly statics

@@ -773,48 +777,48 @@
 public String toStringBody(int tab) {

 	/*slow code */

 

-	String s = " {"/*nonNLS*/;

+	String s = " {"; //$NON-NLS-1$

 	if (memberTypes != null) {

 		for (int i = 0; i < memberTypes.length; i++) {

 			if (memberTypes[i] != null) {

-				s += "\n"/*nonNLS*/ + memberTypes[i].toString(tab + 1);

+				s += "\n" + memberTypes[i].toString(tab + 1); //$NON-NLS-1$

 			}

 		}

 	}

 	if (fields != null) {

 		for (int fieldI = 0; fieldI < fields.length; fieldI++) {

 			if (fields[fieldI] != null) {

-				s += "\n"/*nonNLS*/ + fields[fieldI].toString(tab + 1);

-				if (fields[fieldI].isField()) s += ";"/*nonNLS*/;

+				s += "\n" + fields[fieldI].toString(tab + 1); //$NON-NLS-1$

+				if (fields[fieldI].isField()) s += ";"; //$NON-NLS-1$

 			}

 		}

 	}

 	if (methods != null) {

 		for (int i = 0; i < methods.length; i++) {

 			if (methods[i] != null) {

-				s += "\n"/*nonNLS*/ + methods[i].toString(tab + 1);

+				s += "\n" + methods[i].toString(tab + 1); //$NON-NLS-1$

 			}

 		}

 	}

-	s += "\n"/*nonNLS*/+tabString(tab) + "}"/*nonNLS*/;	

+	s += "\n"+tabString(tab) + "}";	 //$NON-NLS-2$ //$NON-NLS-1$

 	return s;

 }

 public String toStringHeader() {

 	/*slow code */

 

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	if (modifiers != AccDefault) {

 		s += modifiersString(modifiers);

 	}

-	s += (isInterface() ? "interface "/*nonNLS*/ : "class "/*nonNLS*/) + new String(name);

+	s += (isInterface() ? "interface " : "class ") + new String(name); //$NON-NLS-1$ //$NON-NLS-2$

 	if (superclass != null)

-		s += " extends "/*nonNLS*/ + superclass.toString(0);

+		s += " extends " + superclass.toString(0); //$NON-NLS-1$

 	if (superInterfaces != null && superInterfaces.length > 0) {

-		s += (isInterface() ? " extends "/*nonNLS*/ : " implements "/*nonNLS*/);

+		s += (isInterface() ? " extends " : " implements "); //$NON-NLS-2$ //$NON-NLS-1$

 		for (int i = 0; i < superInterfaces.length; i++) {

 			s += superInterfaces[i].toString(0);

 			if (i != superInterfaces.length-1)

-				s += ", "/*nonNLS*/;

+				s += ", "; //$NON-NLS-1$

 		};

 	};

 

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java b/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
index d99021d..3093dd5 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
@@ -245,7 +245,7 @@
 public String toStringExpressionNoParenthesis(){

 	/* slow code*/

 

-	return	operatorToString() + " "/*nonNLS*/ + expression.toStringExpression() ; }

+	return	operatorToString() + " " + expression.toStringExpression() ; } //$NON-NLS-1$

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

 		expression.traverse(visitor, blockScope);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
index b879a0c..86df1fc 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
@@ -149,14 +149,14 @@
 	/* slow code */

 

 	String s = tabString(tab) ;

-	s = s + "while ("/*nonNLS*/ + condition.toStringExpression() + ")"/*nonNLS*/;

+	s = s + "while (" + condition.toStringExpression() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	if (action == null)

-		s = s + " {} ;"/*nonNLS*/;

+		s = s + " {} ;"; //$NON-NLS-1$

 	else

 		if (action instanceof Block)

-			s = s + "\n"/*nonNLS*/ + action.toString(tab+1) ;

+			s = s + "\n" + action.toString(tab+1) ; //$NON-NLS-1$

 		else

-			s = s + " {\n"/*nonNLS*/ + action.toString(tab+1) + "}"/*nonNLS*/ ;

+			s = s + " {\n" + action.toString(tab+1) + "}" ; //$NON-NLS-2$ //$NON-NLS-1$

 	return s;}

 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {

 	if (visitor.visit(this, blockScope)) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
index 1a19a46..24acdb2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
@@ -4,12 +4,15 @@
  * (c) Copyright IBM Corp. 2000, 2001.

  * All Rights Reserved.

  */

-import org.eclipse.jdt.internal.compiler.env.*;

-

-import org.eclipse.jdt.internal.compiler.util.*;

 import org.eclipse.jdt.internal.compiler.codegen.*;

+import org.eclipse.jdt.internal.compiler.env.*;

+import org.eclipse.jdt.internal.compiler.impl.Constant;

+import org.eclipse.jdt.internal.compiler.impl.NullConstant;

+import org.eclipse.jdt.internal.compiler.lookup.TypeIds;

+import org.eclipse.jdt.internal.compiler.util.*;

 

 import java.io.*;

+import java.util.Arrays;

 

 public class ClassFileReader extends ClassFileStruct implements AttributeNamesConstants, IBinaryType {

 	private int constantPoolCount;

@@ -508,12 +511,216 @@
 	java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();

 	java.io.PrintWriter print = new java.io.PrintWriter(out);

 	

-	print.println(this.getClass().getName() + "{"/*nonNLS*/);

-	print.println(" className: "/*nonNLS*/ + new String(getName()));

-	print.println(" superclassName: "/*nonNLS*/ + (getSuperclassName() == null ? "null"/*nonNLS*/ : new String(getSuperclassName())));

-	print.println(" access_flags: "/*nonNLS*/ + ClassFileStruct.printTypeModifiers(accessFlags()) + "("/*nonNLS*/ + accessFlags() + ")"/*nonNLS*/);

+	print.println(this.getClass().getName() + "{"); //$NON-NLS-1$

+	print.println(" className: " + new String(getName())); //$NON-NLS-1$

+	print.println(" superclassName: " + (getSuperclassName() == null ? "null" : new String(getSuperclassName()))); //$NON-NLS-2$ //$NON-NLS-1$

+	print.println(" access_flags: " + ClassFileStruct.printTypeModifiers(accessFlags()) + "(" + accessFlags() + ")"); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$

 

 	print.flush();

 	return out.toString();

 }

+/**

+ * Check if the receiver has structural changes compare to the byte array in argument.

+ * Structural changes are:

+ * - modifiers changes for the class, the fields or the methods

+ * - signature changes for fields or methods.

+ * - changes in the number of fields or methods

+ * - changes for field constants

+ * - changes for thrown exceptions

+ * - change for the super class or any super interfaces.

+ * - changes for member types name or modifiers

+ * If any of these changes occurs, the method returns true. false otherwise.

+ */

+public boolean hasStructuralChanges(byte[] newBytes) {

+	try {

+		ClassFileReader newClassFile =

+			new ClassFileReader(newBytes, this.classFileName);

+		// type level comparison

+		// modifiers

+		if (this.getModifiers() != newClassFile.getModifiers()) {

+			return true;

+		}

+		// superclass

+		if (!CharOperation.equals(this.getSuperclassName(), newClassFile.getSuperclassName())) {

+			return true;

+		}

+		// interfaces

+		char[][] newInterfacesNames = newClassFile.getInterfaceNames();

+		int newInterfacesLength = newInterfacesNames == null ? 0 : newInterfacesNames.length;

+		if (newInterfacesLength != this.interfacesCount) {

+			return true;

+		}

+		if (this.interfacesCount != 0) {

+			for (int i = 0, max = this.interfacesCount; i < max; i++) {

+				if (!CharOperation.equals(this.interfaceNames[i], newInterfacesNames[i])) {

+					return true;

+				}

+			}

+		}

+		// fields

+		FieldInfo[] otherFieldInfos = (FieldInfo[]) newClassFile.getFields();

+		int otherFieldInfosLength = otherFieldInfos == null ? 0 : otherFieldInfos.length;

+		if (this.fieldsCount != otherFieldInfosLength) {

+			return true;

+		}

+		if (otherFieldInfosLength != 0) {

+//			Arrays.sort(this.fields);

+//			Arrays.sort(otherFieldInfos);

+			for (int i = 0; i < otherFieldInfosLength; i++) {

+				FieldInfo currentFieldInfo = this.fields[i];

+				FieldInfo otherFieldInfo = otherFieldInfos[i];

+				if (currentFieldInfo.getModifiers() != otherFieldInfo.getModifiers()) {

+					return true;

+				}

+				if (!CharOperation.equals(currentFieldInfo.getName(), otherFieldInfo.getName())) {

+					return true;

+				}

+				if (!CharOperation.equals(currentFieldInfo.getTypeName(), otherFieldInfo.getTypeName())) {

+					return true;

+				}

+				if (currentFieldInfo.hasConstant()) {

+					if (!otherFieldInfo.hasConstant()) {

+						return true;

+					}

+					Constant currentConstant = currentFieldInfo.getConstant();

+					Constant otherConstant = otherFieldInfo.getConstant();

+					if (!currentConstant.getClass().equals(otherConstant.getClass())) {

+						return true;

+					} 

+					switch (currentConstant.typeID()) {

+							case TypeIds.T_int : 

+								if (otherConstant.typeID() != TypeIds.T_int) {

+									return true;

+								}

+								if (otherConstant.intValue() != currentConstant.intValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_byte :

+								if (otherConstant.typeID() != TypeIds.T_byte) {

+									return true;

+								}

+								if (otherConstant.byteValue() != currentConstant.byteValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_short : 

+								if (otherConstant.typeID() != TypeIds.T_short) {

+									return true;

+								}

+								if (otherConstant.shortValue() != currentConstant.shortValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_char : 

+								if (otherConstant.typeID() != TypeIds.T_char) {

+									return true;

+								}

+								if (otherConstant.charValue() != currentConstant.charValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_float :

+								if (otherConstant.typeID() != TypeIds.T_float) {

+									return true;

+								}

+								if (otherConstant.floatValue() != currentConstant.floatValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_double :

+								if (otherConstant.typeID() != TypeIds.T_double) {

+									return true;

+								}

+								if (otherConstant.doubleValue() != currentConstant.doubleValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_boolean : 

+								if (otherConstant.typeID() != TypeIds.T_boolean) {

+									return true;

+								}

+								if (otherConstant.booleanValue() != currentConstant.booleanValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_String : 

+								if (otherConstant.typeID() != TypeIds.T_String) {

+									return true;

+								}

+								if (otherConstant.stringValue() != currentConstant.stringValue()) {

+									return true;

+								}

+								break;

+							case TypeIds.T_null :

+								if (otherConstant.typeID() != TypeIds.T_null) {

+									return true;

+								}

+								if (otherConstant != NullConstant.Default) {

+									return true;

+								}

+					}

+				} else if (otherFieldInfo.hasConstant()) {

+					return true;

+				}

+			}

+		}

+		// methods

+		MethodInfo[] otherMethodInfos = (MethodInfo[]) newClassFile.getMethods();

+		int otherMethodInfosLength = otherMethodInfos == null ? 0 : otherMethodInfos.length;

+		if (this.methodsCount != otherMethodInfosLength) {

+			return true;

+		}

+		if (otherMethodInfosLength != 0) {

+//			Arrays.sort(this.methods);

+//			Arrays.sort(otherMethodInfos);

+			for (int i = 0; i < otherMethodInfosLength; i++) {

+				MethodInfo otherMethodInfo = otherMethodInfos[i];

+				MethodInfo currentMethodInfo = this.methods[i];

+				if (otherMethodInfo.getModifiers() != currentMethodInfo.getModifiers()) {

+					return true;

+				}				

+				if (!CharOperation.equals(otherMethodInfo.getSelector(), currentMethodInfo.getSelector())) {

+					return true;

+				}

+				if (!CharOperation.equals(otherMethodInfo.getMethodDescriptor(), currentMethodInfo.getMethodDescriptor())) {

+					return true;

+				}

+				char[][] otherThrownExceptions = otherMethodInfo.getExceptionTypeNames();

+				int otherThrownExceptionsLength = otherThrownExceptions == null ? 0 : otherThrownExceptions.length;

+				char[][] currentThrownExceptions = currentMethodInfo.getExceptionTypeNames();

+				int currentThrownExceptionsLength = currentThrownExceptions == null ? 0 : currentThrownExceptions.length;

+				if (currentThrownExceptionsLength != otherThrownExceptionsLength) {

+					return true;

+				}

+				if (currentThrownExceptionsLength != 0) {

+					for (int k = 0; k < currentThrownExceptionsLength; k++) {

+						if (!CharOperation.equals(currentThrownExceptions[k], otherThrownExceptions[k])) {

+							return true;

+						}

+					}

+				}

+			}

+		}

+		// Member types

+		InnerClassInfo[] currentMemberTypes = (InnerClassInfo[]) this.getMemberTypes();

+		InnerClassInfo[] otherMemberTypes = (InnerClassInfo[]) newClassFile.getMemberTypes();

+		int currentMemberTypeLength = currentMemberTypes == null ? 0 : currentMemberTypes.length;

+		int otherMemberTypeLength = otherMemberTypes == null ? 0 : otherMemberTypes.length;

+		if (currentMemberTypeLength != otherMemberTypeLength) {

+			return true;

+		}

+		if (currentMemberTypeLength != 0) {

+			for (int i = 0; i < currentMemberTypeLength; i++) {

+				if (!CharOperation.equals(currentMemberTypes[i].getName(), otherMemberTypes[i].getName())

+					|| currentMemberTypes[i].getModifiers() != otherMemberTypes[i].getModifiers()) {

+						return true;

+				}

+			}			

+		}

+		return false;

+	} catch (ClassFormatException e) {

+		return true;

+	}

+}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.java b/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.java
index 1ff4e1f..b0bc498 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.java
@@ -114,12 +114,12 @@
 	java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();

 	java.io.PrintWriter print = new java.io.PrintWriter(out);

 

-	if ((modifiers & AccPublic) != 0) print.print("public "/*nonNLS*/);

-	if ((modifiers & AccPrivate) != 0) print.print("private "/*nonNLS*/);

-	if ((modifiers & AccFinal) != 0) print.print("final "/*nonNLS*/);

-	if ((modifiers & AccSuper) != 0) print.print("super "/*nonNLS*/);

-	if ((modifiers & AccInterface) != 0) print.print("interface "/*nonNLS*/);

-	if ((modifiers & AccAbstract) != 0) print.print("abstract "/*nonNLS*/);

+	if ((modifiers & AccPublic) != 0) print.print("public "); //$NON-NLS-1$

+	if ((modifiers & AccPrivate) != 0) print.print("private "); //$NON-NLS-1$

+	if ((modifiers & AccFinal) != 0) print.print("final "); //$NON-NLS-1$

+	if ((modifiers & AccSuper) != 0) print.print("super "); //$NON-NLS-1$

+	if ((modifiers & AccInterface) != 0) print.print("interface "); //$NON-NLS-1$

+	if ((modifiers & AccAbstract) != 0) print.print("abstract "); //$NON-NLS-1$

 	print.flush();

 	return out.toString();

 }

@@ -270,7 +270,7 @@
 

 	// if name begins with the < character it must be clinit or init

 	if (name[0] == '<') {

-		if (new String(name).equals("<clinit>"/*nonNLS*/) || new String(name).equals("<init>"/*nonNLS*/)) {

+		if (new String(name).equals("<clinit>") || new String(name).equals("<init>")) { //$NON-NLS-2$ //$NON-NLS-1$

 			int signatureLength = signature.length;

 			if (!((signatureLength > 2)

 				&& (signature[0] == '(')

diff --git a/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java b/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
index 0c371b5..5f4676f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
@@ -11,7 +11,7 @@
 import org.eclipse.jdt.internal.compiler.codegen.*;

 import org.eclipse.jdt.internal.compiler.util.*;

 

-public class FieldInfo extends ClassFileStruct implements AttributeNamesConstants, IBinaryField {

+public class FieldInfo extends ClassFileStruct implements AttributeNamesConstants, IBinaryField, Comparable {

 	private Constant constant;

 	private boolean isDeprecated;

 	private int[] constantPoolOffsets;

@@ -38,8 +38,8 @@
 }

 /**

  * Return the constant of the field.

- * Return org.eclipse.jdt.internal.compiler.Constant.NotAConstant if there is none.

- * @return org.eclipse.jdt.internal.compiler.Constant

+ * Return org.eclipse.jdt.internal.compiler.impl.Constant.NotAConstant if there is none.

+ * @return org.eclipse.jdt.internal.compiler.impl.Constant

  */

 public Constant getConstant() {

 	if (constant == null) {

@@ -261,22 +261,29 @@
 	StringBuffer buffer = new StringBuffer(this.getClass().getName());

 	int modifiers = getModifiers();

 	return buffer

-		.append("{"/*nonNLS*/)

+		.append("{") //$NON-NLS-1$

 		.append(

-			((modifiers & AccDeprecated) != 0 ? "deprecated "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0001) == 1 ? "public "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0002) == 0x0002 ? "private "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0004) == 0x0004 ? "protected "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0008) == 0x000008 ? "static "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0010) == 0x0010 ? "final "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0040) == 0x0040 ? "volatile "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0080) == 0x0080 ? "transient "/*nonNLS*/ : ""/*nonNLS*/))

+			((modifiers & AccDeprecated) != 0 ? "deprecated " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0001) == 1 ? "public " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0002) == 0x0002 ? "private " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0004) == 0x0004 ? "protected " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0008) == 0x000008 ? "static " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0010) == 0x0010 ? "final " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0040) == 0x0040 ? "volatile " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0080) == 0x0080 ? "transient " : "")) //$NON-NLS-1$ //$NON-NLS-2$

 		.append(getTypeName())

-		.append(" "/*nonNLS*/)

+		.append(" ") //$NON-NLS-1$

 		.append(getName())

-		.append(" "/*nonNLS*/)

+		.append(" ") //$NON-NLS-1$

 		.append(getConstant())

-		.append("}"/*nonNLS*/)

+		.append("}") //$NON-NLS-1$

 		.toString(); 

 }

+

+public int compareTo(Object o) {

+	if (!(o instanceof FieldInfo)) {

+		throw new ClassCastException();

+	}

+	return new String(this.getName()).compareTo(new String(((FieldInfo) o).getName()));

+}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.java b/compiler/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.java
index 3cc4f94..ea42789 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.java
@@ -109,11 +109,11 @@
 	if (getName() != null) {

 		buffer.append(getName());

 	}

-	buffer.append("\n"/*nonNLS*/);

+	buffer.append("\n"); //$NON-NLS-1$

 	if (getEnclosingTypeName() != null) {

 		buffer.append(getEnclosingTypeName());

 	}

-	buffer.append("\n"/*nonNLS*/);

+	buffer.append("\n"); //$NON-NLS-1$

 	if (getSourceName() != null) {

 		buffer.append(getSourceName());

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java b/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
index 06146a5..9e806b0 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
@@ -10,7 +10,7 @@
 import org.eclipse.jdt.internal.compiler.codegen.*;

 import org.eclipse.jdt.internal.compiler.util.*;

 

-public class MethodInfo extends ClassFileStruct implements IBinaryMethod, AttributeNamesConstants {

+public class MethodInfo extends ClassFileStruct implements IBinaryMethod, AttributeNamesConstants, Comparable {

 	private char[][] exceptionNames;

 	private int[] constantPoolOffsets;

 	private boolean isDeprecated;

@@ -192,19 +192,30 @@
 	int modifiers = getModifiers();

 	StringBuffer buffer = new StringBuffer(this.getClass().getName());

 	return buffer

-		.append("{"/*nonNLS*/)

+		.append("{") //$NON-NLS-1$

 		.append(

-			((modifiers & AccDeprecated) != 0 ? "deprecated "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0001) == 1 ? "public "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0002) == 0x0002 ? "private "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0004) == 0x0004 ? "protected "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0008) == 0x000008 ? "static "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0010) == 0x0010 ? "final "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0040) == 0x0040 ? "volatile "/*nonNLS*/ : ""/*nonNLS*/)

-				+ ((modifiers & 0x0080) == 0x0080 ? "transient "/*nonNLS*/ : ""/*nonNLS*/))

+			((modifiers & AccDeprecated) != 0 ? "deprecated " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0001) == 1 ? "public " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0002) == 0x0002 ? "private " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0004) == 0x0004 ? "protected " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0008) == 0x000008 ? "static " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0010) == 0x0010 ? "final " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0040) == 0x0040 ? "volatile " : "") //$NON-NLS-1$ //$NON-NLS-2$

+				+ ((modifiers & 0x0080) == 0x0080 ? "transient " : "")) //$NON-NLS-1$ //$NON-NLS-2$

 		.append(getSelector())

 		.append(getMethodDescriptor())

-		.append("}"/*nonNLS*/)

+		.append("}") //$NON-NLS-1$

 		.toString(); 

 }

+public int compareTo(Object o) {

+	if (!(o instanceof MethodInfo)) {

+		throw new ClassCastException();

+	}

+	StringBuffer currentComparisonKey = new StringBuffer();

+	currentComparisonKey.append(this.getSelector()).append(this.getMethodDescriptor());

+	StringBuffer otherComparisonKey = new StringBuffer();

+	MethodInfo otherMethodInfo = (MethodInfo) o;

+	otherComparisonKey.append(otherMethodInfo.getSelector()).append(otherMethodInfo.getMethodDescriptor());

+	return currentComparisonKey.toString().compareTo(otherComparisonKey.toString());

+}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.java
index aa41c79..dcd721f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.java
@@ -166,16 +166,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if (keyTable[i] != null) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index acb59b9..d381484 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -1369,7 +1369,7 @@
 	// Wrap the code in an exception handler to convert a ClassNotFoundException into a NoClassDefError

 

 	anyExceptionHandler = new ExceptionLabel(this, TypeBinding.NullBinding /* represents ClassNotFoundException*/);

-	this.ldc(accessedType == TypeBinding.NullBinding ? "java.lang.Object"/*nonNLS*/ : String.valueOf(accessedType.constantPoolName()).replace('/', '.'));

+	this.ldc(accessedType == TypeBinding.NullBinding ? "java.lang.Object" : String.valueOf(accessedType.constantPoolName()).replace('/', '.')); //$NON-NLS-1$

 	this.invokeClassForName();

 

 	/* We need to protect the runtime code from binary inconsistencies

@@ -1429,7 +1429,7 @@
 	anewarrayJavaLangClass();

 	dup();

 	iconst_0();

-	ldc("java.lang.String"/*nonNLS*/);

+	ldc("java.lang.String"); //$NON-NLS-1$

 	invokeClassForName();

 	aastore();

 	invokeConstructorGetConstructor();

@@ -1773,28 +1773,28 @@
 	char[][] wrapperTypeCompoundName = null;

 	switch (valueType.id) {

 		case T_int : // new: java.lang.Integer

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Integer"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Integer".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_boolean : // new: java.lang.Boolean

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Boolean"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Boolean".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_byte : // new: java.lang.Byte

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Byte"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Byte".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_char : // new: java.lang.Character

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Character"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Character".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_float : // new: java.lang.Float

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Float"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Float".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_double : // new: java.lang.Double

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Double"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Double".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_short : // new: java.lang.Short

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Short"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Short".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 		case T_long : // new: java.lang.Long

-			wrapperTypeCompoundName = new char[][] {"java"/*nonNLS*/.toCharArray(), "lang"/*nonNLS*/.toCharArray(), "Long"/*nonNLS*/.toCharArray()};

+			wrapperTypeCompoundName = new char[][] {"java".toCharArray(), "lang".toCharArray(), "Long".toCharArray()}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 			break;

 	}

 	TypeBinding wrapperType = methodDeclaration.scope.getType(wrapperTypeCompoundName);

@@ -2885,6 +2885,20 @@
 	}

 	writeUnsignedShort(constantPool.literalIndexForJavaLangClassForName());

 }

+

+public void invokeJavaLangClassDesiredAssertionStatus() {

+	// invokevirtual: java.lang.Class.desiredAssertionStatus()Z;

+	countLabels = 0;

+	stackDepth--;

+	try {

+		position++;

+		bCodeStream[classFileOffset++] = OPC_invokevirtual;

+	} catch (IndexOutOfBoundsException e) {

+		resizeByteArray(OPC_invokevirtual);

+	}

+	writeUnsignedShort(constantPool.literalIndexForJavaLangClassDesiredAssertionStatus());

+}

+

 public void invokeConstructorGetConstructor() {

 	// invokevirtual: java.lang.Class.getConstructor(java.lang.Class[])Ljava.lang.reflect.Constructor;

 	countLabels = 0;

@@ -3068,6 +3082,33 @@
 	else

 		stackDepth--;

 }

+

+public void invokeJavaLangAssertionErrorConstructor(int typeBindingID) {

+	// invokespecial: java.lang.AssertionError.<init>(typeBindingID)V

+	countLabels = 0;

+	try {

+		position++;

+		bCodeStream[classFileOffset++] = OPC_invokespecial;

+	} catch (IndexOutOfBoundsException e) {

+		resizeByteArray(OPC_invokespecial);

+	}

+	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorConstructor(typeBindingID));

+	stackDepth -= 2;

+}

+

+public void invokeJavaLangAssertionErrorDefaultConstructor() {

+	// invokespecial: java.lang.AssertionError.<init>()V

+	countLabels = 0;

+	try {

+		position++;

+		bCodeStream[classFileOffset++] = OPC_invokespecial;

+	} catch (IndexOutOfBoundsException e) {

+		resizeByteArray(OPC_invokespecial);

+	}

+	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorDefaultConstructor());

+	stackDepth --;

+}

+

 public void invokeStringBufferDefaultConstructor() {

 	// invokespecial: java.lang.StringBuffer.<init>()V

 	countLabels = 0;

@@ -3092,6 +3133,7 @@
 	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferConstructor());

 	stackDepth -= 2;

 }

+

 public void invokeStringBufferToString() {

 	// invokevirtual: StringBuffer.toString()Ljava.lang.String;

 	countLabels = 0;

@@ -4441,6 +4483,22 @@
 	}

 	writeUnsignedShort(constantPool.literalIndexForJavaLangError());

 }

+

+public void newJavaLangAssertionError() {

+	// new: java.lang.AssertionError

+	countLabels = 0;

+	stackDepth++;

+	if (stackDepth > stackMax)

+		stackMax = stackDepth;

+	try {

+		position++;

+		bCodeStream[classFileOffset++] = OPC_new;

+	} catch (IndexOutOfBoundsException e) {

+		resizeByteArray(OPC_new);

+	}

+	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionError());

+}

+

 public void newNoClassDefFoundError() { // new: java.lang.NoClassDefFoundError

 	countLabels = 0;

 	stackDepth++;

@@ -5304,15 +5362,15 @@
 	}

 }

 public String toString() {

-	StringBuffer buffer = new StringBuffer("( position:"/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("( position:"); //$NON-NLS-1$

 	buffer.append(position);

-	buffer.append(",\nstackDepth:"/*nonNLS*/);

+	buffer.append(",\nstackDepth:"); //$NON-NLS-1$

 	buffer.append(stackDepth);

-	buffer.append(",\nmaxStack:"/*nonNLS*/);

+	buffer.append(",\nmaxStack:"); //$NON-NLS-1$

 	buffer.append(stackMax);

-	buffer.append(",\nmaxLocals:"/*nonNLS*/);

+	buffer.append(",\nmaxLocals:"); //$NON-NLS-1$

 	buffer.append(maxLocals);

-	buffer.append(")"/*nonNLS*/);

+	buffer.append(")"); //$NON-NLS-1$

 	return buffer.toString();

 }

 public void updateLastRecordedEndPC(int pos) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
index e87240f..3580794 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
@@ -41,11 +41,11 @@
 	protected ObjectCache classCache;

 	protected FieldNameAndTypeCache nameAndTypeCacheForFields;

 	protected MethodNameAndTypeCache nameAndTypeCacheForMethods;

-	int[] wellKnownTypes = new int[20];

-	int[] wellKnownMethods = new int[26];

+	int[] wellKnownTypes = new int[21];

+	int[] wellKnownMethods = new int[35];

 	int[] wellKnownFields = new int[10];

 	int[] wellKnownFieldNameAndTypes = new int[2];

-	int[] wellKnownMethodNameAndTypes = new int[24];

+	int[] wellKnownMethodNameAndTypes = new int[32];

 	public byte[] poolContent;

 	public int currentIndex = 1;

 	public int currentOffset;

@@ -70,6 +70,8 @@
 	final static int JAVA_LANG_ERROR_TYPE = 17;

 	final static int JAVA_LANG_EXCEPTION_TYPE = 18;

 	final static int JAVA_LANG_REFLECT_CONSTRUCTOR_TYPE = 19;

+	final static int JAVA_LANG_ASSERTIONERROR_TYPE = 20;

+	

 	// predefined constant index for well known fields  

 	final static int TYPE_BYTE_FIELD = 0;

 	final static int TYPE_SHORT_FIELD = 1;

@@ -108,12 +110,21 @@
 	final static int VALUEOF_CHAR_METHOD = 23;

 	final static int VALUEOF_BOOLEAN_METHOD = 24;

 	final static int VALUEOF_DOUBLE_METHOD = 25;

+	final static int ASSERTIONERROR_CONSTR_OBJECT_METHOD = 26;

+	final static int ASSERTIONERROR_CONSTR_INT_METHOD = 27;

+	final static int ASSERTIONERROR_CONSTR_LONG_METHOD = 28;

+	final static int ASSERTIONERROR_CONSTR_FLOAT_METHOD = 29;

+	final static int ASSERTIONERROR_CONSTR_DOUBLE_METHOD = 30;

+	final static int ASSERTIONERROR_CONSTR_BOOLEAN_METHOD = 31;

+	final static int ASSERTIONERROR_CONSTR_CHAR_METHOD = 32;

+	final static int ASSERTIONERROR_DEFAULT_CONSTR_METHOD = 33;

+	final static int DESIREDASSERTIONSTATUS_CLASS_METHOD = 34;

 	// predefined constant index for well known name and type for fields

 	final static int TYPE_JAVALANGCLASS_NAME_AND_TYPE = 0;

 	final static int OUT_SYSTEM_NAME_AND_TYPE = 1;

 	// predefined constant index for well known name and type for methods

 	final static int FORNAME_CLASS_METHOD_NAME_AND_TYPE = 0;

-	final static int STRING_CONSTR_METHOD_NAME_AND_TYPE = 1;

+	final static int CONSTR_STRING_METHOD_NAME_AND_TYPE = 1;

 	final static int DEFAULT_CONSTR_METHOD_NAME_AND_TYPE = 2;

 	final static int APPEND_INT_METHOD_NAME_AND_TYPE = 3;

 	final static int APPEND_FLOAT_METHOD_NAME_AND_TYPE = 4;

@@ -136,6 +147,15 @@
 	final static int VALUEOF_CHAR_METHOD_NAME_AND_TYPE = 21;

 	final static int VALUEOF_BOOLEAN_METHOD_NAME_AND_TYPE = 22;

 	final static int VALUEOF_DOUBLE_METHOD_NAME_AND_TYPE = 23;

+	final static int CONSTR_INT_METHOD_NAME_AND_TYPE = 24;

+	final static int CONSTR_LONG_METHOD_NAME_AND_TYPE = 25;

+	final static int CONSTR_FLOAT_METHOD_NAME_AND_TYPE = 26;

+	final static int CONSTR_DOUBLE_METHOD_NAME_AND_TYPE = 27;

+	final static int CONSTR_OBJECT_METHOD_NAME_AND_TYPE = 28;

+	final static int CONSTR_CHAR_METHOD_NAME_AND_TYPE = 29;

+	final static int CONSTR_BOOLEAN_METHOD_NAME_AND_TYPE = 30;

+	final static int DESIREDASSERTIONSTATUS_METHOD_NAME_AND_TYPE = 31;

+	

 	public ClassFile classFile;

 

 /**

@@ -252,13 +272,63 @@
 			break;

 		case '<' :

 			if (CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.Init)) {

-				if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.StringConstructorSignature)) {

-					// This method binding is (java.lang.String)V

-					return STRING_CONSTR_METHOD_NAME_AND_TYPE;

-				} else

-					if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.DefaultConstructorSignature)) {

-						return DEFAULT_CONSTR_METHOD_NAME_AND_TYPE;

-					}

+				switch(methodBinding.parameters.length) {

+					case 1:

+						switch(methodBinding.parameters[0].id) {

+							case T_String :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.StringConstructorSignature)) {

+									return CONSTR_STRING_METHOD_NAME_AND_TYPE;	

+								} else {

+									return -1;

+								}

+							case T_Object :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorObjectConstrSignature)) {

+									return CONSTR_OBJECT_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_int :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorIntConstrSignature)) {

+									return CONSTR_INT_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_char :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorCharConstrSignature)) {

+									return CONSTR_CHAR_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_boolean :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorBooleanConstrSignature)) {

+									return CONSTR_BOOLEAN_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_float :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorFloatConstrSignature)) {

+									return CONSTR_FLOAT_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_double :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorDoubleConstrSignature)) {

+									return CONSTR_DOUBLE_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+							case T_long :

+								if (CharOperation.equals(methodBinding.signature(), QualifiedNamesConstants.AssertionErrorLongConstrSignature)) {

+									return CONSTR_LONG_METHOD_NAME_AND_TYPE;

+								} else {

+									return -1;

+								}

+						}

+					case 0:

+						if (methodBinding.signature().length == 3) {

+							return DEFAULT_CONSTR_METHOD_NAME_AND_TYPE;

+						}

+				}

 			}

 			break;

 		case 'a' :

@@ -357,10 +427,11 @@
 			if ((firstChar == 'f') && (methodBinding.isStatic()) && (methodBinding.parameters.length == 1) && (methodBinding.parameters[0].id == T_JavaLangString) && (methodBinding.returnType.id == T_JavaLangClass) && (CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.ForName))) {

 				// This method binding is forName(java.lang.String)

 				return FORNAME_CLASS_METHOD;

-			} else

-				if ((firstChar == 'g') && (methodBinding.parameters.length == 1) && (methodBinding.returnType.id == T_JavaLangReflectConstructor) && CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.GetConstructor) && CharOperation.equals(methodBinding.parameters[0].constantPoolName(), QualifiedNamesConstants.ArrayJavaLangClassConstantPoolName)) {

+			} else if ((firstChar == 'g') && (methodBinding.parameters.length == 1) && (methodBinding.returnType.id == T_JavaLangReflectConstructor) && CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.GetConstructor) && CharOperation.equals(methodBinding.parameters[0].constantPoolName(), QualifiedNamesConstants.ArrayJavaLangClassConstantPoolName)) {

 					return GETCONSTRUCTOR_CLASS_METHOD;

-				}

+			} else if ((firstChar == 'd') && (methodBinding.parameters.length == 0) && (methodBinding.returnType.id == T_boolean) && CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.DesiredAssertionStatus)) {

+					return DESIREDASSERTIONSTATUS_CLASS_METHOD;

+			}

 			break;

 		case T_JavaLangNoClassDefError :

 			if ((firstChar == '<') && (methodBinding.parameters.length == 1) && (methodBinding.parameters[0].id == T_JavaLangString) && (CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.Init))) {

@@ -462,6 +533,32 @@
 			if ((firstChar == '<') && (methodBinding.parameters.length == 1) && (CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.Init)) && (methodBinding.parameters[0].id == T_String)) {

 				return JAVALANGERROR_CONSTR_METHOD;

 			}

+		case T_JavaLangAssertionError :

+			if ((firstChar == '<') && CharOperation.equals(methodBinding.selector, QualifiedNamesConstants.Init)) {

+				switch (methodBinding.parameters.length) {

+					case 0:

+						return ASSERTIONERROR_DEFAULT_CONSTR_METHOD;

+					case 1:

+						switch(methodBinding.parameters[0].id) {

+							case T_boolean :

+								return ASSERTIONERROR_CONSTR_BOOLEAN_METHOD;

+							case T_char :

+								return ASSERTIONERROR_CONSTR_CHAR_METHOD;

+							case T_double :

+								return ASSERTIONERROR_CONSTR_DOUBLE_METHOD;

+							case T_int :

+							case T_byte :

+							case T_short :

+								return ASSERTIONERROR_CONSTR_INT_METHOD;

+							case T_float :

+								return ASSERTIONERROR_CONSTR_FLOAT_METHOD;

+							case T_long :

+								return ASSERTIONERROR_CONSTR_LONG_METHOD;

+							default:

+								return ASSERTIONERROR_CONSTR_OBJECT_METHOD;

+						}

+				}

+			}

 	}

 	return -1;

 }

@@ -496,6 +593,7 @@
 		case T_JavaLangError : return JAVA_LANG_ERROR_TYPE;

 		case T_JavaLangException : return JAVA_LANG_EXCEPTION_TYPE;

 		case T_JavaLangReflectConstructor : return JAVA_LANG_REFLECT_CONSTRUCTOR_TYPE;

+		case T_JavaLangAssertionError : return JAVA_LANG_ASSERTIONERROR_TYPE;

 	}

 	return -1;

 }

@@ -1248,6 +1346,42 @@
 	return index;

 }

 /**

+ * This method returns the index into the constantPool corresponding to the 

+ * method descriptor. It can be either an interface method reference constant

+ * or a method reference constant.

+ *

+ * @return <CODE>int</CODE>

+ */

+public int literalIndexForJavaLangClassDesiredAssertionStatus() {

+	int index;

+	int nameAndTypeIndex;

+	int classIndex;

+	// Looking into the method ref table

+	if ((index = wellKnownMethods[DESIREDASSERTIONSTATUS_CLASS_METHOD]) == 0) {

+		classIndex = literalIndexForJavaLangClass();

+		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[DESIREDASSERTIONSTATUS_METHOD_NAME_AND_TYPE]) == 0) {

+			int nameIndex = literalIndex(QualifiedNamesConstants.DesiredAssertionStatus);

+			int typeIndex = literalIndex(QualifiedNamesConstants.DesiredAssertionStatusSignature);

+			nameAndTypeIndex = wellKnownMethodNameAndTypes[DESIREDASSERTIONSTATUS_METHOD_NAME_AND_TYPE] = currentIndex++;

+			writeU1(NameAndTypeTag);

+			writeU2(nameIndex);

+			writeU2(typeIndex);

+		}

+		index = wellKnownMethods[DESIREDASSERTIONSTATUS_CLASS_METHOD] = currentIndex++;

+		if (index > 0xFFFF){

+			this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+		}

+		// Write the method ref constant into the constant pool

+		// First add the tag

+		writeU1(MethodRefTag);

+		// Then write the class index

+		writeU2(classIndex);

+		// The write the nameAndType index

+		writeU2(nameAndTypeIndex);

+	}

+	return index;

+}

+/**

  * This method returns the index into the constantPool corresponding to the type descriptor.

  *

  * @param TypeBinding aTypeBinding

@@ -1358,10 +1492,10 @@
 	// Looking into the method ref table

 	if ((index = wellKnownMethods[JAVALANGERROR_CONSTR_METHOD]) == 0) {

 		classIndex = literalIndexForJavaLangError();

-		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE]) == 0) {

+		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE]) == 0) {

 			int nameIndex = literalIndex(QualifiedNamesConstants.Init);

 			int typeIndex = literalIndex(QualifiedNamesConstants.StringConstructorSignature);

-			nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE] = currentIndex++;

+			nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE] = currentIndex++;

 			writeU1(NameAndTypeTag);

 			writeU2(nameIndex);

 			writeU2(typeIndex);

@@ -1576,6 +1710,254 @@
 	}

 	return index;

 }

+

+/**

+ * This method returns the index into the constantPool corresponding to the type descriptor.

+ *

+ * @param TypeBinding aTypeBinding

+ * @return <CODE>int</CODE>

+ */

+public int literalIndexForJavaLangAssertionError() {

+	int index;

+	if ((index = wellKnownTypes[JAVA_LANG_ASSERTIONERROR_TYPE]) == 0) {

+		int nameIndex;

+		// The entry doesn't exit yet

+		nameIndex = literalIndex(QualifiedNamesConstants.JavaLangAssertionErrorConstantPoolName);

+		index = wellKnownTypes[JAVA_LANG_ASSERTIONERROR_TYPE] = currentIndex++;

+		if (index > 0xFFFF){

+			this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+		}

+		writeU1(ClassTag);

+		// Then add the 8 bytes representing the long

+		writeU2(nameIndex);

+	}

+	return index;

+}

+

+/**

+ * This method returns the index into the constantPool corresponding to the type descriptor.

+ *

+ * @param TypeBinding aTypeBinding

+ * @return <CODE>int</CODE>

+ */

+public int literalIndexForJavaLangAssertionErrorConstructor(int typeBindingID) {

+	int index = 0;

+	int nameAndTypeIndex = 0;

+	int classIndex = 0;

+	switch (typeBindingID) {

+		case T_int :

+		case T_byte :

+		case T_short :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_INT_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_INT_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorIntConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_INT_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_INT_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_long :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_LONG_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_LONG_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorLongConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_LONG_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_LONG_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_float :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_FLOAT_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_FLOAT_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorFloatConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_FLOAT_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_FLOAT_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_double :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_DOUBLE_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_DOUBLE_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorDoubleConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_DOUBLE_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_DOUBLE_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_char :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_CHAR_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_CHAR_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorCharConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_CHAR_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_CHAR_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_boolean :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_BOOLEAN_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_BOOLEAN_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorBooleanConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_BOOLEAN_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_BOOLEAN_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+			break;

+		case T_Object :

+		case T_String :

+		case T_null :

+			if ((index = wellKnownMethods[ASSERTIONERROR_CONSTR_OBJECT_METHOD]) == 0) {

+				classIndex = literalIndexForJavaLangAssertionError();

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_OBJECT_METHOD_NAME_AND_TYPE]) == 0) {

+					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+					int typeIndex = literalIndex(QualifiedNamesConstants.AssertionErrorObjectConstrSignature);

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_OBJECT_METHOD_NAME_AND_TYPE] = currentIndex++;

+					writeU1(NameAndTypeTag);

+					writeU2(nameIndex);

+					writeU2(typeIndex);

+				}

+				index = wellKnownMethods[ASSERTIONERROR_CONSTR_OBJECT_METHOD] = currentIndex++;

+				if (index > 0xFFFF){

+					this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+				}

+				// Write the method ref constant into the constant pool

+				// First add the tag

+				writeU1(MethodRefTag);

+				// Then write the class index

+				writeU2(classIndex);

+				// The write the nameAndType index

+				writeU2(nameAndTypeIndex);

+			}

+	}

+	return index;

+}

+

+/**

+ * This method returns the index into the constantPool corresponding to the 

+ * method descriptor. It can be either an interface method reference constant

+ * or a method reference constant.

+ *

+ * @return <CODE>int</CODE>

+ */

+public int literalIndexForJavaLangAssertionErrorDefaultConstructor() {

+	int index;

+	int nameAndTypeIndex;

+	int classIndex;

+	// Looking into the method ref table

+	if ((index = wellKnownMethods[ASSERTIONERROR_DEFAULT_CONSTR_METHOD]) == 0) {

+		classIndex = literalIndexForJavaLangAssertionError();

+		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[DEFAULT_CONSTR_METHOD_NAME_AND_TYPE]) == 0) {

+			int nameIndex = literalIndex(QualifiedNamesConstants.Init);

+			int typeIndex = literalIndex(QualifiedNamesConstants.DefaultConstructorSignature);

+			nameAndTypeIndex = wellKnownMethodNameAndTypes[DEFAULT_CONSTR_METHOD_NAME_AND_TYPE] = currentIndex++;

+			writeU1(NameAndTypeTag);

+			writeU2(nameIndex);

+			writeU2(typeIndex);

+		}

+		index = wellKnownMethods[ASSERTIONERROR_DEFAULT_CONSTR_METHOD] = currentIndex++;

+		if (index > 0xFFFF){

+			this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());

+		}

+		// Write the method ref constant into the constant pool

+		// First add the tag

+		writeU1(MethodRefTag);

+		// Then write the class index

+		writeU2(classIndex);

+		// The write the nameAndType index

+		writeU2(nameAndTypeIndex);

+	}

+	return index;

+}

+

+

 /**

  * This method returns the index into the constantPool corresponding to the 

  * method descriptor. It can be either an interface method reference constant

@@ -1590,10 +1972,10 @@
 	// Looking into the method ref table

 	if ((index = wellKnownMethods[NOCLASSDEFFOUNDERROR_CONSTR_METHOD]) == 0) {

 		classIndex = literalIndexForJavaLangNoClassDefFoundError();

-		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE]) == 0) {

+		if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE]) == 0) {

 			int nameIndex = literalIndex(QualifiedNamesConstants.Init);

 			int typeIndex = literalIndex(QualifiedNamesConstants.StringConstructorSignature);

-			nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE] = currentIndex++;

+			nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE] = currentIndex++;

 			writeU1(NameAndTypeTag);

 			writeU2(nameIndex);

 			writeU2(typeIndex);

@@ -2006,10 +2388,10 @@
 	// Looking into the method ref table

 	if ((index = wellKnownMethods[STRINGBUFFER_STRING_CONSTR_METHOD]) == 0) {

 		classIndex = literalIndexForJavaLangStringBuffer();

-				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE]) == 0) {

+				if ((nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE]) == 0) {

 					int nameIndex = literalIndex(QualifiedNamesConstants.Init);

 					int typeIndex = literalIndex(QualifiedNamesConstants.StringConstructorSignature);

-					nameAndTypeIndex = wellKnownMethodNameAndTypes[STRING_CONSTR_METHOD_NAME_AND_TYPE] = currentIndex++;

+					nameAndTypeIndex = wellKnownMethodNameAndTypes[CONSTR_STRING_METHOD_NAME_AND_TYPE] = currentIndex++;

 					writeU1(NameAndTypeTag);

 					writeU2(nameIndex);

 					writeU2(typeIndex);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java
index 7711e17..bb798cd 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java
@@ -120,16 +120,16 @@
 public String toString() {

 	int max = elementSize;

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if ((keyTable[i] != 0) || ((keyTable[i] == 0) &&(valueTable[i] != 0))) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/FieldNameAndTypeCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/FieldNameAndTypeCache.java
index 4ea1f89..10d146e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/FieldNameAndTypeCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/FieldNameAndTypeCache.java
@@ -143,16 +143,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if (keyTable[i] != null) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java
index 3480a6c..e819264 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java
@@ -120,16 +120,16 @@
 public String toString() {

 	int max = elementSize;

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if ((keyTable[i] != 0) || ((keyTable[i] == 0) && (valueTable[i] != 0))) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.java
index d49b8b3..e74f996 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.java
@@ -138,16 +138,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if ((keyTable[i] != 0) || ((keyTable[i] == 0) && (valueTable[i] != 0))) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/Label.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/Label.java
index a621896..1fd1b8c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/Label.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/Label.java
@@ -151,6 +151,11 @@
 						LocalVariableBinding local = locals[i];

 						if ((local != null) && (local.initializationCount > 0)) {

 							if (local.initializationPCs[((local.initializationCount - 1) << 1) + 1] == oldPosition) {

+								// we want to prevent interval of size 0 to have a negative size.

+								// see PR 1GIRQLA: ITPJCORE:ALL - ClassFormatError for local variable attribute

+								if (local.initializationPCs[((local.initializationCount - 1) << 1)] == oldPosition) {

+									local.initializationPCs[((local.initializationCount - 1) << 1)] = position;

+								}

 								local.initializationPCs[((local.initializationCount - 1) << 1) + 1] = position;

 							}

 						}

@@ -190,14 +195,14 @@
  * Print out the receiver

  */

 public String toString() {

-	StringBuffer buffer = new StringBuffer("(position="/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("(position="); //$NON-NLS-1$

 	buffer.append(position);

-	buffer.append(", forwards = ["/*nonNLS*/);

+	buffer.append(", forwards = ["); //$NON-NLS-1$

 	for (int i = 0; i < forwardReferenceCount - 1; i++)

-		buffer.append(forwardReferences[i] + ", "/*nonNLS*/);

+		buffer.append(forwardReferences[i] + ", "); //$NON-NLS-1$

 	if (forwardReferenceCount >= 1)

 		buffer.append(forwardReferences[forwardReferenceCount-1]);

-	buffer.append("] )"/*nonNLS*/);

+	buffer.append("] )"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/LongCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/LongCache.java
index a59397f..e4f519e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/LongCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/LongCache.java
@@ -138,16 +138,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if ((keyTable[i] != 0) || ((keyTable[i] == 0) && (valueTable[i] != 0))) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/MethodNameAndTypeCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/MethodNameAndTypeCache.java
index 2d50853..9a8ca43 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/MethodNameAndTypeCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/MethodNameAndTypeCache.java
@@ -144,16 +144,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if (keyTable[i] != null) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.java
index 63cb51f..64363a6 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.java
@@ -135,16 +135,16 @@
 public String toString() {

 	int max = size();

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	for (int i = 0; i < max; ++i) {

 		if (keyTable[i] != null) {

-			buf.append(keyTable[i]).append("->"/*nonNLS*/).append(valueTable[i]);

+			buf.append(keyTable[i]).append("->").append(valueTable[i]); //$NON-NLS-1$

 		}

 		if (i < max) {

-			buf.append(", "/*nonNLS*/);

+			buf.append(", "); //$NON-NLS-1$

 		}

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java b/compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java
index edefbdd..6d46de4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java
@@ -6,26 +6,26 @@
 import org.eclipse.jdt.internal.compiler.problem.*;

 

 public interface QualifiedNamesConstants {

-	char[] JavaLangObjectConstantPoolName = "java/lang/Object"/*nonNLS*/.toCharArray();

-	char[] JavaLangStringConstantPoolName = "java/lang/String"/*nonNLS*/.toCharArray();

-	char[] JavaLangStringBufferConstantPoolName = "java/lang/StringBuffer"/*nonNLS*/.toCharArray();

-	char[] JavaLangClassConstantPoolName = "java/lang/Class"/*nonNLS*/.toCharArray();

-	char[] JavaLangThrowableConstantPoolName = "java/lang/Throwable"/*nonNLS*/.toCharArray();

-	char[] JavaLangClassNotFoundExceptionConstantPoolName = "java/lang/ClassNotFoundException"/*nonNLS*/.toCharArray();

-	char[] JavaLangNoClassDefFoundErrorConstantPoolName = "java/lang/NoClassDefFoundError"/*nonNLS*/.toCharArray();

-	char[] JavaLangIntegerConstantPoolName = "java/lang/Integer"/*nonNLS*/.toCharArray();

-	char[] JavaLangFloatConstantPoolName = "java/lang/Float"/*nonNLS*/.toCharArray();

-	char[] JavaLangDoubleConstantPoolName = "java/lang/Double"/*nonNLS*/.toCharArray();

-	char[] JavaLangLongConstantPoolName = "java/lang/Long"/*nonNLS*/.toCharArray();

-	char[] JavaLangShortConstantPoolName = "java/lang/Short"/*nonNLS*/.toCharArray();

-	char[] JavaLangByteConstantPoolName = "java/lang/Byte"/*nonNLS*/.toCharArray();

-	char[] JavaLangCharacterConstantPoolName = "java/lang/Character"/*nonNLS*/.toCharArray();

-	char[] JavaLangVoidConstantPoolName = "java/lang/Void"/*nonNLS*/.toCharArray();

-	char[] JavaLangBooleanConstantPoolName = "java/lang/Boolean"/*nonNLS*/.toCharArray();

-	char[] JavaLangSystemConstantPoolName = "java/lang/System"/*nonNLS*/.toCharArray();

-	char[] JavaLangErrorConstantPoolName = "java/lang/Error"/*nonNLS*/.toCharArray();

-	char[] JavaLangExceptionConstantPoolName = "java/lang/Exception"/*nonNLS*/.toCharArray();

-	char[] JavaLangReflectConstructor = "java/lang/reflect/Constructor"/*nonNLS*/.toCharArray();  

+	char[] JavaLangObjectConstantPoolName = "java/lang/Object".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangStringConstantPoolName = "java/lang/String".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangStringBufferConstantPoolName = "java/lang/StringBuffer".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangClassConstantPoolName = "java/lang/Class".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangThrowableConstantPoolName = "java/lang/Throwable".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangClassNotFoundExceptionConstantPoolName = "java/lang/ClassNotFoundException".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangNoClassDefFoundErrorConstantPoolName = "java/lang/NoClassDefFoundError".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangIntegerConstantPoolName = "java/lang/Integer".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangFloatConstantPoolName = "java/lang/Float".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangDoubleConstantPoolName = "java/lang/Double".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangLongConstantPoolName = "java/lang/Long".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangShortConstantPoolName = "java/lang/Short".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangByteConstantPoolName = "java/lang/Byte".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangCharacterConstantPoolName = "java/lang/Character".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangVoidConstantPoolName = "java/lang/Void".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangBooleanConstantPoolName = "java/lang/Boolean".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangSystemConstantPoolName = "java/lang/System".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangErrorConstantPoolName = "java/lang/Error".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangExceptionConstantPoolName = "java/lang/Exception".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangReflectConstructor = "java/lang/reflect/Constructor".toCharArray();   //$NON-NLS-1$

 	char[] Append = new char[] {'a', 'p', 'p', 'e', 'n', 'd'};

 	char[] ToString = new char[] {'t', 'o', 'S', 't', 'r', 'i', 'n', 'g'};

 	char[] Init = new char[] {'<', 'i', 'n', 'i', 't', '>'};

@@ -33,41 +33,52 @@
 	char[] ValueOf = new char[] {'v', 'a', 'l', 'u', 'e', 'O', 'f'};

 	char[] ForName = new char[] {'f', 'o', 'r', 'N', 'a', 'm', 'e'};

 	char[] GetMessage = new char[] {'g', 'e', 't', 'M', 'e', 's', 's', 'a', 'g', 'e'};

-	char[] NewInstance = "newInstance"/*nonNLS*/.toCharArray();

-	char[] GetConstructor = "getConstructor"/*nonNLS*/.toCharArray();

+	char[] NewInstance = "newInstance".toCharArray(); //$NON-NLS-1$

+	char[] GetConstructor = "getConstructor".toCharArray(); //$NON-NLS-1$

 	char[] Exit = new char[] {'e', 'x', 'i', 't'};

-	char[] Intern = "intern"/*nonNLS*/.toCharArray();

+	char[] Intern = "intern".toCharArray(); //$NON-NLS-1$

 	char[] Out = new char[] {'o', 'u', 't'};

 	char[] TYPE = new char[] {'T', 'Y', 'P', 'E'};

 	char[] This = new char[] {'t', 'h', 'i', 's'};

 	char[] JavaLangClassSignature = new char[] {'L', 'j', 'a', 'v', 'a', '/', 'l', 'a', 'n', 'g', '/', 'C', 'l', 'a', 's', 's', ';'};

-	char[] ForNameSignature = "(Ljava/lang/String;)Ljava/lang/Class;"/*nonNLS*/.toCharArray();

-	char[] GetMessageSignature = "()Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] GetConstructorSignature = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;"/*nonNLS*/.toCharArray();

-	char[] StringConstructorSignature = "(Ljava/lang/String;)V"/*nonNLS*/.toCharArray();

-	char[] NewInstanceSignature = "([Ljava/lang/Object;)Ljava/lang/Object;"/*nonNLS*/.toCharArray();

+	char[] ForNameSignature = "(Ljava/lang/String;)Ljava/lang/Class;".toCharArray(); //$NON-NLS-1$

+	char[] GetMessageSignature = "()Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] GetConstructorSignature = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;".toCharArray(); //$NON-NLS-1$

+	char[] StringConstructorSignature = "(Ljava/lang/String;)V".toCharArray(); //$NON-NLS-1$

+	char[] NewInstanceSignature = "([Ljava/lang/Object;)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$

 	char[] DefaultConstructorSignature = {'(', ')', 'V'};

 	char[] ClinitSignature = DefaultConstructorSignature;

 	char[] ToStringSignature = GetMessageSignature;

 	char[] InternSignature = GetMessageSignature;

-	char[] AppendIntSignature = "(I)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendLongSignature = "(J)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendFloatSignature = "(F)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendDoubleSignature = "(D)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendCharSignature = "(C)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendBooleanSignature = "(Z)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendObjectSignature = "(Ljava/lang/Object;)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] AppendStringSignature = "(Ljava/lang/String;)Ljava/lang/StringBuffer;"/*nonNLS*/.toCharArray();

-	char[] ValueOfObjectSignature = "(Ljava/lang/Object;)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfIntSignature = "(I)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfLongSignature = "(J)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfCharSignature = "(C)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfBooleanSignature = "(Z)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfDoubleSignature = "(D)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] ValueOfFloatSignature = "(F)Ljava/lang/String;"/*nonNLS*/.toCharArray();

-	char[] JavaIoPrintStreamSignature = "Ljava/io/PrintStream;"/*nonNLS*/.toCharArray();

+	char[] AppendIntSignature = "(I)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendLongSignature = "(J)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendFloatSignature = "(F)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendDoubleSignature = "(D)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendCharSignature = "(C)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendBooleanSignature = "(Z)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendObjectSignature = "(Ljava/lang/Object;)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] AppendStringSignature = "(Ljava/lang/String;)Ljava/lang/StringBuffer;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfObjectSignature = "(Ljava/lang/Object;)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfIntSignature = "(I)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfLongSignature = "(J)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfCharSignature = "(C)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfBooleanSignature = "(Z)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfDoubleSignature = "(D)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] ValueOfFloatSignature = "(F)Ljava/lang/String;".toCharArray(); //$NON-NLS-1$

+	char[] JavaIoPrintStreamSignature = "Ljava/io/PrintStream;".toCharArray(); //$NON-NLS-1$

 	char[] ExitIntSignature = new char[] {'(', 'I', ')', 'V'};

-	char[] ArrayJavaLangObjectConstantPoolName = "[Ljava/lang/Object;"/*nonNLS*/.toCharArray();

-	char[] ArrayJavaLangClassConstantPoolName = "[Ljava/lang/Class;"/*nonNLS*/.toCharArray();

-

+	char[] ArrayJavaLangObjectConstantPoolName = "[Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$

+	char[] ArrayJavaLangClassConstantPoolName = "[Ljava/lang/Class;".toCharArray(); //$NON-NLS-1$

+	char[] JavaLangAssertionErrorConstantPoolName = "java/lang/AssertionError".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorIntConstrSignature = "(I)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorLongConstrSignature = "(J)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorFloatConstrSignature = "(F)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorDoubleConstrSignature = "(D)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorCharConstrSignature = "(C)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorBooleanConstrSignature = "(Z)V".toCharArray(); //$NON-NLS-1$

+	char[] AssertionErrorObjectConstrSignature = "(Ljava/lang/Object;)V".toCharArray(); //$NON-NLS-1$

+	char[] DesiredAssertionStatus = "desiredAssertionStatus".toCharArray(); //$NON-NLS-1$

+	char[] DesiredAssertionStatusSignature = "()Z".toCharArray(); //$NON-NLS-1$

+	char[] ShortConstrSignature = "(S)V".toCharArray(); //$NON-NLS-1$

+	char[] ByteConstrSignature = "(B)V".toCharArray(); //$NON-NLS-1$

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java b/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
index 1b201af..6b0bee4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
@@ -68,4 +68,11 @@
 

 char[] getSuperclassName();

 

+/**

+ * Answer the source file attribute, or null if none.

+ *

+ * For example, "String.java"

+ */

+

+char[] sourceFileName();

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java b/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
index ecfee24..cffdb47 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.java
@@ -6,62 +6,69 @@
 import org.eclipse.jdt.internal.compiler.*;

 

 public class NameEnvironmentAnswer {

+	

 	// only one of the three can be set

 	IBinaryType binaryType;

 	ICompilationUnit compilationUnit;

-	ISourceType sourceType;

-public NameEnvironmentAnswer(IBinaryType binaryType) {

-	this.binaryType = binaryType;

-}

-public NameEnvironmentAnswer(ICompilationUnit compilationUnit) {

-	this.compilationUnit = compilationUnit;

-}

-public NameEnvironmentAnswer(ISourceType sourceType) {

-	this.sourceType = sourceType;

-}

-/**

- * Answer the resolved binary form for the type or null if the

- * receiver represents a compilation unit or source type.

- */

+	ISourceType[] sourceTypes;

+	

+	public NameEnvironmentAnswer(IBinaryType binaryType) {

+		this.binaryType = binaryType;

+	}

 

-public IBinaryType getBinaryType() {

-	return binaryType;

-}

-/**

- * Answer the compilation unit or null if the

- * receiver represents a binary or source type.

- */

+	public NameEnvironmentAnswer(ICompilationUnit compilationUnit) {

+		this.compilationUnit = compilationUnit;

+	}

 

-public ICompilationUnit getCompilationUnit() {

-	return compilationUnit;

-}

-/**

- * Answer the unresolved source form for the type or null if the

- * receiver represents a compilation unit or binary type.

- */

+	public NameEnvironmentAnswer(ISourceType[] sourceTypes) {

+		this.sourceTypes = sourceTypes;

+	}

 

-public ISourceType getSourceType() {

-	return sourceType;

-}

-/**

- * Answer whether the receiver contains the resolved binary form of the type.

- */

+	/**

+	 * Answer the resolved binary form for the type or null if the

+	 * receiver represents a compilation unit or source type.

+	 */

+	public IBinaryType getBinaryType() {

+		return binaryType;

+	}

 

-public boolean isBinaryType() {

-	return binaryType != null;

-}

-/**

- * Answer whether the receiver contains the compilation unit which defines the type.

- */

+	/**

+	 * Answer the compilation unit or null if the

+	 * receiver represents a binary or source type.

+	 */

+	public ICompilationUnit getCompilationUnit() {

+		return compilationUnit;

+	}

 

-public boolean isCompilationUnit() {

-	return compilationUnit != null;

-}

-/**

- * Answer whether the receiver contains the unresolved source form of the type.

- */

+	/**

+	 * Answer the unresolved source forms for the type or null if the

+	 * receiver represents a compilation unit or binary type.

+	 * 

+	 * Multiple source forms can be answered in case the originating compilation unit did contain

+	 * several type at once. Then the first type is guaranteed to be the requested type.

+	 */

+	public ISourceType[] getSourceTypes() {

+		return sourceTypes;

+	}

 

-public  boolean isSourceType() {

-	return sourceType != null;

-}

-}

+	/**

+	 * Answer whether the receiver contains the resolved binary form of the type.

+	 */

+	public boolean isBinaryType() {

+		return binaryType != null;

+	}

+

+	/**

+	 * Answer whether the receiver contains the compilation unit which defines the type.

+	 */

+	public boolean isCompilationUnit() {

+		return compilationUnit != null;

+	}

+

+	/**

+	 * Answer whether the receiver contains the unresolved source form of the type.

+	 */

+	public boolean isSourceType() {

+		return sourceTypes != null;

+	}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java b/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
index 307d43a..a799dc7 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java
@@ -114,7 +114,7 @@
 	return unconditionalInits().mergedWith(otherInits);

 }

 public String toString() {

-	return "FlowInfo<true: "/*nonNLS*/ + initsWhenTrue.toString() + ", false: "/*nonNLS*/ + initsWhenFalse.toString() + ">"/*nonNLS*/;

+	return "FlowInfo<true: " + initsWhenTrue.toString() + ", false: " + initsWhenFalse.toString() + ">"; //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$

 }

 public UnconditionalFlowInfo unconditionalInits() {

 	return initsWhenTrue.unconditionalInits().copy()

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java b/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
index 426698c..5445b6e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
@@ -91,7 +91,7 @@
 	tryStatement.preserveExceptionHandler = isNeeded;

 }

 public String individualToString() {

-	StringBuffer buffer = new StringBuffer("Exception flow context"/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("Exception flow context"); //$NON-NLS-1$

 	int length = handledExceptions.length;

 	for (int i = 0; i < length; i++) {

 		int cacheIndex = i / BitCacheSize;

@@ -99,12 +99,12 @@
 		buffer.append('[').append(handledExceptions[i].readableName());

 		if ((isReached[cacheIndex] & bitMask) != 0) {

 			if ((isNeeded[cacheIndex] & bitMask) == 0) {

-				buffer.append("-masked"/*nonNLS*/);

+				buffer.append("-masked"); //$NON-NLS-1$

 			} else {

-				buffer.append("-reached"/*nonNLS*/);

+				buffer.append("-reached"); //$NON-NLS-1$

 			}

 		} else {

-			buffer.append("-not reached"/*nonNLS*/);

+			buffer.append("-not reached"); //$NON-NLS-1$

 		}

 		buffer.append('-').append(initsOnExceptions[i].toString()).append(']');

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java b/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
index 329ccbf..632bc3e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
@@ -326,7 +326,7 @@
 	return null;

 }

 public String individualToString(){

-	return "Flow context"/*nonNLS*/;

+	return "Flow context"; //$NON-NLS-1$

 }

 public FlowInfo initsOnBreak() {

 	return FlowInfo.DeadEnd;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java b/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
index 74ef42c..15dd6fe 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
@@ -71,7 +71,7 @@
 abstract public UnconditionalFlowInfo mergedWith(UnconditionalFlowInfo otherInits);

 public String toString(){

 	if (this == DeadEnd){

-		return "FlowInfo.DeadEnd"/*nonNLS*/;

+		return "FlowInfo.DeadEnd"; //$NON-NLS-1$

 	}

 	return super.toString();

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.java b/compiler/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.java
index 0a65428..7a20c56 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.java
@@ -38,7 +38,7 @@
 	}

 }

 public String individualToString(){

-	return "Label flow context [label:"/*nonNLS*/+String.valueOf(labelName)+"]"/*nonNLS*/;

+	return "Label flow context [label:"+String.valueOf(labelName)+"]"; //$NON-NLS-2$ //$NON-NLS-1$

 }

 public char[] labelName() {

 	return labelName;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java b/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
index 93acbaf..77032ef 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
@@ -56,7 +56,7 @@
 	return continueLabel;

 }

 public String individualToString(){

-	return "Looping flow context"/*nonNLS*/;

+	return "Looping flow context"; //$NON-NLS-1$

 }

 public boolean isContinuable() {

 	return true;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.java b/compiler/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.java
index 33a77b5..9d44fbd 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.java
@@ -28,7 +28,7 @@
 	return breakLabel;

 }

 public String individualToString(){

-	return "Switch flow context"/*nonNLS*/;

+	return "Switch flow context"; //$NON-NLS-1$

 }

 public boolean isBreakable() {

 	return true;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java b/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
index 77b1654..67cb8da 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
@@ -420,9 +420,9 @@
 }

 public String toString(){

 	if (this == DeadEnd){

-		return "FlowInfo.DeadEnd"/*nonNLS*/;

+		return "FlowInfo.DeadEnd"; //$NON-NLS-1$

 	}

-	return "FlowInfo<def: "/*nonNLS*/+ definiteInits +", pot: "/*nonNLS*/ + potentialInits + ">"/*nonNLS*/;

+	return "FlowInfo<def: "+ definiteInits +", pot: " + potentialInits + ">"; //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$

 }

 public UnconditionalFlowInfo unconditionalInits() {

 	// also see conditional inits, where it requests them to merge

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.java
index 7f9a421..55832c1 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.java
@@ -23,13 +23,13 @@
 	

 	String s = new Boolean(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(boolean)"/*nonNLS*/ + value ; }

+	return "(boolean)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_boolean;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/ByteConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/ByteConstant.java
index 5d88da8..114af4d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/ByteConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/ByteConstant.java
@@ -36,13 +36,13 @@
 	

 	String s = new Integer(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(byte)"/*nonNLS*/ + value ; }

+	return "(byte)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_byte;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/CharConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/CharConstant.java
index 5b40213..f1015a5 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/CharConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/CharConstant.java
@@ -39,13 +39,13 @@
 	

 	String s = new Character(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(char)"/*nonNLS*/ + value ; }

+	return "(char)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_char;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 3360076..15e735a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -11,6 +11,27 @@
 import org.eclipse.jdt.internal.compiler.lookup.*;

 

 public class CompilerOptions implements ConfigurableProblems, ProblemIrritants, ProblemReasons, ProblemSeverities {

+	

+	/**

+	 * Option IDs

+	 */

+	public static final String OPTION_LocalVariableAttribute = Compiler.class.getName() + ".localVariableAttribute"; //$NON-NLS-1$

+	public static final String OPTION_LineNumberAttribute = Compiler.class.getName() + ".lineNumberAttribute"; //$NON-NLS-1$

+	public static final String OPTION_SourceFileAttribute = Compiler.class.getName() + ".sourceFileAttribute"; //$NON-NLS-1$

+	public static final String OPTION_PreserveUnusedLocal = Compiler.class.getName() + ".preserveUnusedLocal"; //$NON-NLS-1$

+	public static final String OPTION_ReportUnreachableCode = Compiler.class.getName() + ".reportUnreachableCode"; //$NON-NLS-1$

+	public static final String OPTION_ReportInvalidImport = Compiler.class.getName() + ".reportInvalidImport"; //$NON-NLS-1$

+	public static final String OPTION_ReportMethodWithConstructorName = Compiler.class.getName() + ".reportMethodWithConstructorName"; //$NON-NLS-1$

+	public static final String OPTION_ReportOverridingPackageDefaultMethod = Compiler.class.getName() + ".reportOverridingPackageDefaultMethod"; //$NON-NLS-1$

+	public static final String OPTION_ReportDeprecation = Compiler.class.getName() + ".reportDeprecation"; //$NON-NLS-1$

+	public static final String OPTION_ReportHiddenCatchBlock = Compiler.class.getName() + ".reportHiddenCatchBlock"; //$NON-NLS-1$

+	public static final String OPTION_ReportUnusedLocal = Compiler.class.getName() + ".reportUnusedLocal"; //$NON-NLS-1$

+	public static final String OPTION_ReportUnusedParameter = Compiler.class.getName() + ".reportUnusedParameter"; //$NON-NLS-1$

+	public static final String OPTION_ReportSyntheticAccessEmulation = Compiler.class.getName() + ".reportSyntheticAccessEmulation"; //$NON-NLS-1$

+	public static final String OPTION_ReportNonExternalizedStringLiteral = Compiler.class.getName() + ".reportNonExternalizedStringLiteral"; //$NON-NLS-1$

+	public static final String OPTION_Source = Compiler.class.getName() + ".source"; //$NON-NLS-1$

+	public static final String OPTION_TargetPlatform = Compiler.class.getName() + ".targetPlatform"; //$NON-NLS-1$

+	public static final String OPTION_ReportAssertIdentifier = Compiler.class.getName() + ".reportAssertIdentifier"; //$NON-NLS-1$

 

 	// class file output

 	// these are the bits used to buld a mask to know which debug 

@@ -24,11 +45,10 @@
 

 	// default severity level for handlers

 	public int errorThreshold = UnreachableCode | ImportProblem;

-	public int warningThreshold =

-		ParsingOptionalError | 

+	public int warningThreshold = 

 		MethodWithConstructorName | OverriddenPackageDefaultMethod |

 		UsingDeprecatedAPI | MaskedCatchBlock |

-		UnusedLocalVariable | UnusedArgument |

+		UnusedLocalVariable | AssertUsedAsAnIdentifier |

 		TemporaryWarning;

 

 	// target JDK 1.1 or 1.2

@@ -36,6 +56,9 @@
 	public static final int JDK1_2 = 1;

 	public int targetJDK = JDK1_1; // default generates for JVM1.1

 

+	// 1.4 feature

+	public boolean assertMode = false; //1.3 behavior by default

+	

 	// print what unit is being processed

 	public boolean verbose = false;

 	// indicates if reference info is desired

@@ -46,7 +69,7 @@
 	public boolean parseLiteralExpressionsAsConstants = true;

 

 	// exception raised for unresolved compile errors

-	public String runtimeExceptionNameForCompileError = "java.lang.Error"/*nonNLS*/;

+	public String runtimeExceptionNameForCompileError = "java.lang.Error"; //$NON-NLS-1$

 

 	// toggle private access emulation for 1.2 (constr. accessor has extra arg on constructor) or 1.3 (make private constructor default access when access needed)

 	public boolean isPrivateConstructorAccessChangingVisibility = false; // by default, follows 1.2

@@ -60,6 +83,7 @@
  */

 public CompilerOptions(ConfigurableOption[] settings){

 	if (settings == null) return;

+	

 	// filter options which are related to the compiler component

 	String componentName = Compiler.class.getName();

 	for (int i = 0, max = settings.length; i < max; i++){

@@ -68,194 +92,191 @@
 		}

 	}

 }

-/**

- * Returns all the options of the compiler to be shown by the UI

- *

- * @param locale java.util.Locale

- * @return org.eclipse.jdt.internal.compiler.ConfigurableOption[]

- */

-public ConfigurableOption[] getConfigurableOptions(Locale locale) {

-	String componentName = Compiler.class.getName();

-	return new ConfigurableOption[] {

-		new ConfigurableOption(

-			componentName,

-			"debug.vars"/*nonNLS*/, 

-			locale, 

-			(produceDebugAttributes & Vars) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"debug.lines"/*nonNLS*/, 

-			locale, 

-			(produceDebugAttributes & Lines) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"debug.source"/*nonNLS*/, 

-			locale, 

-			(produceDebugAttributes & Source) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"debug.preserveAllLocals"/*nonNLS*/, 

-			locale, 

-			preserveAllLocalVariables ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalError.unReachableCode"/*nonNLS*/, 

-			locale, 

-			(errorThreshold & UnreachableCode) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalError.importProblem"/*nonNLS*/, 

-			locale, 

-			(errorThreshold & ImportProblem) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.methodWithConstructorName"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & MethodWithConstructorName) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.overridingPackageDefaultMethod"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & OverriddenPackageDefaultMethod) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.deprecated"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & UsingDeprecatedAPI) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.maskedCatchBlock"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & MaskedCatchBlock) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.unusedLocalVariable"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & UnusedLocalVariable) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.unusedArgument"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & UnusedArgument) != 0 ? 0 : 1), 

-		new ConfigurableOption(

-			componentName,

-			"binaryCompatibility.targetJDK"/*nonNLS*/, 

-			locale, 

-			targetJDK), 

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.accessEmulation"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & AccessEmulation) != 0 ? 0 : 1),

-		new ConfigurableOption(

-			componentName,

-			"optionalWarning.nonExternalizedString"/*nonNLS*/, 

-			locale, 

-			(warningThreshold & NonExternalizedString) != 0 ? 0 : 1)

-		}; 

-}

+

 public int getDebugAttributesMask() {

 	return this.produceDebugAttributes;

 }

 public int getTargetJDK() {

 	return this.targetJDK;

 }

-public void handleAccessEmulationAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= AccessEmulation;

-	} else {

-		warningThreshold &= ~AccessEmulation;

+public boolean getAssertMode() {

+	return this.assertMode;

+}

+public void setAccessEmulationSeverity(int flag) {

+	errorThreshold &= ~AccessEmulation;

+	warningThreshold &= ~AccessEmulation;

+	switch(flag){

+		case Error : 

+			errorThreshold |= AccessEmulation;

+			break;

+		case Warning : 

+			warningThreshold |= AccessEmulation;

+			break;

 	}

 }

-public void handleDeprecationUseAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= UsingDeprecatedAPI;

-	} else {

-		warningThreshold &= ~UsingDeprecatedAPI;

+public void setDeprecationUseSeverity(int flag) {

+	errorThreshold &= ~UsingDeprecatedAPI;

+	warningThreshold &= ~UsingDeprecatedAPI;

+	switch(flag){

+		case Error : 

+			errorThreshold |= UsingDeprecatedAPI;

+			break;

+		case Warning : 

+			warningThreshold |= UsingDeprecatedAPI;

+			break;

 	}

 }

-public void handleImportProblemAsError(boolean flag) {

-	if (flag) {

-		errorThreshold |= ImportProblem;

-		warningThreshold &= ~ImportProblem;

-	} else {

-		errorThreshold &= ~ImportProblem;

-		warningThreshold |= ImportProblem;

+public void setImportProblemSeverity(int flag) {

+	errorThreshold &= ~ImportProblem;

+	warningThreshold &= ~ImportProblem;

+	switch(flag){

+		case Error : 

+			errorThreshold |= ImportProblem;

+			break;

+		case Warning : 

+			warningThreshold |= ImportProblem;

+			break;

 	}

 }

-public void handleMaskedCatchBlockAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= MaskedCatchBlock;

-	} else {

-		warningThreshold &= ~MaskedCatchBlock;

+public void setMaskedCatchBlockSeverity(int flag) {

+	errorThreshold &= ~MaskedCatchBlock;

+	warningThreshold &= ~MaskedCatchBlock;

+	switch(flag){

+		case Error : 

+			errorThreshold |= MaskedCatchBlock;

+			break;

+		case Warning : 

+			warningThreshold |= MaskedCatchBlock;

+			break;

 	}

 }

-public void handleMethodWithConstructorNameAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= MethodWithConstructorName;

-	} else {

-		warningThreshold &= ~MethodWithConstructorName;

+public void setMethodWithConstructorNameSeverity(int flag) {

+	errorThreshold &= ~MethodWithConstructorName;

+	warningThreshold &= ~MethodWithConstructorName;

+	switch(flag){

+		case Error : 

+			errorThreshold |= MethodWithConstructorName;

+			break;

+		case Warning : 

+			warningThreshold |= MethodWithConstructorName;

+			break;

 	}

 }

-public void handleObsoleteLiteralAsError(boolean flag) {

-	if (flag) {

-		errorThreshold |= ParsingOptionalError;

-		warningThreshold &= ~ParsingOptionalError;

-	} else {

-		errorThreshold &= ~ParsingOptionalError;

-		warningThreshold |= ParsingOptionalError;

+

+public void setOverriddenPackageDefaultMethodSeverity(int flag) {

+	errorThreshold &= ~OverriddenPackageDefaultMethod;

+	warningThreshold &= ~OverriddenPackageDefaultMethod;

+	switch(flag){

+		case Error : 

+			errorThreshold |= OverriddenPackageDefaultMethod;

+			break;

+		case Warning : 

+			warningThreshold |= OverriddenPackageDefaultMethod;

+			break;

 	}

 }

-public void handleOverriddenPackageDefaultMethodAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= OverriddenPackageDefaultMethod;

-	} else {

-		warningThreshold &= ~OverriddenPackageDefaultMethod;

-	}

-}

-public void handleUnreachableCodeAsError(boolean flag) {

-	if (flag) {

-		errorThreshold |= UnreachableCode;

-		warningThreshold &= ~UnreachableCode;

-	} else {

-		errorThreshold &= ~UnreachableCode;

-		warningThreshold |= UnreachableCode;

+public void setUnreachableCodeSeverity(int flag) {

+	errorThreshold &= ~UnreachableCode;

+	warningThreshold &= ~UnreachableCode;

+	switch(flag){

+		case Error : 

+			errorThreshold |= UnreachableCode;

+			break;

+		case Warning : 

+			warningThreshold |= UnreachableCode;

+			break;

 	}	

 }

-public void handleUnusedArgumentAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= UnusedArgument;

-	} else {

-		warningThreshold &= ~UnusedArgument;

+public void setUnusedArgumentSeverity(int flag) {

+	errorThreshold &= ~UnusedArgument;

+	warningThreshold &= ~UnusedArgument;

+	switch(flag){

+		case Error : 

+			errorThreshold |= UnusedArgument;

+			break;

+		case Warning : 

+			warningThreshold |= UnusedArgument;

+			break;

 	}

 }

-public void handleUnusedLocalVariableAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= UnusedLocalVariable;

-	} else {

-		warningThreshold &= ~UnusedLocalVariable;

+public void setUnusedLocalVariableSeverity(int flag) {

+	errorThreshold &= ~UnusedLocalVariable;

+	warningThreshold &= ~UnusedLocalVariable;

+	switch(flag){

+		case Error : 

+			errorThreshold |= UnusedLocalVariable;

+			break;

+		case Warning : 

+			warningThreshold |= UnusedLocalVariable;

+			break;

 	}

 }

-public boolean isAccessEmulationHandledAsWarning() {

-	return (warningThreshold & AccessEmulation) != 0;

+public void setNonExternalizedStringLiteralSeverity(int flag) {

+	errorThreshold &= ~NonExternalizedString;

+	warningThreshold &= ~NonExternalizedString;

+	switch(flag){

+		case Error : 

+			errorThreshold |= NonExternalizedString;

+			break;

+		case Warning : 

+			warningThreshold |= NonExternalizedString;

+			break;

+	}	

 }

-public boolean isDeprecationUseHandledAsWarning() {

-	return (warningThreshold & UsingDeprecatedAPI) != 0;

+public void setAssertIdentifierSeverity(int flag) {

+	errorThreshold &= ~AssertUsedAsAnIdentifier;

+	warningThreshold &= ~AssertUsedAsAnIdentifier;

+	switch(flag){

+		case Error : 

+			errorThreshold |= AssertUsedAsAnIdentifier;

+			break;

+		case Warning : 

+			warningThreshold |= AssertUsedAsAnIdentifier;

+			break;

+	}	

 }

-public boolean isImportProblemHandledAsError() {

-	return (errorThreshold & ImportProblem) != 0;

+public int getAccessEmulationSeverity() {

+	if((warningThreshold & AccessEmulation) != 0)

+		return Warning;

+	if((errorThreshold & AccessEmulation) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isMaskedCatchBlockHandledAsWarning() {

-	return (warningThreshold & MaskedCatchBlock) != 0;

+public int getDeprecationUseSeverity() {

+	if((warningThreshold & UsingDeprecatedAPI) != 0)

+		return Warning;

+	if((errorThreshold & UsingDeprecatedAPI) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isMethodWithConstructorNameHandledAsWarning() {

-	return (warningThreshold & MethodWithConstructorName) != 0;

+public int getImportProblemSeverity() {

+	if((warningThreshold & ImportProblem) != 0)

+		return Warning;

+	if((errorThreshold & ImportProblem) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isObsoleteLiteralAsHandledError() {

-	return (errorThreshold & ParsingOptionalError) != 0;

+public int getMaskedCatchBlockSeverity() {

+	if((warningThreshold & MaskedCatchBlock) != 0)

+		return Warning;

+	if((errorThreshold & MaskedCatchBlock) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isOverriddenPackageDefaultMethodHandledAsWarning() {

-	return (warningThreshold & OverriddenPackageDefaultMethod) != 0;

+public int getMethodWithConstructorNameSeverity() {

+	if((warningThreshold & MethodWithConstructorName) != 0)

+		return Warning;

+	if((errorThreshold & MethodWithConstructorName) != 0)

+		return Error;

+	return Ignore;

+}

+

+public int getOverriddenPackageDefaultMethodSeverity() {

+	if((warningThreshold & OverriddenPackageDefaultMethod) != 0)

+		return Warning;

+	if((errorThreshold & OverriddenPackageDefaultMethod) != 0)

+		return Error;

+	return Ignore;

 }

 public boolean isPreservingAllLocalVariables() {

 	return this.preserveAllLocalVariables ;

@@ -263,14 +284,40 @@
 public boolean isPrivateConstructorAccessChangingVisibility() {

 	return isPrivateConstructorAccessChangingVisibility;

 }

-public boolean isUnreachableCodeHandledAsError() {

-	return (errorThreshold & UnreachableCode) != 0;

+public int getUnreachableCodeHandledAsError() {

+	if((warningThreshold & UnreachableCode) != 0)

+		return Warning;

+	if((errorThreshold & UnreachableCode) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isUnusedArgumentHandledAsWarning() {

-	return (warningThreshold & UnusedArgument) != 0;

+public int getUnusedArgumentSeverity() {

+	if((warningThreshold & UnusedArgument) != 0)

+		return Warning;

+	if((errorThreshold & UnusedArgument) != 0)

+		return Error;

+	return Ignore;

 }

-public boolean isUnusedLocalVariableHandledAsWarning() {

-	return (warningThreshold & UnusedLocalVariable) != 0;

+public int getUnusedLocalVariableSeverity() {

+	if((warningThreshold & UnusedLocalVariable) != 0)

+		return Warning;

+	if((errorThreshold & UnusedLocalVariable) != 0)

+		return Error;

+	return Ignore;

+}

+public int getNonExternalizedStringLiteralSeverity() {

+	if((warningThreshold & NonExternalizedString) != 0)

+		return Warning;

+	if((errorThreshold & NonExternalizedString) != 0)

+		return Error;

+	return Ignore;

+}

+public int getAssertIdentifierSeverity() {

+	if((warningThreshold & NonExternalizedString) != 0)

+		return Warning;

+	if((errorThreshold & NonExternalizedString) != 0)

+		return Error;

+	return Ignore;

 }

 public void preserveAllLocalVariables(boolean flag) {

 	this.preserveAllLocalVariables = flag;

@@ -288,226 +335,311 @@
 	this.errorThreshold = errorMask;

 }

 /**

- * Change the value of the option corresponding to the option number

- *

- * @param optionNumber <CODE>int</CODE>

- * @param setting.getCurrentValueIndex() <CODE>int</CODE>

+ * Change the value of the option corresponding to the option ID

  */

 void setOption(ConfigurableOption setting) {

+	String componentName = Compiler.class.getName();

 	

-	switch (setting.getID()) {

-		case 1 : // Local variable table attribute

-			if (setting.getCurrentValueIndex() == 0) {

-				// set the debug flag with Vars.

-				produceDebugAttributes |= Vars;

-			} else {

-				produceDebugAttributes &= ~Vars;

-			}

-			break;

-		case 2 : // Line number attribute

-			if (setting.getCurrentValueIndex() == 0) {

-				// set the debug flag with Lines

-				produceDebugAttributes |= Lines;

-			} else {

-				produceDebugAttributes &= ~Lines;

-			}

-			break;

-		case 3 : // source file attribute

-			if (setting.getCurrentValueIndex() == 0) {

-				// set the debug flag with Source.

-				produceDebugAttributes |= Source;

-			} else {

-				produceDebugAttributes &= ~Source;

-			}

-			break;

-		case 4 : // preserveAllLocals flag

-			preserveAllLocalVariables(setting.getCurrentValueIndex() == 0);

-			break;

-		case 5 : // unreachable code reported as error

-			handleUnreachableCodeAsError(setting.getCurrentValueIndex() == 0);

-			break;

-		case 6 : // invalid import

-			handleImportProblemAsError(setting.getCurrentValueIndex() == 0);

-			break;

-		case 7 : // methods with constructor name

-			handleMethodWithConstructorNameAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 8 : // overridden package default method

-			handleOverriddenPackageDefaultMethodAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 9 : // use of deprecated API

-			handleDeprecationUseAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 10 : // catch block hidden by another one

-			handleMaskedCatchBlockAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 11 : // local variable not used

-			handleUnusedLocalVariableAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 12 : // argument not used

-			handleUnusedArgumentAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 13 : // temporary warning

-			if (setting.getCurrentValueIndex() == 0) {

-				warningThreshold |= TemporaryWarning;

-			}

-			break;

-		case 14 : // target JDK

-			setTargetJDK(setting.getCurrentValueIndex() == 0 ? JDK1_1 : JDK1_2);

-			break;

-		case 15: // synthetic access emulation

-			handleAccessEmulationAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

-		case 16: // non externalized string literal

-			handleNonExternalizedStringLiteralAsWarning(setting.getCurrentValueIndex() == 0);

-			break;

+	String optionID = setting.getID();

+	

+	if(optionID.equals(OPTION_LocalVariableAttribute)){

+		if (setting.getValueIndex() == 0) {

+			// set the debug flag with Vars.

+			produceDebugAttributes |= Vars;

+		} else {

+			produceDebugAttributes &= ~Vars;

+		}

+	} else if(optionID.equals(OPTION_LineNumberAttribute)) {

+		if (setting.getValueIndex() == 0) {

+			// set the debug flag with Lines

+			produceDebugAttributes |= Lines;

+		} else {

+			produceDebugAttributes &= ~Lines;

+		}

+	}else if(optionID.equals(OPTION_SourceFileAttribute)) {

+		if (setting.getValueIndex() == 0) {

+			// set the debug flag with Source.

+			produceDebugAttributes |= Source;

+		} else {

+			produceDebugAttributes &= ~Source;

+		}

+	}else if(optionID.equals(OPTION_PreserveUnusedLocal)){

+		preserveAllLocalVariables(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_ReportUnreachableCode)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setUnreachableCodeSeverity(Error);

+				break;

+			case 1 :

+				setUnreachableCodeSeverity(Warning);

+				break;

+			case 2 : 

+				setUnreachableCodeSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportInvalidImport)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setImportProblemSeverity(Error);

+				break;

+			case 1 :

+				setImportProblemSeverity(Warning);

+				break;

+			case 2 :

+				setImportProblemSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_TargetPlatform)){

+		setTargetJDK(setting.getValueIndex() == 0 ? JDK1_1 : JDK1_2);

+	}else if(optionID.equals(OPTION_ReportMethodWithConstructorName)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setMethodWithConstructorNameSeverity(Error);

+				break;

+			case 1 :

+				setMethodWithConstructorNameSeverity(Warning);

+				break;

+			case 2 :

+				setMethodWithConstructorNameSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportOverridingPackageDefaultMethod)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setOverriddenPackageDefaultMethodSeverity(Error);

+				break;

+			case 1 :

+				setOverriddenPackageDefaultMethodSeverity(Warning);

+				break;

+			case 2 :

+				setOverriddenPackageDefaultMethodSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportDeprecation)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setDeprecationUseSeverity(Error);

+				break;

+			case 1 :

+				setDeprecationUseSeverity(Warning);

+				break;

+			case 2 :

+				setDeprecationUseSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportHiddenCatchBlock)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setMaskedCatchBlockSeverity(Error);

+				break;

+			case 1 :

+				setMaskedCatchBlockSeverity(Warning);

+				break;

+			case 2 :

+				setMaskedCatchBlockSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportUnusedLocal)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setUnusedLocalVariableSeverity(Error);

+				break;

+			case 1 :

+				setUnusedLocalVariableSeverity(Warning);

+				break;

+			case 2 :

+				setUnusedLocalVariableSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportUnusedParameter)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setUnusedArgumentSeverity(Error);

+				break;

+			case 1 :

+				setUnusedArgumentSeverity(Warning);

+				break;

+			case 2 :

+				setUnusedArgumentSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportSyntheticAccessEmulation)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setAccessEmulationSeverity(Error);

+				break;

+			case 1 :

+				setAccessEmulationSeverity(Warning);

+				break;

+			case 2 :

+				setAccessEmulationSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportNonExternalizedStringLiteral)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setNonExternalizedStringLiteralSeverity(Error);

+				break;

+			case 1 :

+				setNonExternalizedStringLiteralSeverity(Warning);

+				break;

+			case 2 :

+				setNonExternalizedStringLiteralSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_ReportAssertIdentifier)){

+		switch(setting.getValueIndex()){

+			case 0 : 

+				setAssertIdentifierSeverity(Error);

+				break;

+			case 1 :

+				setAssertIdentifierSeverity(Warning);

+				break;

+			case 2 :

+				setAssertIdentifierSeverity(Ignore);

+				break;

+		}

+	}else if(optionID.equals(OPTION_Source)){

+		setAssertMode(setting.getValueIndex() == 1);

 	}

 }

+

 public void setTargetJDK(int vmID) {

 	this.targetJDK = vmID;

 }

 public void setVerboseMode(boolean flag) {

 	this.verbose = flag;

 }

+public void setAssertMode(boolean assertMode) {

+	this.assertMode = assertMode;

+}

 public void setWarningThreshold(int warningMask) {

 	this.warningThreshold = warningMask;

 }

 public String toString() {

 

-	StringBuffer buf = new StringBuffer("CompilerOptions:"/*nonNLS*/);

+	StringBuffer buf = new StringBuffer("CompilerOptions:"); //$NON-NLS-1$

 	if ((produceDebugAttributes & Vars) != 0){

-		buf.append("\n-local variables debug attributes: ON"/*nonNLS*/);

+		buf.append("\n-local variables debug attributes: ON"); //$NON-NLS-1$

 	} else {

-		buf.append("\n-local variables debug attributes: OFF"/*nonNLS*/);

+		buf.append("\n-local variables debug attributes: OFF"); //$NON-NLS-1$

 	}

 	if ((produceDebugAttributes & Lines) != 0){

-		buf.append("\n-line number debug attributes: ON"/*nonNLS*/);

+		buf.append("\n-line number debug attributes: ON"); //$NON-NLS-1$

 	} else {

-		buf.append("\n-line number debug attributes: OFF"/*nonNLS*/);

+		buf.append("\n-line number debug attributes: OFF"); //$NON-NLS-1$

 	}

 	if ((produceDebugAttributes & Source) != 0){

-		buf.append("\n-source debug attributes: ON"/*nonNLS*/);

+		buf.append("\n-source debug attributes: ON"); //$NON-NLS-1$

 	} else {

-		buf.append("\n-source debug attributes: OFF"/*nonNLS*/);

+		buf.append("\n-source debug attributes: OFF"); //$NON-NLS-1$

 	}

 	if (preserveAllLocalVariables){

-		buf.append("\n-preserve all local variables: ON"/*nonNLS*/);

+		buf.append("\n-preserve all local variables: ON"); //$NON-NLS-1$

 	} else {

-		buf.append("\n-preserve all local variables: OFF"/*nonNLS*/);

+		buf.append("\n-preserve all local variables: OFF"); //$NON-NLS-1$

 	}

 	if ((errorThreshold & UnreachableCode) != 0){

-		buf.append("\n-unreachable code: ERROR"/*nonNLS*/);

+		buf.append("\n-unreachable code: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & UnreachableCode) != 0){

-			buf.append("\n-unreachable code: WARNING"/*nonNLS*/);

+			buf.append("\n-unreachable code: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-unreachable code: IGNORE"/*nonNLS*/);

+			buf.append("\n-unreachable code: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & ImportProblem) != 0){

-		buf.append("\n-import problem: ERROR"/*nonNLS*/);

+		buf.append("\n-import problem: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & ImportProblem) != 0){

-			buf.append("\n-import problem: WARNING"/*nonNLS*/);

+			buf.append("\n-import problem: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-import problem: IGNORE"/*nonNLS*/);

+			buf.append("\n-import problem: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & MethodWithConstructorName) != 0){

-		buf.append("\n-method with constructor name: ERROR"/*nonNLS*/);		

+		buf.append("\n-method with constructor name: ERROR");		 //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & MethodWithConstructorName) != 0){

-			buf.append("\n-method with constructor name: WARNING"/*nonNLS*/);

+			buf.append("\n-method with constructor name: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-method with constructor name: IGNORE"/*nonNLS*/);

+			buf.append("\n-method with constructor name: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & OverriddenPackageDefaultMethod) != 0){

-		buf.append("\n-overridden package default method: ERROR"/*nonNLS*/);

+		buf.append("\n-overridden package default method: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & OverriddenPackageDefaultMethod) != 0){

-			buf.append("\n-overridden package default method: WARNING"/*nonNLS*/);

+			buf.append("\n-overridden package default method: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-overridden package default method: IGNORE"/*nonNLS*/);

+			buf.append("\n-overridden package default method: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & UsingDeprecatedAPI) != 0){

-		buf.append("\n-deprecation: ERROR"/*nonNLS*/);

+		buf.append("\n-deprecation: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & UsingDeprecatedAPI) != 0){

-			buf.append("\n-deprecation: WARNING"/*nonNLS*/);

+			buf.append("\n-deprecation: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-deprecation: IGNORE"/*nonNLS*/);

+			buf.append("\n-deprecation: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & MaskedCatchBlock) != 0){

-		buf.append("\n-masked catch block: ERROR"/*nonNLS*/);

+		buf.append("\n-masked catch block: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & MaskedCatchBlock) != 0){

-			buf.append("\n-masked catch block: WARNING"/*nonNLS*/);

+			buf.append("\n-masked catch block: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-masked catch block: IGNORE"/*nonNLS*/);

+			buf.append("\n-masked catch block: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & UnusedLocalVariable) != 0){

-		buf.append("\n-unused local variable: ERROR"/*nonNLS*/);

+		buf.append("\n-unused local variable: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & UnusedLocalVariable) != 0){

-			buf.append("\n-unused local variable: WARNING"/*nonNLS*/);

+			buf.append("\n-unused local variable: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-unused local variable: IGNORE"/*nonNLS*/);

+			buf.append("\n-unused local variable: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & UnusedArgument) != 0){

-		buf.append("\n-unused parameter: ERROR"/*nonNLS*/);

+		buf.append("\n-unused parameter: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & UnusedArgument) != 0){

-			buf.append("\n-unused parameter: WARNING"/*nonNLS*/);

+			buf.append("\n-unused parameter: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-unused parameter: IGNORE"/*nonNLS*/);

+			buf.append("\n-unused parameter: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & AccessEmulation) != 0){

-		buf.append("\n-synthetic access emulation: ERROR"/*nonNLS*/);

+		buf.append("\n-synthetic access emulation: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & AccessEmulation) != 0){

-			buf.append("\n-synthetic access emulation: WARNING"/*nonNLS*/);

+			buf.append("\n-synthetic access emulation: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-synthetic access emulation: IGNORE"/*nonNLS*/);

+			buf.append("\n-synthetic access emulation: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	if ((errorThreshold & NonExternalizedString) != 0){

-		buf.append("\n-non externalized string: ERROR"/*nonNLS*/);

+		buf.append("\n-non externalized string: ERROR"); //$NON-NLS-1$

 	} else {

 		if ((warningThreshold & NonExternalizedString) != 0){

-			buf.append("\n-non externalized string: WARNING"/*nonNLS*/);

+			buf.append("\n-non externalized string: WARNING"); //$NON-NLS-1$

 		} else {

-			buf.append("\n-non externalized string: IGNORE"/*nonNLS*/);

+			buf.append("\n-non externalized string: IGNORE"); //$NON-NLS-1$

 		}

 	}

 	switch(targetJDK){

 		case JDK1_1 :

-			buf.append("\n-target JDK: 1.1"/*nonNLS*/);

+			buf.append("\n-target JDK: 1.1"); //$NON-NLS-1$

 			break;

 		case JDK1_2 :

-			buf.append("\n-target JDK: 1.2"/*nonNLS*/);

+			buf.append("\n-target JDK: 1.2"); //$NON-NLS-1$

 	}

-	buf.append("\n-verbose : "/*nonNLS*/ + (verbose ? "ON"/*nonNLS*/ : "OFF"/*nonNLS*/));

-	buf.append("\n-produce reference info : "/*nonNLS*/ + (produceReferenceInfo ? "ON"/*nonNLS*/ : "OFF"/*nonNLS*/));

-	buf.append("\n-parse literal expressions as constants : "/*nonNLS*/ + (parseLiteralExpressionsAsConstants ? "ON"/*nonNLS*/ : "OFF"/*nonNLS*/));

-	buf.append("\n-runtime exception name for compile error : "/*nonNLS*/ + runtimeExceptionNameForCompileError);

+	buf.append("\n-verbose : " + (verbose ? "ON" : "OFF")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

+	buf.append("\n-produce reference info : " + (produceReferenceInfo ? "ON" : "OFF")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

+	buf.append("\n-parse literal expressions as constants : " + (parseLiteralExpressionsAsConstants ? "ON" : "OFF")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

+	buf.append("\n-runtime exception name for compile error : " + runtimeExceptionNameForCompileError); //$NON-NLS-1$

 	return buf.toString();

 }

-

-public void handleNonExternalizedStringLiteralAsWarning(boolean flag) {

-	if (flag) {

-		warningThreshold |= NonExternalizedString;

-	} else {

-		warningThreshold &= ~NonExternalizedString;

-	}

-}

-

-public boolean isNonExternalizedStringLiteralHandledAsWarning() {

-	return (warningThreshold & NonExternalizedString) != 0;

-}

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java b/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
index 4482fd9..033843d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
@@ -9,7 +9,6 @@
 

 public interface ConfigurableProblems {

 	final int UnreachableCode = 0x100;

-	final int ParsingOptionalError = 0x200;

 	final int ImportProblem = 0x400;

 	final int MethodWithConstructorName = 0x1000;

 	final int OverriddenPackageDefaultMethod = 0x2000;

@@ -20,4 +19,5 @@
 	final int TemporaryWarning = 0x40000;

 	final int AccessEmulation = 0x80000;

 	final int NonExternalizedString = 0x100000;

+	final int AssertUsedAsAnIdentifier = 0x200000;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
index 92b55dd..8f05951 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/Constant.java
@@ -16,10 +16,10 @@
 	public static final IntConstant Two = new IntConstant(2);

 	public static final IntConstant One = new IntConstant(1);

 public boolean booleanValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"boolean"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"boolean")); //$NON-NLS-1$ //$NON-NLS-2$

 }

 public byte byteValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"byte"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"byte")); //$NON-NLS-1$ //$NON-NLS-2$

 }

 public final Constant castTo(int conversionToTargetType){

 	//the cast is an int of the form

@@ -218,7 +218,7 @@
 	return NotAConstant ;

 }

 public char charValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"char"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"char")); //$NON-NLS-1$ //$NON-NLS-2$

 }

 public static final Constant computeConstantOperation(Constant cst, int id, int operator) {

 	//this method  assumes that the TC has been done . 

@@ -1416,10 +1416,10 @@
 

 	return NotAConstant ;}  // should not get here 

 public double doubleValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"double"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"double")); //$NON-NLS-2$ //$NON-NLS-1$

 }

 public float floatValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"float"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"float")); //$NON-NLS-2$ //$NON-NLS-1$

 }

 public static Constant fromValue(byte value) {

 	return new ByteConstant(value);

@@ -1450,36 +1450,36 @@
 	return new BooleanConstant(value);

 }

 public int intValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"int"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"int")); //$NON-NLS-2$ //$NON-NLS-1$

 }

 public long longValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto"/*nonNLS*/,typeName(),"long"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"long")); //$NON-NLS-2$ //$NON-NLS-1$

 }

 public short shortValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo"/*nonNLS*/,typeName(),"short"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"short")); //$NON-NLS-2$ //$NON-NLS-1$

 }

 /** Deprecated

 */

 public String stringValue() {

-	throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo"/*nonNLS*/,typeName(),"String"/*nonNLS*/));

+	throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"String")); //$NON-NLS-1$ //$NON-NLS-2$

 }

 public String toString(){

 

-	if (this == NotAConstant) return "(Constant) NotAConstant"/*nonNLS*/ ;

+	if (this == NotAConstant) return "(Constant) NotAConstant" ; //$NON-NLS-1$

 	return super.toString(); }

 public abstract int typeID();

 public String typeName() {

 	switch (typeID()) {

-		case T_int : return "int"/*nonNLS*/;

-		case T_byte : return "byte"/*nonNLS*/;

-		case T_short : return "short"/*nonNLS*/;

-		case T_char : return "char"/*nonNLS*/;

-		case T_float : return "float"/*nonNLS*/;

-		case T_double : return "double"/*nonNLS*/;

-		case T_boolean : return "boolean"/*nonNLS*/;

-		case T_String : return "java.lang.String"/*nonNLS*/;

-		case T_null : return "null"/*nonNLS*/;	

-		default: return "unknown"/*nonNLS*/;

+		case T_int : return "int"; //$NON-NLS-1$

+		case T_byte : return "byte"; //$NON-NLS-1$

+		case T_short : return "short"; //$NON-NLS-1$

+		case T_char : return "char"; //$NON-NLS-1$

+		case T_float : return "float"; //$NON-NLS-1$

+		case T_double : return "double"; //$NON-NLS-1$

+		case T_boolean : return "boolean"; //$NON-NLS-1$

+		case T_String : return "java.lang.String"; //$NON-NLS-1$

+		case T_null : return "null";	 //$NON-NLS-1$

+		default: return "unknown"; //$NON-NLS-1$

 	}

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.java
index 522474c..03794b2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.java
@@ -36,14 +36,14 @@
 	

 	String s = new Double(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	if (this == NotAConstant) return "(Constant) NotAConstant"/*nonNLS*/ ;

-	return "(double)"/*nonNLS*/ + value ; }

+	if (this == NotAConstant) return "(Constant) NotAConstant" ; //$NON-NLS-1$

+	return "(double)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_double;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/FloatConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/FloatConstant.java
index 483ef5d..8e411cf 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/FloatConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/FloatConstant.java
@@ -36,13 +36,13 @@
 	

 	String s = new Float(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(float)"/*nonNLS*/ + value ; }

+	return "(float)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_float;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.java b/compiler/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.java
index f4270ac..939f0b7 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.java
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java
index 490196c..d000a1d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java
@@ -36,13 +36,13 @@
 	

 	String s = new Integer(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(int)"/*nonNLS*/ + value ; }

+	return "(int)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_int;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java
index 911b81f..d6b4161 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java
@@ -36,13 +36,13 @@
 	

 	String s = new Long(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(long)"/*nonNLS*/ + value ; }

+	return "(long)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_long;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/NullConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/NullConstant.java
index 6e24bf5..1024159 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/NullConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/NullConstant.java
@@ -17,7 +17,7 @@
 }

 public String toString(){

 

-	return "(null)"/*nonNLS*/ + null ; }

+	return "(null)" + null ; } //$NON-NLS-1$

 public int typeID() {

 	return T_null;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/ShortConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/ShortConstant.java
index fd87ca9..d1bebfa 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/ShortConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/ShortConstant.java
@@ -36,13 +36,13 @@
 	

 	String s = new Integer(value).toString() ;

 	if (s == null)

-		return "null"/*nonNLS*/;

+		return "null"; //$NON-NLS-1$

 	else

 		return s;

 }

 public String toString(){

 

-	return "(short)"/*nonNLS*/ + value ; }

+	return "(short)" + value ; } //$NON-NLS-1$

 public int typeID() {

 	return T_short;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/StringConstant.java b/compiler/org/eclipse/jdt/internal/compiler/impl/StringConstant.java
index fe197d4..2e757d3 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/StringConstant.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/StringConstant.java
@@ -33,7 +33,7 @@
 }

 public String toString(){

 

-	return "(String)\""/*nonNLS*/ + value +"\""/*nonNLS*/; }

+	return "(String)\"" + value +"\""; } //$NON-NLS-2$ //$NON-NLS-1$

 public int typeID() {

 	return T_String;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/options.properties b/compiler/org/eclipse/jdt/internal/compiler/impl/options.properties
deleted file mode 100644
index c166fc2..0000000
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/options.properties
+++ /dev/null
@@ -1,84 +0,0 @@
-debug.vars.number=1

-debug.vars.category=Debug Information

-debug.vars.name=Local variable attribute

-debug.vars.possibleValues=2|Generate|Do not generate

-debug.vars.description=When generated, this attribute will enable local variable names to be displayed in debugger, only in place where variables are definitely assigned (.class file is then bigger)

-

-debug.lines.number=2

-debug.lines.category=Debug Information

-debug.lines.name=Line number attribute

-debug.lines.possibleValues=2|Generate|Do not generate

-debug.lines.description=When generated, this attribute will enable source code highlighting in debugger (.class file is then bigger).

-

-debug.source.number=3

-debug.source.category=Debug Information

-debug.source.name=Source file attribute

-debug.source.possibleValues=2|Generate|Do not generate

-debug.source.description=When generated, this attribute will enable the debugger to present the corresponding source code.

-

-debug.preserveAllLocals.number=4

-debug.preserveAllLocals.category=Code Generation

-debug.preserveAllLocals.name=Preserve unused locals

-debug.preserveAllLocals.possibleValues=2|Preserve|Optimize out

-debug.preserveAllLocals.description=Unless requested to preserve unused local variables (i.e. never read), the compiler will optimize them out, potentially altering debugging

-

-optionalError.unReachableCode.number=5

-optionalError.unReachableCode.category=Optional Errors

-optionalError.unReachableCode.name=Unreachable code

-optionalError.unReachableCode.possibleValues=2|Raise error|Warn

-optionalError.unReachableCode.description=Unreachable code can either be reported as an error or a warning

-

-optionalError.importProblem.number=6

-optionalError.importProblem.category=Optional Errors

-optionalError.importProblem.name=Invalid import

-optionalError.importProblem.possibleValues=2|Raise error|Warn

-optionalError.importProblem.description=An import statement that cannot be resolved might either be reported either as an error or as a warning

-

-optionalWarning.methodWithConstructorName.number=7

-optionalWarning.methodWithConstructorName.category=Optional Warnings

-optionalWarning.methodWithConstructorName.name=Method with constructor name

-optionalWarning.methodWithConstructorName.possibleValues=2|Warn|Ignore

-optionalWarning.methodWithConstructorName.description=Naming a method with a constructor name is generally considered poor style programming. When enabling this option, the compiler will signal such scenarii.

-

-optionalWarning.overridingPackageDefaultMethod.number=8

-optionalWarning.overridingPackageDefaultMethod.category=Optional Warnings

-optionalWarning.overridingPackageDefaultMethod.name=Overriding a package default method

-optionalWarning.overridingPackageDefaultMethod.possibleValues=2|Warn|Ignore

-optionalWarning.overridingPackageDefaultMethod.description=A package default method is not visible in a different package, and thus cannot be overriden. When enabling this option, the compiler will signal such scenarii.

-

-optionalWarning.deprecated.number=9

-optionalWarning.deprecated.category=Optional Warnings

-optionalWarning.deprecated.name=Deprecation

-optionalWarning.deprecated.possibleValues=2|Warn|Ignore

-optionalWarning.deprecated.description=When enabled, the compiler will signal use of deprecated API.

-

-optionalWarning.maskedCatchBlock.number=10

-optionalWarning.maskedCatchBlock.category=Optional Warnings

-optionalWarning.maskedCatchBlock.name=Hidden catch block

-optionalWarning.maskedCatchBlock.possibleValues=2|Warn|Ignore

-optionalWarning.maskedCatchBlock.description=Locally to a try statement, some catch blocks may hide others (e.g. try {throw new java.io.CharConversionException();} catch (java.io.CharConversionException e) {} catch (java.io.IOException e) {}). When enabling this option, the compiler will issue a warning for hidden catch blocks corresponding to checked exceptions

-

-optionalWarning.unusedLocalVariable.number=11

-optionalWarning.unusedLocalVariable.category=Optional Warnings

-optionalWarning.unusedLocalVariable.name=Unused local variable

-optionalWarning.unusedLocalVariable.possibleValues=2|Warn|Ignore

-optionalWarning.unusedLocalVariable.description=When enabled, the compiler will issue a warning for unused local variables (i.e. variables never read from)

-

-optionalWarning.unusedArgument.number=12

-optionalWarning.unusedArgument.category=Optional Warnings

-optionalWarning.unusedArgument.name=Unused parameter

-optionalWarning.unusedArgument.possibleValues=2|Warn|Ignore

-optionalWarning.unusedArgument.description=When enabled, the compiler will issue a warning for unused method parameters (i.e. parameters never read from)

-

-binaryCompatibility.targetJDK.number=14

-binaryCompatibility.targetJDK.category=Binary Compatibility

-binaryCompatibility.targetJDK.name=Target platform

-binaryCompatibility.targetJDK.possibleValues=2|1.1|1.2

-binaryCompatibility.targetJDK.description=Generate .class files either backward compatible with JVM 1.1 or only executable on JVM 1.2 and later

-

-optionalWarning.accessEmulation.number=15

-optionalWarning.accessEmulation.category=Optional Warnings

-optionalWarning.accessEmulation.name=Synthetic Access Emulation

-optionalWarning.accessEmulation.possibleValues=2|Warn|Ignore

-optionalWarning.accessEmulation.description=When enabled, the compiler will issue a warning whenever it emulates access to a non-accessible member of an enclosing type

-

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
index 15e789c..98050d2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
@@ -39,7 +39,7 @@
 String debugName() {

 	StringBuffer brackets = new StringBuffer(dimensions * 2);

 	for (int i = dimensions; --i >= 0;)

-		brackets.append("[]"/*nonNLS*/);

+		brackets.append("[]"); //$NON-NLS-1$

 	return leafComponentType.debugName() + brackets.toString();

 }

 /* Answer an array whose dimension size is one less than the receiver.

@@ -128,6 +128,6 @@
 	return CharOperation.concat(leafComponentType.sourceName(), brackets);

 }

 public String toString() {

-	return leafComponentType != null ? debugName() : "NULL TYPE ARRAY"/*nonNLS*/;

+	return leafComponentType != null ? debugName() : "NULL TYPE ARRAY"; //$NON-NLS-1$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
index d664852..0f1de7d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
@@ -146,6 +146,6 @@
 	return simpleName;

 }

 public String toString() {

-	return new String(constantPoolName) + " (id="/*nonNLS*/ + id + ")"/*nonNLS*/;

+	return new String(constantPoolName) + " (id=" + id + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypes.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypes.java
index 45caffe..7c43f2c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypes.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/BaseTypes.java
@@ -6,14 +6,14 @@
 import org.eclipse.jdt.internal.compiler.*;

 

 public interface BaseTypes {

-	final BaseTypeBinding IntBinding = new BaseTypeBinding(TypeIds.T_int, "int"/*nonNLS*/.toCharArray(), new char[] {'I'});

-	final BaseTypeBinding ByteBinding = new BaseTypeBinding(TypeIds.T_byte, "byte"/*nonNLS*/.toCharArray(), new char[] {'B'});

-	final BaseTypeBinding ShortBinding = new BaseTypeBinding(TypeIds.T_short, "short"/*nonNLS*/.toCharArray(), new char[] {'S'});

-	final BaseTypeBinding CharBinding = new BaseTypeBinding(TypeIds.T_char, "char"/*nonNLS*/.toCharArray(), new char[] {'C'});

-	final BaseTypeBinding LongBinding = new BaseTypeBinding(TypeIds.T_long, "long"/*nonNLS*/.toCharArray(), new char[] {'J'});

-	final BaseTypeBinding FloatBinding = new BaseTypeBinding(TypeIds.T_float, "float"/*nonNLS*/.toCharArray(), new char[] {'F'});

-	final BaseTypeBinding DoubleBinding = new BaseTypeBinding(TypeIds.T_double, "double"/*nonNLS*/.toCharArray(), new char[] {'D'});

-	final BaseTypeBinding BooleanBinding = new BaseTypeBinding(TypeIds.T_boolean, "boolean"/*nonNLS*/.toCharArray(), new char[] {'Z'});

-	final BaseTypeBinding NullBinding = new BaseTypeBinding(TypeIds.T_null, "null"/*nonNLS*/.toCharArray(), new char[] {'N'}); //N stands for null even if it is never internally used

-	final BaseTypeBinding VoidBinding = new BaseTypeBinding(TypeIds.T_void, "void"/*nonNLS*/.toCharArray(), new char[] {'V'});

+	final BaseTypeBinding IntBinding = new BaseTypeBinding(TypeIds.T_int, "int".toCharArray(), new char[] {'I'}); //$NON-NLS-1$

+	final BaseTypeBinding ByteBinding = new BaseTypeBinding(TypeIds.T_byte, "byte".toCharArray(), new char[] {'B'}); //$NON-NLS-1$

+	final BaseTypeBinding ShortBinding = new BaseTypeBinding(TypeIds.T_short, "short".toCharArray(), new char[] {'S'}); //$NON-NLS-1$

+	final BaseTypeBinding CharBinding = new BaseTypeBinding(TypeIds.T_char, "char".toCharArray(), new char[] {'C'}); //$NON-NLS-1$

+	final BaseTypeBinding LongBinding = new BaseTypeBinding(TypeIds.T_long, "long".toCharArray(), new char[] {'J'}); //$NON-NLS-1$

+	final BaseTypeBinding FloatBinding = new BaseTypeBinding(TypeIds.T_float, "float".toCharArray(), new char[] {'F'}); //$NON-NLS-1$

+	final BaseTypeBinding DoubleBinding = new BaseTypeBinding(TypeIds.T_double, "double".toCharArray(), new char[] {'D'}); //$NON-NLS-1$

+	final BaseTypeBinding BooleanBinding = new BaseTypeBinding(TypeIds.T_boolean, "boolean".toCharArray(), new char[] {'Z'}); //$NON-NLS-1$

+	final BaseTypeBinding NullBinding = new BaseTypeBinding(TypeIds.T_null, "null".toCharArray(), new char[] {'N'}); //N stands for null even if it is never internally used //$NON-NLS-1$

+	final BaseTypeBinding VoidBinding = new BaseTypeBinding(TypeIds.T_void, "void".toCharArray(), new char[] {'V'}); //$NON-NLS-1$

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index 683a617..25a88b7 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -376,71 +376,71 @@
 	return superInterfaces;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 

-	if (isDeprecated()) s += "deprecated "/*nonNLS*/;

-	if (isPublic()) s += "public "/*nonNLS*/;

-	if (isProtected()) s += "protected "/*nonNLS*/;

-	if (isPrivate()) s += "private "/*nonNLS*/;

-	if (isAbstract() && isClass()) s += "abstract "/*nonNLS*/;

-	if (isStatic() && isNestedType()) s += "static "/*nonNLS*/;

-	if (isFinal()) s += "final "/*nonNLS*/;

+	if (isDeprecated()) s += "deprecated "; //$NON-NLS-1$

+	if (isPublic()) s += "public "; //$NON-NLS-1$

+	if (isProtected()) s += "protected "; //$NON-NLS-1$

+	if (isPrivate()) s += "private "; //$NON-NLS-1$

+	if (isAbstract() && isClass()) s += "abstract "; //$NON-NLS-1$

+	if (isStatic() && isNestedType()) s += "static "; //$NON-NLS-1$

+	if (isFinal()) s += "final "; //$NON-NLS-1$

 

-	s += isInterface() ? "interface "/*nonNLS*/ : "class "/*nonNLS*/;

-	s += (compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED TYPE"/*nonNLS*/;

+	s += isInterface() ? "interface " : "class "; //$NON-NLS-1$ //$NON-NLS-2$

+	s += (compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED TYPE"; //$NON-NLS-1$

 

-	s += "\n\textends "/*nonNLS*/;

-	s += (superclass != null) ? superclass.debugName() : "NULL TYPE"/*nonNLS*/;

+	s += "\n\textends "; //$NON-NLS-1$

+	s += (superclass != null) ? superclass.debugName() : "NULL TYPE"; //$NON-NLS-1$

 

 	if (superInterfaces != null) {

 		if (superInterfaces != NoSuperInterfaces) {

-			s += "\n\timplements : "/*nonNLS*/;

+			s += "\n\timplements : "; //$NON-NLS-1$

 			for (int i = 0, length = superInterfaces.length; i < length; i++) {

 				if (i  > 0)

-					s += ", "/*nonNLS*/;

-				s += (superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"/*nonNLS*/;

+					s += ", "; //$NON-NLS-1$

+				s += (superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"; //$NON-NLS-1$

 			}

 		}

 	} else {

-		s += "NULL SUPERINTERFACES"/*nonNLS*/;

+		s += "NULL SUPERINTERFACES"; //$NON-NLS-1$

 	}

 

 	if (enclosingType != null) {

-		s += "\n\tenclosing type : "/*nonNLS*/;

+		s += "\n\tenclosing type : "; //$NON-NLS-1$

 		s += enclosingType.debugName();

 	}

 

 	if (fields != null) {

 		if (fields != NoFields) {

-			s += "\n/*   fields   */"/*nonNLS*/;

+			s += "\n/*   fields   */"; //$NON-NLS-1$

 			for (int i = 0, length = fields.length; i < length; i++)

-				s += (fields[i] != null) ? "\n"/*nonNLS*/ + fields[i].toString() : "\nNULL FIELD"/*nonNLS*/;

+				s += (fields[i] != null) ? "\n" + fields[i].toString() : "\nNULL FIELD"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL FIELDS"/*nonNLS*/;

+		s += "NULL FIELDS"; //$NON-NLS-1$

 	}

 

 	if (methods != null) {

 		if (methods != NoMethods) {

-			s += "\n/*   methods   */"/*nonNLS*/;

+			s += "\n/*   methods   */"; //$NON-NLS-1$

 			for (int i = 0, length = methods.length; i < length; i++)

-				s += (methods[i] != null) ? "\n"/*nonNLS*/ + methods[i].toString() : "\nNULL METHOD"/*nonNLS*/;

+				s += (methods[i] != null) ? "\n" + methods[i].toString() : "\nNULL METHOD"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL METHODS"/*nonNLS*/;

+		s += "NULL METHODS"; //$NON-NLS-1$

 	}

 

 	if (memberTypes != null) {

 		if (memberTypes != NoMemberTypes) {

-			s += "\n/*   members   */"/*nonNLS*/;

+			s += "\n/*   members   */"; //$NON-NLS-1$

 			for (int i = 0, length = memberTypes.length; i < length; i++)

-				s += (memberTypes[i] != null) ? "\n"/*nonNLS*/ + memberTypes[i].toString() : "\nNULL TYPE"/*nonNLS*/;

+				s += (memberTypes[i] != null) ? "\n" + memberTypes[i].toString() : "\nNULL TYPE"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL MEMBER TYPES"/*nonNLS*/;

+		s += "NULL MEMBER TYPES"; //$NON-NLS-1$

 	}

 

-	s += "\n\n\n"/*nonNLS*/;

+	s += "\n\n\n"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index a4e14bc..02e4351 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -139,16 +139,16 @@
 		|| ((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod(); // inside constructor or clinit

 }

 String basicToString(int tab) {

-	String newLine = "\n"/*nonNLS*/;

+	String newLine = "\n"; //$NON-NLS-1$

 	for (int i = tab; --i >= 0;)

-		newLine += "\t"/*nonNLS*/;

+		newLine += "\t"; //$NON-NLS-1$

 

-	String s = newLine + "--- Block Scope ---"/*nonNLS*/;

-	newLine += "\t"/*nonNLS*/;

-	s += newLine + "locals:"/*nonNLS*/;

+	String s = newLine + "--- Block Scope ---"; //$NON-NLS-1$

+	newLine += "\t"; //$NON-NLS-1$

+	s += newLine + "locals:"; //$NON-NLS-1$

 	for (int i = 0; i < localIndex; i++)

-		s += newLine + "\t"/*nonNLS*/ + locals[i].toString();

-	s += newLine + "startIndex = "/*nonNLS*/ + startIndex;

+		s += newLine + "\t" + locals[i].toString(); //$NON-NLS-1$

+	s += newLine + "startIndex = " + startIndex; //$NON-NLS-1$

 	return s;

 }

 private void checkAndSetModifiersForVariable(LocalVariableBinding varBinding) {

@@ -1175,7 +1175,7 @@
 	String s = basicToString(tab);

 	for (int i = 0; i < scopeIndex; i++)

 		if (subscopes[i] instanceof BlockScope)

-			s += ((BlockScope) subscopes[i]).toString(tab + 1) + "\n"/*nonNLS*/;

+			s += ((BlockScope) subscopes[i]).toString(tab + 1) + "\n"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index 02a39d2..46d5372 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -11,606 +11,676 @@
 

 public class ClassScope extends Scope {

 	public TypeDeclaration referenceContext;

-public ClassScope(Scope parent, TypeDeclaration context) {

-	super(CLASS_SCOPE, parent);

-	this.referenceContext = context;

-}

-void buildAnonymousTypeBinding(SourceTypeBinding enclosingType, ReferenceBinding supertype) {

- 	buildLocalType(enclosingType, enclosingType.fPackage);

-

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if (supertype.isInterface()) {

-		sourceType.superclass = getJavaLangObject();

-		sourceType.superInterfaces = new ReferenceBinding[] {supertype};

-	} else {

-		sourceType.superclass = supertype;

-		sourceType.superInterfaces = TypeBinding.NoSuperInterfaces;

+	

+	public ClassScope(Scope parent, TypeDeclaration context) {

+		super(CLASS_SCOPE, parent);

+		this.referenceContext = context;

 	}

-	connectMemberTypes();

-	buildFieldsAndMethods();

-	sourceType.verifyMethods(environment().methodVerifier());

-}

-private void buildFields() {

-	if (referenceContext.fields == null) {

-		referenceContext.binding.fields = NoFields;

-		return;

-	}

+	

+	void buildAnonymousTypeBinding(SourceTypeBinding enclosingType, ReferenceBinding supertype) {

+		buildLocalType(enclosingType, enclosingType.fPackage);

 

-	// count the number of fields vs. initializers

-	FieldDeclaration[] fields = referenceContext.fields;

-	int size = fields.length;

-	int count = 0;

-	for (int i = 0; i < size; i++)

-		if (fields[i].isField())

-			count++;

-

-	// iterate the field declarations to create the bindings, lose all duplicates

-	FieldBinding[] fieldBindings = new FieldBinding[count];

-	HashtableOfObject knownFieldNames = new HashtableOfObject(count);

-	boolean duplicate = false;

-	count = 0;

-	for (int i = 0; i < size; i++) {

-		FieldDeclaration field = fields[i];

-		if (!field.isField()) {

-			if (referenceContext.binding.isInterface())

-				problemReporter().interfaceCannotHaveInitializers(referenceContext.binding, field);

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if (supertype.isInterface()) {

+			sourceType.superclass = getJavaLangObject();

+			sourceType.superInterfaces = new ReferenceBinding[] { supertype };

 		} else {

-			FieldBinding fieldBinding = new FieldBinding(field, null, referenceContext.binding); // field's type will be resolved when needed for top level types

-			checkAndSetModifiersForField(fieldBinding, field);

+			sourceType.superclass = supertype;

+			sourceType.superInterfaces = TypeBinding.NoSuperInterfaces;

+		}

+		connectMemberTypes();

+		buildFieldsAndMethods();

+		sourceType.verifyMethods(environment().methodVerifier());

+	}

+	

+	private void buildFields() {

+		if (referenceContext.fields == null) {

+			referenceContext.binding.fields = NoFields;

+			return;

+		}

+		// count the number of fields vs. initializers

+		FieldDeclaration[] fields = referenceContext.fields;

+		int size = fields.length;

+		int count = 0;

+		for (int i = 0; i < size; i++)

+			if (fields[i].isField())

+				count++;

 

-			if (knownFieldNames.containsKey(field.name)) {

-				duplicate = true;

-				FieldBinding previousBinding = (FieldBinding) knownFieldNames.get(field.name);

-				if (previousBinding != null) {

-					for (int f = 0; f < i; f++) {

-						FieldDeclaration previousField = fields[f];

-						if (previousField.binding == previousBinding) {

-							problemReporter().duplicateFieldInType(referenceContext.binding, previousField);

-							previousField.binding = null;

-							break;

+		// iterate the field declarations to create the bindings, lose all duplicates

+		FieldBinding[] fieldBindings = new FieldBinding[count];

+		HashtableOfObject knownFieldNames = new HashtableOfObject(count);

+		boolean duplicate = false;

+		count = 0;

+		for (int i = 0; i < size; i++) {

+			FieldDeclaration field = fields[i];

+			if (!field.isField()) {

+				if (referenceContext.binding.isInterface())

+					problemReporter().interfaceCannotHaveInitializers(referenceContext.binding, field);

+			} else {

+				FieldBinding fieldBinding = new FieldBinding(field, null, referenceContext.binding);

+				// field's type will be resolved when needed for top level types

+				checkAndSetModifiersForField(fieldBinding, field);

+

+				if (knownFieldNames.containsKey(field.name)) {

+					duplicate = true;

+					FieldBinding previousBinding = (FieldBinding) knownFieldNames.get(field.name);

+					if (previousBinding != null) {

+						for (int f = 0; f < i; f++) {

+							FieldDeclaration previousField = fields[f];

+							if (previousField.binding == previousBinding) {

+								problemReporter().duplicateFieldInType(referenceContext.binding, previousField);

+								previousField.binding = null;

+								break;

+							}

+						}

+					}

+					knownFieldNames.put(field.name, null); // ensure that the duplicate field is found & removed

+					problemReporter().duplicateFieldInType(referenceContext.binding, field);

+					field.binding = null;

+				} else {

+					knownFieldNames.put(field.name, fieldBinding);

+					// remember that we have seen a field with this name

+					if (fieldBinding != null)

+						fieldBindings[count++] = fieldBinding;

+				}

+			}

+		}

+		// remove duplicate fields

+		if (duplicate) {

+			FieldBinding[] newFieldBindings = new FieldBinding[knownFieldNames.size() - 1];

+			// we know we'll be removing at least 1 duplicate name

+			size = count;

+			count = 0;

+			for (int i = 0; i < size; i++) {

+				FieldBinding fieldBinding = fieldBindings[i];

+				if (knownFieldNames.get(fieldBinding.name) != null)

+					newFieldBindings[count++] = fieldBinding;

+			}

+			fieldBindings = newFieldBindings;

+		}

+

+		if (count != fieldBindings.length)

+			System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count);

+		for (int i = 0; i < count; i++)

+			fieldBindings[i].id = i;

+		referenceContext.binding.fields = fieldBindings;

+		if (referenceContext.binding.isLocalType())

+			referenceContext.binding.fields();

+		// fault the types for the local type's fields now since we need them

+	}

+	

+	void buildFieldsAndMethods() {

+		buildFields();

+		buildMethods();

+

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if (sourceType.isMemberType() && !sourceType.isLocalType())

+			 ((MemberTypeBinding) sourceType).checkSyntheticArgsAndFields();

+

+		ReferenceBinding[] memberTypes = sourceType.memberTypes;

+		for (int i = 0, length = memberTypes.length; i < length; i++)

+			 ((SourceTypeBinding) memberTypes[i]).scope.buildFieldsAndMethods();

+	}

+	

+	private LocalTypeBinding buildLocalType(

+		SourceTypeBinding enclosingType,

+		PackageBinding packageBinding) {

+		referenceContext.scope = this;

+		referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true);

+		referenceContext.initializerScope = new MethodScope(this, referenceContext, false);

+

+		// build the binding or the local type

+		LocalTypeBinding localType = new LocalTypeBinding(this, enclosingType);

+		referenceContext.binding = localType;

+		checkAndSetModifiers();

+

+		// Look at member types

+		ReferenceBinding[] memberTypeBindings = NoMemberTypes;

+		if (referenceContext.memberTypes != null) {

+			int size = referenceContext.memberTypes.length;

+			memberTypeBindings = new ReferenceBinding[size];

+			int count = 0;

+			nextMember : for (int i = 0; i < size; i++) {

+				TypeDeclaration memberContext = referenceContext.memberTypes[i];

+				if (memberContext.isInterface()) {

+					problemReporter().nestedClassCannotDeclareInterface(memberContext);

+					continue nextMember;

+				}

+				ReferenceBinding type = localType;

+				// check that the member does not conflict with an enclosing type

+				do {

+					if (CharOperation.equals(type.sourceName, memberContext.name)) {

+						problemReporter().hidingEnclosingType(memberContext);

+						continue nextMember;

+					}

+					type = type.enclosingType();

+				} while (type != null);

+				// check the member type does not conflict with another sibling member type

+				for (int j = 0; j < i; j++) {

+					if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) {

+						problemReporter().duplicateNestedType(memberContext);

+						continue nextMember;

+					}

+				}

+

+				ClassScope memberScope = new ClassScope(this, referenceContext.memberTypes[i]);

+				LocalTypeBinding memberBinding = memberScope.buildLocalType(localType, packageBinding);

+				memberBinding.setAsMemberType();

+				memberTypeBindings[count++] = memberBinding;

+			}

+			if (count != size)

+				System.arraycopy(memberTypeBindings, 0, memberTypeBindings = new ReferenceBinding[count], 0, count);

+		}

+		localType.memberTypes = memberTypeBindings;

+		return localType;

+	}

+	

+	void buildLocalTypeBinding(SourceTypeBinding enclosingType) {

+		buildLocalType(enclosingType, enclosingType.fPackage);

+		connectTypeHierarchy();

+		buildFieldsAndMethods();

+		referenceContext.binding.verifyMethods(environment().methodVerifier());

+	}

+	

+	private void buildMethods() {

+		if (referenceContext.methods == null) {

+			referenceContext.binding.methods = NoMethods;

+			return;

+		}

+

+		// iterate the method declarations to create the bindings

+		AbstractMethodDeclaration[] methods = referenceContext.methods;

+		int size = methods.length;

+		int clinitIndex = -1;

+		for (int i = 0; i < size; i++) {

+			if (methods[i] instanceof Clinit) {

+				clinitIndex = i;

+				break;

+			}

+		}

+		MethodBinding[] methodBindings = new MethodBinding[clinitIndex == -1 ? size : size - 1];

+

+		int count = 0;

+		for (int i = 0; i < size; i++) {

+			if (i != clinitIndex) {

+				MethodScope scope = new MethodScope(this, methods[i], false);

+				MethodBinding methodBinding = scope.createMethod(methods[i]);

+				if (methodBinding != null) // is null if binding could not be created

+					methodBindings[count++] = methodBinding;

+			}

+		}

+		if (count != methodBindings.length)

+			System.arraycopy(methodBindings, 0, methodBindings = new MethodBinding[count], 0, count);

+

+		referenceContext.binding.methods = methodBindings;

+		referenceContext.binding.modifiers |= AccUnresolved; // until methods() is sent

+		if (referenceContext.binding.isLocalType())

+			referenceContext.binding.methods();

+		// fault the types for the local type's methods now since we need them

+	}

+	SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding) {

+		// provide the typeDeclaration with needed scopes

+		referenceContext.scope = this;

+		referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true);

+		referenceContext.initializerScope = new MethodScope(this, referenceContext, false);

+

+		if (enclosingType == null) {

+			char[][] className = CharOperation.arrayConcat(packageBinding.compoundName, referenceContext.name);

+			referenceContext.binding = new SourceTypeBinding(className, packageBinding, this);

+		} else {

+			char[][] className = CharOperation.deepCopy(enclosingType.compoundName);

+			className[className.length - 1] =

+				CharOperation.concat(className[className.length - 1], referenceContext.name, '$');

+			referenceContext.binding = new MemberTypeBinding(className, this, enclosingType);

+		}

+

+		SourceTypeBinding sourceType = referenceContext.binding;

+		sourceType.fPackage.addType(sourceType);

+		checkAndSetModifiers();

+

+		// Look at member types

+		ReferenceBinding[] memberTypeBindings = NoMemberTypes;

+		if (referenceContext.memberTypes != null) {

+			int size = referenceContext.memberTypes.length;

+			memberTypeBindings = new ReferenceBinding[size];

+			int count = 0;

+			nextMember : for (int i = 0; i < size; i++) {

+				TypeDeclaration memberContext = referenceContext.memberTypes[i];

+				if (memberContext.isInterface()

+					&& sourceType.isNestedType()

+					&& sourceType.isClass()

+					&& !sourceType.isStatic()) {

+					problemReporter().nestedClassCannotDeclareInterface(memberContext);

+					continue nextMember;

+				}

+				ReferenceBinding type = sourceType;

+				// check that the member does not conflict with an enclosing type

+				do {

+					if (CharOperation.equals(type.sourceName, memberContext.name)) {

+						problemReporter().hidingEnclosingType(memberContext);

+						continue nextMember;

+					}

+					type = type.enclosingType();

+				} while (type != null);

+				// check that the member type does not conflict with another sibling member type

+				for (int j = 0; j < i; j++) {

+					if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) {

+						problemReporter().duplicateNestedType(memberContext);

+						continue nextMember;

+					}

+				}

+

+				ClassScope memberScope = new ClassScope(this, memberContext);

+				memberTypeBindings[count++] = memberScope.buildType(sourceType, packageBinding);

+			}

+			if (count != size)

+				System.arraycopy(memberTypeBindings, 0, memberTypeBindings = new ReferenceBinding[count], 0, count);

+		}

+		sourceType.memberTypes = memberTypeBindings;

+		return sourceType;

+	}

+	

+	private void checkAndSetModifiers() {

+		SourceTypeBinding sourceType = referenceContext.binding;

+		int modifiers = sourceType.modifiers;

+		if ((modifiers & AccAlternateModifierProblem) != 0)

+			problemReporter().duplicateModifierForType(sourceType);

+

+		if (sourceType.isMemberType()) {

+			// checks for member types before local types to catch local members

+			if (sourceType.enclosingType().isStrictfp())

+				modifiers |= AccStrictfp;

+			if (sourceType.enclosingType().isDeprecated())

+				modifiers |= AccDeprecatedImplicitly;

+			if (sourceType.enclosingType().isInterface())

+				modifiers |= AccPublic;

+		} else if (sourceType.isLocalType()) {

+			if (sourceType.isAnonymousType())

+				modifiers |= AccFinal;

+			ReferenceContext refContext = methodScope().referenceContext;

+			if (refContext instanceof TypeDeclaration) {

+				ReferenceBinding type = ((TypeDeclaration) refContext).binding;

+				if (type.isStrictfp())

+					modifiers |= AccStrictfp;

+				if (type.isDeprecated())

+					modifiers |= AccDeprecatedImplicitly;

+			} else {

+				MethodBinding method = ((AbstractMethodDeclaration) refContext).binding;

+				if (method.isStrictfp())

+					modifiers |= AccStrictfp;

+				if (method.isDeprecated())

+					modifiers |= AccDeprecatedImplicitly;

+			}

+		}

+		// after this point, tests on the 16 bits reserved.

+		int realModifiers = modifiers & AccJustFlag;

+

+		if ((realModifiers & AccInterface) != 0) {

+			// detect abnormal cases for interfaces

+			if (sourceType.isMemberType()) {

+				int unexpectedModifiers =

+					~(AccPublic | AccPrivate | AccProtected | AccStatic | AccAbstract | AccInterface | AccStrictfp);

+				if ((realModifiers & unexpectedModifiers) != 0)

+					problemReporter().illegalModifierForMemberInterface(sourceType);

+				/*

+				} else if (sourceType.isLocalType()) { //interfaces cannot be defined inside a method

+					int unexpectedModifiers = ~(AccAbstract | AccInterface | AccStrictfp);

+					if ((realModifiers & unexpectedModifiers) != 0)

+						problemReporter().illegalModifierForLocalInterface(sourceType);

+				*/

+			} else {

+				int unexpectedModifiers = ~(AccPublic | AccAbstract | AccInterface | AccStrictfp);

+				if ((realModifiers & unexpectedModifiers) != 0)

+					problemReporter().illegalModifierForInterface(sourceType);

+			}

+			modifiers |= AccAbstract;

+		} else {

+			// detect abnormal cases for types

+			if (sourceType.isMemberType()) { // includes member types defined inside local types

+				int unexpectedModifiers =

+					~(AccPublic | AccPrivate | AccProtected | AccStatic | AccAbstract | AccFinal | AccStrictfp);

+				if ((realModifiers & unexpectedModifiers) != 0)

+					problemReporter().illegalModifierForMemberClass(sourceType);

+			} else if (sourceType.isLocalType()) {

+				int unexpectedModifiers = ~(AccAbstract | AccFinal | AccStrictfp);

+				if ((realModifiers & unexpectedModifiers) != 0)

+					problemReporter().illegalModifierForLocalClass(sourceType);

+			} else {

+				int unexpectedModifiers = ~(AccPublic | AccAbstract | AccFinal | AccStrictfp);

+				if ((realModifiers & unexpectedModifiers) != 0)

+					problemReporter().illegalModifierForClass(sourceType);

+			}

+

+			// check that Final and Abstract are not set together

+			if ((realModifiers & (AccFinal | AccAbstract)) == (AccFinal | AccAbstract))

+				problemReporter().illegalModifierCombinationFinalAbstractForClass(sourceType);

+		}

+

+		if (sourceType.isMemberType()) {

+			// test visibility modifiers inconsistency, isolate the accessors bits

+			if (sourceType.enclosingType().isInterface()) {

+				if ((realModifiers & (AccProtected | AccPrivate)) != 0) {

+					problemReporter().illegalVisibilityModifierForInterfaceMemberType(sourceType);

+

+					// need to keep the less restrictive

+					if ((realModifiers & AccProtected) != 0)

+						modifiers ^= AccProtected;

+					if ((realModifiers & AccPrivate) != 0)

+						modifiers ^= AccPrivate;

+				}

+			} else {

+				int accessorBits = realModifiers & (AccPublic | AccProtected | AccPrivate);

+				if ((accessorBits & (accessorBits - 1)) > 1) {

+					problemReporter().illegalVisibilityModifierCombinationForMemberType(sourceType);

+

+					// need to keep the less restrictive

+					if ((accessorBits & AccPublic) != 0) {

+						if ((accessorBits & AccProtected) != 0)

+							modifiers ^= AccProtected;

+						if ((accessorBits & AccPrivate) != 0)

+							modifiers ^= AccPrivate;

+					}

+					if ((accessorBits & AccProtected) != 0)

+						if ((accessorBits & AccPrivate) != 0)

+							modifiers ^= AccPrivate;

+				}

+			}

+

+			// static modifier test

+			if ((realModifiers & AccStatic) == 0) {

+				if (sourceType.enclosingType().isInterface())

+					modifiers |= AccStatic;

+			} else {

+				if (!sourceType.enclosingType().isStatic())

+					// error the enclosing type of a static field must be static or a top-level type

+					problemReporter().illegalStaticModifierForMemberType(sourceType);

+			}

+		}

+

+		sourceType.modifiers = modifiers;

+	}

+	

+	/* This method checks the modifiers of a field.

+	*

+	* 9.3 & 8.3

+	* Need to integrate the check for the final modifiers for nested types

+	*

+	* Note : A scope is accessible by : fieldBinding.declaringClass.scope

+	*/

+	private void checkAndSetModifiersForField(FieldBinding fieldBinding, FieldDeclaration fieldDecl) {

+		int modifiers = fieldBinding.modifiers;

+		if ((modifiers & AccAlternateModifierProblem) != 0)

+			problemReporter().duplicateModifierForField(fieldBinding.declaringClass, fieldDecl);

+

+		if (fieldBinding.declaringClass.isInterface()) {

+			int expectedValue = AccPublic | AccStatic | AccFinal;

+			// set the modifiers

+			modifiers |= expectedValue;

+

+			// and then check that they are the only ones

+			if ((modifiers & AccJustFlag) != expectedValue)

+				problemReporter().illegalModifierForInterfaceField(fieldBinding.declaringClass, fieldDecl);

+			fieldBinding.modifiers = modifiers;

+			return;

+		}

+

+		// after this point, tests on the 16 bits reserved.

+		int realModifiers = modifiers & AccJustFlag;

+		int unexpectedModifiers =

+			~(AccPublic | AccPrivate | AccProtected | AccFinal | AccStatic | AccTransient | AccVolatile);

+		if ((realModifiers & unexpectedModifiers) != 0)

+			problemReporter().illegalModifierForField(fieldBinding.declaringClass, fieldDecl);

+

+		int accessorBits = realModifiers & (AccPublic | AccProtected | AccPrivate);

+		if ((accessorBits & (accessorBits - 1)) > 1) {

+			problemReporter().illegalVisibilityModifierCombinationForField(

+				fieldBinding.declaringClass,

+				fieldDecl);

+

+			// need to keep the less restrictive

+			if ((accessorBits & AccPublic) != 0) {

+				if ((accessorBits & AccProtected) != 0)

+					modifiers ^= AccProtected;

+				if ((accessorBits & AccPrivate) != 0)

+					modifiers ^= AccPrivate;

+			}

+			if ((accessorBits & AccProtected) != 0)

+				if ((accessorBits & AccPrivate) != 0)

+					modifiers ^= AccPrivate;

+		}

+

+		if ((realModifiers & (AccFinal | AccVolatile)) == (AccFinal | AccVolatile))

+			problemReporter().illegalModifierCombinationFinalVolatileForField(

+				fieldBinding.declaringClass,

+				fieldDecl);

+

+		fieldBinding.modifiers = modifiers;

+	}

+	

+	private void checkForInheritedMemberTypes(SourceTypeBinding sourceType) {

+		// search up the hierarchy of the sourceType to see if any superType defines a member type

+		// when no member types are defined, tag the sourceType & each superType with the HasNoMemberTypes bit

+		ReferenceBinding currentType = sourceType;

+		ReferenceBinding[][] interfacesToVisit = null;

+		int lastPosition = -1;

+		do {

+			if ((currentType.tagBits & HasNoMemberTypes) != 0)

+				break; // already know it has no inherited member types, can stop looking up

+			if (currentType.memberTypes() != NoMemberTypes)

+				return; // has member types

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				if (interfacesToVisit == null)

+					interfacesToVisit = new ReferenceBinding[5][];

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

+			}

+		} while ((currentType = currentType.superclass()) != null);

+

+		boolean hasMembers = false;

+		if (interfacesToVisit != null) {

+			done : for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++) {

+					ReferenceBinding anInterface = interfaces[j];

+					if ((anInterface.tagBits & InterfaceVisited) == 0) { // if interface as not already been visited

+						anInterface.tagBits |= InterfaceVisited;

+						if ((anInterface.tagBits & HasNoMemberTypes) != 0)

+							continue; // already know it has no inherited member types

+						if (anInterface.memberTypes() != NoMemberTypes) {

+							hasMembers = true;

+							break done;

+						}

+

+						ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

+						if (itsInterfaces != NoSuperInterfaces) {

+							if (++lastPosition == interfacesToVisit.length)

+								System.arraycopy(

+									interfacesToVisit,

+									0,

+									interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+									0,

+									lastPosition);

+							interfacesToVisit[lastPosition] = itsInterfaces;

 						}

 					}

 				}

-				knownFieldNames.put(field.name, null); // ensure that the duplicate field is found & removed

-				problemReporter().duplicateFieldInType(referenceContext.binding, field);

-				field.binding = null;

+			}

+

+			for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++) {

+					interfaces[j].tagBits &= ~InterfaceVisited;

+					if (!hasMembers)

+						interfaces[j].tagBits |= HasNoMemberTypes;

+				}

+			}

+		}

+

+		if (!hasMembers) {

+			currentType = sourceType;

+			do {

+				currentType.tagBits |= HasNoMemberTypes;

+			} while ((currentType = currentType.superclass()) != null);

+		}

+	}

+	

+	private void connectMemberTypes() {

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if (sourceType.memberTypes != NoMemberTypes)

+			for (int i = 0, size = sourceType.memberTypes.length; i < size; i++)

+				 ((SourceTypeBinding) sourceType.memberTypes[i]).scope.connectTypeHierarchy();

+	}

+	/*

+		Our current belief based on available JCK tests is:

+			inherited member types are visible as a potential superclass.

+			inherited interfaces are not visible when defining a superinterface.

+	

+		Error recovery story:

+			ensure the superclass is set to java.lang.Object if a problem is detected

+			resolving the superclass.

+	

+		Answer false if an error was reported against the sourceType.

+	*/

+	private boolean connectSuperclass() {

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if (referenceContext.superclass == null) {

+			if (isJavaLangObject(sourceType))

+				return true;

+			sourceType.superclass = getJavaLangObject();

+			compilationUnitScope().addTypeReference(sourceType.superclass);

+			return !detectCycle(sourceType, sourceType.superclass, null);

+			// ensure Object is initialized if it comes from a source file

+		}

+		ReferenceBinding superclass = findSupertype(referenceContext.superclass);

+		if (superclass != null) { // is null if a cycle was detected cycle

+			if (!superclass.isValidBinding()) {

+				problemReporter().invalidSuperclass(sourceType, referenceContext.superclass, superclass);

+			} else if (superclass.isInterface()) {

+				problemReporter().superclassMustBeAClass(sourceType, referenceContext.superclass, superclass);

+			} else if (superclass.isFinal()) {

+				problemReporter().classExtendFinalClass(sourceType, referenceContext.superclass, superclass);

+			} else if (isJavaLangObject(sourceType)) {

+				// can only happen if Object extends another type... will never happen unless we're testing for it.

+				sourceType.tagBits |= HierarchyHasProblems;

+				sourceType.superclass = null;

+				return true;

 			} else {

-				knownFieldNames.put(field.name, fieldBinding); // remember that we have seen a field with this name

-				if (fieldBinding != null)

-					fieldBindings[count++] = fieldBinding;

+				// only want to reach here when no errors are reported

+				referenceContext.superclass.binding = superclass;

+				sourceType.superclass = superclass;

+				return true;

 			}

 		}

-	}

-

-	// remove duplicate fields

-	if (duplicate) {

-		FieldBinding[] newFieldBindings = new FieldBinding[knownFieldNames.size() - 1]; // we know we'll be removing at least 1 duplicate name

-		size = count;

-		count = 0;

-		for (int i = 0; i < size; i++) {

-			FieldBinding fieldBinding = fieldBindings[i];

-			if (knownFieldNames.get(fieldBinding.name) != null)

-				newFieldBindings[count++] = fieldBinding;

+		sourceType.tagBits |= HierarchyHasProblems;

+		if (!isJavaLangObject(sourceType)) {

+			sourceType.superclass = getJavaLangObject();

+			if ((sourceType.superclass.tagBits & BeginHierarchyCheck) == 0)

+				detectCycle(sourceType, sourceType.superclass, null);

+			// ensure Object is initialized if it comes from a source file

 		}

-		fieldBindings = newFieldBindings;

+		return false; // reported some error against the source type

 	}

 

-	if (count != fieldBindings.length)

-		System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count);

-	for (int i = 0; i < count; i++)

-		fieldBindings[i].id = i;

-	referenceContext.binding.fields = fieldBindings;

-	if (referenceContext.binding.isLocalType())

-		referenceContext.binding.fields(); // fault the types for the local type's fields now since we need them

-}

-void buildFieldsAndMethods() {

-	buildFields();

-	buildMethods();

-

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if (sourceType.isMemberType() && !sourceType.isLocalType())

-		((MemberTypeBinding) sourceType).checkSyntheticArgsAndFields();

-

-	ReferenceBinding[] memberTypes = sourceType.memberTypes;

-	for (int i = 0, length = memberTypes.length; i < length; i++)

-		((SourceTypeBinding) memberTypes[i]).scope.buildFieldsAndMethods();

-}

-private LocalTypeBinding buildLocalType(SourceTypeBinding enclosingType, PackageBinding packageBinding) {

-	referenceContext.scope = this;

-	referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true);

-	referenceContext.initializerScope = new MethodScope(this, referenceContext, false);

-

-	// build the binding or the local type

-	LocalTypeBinding localType = new LocalTypeBinding(this, enclosingType);

-	referenceContext.binding = localType;

-	checkAndSetModifiers();

-

-	// Look at member types

-	ReferenceBinding[] memberTypeBindings = NoMemberTypes;

-	if (referenceContext.memberTypes != null) {

-		int size = referenceContext.memberTypes.length;

-		memberTypeBindings = new ReferenceBinding[size];

-		int count = 0;

-		nextMember: for (int i = 0; i < size; i++) {

-			TypeDeclaration memberContext = referenceContext.memberTypes[i];

-			if (memberContext.isInterface()) {

-				problemReporter().nestedClassCannotDeclareInterface(memberContext);

-				continue nextMember;

-			}

-			ReferenceBinding type = localType;

-			// check that the member does not conflict with an enclosing type

-			do {

-				if (CharOperation.equals(type.sourceName, memberContext.name)) {

-					problemReporter().hidingEnclosingType(memberContext);

-					continue nextMember;

-				}

-				type = type.enclosingType();

-			} while (type != null);

-			// check the member type does not conflict with another sibling member type

-			for (int j = 0; j < i; j++) {

-				if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) {

-					problemReporter().duplicateNestedType(memberContext);

-					continue nextMember;

-				}

-			}

-

-			ClassScope memberScope = new ClassScope(this, referenceContext.memberTypes[i]);

-			LocalTypeBinding memberBinding = memberScope.buildLocalType(localType, packageBinding);

-			memberBinding.setAsMemberType();

-			memberTypeBindings[count++] = memberBinding;

-		}

-		if (count != size)

-			System.arraycopy(memberTypeBindings, 0, memberTypeBindings = new ReferenceBinding[count], 0, count);

-	}

-	localType.memberTypes = memberTypeBindings;

-	return localType;

-}

-void buildLocalTypeBinding(SourceTypeBinding enclosingType) {

-	buildLocalType(enclosingType, enclosingType.fPackage);

-	connectTypeHierarchy();

-	buildFieldsAndMethods();

-	referenceContext.binding.verifyMethods(environment().methodVerifier());

-}

-private void buildMethods() {

-	if (referenceContext.methods == null) {

-		referenceContext.binding.methods = NoMethods;

-		return;

-	}

-

-	// iterate the method declarations to create the bindings

-	AbstractMethodDeclaration[] methods = referenceContext.methods;

-	int size = methods.length;

-	int clinitIndex = -1;

-	for (int i = 0; i < size; i++) {

-		if (methods[i] instanceof Clinit) {

-			clinitIndex = i;

-			break;

-		}

-	}

-	MethodBinding[] methodBindings = new MethodBinding[clinitIndex == -1 ? size : size - 1];

-

-	int count = 0;

-	for (int i = 0; i < size; i++) {

-		if (i != clinitIndex) {

-			MethodScope scope = new MethodScope(this, methods[i], false);

-			MethodBinding methodBinding = scope.createMethod(methods[i]);

-			if (methodBinding != null) // is null if binding could not be created

-				methodBindings[count++] = methodBinding;

-		}

-	}

-	if (count != methodBindings.length)

-		System.arraycopy(methodBindings, 0, methodBindings = new MethodBinding[count], 0, count);

-

-	referenceContext.binding.methods = methodBindings;

-	referenceContext.binding.modifiers |= AccUnresolved; // until methods() is sent

-	if (referenceContext.binding.isLocalType())

-		referenceContext.binding.methods(); // fault the types for the local type's methods now since we need them

-}

-SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding) {

-	// provide the typeDeclaration with needed scopes

-	referenceContext.scope = this;

-	referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true);

-	referenceContext.initializerScope = new MethodScope(this, referenceContext, false);

-

-	if (enclosingType == null) {

-		char[][] className = CharOperation.arrayConcat(packageBinding.compoundName, referenceContext.name);

-		referenceContext.binding = new SourceTypeBinding(className, packageBinding, this);

-	} else {

-		char[][] className = CharOperation.deepCopy(enclosingType.compoundName);

-		className[className.length - 1] = CharOperation.concat(className[className.length - 1], referenceContext.name, '$');

-		referenceContext.binding = new MemberTypeBinding(className, this, enclosingType);

-	}

-

-	SourceTypeBinding sourceType = referenceContext.binding;

-	sourceType.fPackage.addType(sourceType);

-	checkAndSetModifiers();

-

-	// Look at member types

-	ReferenceBinding[] memberTypeBindings = NoMemberTypes;

-	if (referenceContext.memberTypes != null) {

-		int size = referenceContext.memberTypes.length;

-		memberTypeBindings = new ReferenceBinding[size];

-		int count = 0;

-		nextMember: for (int i = 0; i < size; i++) {

-			TypeDeclaration memberContext = referenceContext.memberTypes[i];

-			if (memberContext.isInterface() && sourceType.isNestedType() && sourceType.isClass() && !sourceType.isStatic()) {

-				problemReporter().nestedClassCannotDeclareInterface(memberContext);

-				continue nextMember;

-			}

-			ReferenceBinding type = sourceType;

-			// check that the member does not conflict with an enclosing type

-			do {

-				if (CharOperation.equals(type.sourceName, memberContext.name)) {

-					problemReporter().hidingEnclosingType(memberContext);

-					continue nextMember;

-				}

-				type = type.enclosingType();

-			} while (type != null);

-			// check that the member type does not conflict with another sibling member type

-			for (int j = 0; j < i; j++) {

-				if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) {

-					problemReporter().duplicateNestedType(memberContext);

-					continue nextMember;

-				}

-			}

-

-			ClassScope memberScope = new ClassScope(this, memberContext);

-			memberTypeBindings[count++] = memberScope.buildType(sourceType, packageBinding);

-		}

-		if (count != size)

-			System.arraycopy(memberTypeBindings, 0, memberTypeBindings = new ReferenceBinding[count], 0, count);

-	}

-	sourceType.memberTypes = memberTypeBindings;

-	return sourceType;

-}

-private void checkAndSetModifiers() {

-	SourceTypeBinding sourceType = referenceContext.binding;

-	int modifiers = sourceType.modifiers;

-	if ((modifiers & AccAlternateModifierProblem) != 0)

-		problemReporter().duplicateModifierForType(sourceType);

-

-	if (sourceType.isMemberType()) { // checks for member types before local types to catch local members

-		if (sourceType.enclosingType().isStrictfp())

-			modifiers |= AccStrictfp;

-		if (sourceType.enclosingType().isDeprecated())

-			modifiers |= AccDeprecatedImplicitly;

-		if (sourceType.enclosingType().isInterface())

-			modifiers |= AccPublic;

-	} else if (sourceType.isLocalType()) {

-		if (sourceType.isAnonymousType())

-			modifiers |= AccFinal;

-		ReferenceContext refContext = methodScope().referenceContext;

-		if (refContext instanceof TypeDeclaration) {

-			ReferenceBinding type = ((TypeDeclaration) refContext).binding;

-			if (type.isStrictfp())

-				modifiers |= AccStrictfp;

-			if (type.isDeprecated())

-				modifiers |= AccDeprecatedImplicitly;

-		} else {

-			MethodBinding method = ((AbstractMethodDeclaration) refContext).binding;

-			if (method.isStrictfp())

-				modifiers |= AccStrictfp;

-			if (method.isDeprecated())

-				modifiers |= AccDeprecatedImplicitly;

-		}

-	}

-

-	// after this point, tests on the 16 bits reserved.

-	int realModifiers = modifiers & AccJustFlag;

-

-	if ((realModifiers & AccInterface) != 0) {

-		// detect abnormal cases for interfaces

-		if (sourceType.isMemberType()) {

-			int unexpectedModifiers = ~(AccPublic | AccPrivate | AccProtected | AccStatic | AccAbstract | AccInterface | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForMemberInterface(sourceType);

-		/*

-		} else if (sourceType.isLocalType()) { //interfaces cannot be defined inside a method

-			int unexpectedModifiers = ~(AccAbstract | AccInterface | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForLocalInterface(sourceType);

-		*/

-		} else {

-			int unexpectedModifiers = ~(AccPublic | AccAbstract | AccInterface | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForInterface(sourceType);

-		}

-		modifiers |= AccAbstract;

-	} else {

-		// detect abnormal cases for types

-		if (sourceType.isMemberType()) { // includes member types defined inside local types

-			int unexpectedModifiers = ~(AccPublic | AccPrivate | AccProtected | AccStatic | AccAbstract | AccFinal | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForMemberClass(sourceType);

-		} else if (sourceType.isLocalType()) {

-			int unexpectedModifiers = ~(AccAbstract | AccFinal | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForLocalClass(sourceType);

-		} else {

-			int unexpectedModifiers = ~(AccPublic | AccAbstract | AccFinal | AccStrictfp);

-			if ((realModifiers & unexpectedModifiers) != 0)

-				problemReporter().illegalModifierForClass(sourceType);

-		}

-

-		// check that Final and Abstract are not set together

-		if ((realModifiers & (AccFinal | AccAbstract)) == (AccFinal | AccAbstract))

-			problemReporter().illegalModifierCombinationFinalAbstractForClass(sourceType);

-	}

-

-	if (sourceType.isMemberType()) {

-		// test visibility modifiers inconsistency, isolate the accessors bits

-		if (sourceType.enclosingType().isInterface()) {

-			if ((realModifiers & (AccProtected | AccPrivate)) != 0) {

-				problemReporter().illegalVisibilityModifierForInterfaceMemberType(sourceType);

-

-				// need to keep the less restrictive

-				if ((realModifiers & AccProtected) != 0)

-					modifiers ^= AccProtected;

-				if ((realModifiers & AccPrivate) != 0)

-					modifiers ^= AccPrivate;

-			}

-		} else {

-			int accessorBits = realModifiers & (AccPublic | AccProtected | AccPrivate);

-			if ((accessorBits & (accessorBits - 1)) > 1) {

-				problemReporter().illegalVisibilityModifierCombinationForMemberType(sourceType);

-

-				// need to keep the less restrictive

-				if ((accessorBits & AccPublic) != 0) {

-					if ((accessorBits & AccProtected) != 0)

-						modifiers ^= AccProtected;

-					if ((accessorBits & AccPrivate) != 0)

-						modifiers ^= AccPrivate;

-				}

-				if ((accessorBits & AccProtected) != 0)

-					if ((accessorBits & AccPrivate) != 0)

-						modifiers ^= AccPrivate;

-			}

-		}

-

-		// static modifier test

-		if ((realModifiers & AccStatic) == 0) {

-			if (sourceType.enclosingType().isInterface())

-				modifiers |= AccStatic;

-		} else {

-			if (!sourceType.enclosingType().isStatic())

-				// error the enclosing type of a static field must be static or a top-level type

-				problemReporter().illegalStaticModifierForMemberType(sourceType);

-		}

-	}

-

-	sourceType.modifiers = modifiers;

-}

-/* This method checks the modifiers of a field.

-*

-* 9.3 & 8.3

-* Need to integrate the check for the final modifiers for nested types

-*

-* Note : A scope is accessible by : fieldBinding.declaringClass.scope

-*/

-

-private void checkAndSetModifiersForField(FieldBinding fieldBinding, FieldDeclaration fieldDecl) {

-	int modifiers = fieldBinding.modifiers;

-	if ((modifiers & AccAlternateModifierProblem) != 0)

-		problemReporter().duplicateModifierForField(fieldBinding.declaringClass, fieldDecl);

-

-	if (fieldBinding.declaringClass.isInterface()) {

-		int expectedValue = AccPublic | AccStatic | AccFinal;

-		// set the modifiers

-		modifiers |= expectedValue;

-

-		// and then check that they are the only ones

-		if ((modifiers & AccJustFlag) != expectedValue)

-			problemReporter().illegalModifierForInterfaceField(fieldBinding.declaringClass, fieldDecl);

-		fieldBinding.modifiers = modifiers;

-		return;

-	}

-

-	// after this point, tests on the 16 bits reserved.

-	int realModifiers = modifiers & AccJustFlag;

-	int unexpectedModifiers = ~(AccPublic | AccPrivate | AccProtected | AccFinal | AccStatic | AccTransient | AccVolatile);

-	if ((realModifiers & unexpectedModifiers) != 0)

-		problemReporter().illegalModifierForField(fieldBinding.declaringClass, fieldDecl);

-

-	int accessorBits = realModifiers & (AccPublic | AccProtected | AccPrivate);

-	if ((accessorBits & (accessorBits - 1)) > 1) {

-		problemReporter().illegalVisibilityModifierCombinationForField(fieldBinding.declaringClass, fieldDecl);

-

-		// need to keep the less restrictive

-		if ((accessorBits & AccPublic) != 0) {

-			if ((accessorBits & AccProtected) != 0)

-				modifiers ^= AccProtected;

-			if ((accessorBits & AccPrivate) != 0)

-				modifiers ^= AccPrivate;

-		}

-		if ((accessorBits & AccProtected) != 0)

-			if ((accessorBits & AccPrivate) != 0)

-				modifiers ^= AccPrivate;

-	}

-

-	if ((realModifiers & (AccFinal | AccVolatile)) == (AccFinal | AccVolatile))

-		problemReporter().illegalModifierCombinationFinalVolatileForField(fieldBinding.declaringClass, fieldDecl);

-

-	fieldBinding.modifiers = modifiers;

-}

-private void checkForInheritedMemberTypes(SourceTypeBinding sourceType) {

-	// search up the hierarchy of the sourceType to see if any superType defines a member type

-	// when no member types are defined, tag the sourceType & each superType with the HasNoMemberTypes bit

-	ReferenceBinding currentType = sourceType;

-	ReferenceBinding[][] interfacesToVisit = null;

-	int lastPosition = -1;

-	do {

-		if ((currentType.tagBits & HasNoMemberTypes) != 0) break; // already know it has no inherited member types, can stop looking up

-		if (currentType.memberTypes() != NoMemberTypes) return; // has member types

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			if (interfacesToVisit == null)

-				interfacesToVisit = new ReferenceBinding[5][];

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-		}

-	} while ((currentType = currentType.superclass()) != null);

-

-	boolean hasMembers = false;

-	if (interfacesToVisit != null) {

-		done : for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				ReferenceBinding anInterface = interfaces[j];

-				if ((anInterface.tagBits & InterfaceVisited) == 0) { // if interface as not already been visited

-					anInterface.tagBits |= InterfaceVisited;

-					if ((anInterface.tagBits & HasNoMemberTypes) != 0) continue; // already know it has no inherited member types

-					if (anInterface.memberTypes() != NoMemberTypes) {

-						hasMembers = true;

-						break done;

-					}

-

-					ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

-					if (itsInterfaces != NoSuperInterfaces) {

-						if (++lastPosition == interfacesToVisit.length)

-							System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-						interfacesToVisit[lastPosition] = itsInterfaces;

-					}

-				}

-			}

-		}

-

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				interfaces[j].tagBits &= ~InterfaceVisited;

-				if (!hasMembers)

-					interfaces[j].tagBits |= HasNoMemberTypes;

-			}

-		}

-	}

-

-	if (!hasMembers) {

-		currentType = sourceType;

-		do {

-			currentType.tagBits |= HasNoMemberTypes;

-		} while ((currentType = currentType.superclass()) != null);

-	}

-}

-private void connectMemberTypes() {

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if (sourceType.memberTypes != NoMemberTypes)

-		for (int i = 0, size = sourceType.memberTypes.length; i < size; i++)

-			((SourceTypeBinding) sourceType.memberTypes[i]).scope.connectTypeHierarchy();

-}

-/*

-	Our current belief based on available JCK tests is:

-		inherited member types are visible as a potential superclass.

-		inherited interfaces are not visible when defining a superinterface.

-

-	Error recovery story:

-		ensure the superclass is set to java.lang.Object if a problem is detected

-		resolving the superclass.

-

-	Answer false if an error was reported against the sourceType.

-*/

-

-private boolean connectSuperclass() {

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if (referenceContext.superclass == null) {

-		if (isJavaLangObject(sourceType)) return true;

-		sourceType.superclass = getJavaLangObject();

-		compilationUnitScope().addTypeReference(sourceType.superclass);		

-		return !detectCycle(sourceType, sourceType.superclass, null); // ensure Object is initialized if it comes from a source file

-	}

-

-	ReferenceBinding superclass = findSupertype(referenceContext.superclass);

-	if (superclass != null) { // is null if a cycle was detected cycle

-		if (!superclass.isValidBinding()) {

-			problemReporter().invalidSuperclass(sourceType, referenceContext.superclass, superclass);

-		} else if (superclass.isInterface()) {

-			problemReporter().superclassMustBeAClass(sourceType, referenceContext.superclass, superclass);

-		} else if (superclass.isFinal()) {

-			problemReporter().classExtendFinalClass(sourceType, referenceContext.superclass, superclass);

-		} else if (isJavaLangObject(sourceType)) {

-			// can only happen if Object extends another type... will never happen unless we're testing for it.

-			sourceType.tagBits |= HierarchyHasProblems;

-			sourceType.superclass = null;

+	/*

+		Our current belief based on available JCK 1.3 tests is:

+			inherited member types are visible as a potential superclass.

+			inherited interfaces are visible when defining a superinterface.

+	

+		Error recovery story:

+			ensure the superinterfaces contain only valid visible interfaces.

+	

+		Answer false if an error was reported against the sourceType.

+	*/

+	private boolean connectSuperInterfaces() {

+		SourceTypeBinding sourceType = referenceContext.binding;

+		sourceType.superInterfaces = NoSuperInterfaces;

+		if (referenceContext.superInterfaces == null)

 			return true;

-		} else {

-			// only want to reach here when no errors are reported

-			referenceContext.superclass.binding = superclass;

-			sourceType.superclass = superclass;

-			return true;

-		}

-	}

 

-	sourceType.tagBits |= HierarchyHasProblems;

-	if (!isJavaLangObject(sourceType)) {

-		sourceType.superclass = getJavaLangObject();

-		if ((sourceType.superclass.tagBits & BeginHierarchyCheck) == 0)

-			detectCycle(sourceType, sourceType.superclass, null); // ensure Object is initialized if it comes from a source file

-	}

-	return false; // reported some error against the source type

-}

-/*

-	Our current belief based on available JCK 1.3 tests is:

-		inherited member types are visible as a potential superclass.

-		inherited interfaces are visible when defining a superinterface.

-

-	Error recovery story:

-		ensure the superinterfaces contain only valid visible interfaces.

-

-	Answer false if an error was reported against the sourceType.

-*/

-

-private boolean connectSuperInterfaces() {

-	SourceTypeBinding sourceType = referenceContext.binding;

-	sourceType.superInterfaces = NoSuperInterfaces;

-	if (referenceContext.superInterfaces == null)

-		return true;

-

-	boolean noProblems = true;

-	int length = referenceContext.superInterfaces.length;

-	ReferenceBinding[] interfaceBindings = new ReferenceBinding[length];

-	int count = 0;

-	nextInterface : for (int i = 0; i < length; i++) {

-		ReferenceBinding superInterface = findSupertype(referenceContext.superInterfaces[i]);

-		if (superInterface == null) { // detected cycle

-			noProblems = false;

-			continue nextInterface;

-		}

-		if (!superInterface.isValidBinding()) {

-			problemReporter().invalidSuperinterface(sourceType, referenceContext.superInterfaces[i], superInterface);

-			sourceType.tagBits |= HierarchyHasProblems;

-			noProblems = false;

-			continue nextInterface;

-		}

-

-		// Check for a duplicate interface once the name is resolved, otherwise we may be confused (ie : a.b.I and c.d.I)

-		for (int k = 0; k < count; k++) {

-			if (interfaceBindings[k] == superInterface) {

-				// should this be treated as a warning?

-				problemReporter().duplicateSuperinterface(sourceType, referenceContext, superInterface);

+		boolean noProblems = true;

+		int length = referenceContext.superInterfaces.length;

+		ReferenceBinding[] interfaceBindings = new ReferenceBinding[length];

+		int count = 0;

+		nextInterface : for (int i = 0; i < length; i++) {

+			ReferenceBinding superInterface = findSupertype(referenceContext.superInterfaces[i]);

+			if (superInterface == null) { // detected cycle

+				noProblems = false;

 				continue nextInterface;

 			}

+			if (!superInterface.isValidBinding()) {

+				problemReporter().invalidSuperinterface(

+					sourceType,

+					referenceContext.superInterfaces[i],

+					superInterface);

+				sourceType.tagBits |= HierarchyHasProblems;

+				noProblems = false;

+				continue nextInterface;

+			}

+			// Check for a duplicate interface once the name is resolved, otherwise we may be confused (ie : a.b.I and c.d.I)

+			for (int k = 0; k < count; k++) {

+				if (interfaceBindings[k] == superInterface) {

+					// should this be treated as a warning?

+					problemReporter().duplicateSuperinterface(sourceType, referenceContext, superInterface);

+					continue nextInterface;

+				}

+			}

+			if (superInterface.isClass()) {

+				problemReporter().superinterfaceMustBeAnInterface(sourceType, referenceContext, superInterface);

+				sourceType.tagBits |= HierarchyHasProblems;

+				noProblems = false;

+				continue nextInterface;

+			}

+			referenceContext.superInterfaces[i].binding = superInterface;

+			// only want to reach here when no errors are reported

+			interfaceBindings[count++] = superInterface;

 		}

-		if (superInterface.isClass()) {

-			problemReporter().superinterfaceMustBeAnInterface(sourceType, referenceContext, superInterface);

-			sourceType.tagBits |= HierarchyHasProblems;

-			noProblems = false;

-			continue nextInterface;

+		// hold onto all correctly resolved superinterfaces

+		if (count > 0) {

+			if (count != length)

+				System.arraycopy(interfaceBindings, 0, interfaceBindings = new ReferenceBinding[count], 0, count);

+			sourceType.superInterfaces = interfaceBindings;

 		}

-		referenceContext.superInterfaces[i].binding = superInterface; // only want to reach here when no errors are reported

-		interfaceBindings[count++] = superInterface;

+		return noProblems;

 	}

+	

+	void connectTypeHierarchy() {

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if ((sourceType.tagBits & BeginHierarchyCheck) == 0) {

+			boolean noProblems = true;

+			sourceType.tagBits |= BeginHierarchyCheck;

+			if (sourceType.isClass())

+				noProblems &= connectSuperclass();

+			noProblems &= connectSuperInterfaces();

+			sourceType.tagBits |= EndHierarchyCheck;

+			if (noProblems && sourceType.isHierarchyInconsistent())

+				problemReporter().hierarchyHasProblems(sourceType);

+		}

+		connectMemberTypes();

+		checkForInheritedMemberTypes(sourceType);

+	}

+	

+	private void connectTypeHierarchyWithoutMembers() {

+		// must ensure the imports are resolved

+		if (parent instanceof CompilationUnitScope) {

+			if (((CompilationUnitScope) parent).imports == null)

+				 ((CompilationUnitScope) parent).checkAndSetImports();

+		} else if (parent instanceof ClassScope) {

+			// ensure that the enclosing type has already been checked

+			 ((ClassScope) parent).connectTypeHierarchyWithoutMembers();

+		}

 

-	// hold onto all correctly resolved superinterfaces

-	if (count > 0) {

-		if (count != length)

-			System.arraycopy(interfaceBindings, 0, interfaceBindings = new ReferenceBinding[count], 0, count);

-		sourceType.superInterfaces = interfaceBindings;

-	}

-	return noProblems;

-}

-void connectTypeHierarchy() {

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if ((sourceType.tagBits & BeginHierarchyCheck) == 0) {

+		// double check that the hierarchy search has not already begun...

+		SourceTypeBinding sourceType = referenceContext.binding;

+		if ((sourceType.tagBits & BeginHierarchyCheck) != 0)

+			return;

+

 		boolean noProblems = true;

 		sourceType.tagBits |= BeginHierarchyCheck;

 		if (sourceType.isClass())

@@ -620,190 +690,174 @@
 		if (noProblems && sourceType.isHierarchyInconsistent())

 			problemReporter().hierarchyHasProblems(sourceType);

 	}

-	connectMemberTypes();

-	checkForInheritedMemberTypes(sourceType);

-}

-private void connectTypeHierarchyWithoutMembers() {

-	// must ensure the imports are resolved

-	if (parent instanceof CompilationUnitScope) {

-		if (((CompilationUnitScope) parent).imports == null)

-			((CompilationUnitScope) parent).checkAndSetImports();

-	} else if (parent instanceof ClassScope) {

-		// ensure that the enclosing type has already been checked

-		((ClassScope) parent).connectTypeHierarchyWithoutMembers();

-	}

-

-	// double check that the hierarchy search has not already begun...

-	SourceTypeBinding sourceType = referenceContext.binding;

-	if ((sourceType.tagBits & BeginHierarchyCheck) != 0) return;

-

-	boolean noProblems = true;

-	sourceType.tagBits |= BeginHierarchyCheck;

-	if (sourceType.isClass())

-		noProblems &= connectSuperclass();

-	noProblems &= connectSuperInterfaces();

-	sourceType.tagBits |= EndHierarchyCheck;

-	if (noProblems && sourceType.isHierarchyInconsistent())

-		problemReporter().hierarchyHasProblems(sourceType);

-}

-// Answer whether a cycle was found between the sourceType & the superType

-

-private boolean detectCycle(SourceTypeBinding sourceType, ReferenceBinding superType, TypeReference reference) {

-	if (sourceType == superType) {

-		problemReporter().hierarchyCircularity(sourceType, superType, reference);

-		sourceType.tagBits |= HierarchyHasProblems;

-		return true;

-	}

-

-	if (superType.isBinaryBinding()) {

-		// force its superclass & superinterfaces to be found... 2 possibilities exist - the source type is included in the hierarchy of:

-		//		- a binary type... this case MUST be caught & reported here

-		//		- another source type... this case is reported against the other source type

-		boolean hasCycle = false;

-		if (superType.superclass() != null) {

-			if (sourceType == superType.superclass()) {

-				problemReporter().hierarchyCircularity(sourceType, superType, reference);

-				sourceType.tagBits |= HierarchyHasProblems;

-				superType.tagBits |= HierarchyHasProblems;

-				return true;

-			}

-			hasCycle |= detectCycle(sourceType, superType.superclass(), reference);

-			if ((superType.superclass().tagBits & HierarchyHasProblems) != 0) {

-				sourceType.tagBits |= HierarchyHasProblems;

-				superType.tagBits |= HierarchyHasProblems; // propagate down the hierarchy

-			}

+	

+	// Answer whether a cycle was found between the sourceType & the superType

+	private boolean detectCycle(

+		SourceTypeBinding sourceType,

+		ReferenceBinding superType,

+		TypeReference reference) {

+		if (sourceType == superType) {

+			problemReporter().hierarchyCircularity(sourceType, superType, reference);

+			sourceType.tagBits |= HierarchyHasProblems;

+			return true;

 		}

 

-		ReferenceBinding[] itsInterfaces = superType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			for (int i = 0, length = itsInterfaces.length; i < length; i++) {

-				ReferenceBinding anInterface = itsInterfaces[i];

-				if (sourceType == anInterface) {

+		if (superType.isBinaryBinding()) {

+			// force its superclass & superinterfaces to be found... 2 possibilities exist - the source type is included in the hierarchy of:

+			//		- a binary type... this case MUST be caught & reported here

+			//		- another source type... this case is reported against the other source type

+			boolean hasCycle = false;

+			if (superType.superclass() != null) {

+				if (sourceType == superType.superclass()) {

 					problemReporter().hierarchyCircularity(sourceType, superType, reference);

 					sourceType.tagBits |= HierarchyHasProblems;

 					superType.tagBits |= HierarchyHasProblems;

 					return true;

 				}

-				hasCycle |= detectCycle(sourceType, anInterface, reference);

-				if ((anInterface.tagBits & HierarchyHasProblems) != 0) {

+				hasCycle |= detectCycle(sourceType, superType.superclass(), reference);

+				if ((superType.superclass().tagBits & HierarchyHasProblems) != 0) {

 					sourceType.tagBits |= HierarchyHasProblems;

-					superType.tagBits |= HierarchyHasProblems;

+					superType.tagBits |= HierarchyHasProblems; // propagate down the hierarchy

 				}

 			}

+

+			ReferenceBinding[] itsInterfaces = superType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				for (int i = 0, length = itsInterfaces.length; i < length; i++) {

+					ReferenceBinding anInterface = itsInterfaces[i];

+					if (sourceType == anInterface) {

+						problemReporter().hierarchyCircularity(sourceType, superType, reference);

+						sourceType.tagBits |= HierarchyHasProblems;

+						superType.tagBits |= HierarchyHasProblems;

+						return true;

+					}

+					hasCycle |= detectCycle(sourceType, anInterface, reference);

+					if ((anInterface.tagBits & HierarchyHasProblems) != 0) {

+						sourceType.tagBits |= HierarchyHasProblems;

+						superType.tagBits |= HierarchyHasProblems;

+					}

+				}

+			}

+			return hasCycle;

 		}

-		return hasCycle;

-	}

 

-	if ((superType.tagBits & EndHierarchyCheck) == 0 && (superType.tagBits & BeginHierarchyCheck) != 0) {

-		problemReporter().hierarchyCircularity(sourceType, superType, reference);

-		sourceType.tagBits |= HierarchyHasProblems;

-		superType.tagBits |= HierarchyHasProblems;

-		return true;

-	}

-	if ((superType.tagBits & BeginHierarchyCheck) == 0)

-		// ensure if this is a source superclass that it has already been checked

-		((SourceTypeBinding) superType).scope.connectTypeHierarchyWithoutMembers();

-	if ((superType.tagBits & HierarchyHasProblems) != 0)

-		sourceType.tagBits |= HierarchyHasProblems;

-	return false;

-}

-private ReferenceBinding findSupertype(TypeReference typeReference) {

-	typeReference.aboutToResolve(this); // allows us to trap completion & selection nodes

-	char[][] compoundName = typeReference.getTypeName();

-	SourceTypeBinding sourceType = referenceContext.binding;

-	int size = compoundName.length;

-	int n = 1;

-	ReferenceBinding superType;

-

-	// resolve the first name of the compoundName

-	if (CharOperation.equals(compoundName[0], sourceType.sourceName)) {

-		superType = sourceType; // match against the sourceType even though nested members cannot be supertypes

-	} else {

-		Binding typeOrPackage = parent.getTypeOrPackage(compoundName[0], TYPE | PACKAGE);

-		if (typeOrPackage == null || !typeOrPackage.isValidBinding()){

-			compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(compoundName[0], NotFound)); // record package ref

-			return new ProblemReferenceBinding(compoundName[0], typeOrPackage == null ? NotFound : typeOrPackage.problemId());

+		if ((superType.tagBits & EndHierarchyCheck) == 0

+			&& (superType.tagBits & BeginHierarchyCheck) != 0) {

+			problemReporter().hierarchyCircularity(sourceType, superType, reference);

+			sourceType.tagBits |= HierarchyHasProblems;

+			superType.tagBits |= HierarchyHasProblems;

+			return true;

 		}

-		boolean checkVisibility = false;

-		for (; n < size; n++) {

-			if (!(typeOrPackage instanceof PackageBinding)) break;

+		if ((superType.tagBits & BeginHierarchyCheck) == 0)

+			// ensure if this is a source superclass that it has already been checked

+			 ((SourceTypeBinding) superType).scope.connectTypeHierarchyWithoutMembers();

+		if ((superType.tagBits & HierarchyHasProblems) != 0)

+			sourceType.tagBits |= HierarchyHasProblems;

+		return false;

+	}

+	

+	private ReferenceBinding findSupertype(TypeReference typeReference) {

+		typeReference.aboutToResolve(this); // allows us to trap completion & selection nodes

+		char[][] compoundName = typeReference.getTypeName();

+		SourceTypeBinding sourceType = referenceContext.binding;

+		int size = compoundName.length;

+		int n = 1;

+		ReferenceBinding superType;

 

-			PackageBinding packageBinding = (PackageBinding) typeOrPackage;

-			compilationUnitScope().addNamespaceReference(packageBinding);

-			typeOrPackage = packageBinding.getTypeOrPackage(compoundName[n]);

-			if (typeOrPackage == null || !typeOrPackage.isValidBinding())

+		// resolve the first name of the compoundName

+		if (CharOperation.equals(compoundName[0], sourceType.sourceName)) {

+			superType = sourceType;

+			// match against the sourceType even though nested members cannot be supertypes

+		} else {

+			Binding typeOrPackage = parent.getTypeOrPackage(compoundName[0], TYPE | PACKAGE);

+			if (typeOrPackage == null || !typeOrPackage.isValidBinding()) {

+				compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(compoundName[0], NotFound));

+				// record package ref

 				return new ProblemReferenceBinding(

-					CharOperation.subarray(compoundName, 0, n + 1),

+					compoundName[0],

 					typeOrPackage == null ? NotFound : typeOrPackage.problemId());

-			checkVisibility = true;

-		}

+			}

+			boolean checkVisibility = false;

+			for (; n < size; n++) {

+				if (!(typeOrPackage instanceof PackageBinding))

+					break;

 

-		// convert to a ReferenceBinding

-		if (typeOrPackage instanceof PackageBinding) // error, the compoundName is a packageName

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), NotFound);

-		superType = (ReferenceBinding) typeOrPackage;

-		compilationUnitScope().addTypeReference(superType);

-		

-		if (checkVisibility && n == size) { // if we're finished and know the final superinterface then check visibility

-			SourceTypeBinding enclosingSourceType = enclosingSourceType();

-			if (enclosingSourceType == null

-				? !superType.canBeSeenBy(sourceType.fPackage)

-				: !superType.canBeSeenBy(sourceType, enclosingSourceType))

+				PackageBinding packageBinding = (PackageBinding) typeOrPackage;

+				compilationUnitScope().addNamespaceReference(packageBinding);

+				typeOrPackage = packageBinding.getTypeOrPackage(compoundName[n]);

+				if (typeOrPackage == null || !typeOrPackage.isValidBinding())

+					return new ProblemReferenceBinding(

+						CharOperation.subarray(compoundName, 0, n + 1),

+						typeOrPackage == null ? NotFound : typeOrPackage.problemId());

+				checkVisibility = true;

+			}

+

+			// convert to a ReferenceBinding

+			if (typeOrPackage instanceof PackageBinding) // error, the compoundName is a packageName

+				return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), NotFound);

+			superType = (ReferenceBinding) typeOrPackage;

+			compilationUnitScope().addTypeReference(superType);

+

+			if (checkVisibility

+				&& n == size) { // if we're finished and know the final supertype then check visibility

+				if (!superType.canBeSeenBy(sourceType.fPackage))

+					// its a toplevel type so just check package access

 					return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), NotVisible);

+			}

+		}

+		// at this point we know we have a type but we have to look for cycles

+		while (true) {

+			// must detect cycles & force connection up the hierarchy... also handle cycles with binary types.

+			// must be guaranteed that the superType knows its entire hierarchy

+			if (detectCycle(sourceType, superType, typeReference))

+				return null; // cycle error was already reported

+

+			if (n >= size)

+				break;

+

+			// retrieve the next member type

+			char[] typeName = compoundName[n++];

+			superType = findMemberType(typeName, superType);

+			if (superType == null)

+				return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), NotFound);

+			if (!superType.isValidBinding()) {

+				superType.compoundName = CharOperation.subarray(compoundName, 0, n);

+				return superType;

+			}

+		}

+		return superType;

+	}

+

+	/* Answer the problem reporter to use for raising new problems.

+	*

+	* Note that as a side-effect, this updates the current reference context

+	* (unit, type or method) in case the problem handler decides it is necessary

+	* to abort.

+	*/

+	public ProblemReporter problemReporter() {

+		MethodScope outerMethodScope;

+		if ((outerMethodScope = outerMostMethodScope()) == null) {

+			ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;

+			problemReporter.referenceContext = referenceContext;

+			return problemReporter;

+		} else {

+			return outerMethodScope.problemReporter();

 		}

 	}

 

-	// at this point we know we have a type but we have to look for cycles

-	while (true) {

-		// must detect cycles & force connection up the hierarchy... also handle cycles with binary types.

-		// must be guaranteed that the superType knows its entire hierarchy

-		if (detectCycle(sourceType, superType, typeReference))

-			return null; // cycle error was already reported

-

-		if (n >= size)

-			break;

-

-		// retrieve the next member type

-		char[] typeName = compoundName[n++];

-		superType = findMemberType(typeName, superType);

-		if (superType == null)

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), NotFound);

-		if (!superType.isValidBinding()) {

-			superType.compoundName = CharOperation.subarray(compoundName, 0, n);

-			return superType;

-		}

+	/* Answer the reference type of this scope.

+	*

+	* i.e. the nearest enclosing type of this scope.

+	*/

+	public TypeDeclaration referenceType() {

+		return referenceContext;

 	}

-	return superType;

-}

-/* Answer the problem reporter to use for raising new problems.

-*

-* Note that as a side-effect, this updates the current reference context

-* (unit, type or method) in case the problem handler decides it is necessary

-* to abort.

-*/

-

-public ProblemReporter problemReporter() {

-	MethodScope outerMethodScope;

-	if ((outerMethodScope = outerMostMethodScope()) == null) {

-		ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;

-		problemReporter.referenceContext = referenceContext;

-		return problemReporter;

-	} else {

-		return outerMethodScope.problemReporter();

+	

+	public String toString() {

+		if (referenceContext != null)

+			return "--- Class Scope ---\n\n"  //$NON-NLS-1$

+			+referenceContext.binding.toString();

+		else

+			return "--- Class Scope ---\n\n Binding not initialized" ; //$NON-NLS-1$

 	}

-}

-/* Answer the reference type of this scope.

-*

-* i.e. the nearest enclosing type of this scope.

-*/

-

-public TypeDeclaration referenceType() {

-	return referenceContext;

-}

-public String toString() {

-	if (referenceContext != null)

-		return "--- Class Scope ---\n\n"/*nonNLS*/ + referenceContext.binding.toString();

-	else

-		return "--- Class Scope ---\n\n Binding not initialized"/*nonNLS*/;

-}

-}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index 043fd7e..230c76a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -427,7 +427,7 @@
 	referenceContext.compilationResult.fileDependencies = fileNames;

 }

 public String toString() {

-	return "--- CompilationUnit Scope : "/*nonNLS*/ + new String(referenceContext.getFileName());

+	return "--- CompilationUnit Scope : " + new String(referenceContext.getFileName()); //$NON-NLS-1$

 }

 public void verifyMethods(MethodVerifier verifier) {

 	for (int i = 0, length = topLevelTypes.length; i < length; i++)

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.java
index 1445d91..badea87 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.java
@@ -25,11 +25,11 @@
 }

 public char[] readableName() {

 	if (onDemand)

-		return CharOperation.concat(CharOperation.concatWith(compoundName, '.'), ".*"/*nonNLS*/.toCharArray());

+		return CharOperation.concat(CharOperation.concatWith(compoundName, '.'), ".*".toCharArray()); //$NON-NLS-1$

 	else

 		return CharOperation.concatWith(compoundName, '.');

 }

 public String toString() {

-	return "import : "/*nonNLS*/ + new String(readableName());

+	return "import : " + new String(readableName()); //$NON-NLS-1$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
index d2de2d1..4fb1dca 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
@@ -56,9 +56,9 @@
 public char[] readableName() {

 	if (isAnonymousType()) {

 		if (superInterfaces == NoSuperInterfaces)

-			return ("<"/*nonNLS*/+Util.bind("binding.subclass"/*nonNLS*/,new String(superclass.readableName())) + ">"/*nonNLS*/).toCharArray();

+			return ("<"+Util.bind("binding.subclass",new String(superclass.readableName())) + ">").toCharArray(); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$

 		else

-			return ("<"/*nonNLS*/+Util.bind("binding.implementation"/*nonNLS*/,new String(superInterfaces[0].readableName())) + ">"/*nonNLS*/).toCharArray();			

+			return ("<"+Util.bind("binding.implementation",new String(superInterfaces[0].readableName())) + ">").toCharArray();			 //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$

 	} else if (isMemberType()) {

 		return CharOperation.concat(enclosingType().readableName(), sourceName, '.');

 	} else {

@@ -78,10 +78,10 @@
 }

 public String toString() {

 	if (isAnonymousType())

-		return "Anonymous type : "/*nonNLS*/ + super.toString();

+		return "Anonymous type : " + super.toString(); //$NON-NLS-1$

 	if (isMemberType())

-		return "Local member type : "/*nonNLS*/ + new String(sourceName()) + " "/*nonNLS*/ + super.toString();

-	return "Local type : "/*nonNLS*/ + new String(sourceName()) + " "/*nonNLS*/ + super.toString();

+		return "Local member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$

+	return "Local type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$

 }

 /* Trigger the dependency mechanism forcing the innerclass emulation

 * to be propagated to all dependent source types.

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
index 0b0591e..1e96370 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
@@ -66,18 +66,18 @@
 public String toString() {

 	String s = super.toString();

 	if (!used)

-		s += "[pos: unused]"/*nonNLS*/;

+		s += "[pos: unused]"; //$NON-NLS-1$

 	else

-		s += "[pos: "/*nonNLS*/ + String.valueOf(resolvedPosition) + "]"/*nonNLS*/;

-	s += "[id:"/*nonNLS*/ + String.valueOf(id) + "]"/*nonNLS*/;

+		s += "[pos: " + String.valueOf(resolvedPosition) + "]"; //$NON-NLS-2$ //$NON-NLS-1$

+	s += "[id:" + String.valueOf(id) + "]"; //$NON-NLS-2$ //$NON-NLS-1$

 	if (initializationCount > 0) {

-		s += "[pc: "/*nonNLS*/;

+		s += "[pc: "; //$NON-NLS-1$

 		for (int i = 0; i < initializationCount; i++) {

 			if (i > 0)

-				s += ", "/*nonNLS*/;

-			s += String.valueOf(initializationPCs[i << 1]) + "-"/*nonNLS*/ + ((initializationPCs[(i << 1) + 1] == -1) ? "?"/*nonNLS*/ : String.valueOf(initializationPCs[(i<< 1) + 1]));

+				s += ", "; //$NON-NLS-1$

+			s += String.valueOf(initializationPCs[i << 1]) + "-" + ((initializationPCs[(i << 1) + 1] == -1) ? "?" : String.valueOf(initializationPCs[(i<< 1) + 1])); //$NON-NLS-2$ //$NON-NLS-1$

 		}

-		s += "]"/*nonNLS*/;

+		s += "]"; //$NON-NLS-1$

 	}

 	return s;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index 27b863a..a7b8128 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -68,7 +68,7 @@
 		typeRequestor.accept(answer.getCompilationUnit());

 	else if (answer.isSourceType())

 		// the type was found as a source model

-		typeRequestor.accept(answer.getSourceType(), computePackageFrom(compoundName));

+		typeRequestor.accept(answer.getSourceTypes(), computePackageFrom(compoundName));

 

 	return getCachedType(compoundName);

 }

@@ -94,7 +94,7 @@
 		typeRequestor.accept(answer.getCompilationUnit());

 	else if (answer.isSourceType())

 		// the type was found as a source model

-		typeRequestor.accept(answer.getSourceType(), packageBinding);

+		typeRequestor.accept(answer.getSourceTypes(), packageBinding);

 

 	return packageBinding.getType0(name);

 }

@@ -505,7 +505,7 @@
 				binding = ShortBinding;

 				break;

 			default :

-				throw new Error(Util.bind("error.undefinedBaseType"/*nonNLS*/,String.valueOf(signature[start])));

+				throw new Error(Util.bind("error.undefinedBaseType",String.valueOf(signature[start]))); //$NON-NLS-1$

 		}

 	} else {

 		binding = getTypeFromConstantPoolName(signature, start + 1, end - 1);

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
index 8002aba..e13f688 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
@@ -28,6 +28,6 @@
 	return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$');

 }

 public String toString() {

-	return "Member type : "/*nonNLS*/ + new String(sourceName()) + " "/*nonNLS*/ + super.toString();

+	return "Member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index 65b5ec8..7dfcb9e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -309,7 +309,7 @@
 	if (parameters != NoParameters) {

 		for (int i = 0, length = parameters.length; i < length; i++) {

 			if (i > 0)

-				buffer.append(", "/*nonNLS*/);

+				buffer.append(", "); //$NON-NLS-1$

 			buffer.append(parameters[i].sourceName());

 		}

 	}

@@ -387,35 +387,35 @@
 	modifiers |= AccClearPrivateModifier;

 }

 public String toString() {

-	String s = (returnType != null) ? returnType.debugName() : "NULL TYPE"/*nonNLS*/;

-	s += " "/*nonNLS*/;

-	s += (selector != null) ? new String(selector) : "UNNAMED METHOD"/*nonNLS*/;

+	String s = (returnType != null) ? returnType.debugName() : "NULL TYPE"; //$NON-NLS-1$

+	s += " "; //$NON-NLS-1$

+	s += (selector != null) ? new String(selector) : "UNNAMED METHOD"; //$NON-NLS-1$

 

-	s += "("/*nonNLS*/;

+	s += "("; //$NON-NLS-1$

 	if (parameters != null) {

 		if (parameters != NoParameters) {

 			for (int i = 0, length = parameters.length; i < length; i++) {

 				if (i  > 0)

-					s += ", "/*nonNLS*/;

-				s += (parameters[i] != null) ? parameters[i].debugName() : "NULL TYPE"/*nonNLS*/;

+					s += ", "; //$NON-NLS-1$

+				s += (parameters[i] != null) ? parameters[i].debugName() : "NULL TYPE"; //$NON-NLS-1$

 			}

 		}

 	} else {

-		s += "NULL PARAMETERS"/*nonNLS*/;

+		s += "NULL PARAMETERS"; //$NON-NLS-1$

 	}

-	s += ") "/*nonNLS*/;

+	s += ") "; //$NON-NLS-1$

 

 	if (thrownExceptions != null) {

 		if (thrownExceptions != NoExceptions) {

-			s += "throws "/*nonNLS*/;

+			s += "throws "; //$NON-NLS-1$

 			for (int i = 0, length = thrownExceptions.length; i < length; i++) {

 				if (i  > 0)

-					s += ", "/*nonNLS*/;

-				s += (thrownExceptions[i] != null) ? thrownExceptions[i].debugName() : "NULL TYPE"/*nonNLS*/;

+					s += ", "; //$NON-NLS-1$

+				s += (thrownExceptions[i] != null) ? thrownExceptions[i].debugName() : "NULL TYPE"; //$NON-NLS-1$

 			}

 		}

 	} else {

-		s += "NULL THROWN EXCEPTIONS"/*nonNLS*/;

+		s += "NULL THROWN EXCEPTIONS"; //$NON-NLS-1$

 	}

 	return s;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
index 9c9f9df..3bd2fda 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
@@ -42,18 +42,18 @@
 	this.startIndex = 0;

 }

 String basicToString(int tab) {

-	String newLine = "\n"/*nonNLS*/;

+	String newLine = "\n"; //$NON-NLS-1$

 	for (int i = tab; --i >= 0;)

-		newLine += "\t"/*nonNLS*/;

+		newLine += "\t"; //$NON-NLS-1$

 

-	String s = newLine + "--- Method Scope ---"/*nonNLS*/;

-	newLine += "\t"/*nonNLS*/;

-	s += newLine + "locals:"/*nonNLS*/;

+	String s = newLine + "--- Method Scope ---"; //$NON-NLS-1$

+	newLine += "\t"; //$NON-NLS-1$

+	s += newLine + "locals:"; //$NON-NLS-1$

 	for (int i = 0; i < localIndex; i++)

-		s += newLine + "\t"/*nonNLS*/ + locals[i].toString();

-	s += newLine + "startIndex = "/*nonNLS*/ + startIndex;

-	s += newLine + "isConstructorCall = "/*nonNLS*/ + isConstructorCall;

-	s += newLine + "fieldDeclarationIndex = "/*nonNLS*/ + fieldDeclarationIndex;

+		s += newLine + "\t" + locals[i].toString(); //$NON-NLS-1$

+	s += newLine + "startIndex = " + startIndex; //$NON-NLS-1$

+	s += newLine + "isConstructorCall = " + isConstructorCall; //$NON-NLS-1$

+	s += newLine + "fieldDeclarationIndex = " + fieldDeclarationIndex; //$NON-NLS-1$

 	return s;

 }

 /* Spec : 8.4.3 & 9.4

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
index a031167..54adb2d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
@@ -190,8 +190,8 @@
 }

 public String toString() {

 	if (compoundName == NoCharChar)

-		return "The Default Package"/*nonNLS*/;

+		return "The Default Package"; //$NON-NLS-1$

 	else

-		return "package "/*nonNLS*/ + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"/*nonNLS*/);

+		return "package " + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 9fffaee..1366b74 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -252,6 +252,11 @@
 		id = T_JavaLangVoid;

 		return;

 	}

+	

+	if (CharOperation.equals(JAVA_LANG_ASSERTIONERROR, compoundName)) {

+		id = T_JavaLangAssertionError;

+		return;

+	}

 }

 /* Answer the receiver's constant pool name.

 *

@@ -259,13 +264,11 @@
 */

 

 public char[] constantPoolName() /* java/lang/Object */ {

-	if (constantPoolName != null)

-		return constantPoolName;

-

+	if (constantPoolName != null) 	return constantPoolName;

 	return constantPoolName = CharOperation.concatWith(compoundName, '/');

 }

 String debugName() {

-	return (compoundName != null) ? new String(readableName()) : "UNNAMED TYPE"/*nonNLS*/;

+	return (compoundName != null) ? new String(readableName()) : "UNNAMED TYPE"; //$NON-NLS-1$

 }

 public final int depth() {

 	int depth = 0;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index aba6c98..4d11ced 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -9,7 +9,16 @@
 import org.eclipse.jdt.internal.compiler.problem.*;

 import org.eclipse.jdt.internal.compiler.util.*;

 

-public abstract class Scope implements BaseTypes, BindingIds, CompilerModifiers, ProblemReasons, TagBits, TypeConstants, TypeIds {

+public abstract class Scope

+	implements

+		BaseTypes,

+		BindingIds,

+		CompilerModifiers,

+		ProblemReasons,

+		TagBits,

+		TypeConstants,

+		TypeIds {

+

 	public Scope parent;

 	public int kind;

 

@@ -17,1048 +26,1194 @@
 	public final static int METHOD_SCOPE = 2;

 	public final static int CLASS_SCOPE = 3;

 	public final static int COMPILATION_UNIT_SCOPE = 4;

-protected Scope(int kind, Scope parent) {

-	this.kind = kind;

-	this.parent = parent;

-}

-// Internal use only

+	protected Scope(int kind, Scope parent) {

+		this.kind = kind;

+		this.parent = parent;

+	}

 

-protected final boolean areParametersAssignable(TypeBinding[] parameters, TypeBinding[] arguments) {

-	if (parameters == arguments)

+	public abstract ProblemReporter problemReporter();

+

+	// Internal use only

+	protected final boolean areParametersAssignable(

+		TypeBinding[] parameters,

+		TypeBinding[] arguments) {

+		if (parameters == arguments)

+			return true;

+

+		int length = parameters.length;

+		if (length != arguments.length)

+			return false;

+

+		for (int i = 0; i < length; i++)

+			if (parameters[i] != arguments[i])

+				if (!arguments[i].isCompatibleWith(parameters[i]))

+					return false;

 		return true;

+	}

 

-	int length = parameters.length;

-	if (length != arguments.length)

-		return false;

+	/* Answer true if the left type can be assigned to right

+	*/

+	public boolean areTypesCompatible(TypeBinding left, TypeBinding right) {

+		return left.isCompatibleWith(right);

+	}

+

+	/* Answer an int describing the relationship between the given types.

+	*

+	* 		NotRelated 

+	* 		EqualOrMoreSpecific : left is compatible with right

+	* 		MoreGeneric : right is compatible with left

+	*/

+	public int compareTypes(TypeBinding left, TypeBinding right) {

+		if (areTypesCompatible(left, right))

+			return EqualOrMoreSpecific;

+		if (areTypesCompatible(right, left))

+			return MoreGeneric;

+		return NotRelated;

+	}

+

+	/* Answer an int describing the relationship between the given type and unchecked exceptions.

+	*

+	* 	NotRelated 

+	* 	EqualOrMoreSpecific : type is known for sure to be an unchecked exception type

+	* 	MoreGeneric : type is a supertype of an actual unchecked exception type

+	*/

+	public int compareUncheckedException(ReferenceBinding type) {

+		int comparison = compareTypes(type, getJavaLangRuntimeException());

+		if (comparison != 0)

+			return comparison;

+		else

+			return compareTypes(type, getJavaLangError());

+	}

+

+	public final CompilationUnitScope compilationUnitScope() {

+		Scope lastScope = null;

+		Scope scope = this;

+		do {

+			lastScope = scope;

+			scope = scope.parent;

+		} while (scope != null);

+		return (CompilationUnitScope) lastScope;

+	}

+

+	public ArrayBinding createArray(TypeBinding type, int dimension) {

+		if (type.isValidBinding())

+			return environment().createArrayType(type, dimension);

+		else

+			return new ArrayBinding(type, dimension);

+	}

+

+	/* Answer the receiver's enclosing source type.

+	*/

+	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;

+	}

+

+	// Internal use only

+	public ReferenceBinding findDirectMemberType(

+		char[] typeName,

+		ReferenceBinding enclosingType) {

+		if ((enclosingType.tagBits & HasNoMemberTypes) != 0)

+			return null; // know it has no member types (nor inherited member types)

+

+		SourceTypeBinding enclosingSourceType = enclosingSourceType();

+		compilationUnitScope().addTypeReference(enclosingType);

+		ReferenceBinding memberType = enclosingType.getMemberType(typeName);

+		if (memberType != null) {

+			compilationUnitScope().addTypeReference(memberType);

+			if (enclosingSourceType == null

+				? memberType.canBeSeenBy(getCurrentPackage())

+				: memberType.canBeSeenBy(enclosingType, enclosingSourceType))

+				return memberType;

+			else

+				return new ProblemReferenceBinding(typeName, NotVisible);

+		}

+		return null;

+	}

+

+	// Internal use only

+	public MethodBinding findExactMethod(

+		ReferenceBinding receiverType,

+		char[] selector,

+		TypeBinding[] argumentTypes,

+		InvocationSite invocationSite) {

+		compilationUnitScope().addTypeReference(receiverType);

+		compilationUnitScope().addTypeReferences(argumentTypes);

+		MethodBinding exactMethod =

+			receiverType.getExactMethod(selector, argumentTypes);

+		if (exactMethod != null) {

+			compilationUnitScope().addTypeReferences(exactMethod.thrownExceptions);

+			if (receiverType.isInterface()

+				|| exactMethod.canBeSeenBy(receiverType, invocationSite, this))

+				return exactMethod;

+		}

+		return null;

+	}

+

+	// Internal use only

+	/*	Answer the field binding that corresponds to fieldName.

+		Start the lookup at the receiverType.

+		InvocationSite implements

+			isSuperAccess(); this is used to determine if the discovered field is visible.

+		Only fields defined by the receiverType or its supertypes are answered;

+		a field of an enclosing type will not be found using this API.

 	

-	for (int i = 0; i < length; i++)

-		if (parameters[i] != arguments[i])

-			if (!arguments[i].isCompatibleWith(parameters[i]))

-				return false;

-	return true;

-}

-/* Answer true if the left type can be assigned to right

-*/

-

-public boolean areTypesCompatible(TypeBinding left, TypeBinding right) {

-	return left.isCompatibleWith(right);

-}

-/* Answer an int describing the relationship between the given types.

-*

-* 		NotRelated 

-* 		EqualOrMoreSpecific : left is compatible with right

-* 		MoreGeneric : right is compatible with left

-*/

-

-public int compareTypes(TypeBinding left, TypeBinding right) {

-	if (areTypesCompatible(left, right))

-		return EqualOrMoreSpecific;

-	if (areTypesCompatible(right, left))

-		return MoreGeneric;

-	return NotRelated;

-}

-/* Answer an int describing the relationship between the given type and unchecked exceptions.

-*

-* 	NotRelated 

-* 	EqualOrMoreSpecific : type is known for sure to be an unchecked exception type

-* 	MoreGeneric : type is a supertype of an actual unchecked exception type

-*/

-

-public int compareUncheckedException(ReferenceBinding type) {

-	int comparison = compareTypes(type, getJavaLangRuntimeException());

-	if (comparison != 0)

-		return comparison;

-	else

-		return compareTypes(type, getJavaLangError());

-}

-public final CompilationUnitScope compilationUnitScope() {

-	Scope lastScope = null;

-	Scope scope = this;

-	do {

-		lastScope = scope;

-		scope = scope.parent;

-	} while (scope != null);

-	return (CompilationUnitScope) lastScope;

-}

-public ArrayBinding createArray(TypeBinding type, int dimension) {

-	if (type.isValidBinding())

-		return environment().createArrayType(type, dimension);

-	else

-		return new ArrayBinding(type, dimension);

-}

-/* Answer the receiver's enclosing source type.

-*/

-

-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;

-}

-// Internal use only

-

-public ReferenceBinding findDirectMemberType(char[] typeName, ReferenceBinding enclosingType) {

-	if ((enclosingType.tagBits & HasNoMemberTypes) != 0)

-		return null; // know it has no member types (nor inherited member types)

-

-	SourceTypeBinding enclosingSourceType = enclosingSourceType();

-	compilationUnitScope().addTypeReference(enclosingType);

-	ReferenceBinding memberType = enclosingType.getMemberType(typeName);

-	if (memberType != null) {

-		compilationUnitScope().addTypeReference(memberType);

-		if (enclosingSourceType == null

-			? memberType.canBeSeenBy(getCurrentPackage())

-			: memberType.canBeSeenBy(enclosingType, enclosingSourceType))

-				return memberType;

-		else

-				return new ProblemReferenceBinding(typeName, NotVisible);

-	}

-	return null;

-}

-// Internal use only

-

-public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {

-	compilationUnitScope().addTypeReference(receiverType);

-	compilationUnitScope().addTypeReferences(argumentTypes);

-	MethodBinding exactMethod = receiverType.getExactMethod(selector, argumentTypes);

-	if (exactMethod != null){

-		compilationUnitScope().addTypeReferences(exactMethod.thrownExceptions);

-		if (receiverType.isInterface() || exactMethod.canBeSeenBy(receiverType, invocationSite, this))

-			return exactMethod;

-	}

-	return null;

-}

-// Internal use only

-

-/*	Answer the field binding that corresponds to fieldName.

-	Start the lookup at the receiverType.

-	InvocationSite implements

-		isSuperAccess(); this is used to determine if the discovered field is visible.

-	Only fields defined by the receiverType or its supertypes are answered;

-	a field of an enclosing type will not be found using this API.

-

-	If no visible field is discovered, null is answered.

-*/

-

-public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) {

-	if (receiverType.isBaseType())

-		return null;

-	if (receiverType.isArrayType()) {

-		if (CharOperation.equals(fieldName, LENGTH))

-			return ArrayBinding.LengthField;

-		return null;

-	}

-

-	ReferenceBinding currentType = (ReferenceBinding) receiverType;

-	if (!currentType.canBeSeenBy(this))

-		return new ProblemFieldBinding(fieldName, NotVisible); // *** Need a new problem id - TypeNotVisible?

-

-	compilationUnitScope().addTypeReference(currentType);

-	FieldBinding field = currentType.getField(fieldName);

-	if (field != null) {

-		if (field.canBeSeenBy(currentType, invocationSite, this))

-			return field;

-		else

+		If no visible field is discovered, null is answered.

+	*/

+	public FieldBinding findField(

+		TypeBinding receiverType,

+		char[] fieldName,

+		InvocationSite invocationSite) {

+		if (receiverType.isBaseType())

+			return null;

+		if (receiverType.isArrayType()) {

+			if (CharOperation.equals(fieldName, LENGTH))

+				return ArrayBinding.LengthField;

+			return null;

+		}

+		ReferenceBinding currentType = (ReferenceBinding) receiverType;

+		if (!currentType.canBeSeenBy(this))

 			return new ProblemFieldBinding(fieldName, NotVisible);

-	}

-

-	// collect all superinterfaces of receiverType until the field is found in a supertype

-	ReferenceBinding[][] interfacesToVisit = null;

-	int lastPosition = -1;

-	FieldBinding visibleField = null;

-	boolean keepLooking = true;

-	boolean notVisible = false; // we could hold onto the not visible field for extra error reporting

-	while (keepLooking) {

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			if (interfacesToVisit == null)

-				interfacesToVisit = new ReferenceBinding[5][];

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-		}

-		if ((currentType = currentType.superclass()) == null)

-			break;

-

-		if ((field = currentType.getField(fieldName)) != null) {

-			keepLooking = false;

-			if (field.canBeSeenBy(receiverType, invocationSite, this)) {

-				if (visibleField == null)

-					visibleField = field;

-				else

-					return new ProblemFieldBinding(fieldName, Ambiguous);

-			} else {

-				notVisible = true;

-			}

-		}

-	}

-

-	// walk all visible interfaces to find ambiguous references

-	if (interfacesToVisit != null) {

-		ProblemFieldBinding ambiguous = null;

-		done : for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				ReferenceBinding anInterface = interfaces[j];

-				if ((anInterface.tagBits & InterfaceVisited) == 0) { // if interface as not already been visited

-					anInterface.tagBits |= InterfaceVisited;

-					if ((field = anInterface.getField(fieldName)) != null) {

-						if (visibleField == null) {

-							visibleField = field;

-						} else {

-							ambiguous = new ProblemFieldBinding(fieldName, Ambiguous);

-							break done;

-						}

-					} else {

-						ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

-						if (itsInterfaces != NoSuperInterfaces) {

-							if (++lastPosition == interfacesToVisit.length)

-								System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-							interfacesToVisit[lastPosition] = itsInterfaces;

-						}

-					}

-				}

-			}

-		}

-

-		// bit reinitialization

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++)

-				interfaces[j].tagBits &= ~InterfaceVisited;

-		}

-		if (ambiguous != null) return ambiguous;

-	}

-

-	if (visibleField != null)

-		return visibleField;

-	if (notVisible)

-		return new ProblemFieldBinding(fieldName, NotVisible);

-	return null;

-}

-// Internal use only

-

-public  ReferenceBinding findMemberType(char[] typeName, ReferenceBinding enclosingType) {

-	if ((enclosingType.tagBits & HasNoMemberTypes) != 0)

-		return null; // know it has no member types (nor inherited member types)

-

-	SourceTypeBinding enclosingSourceType = enclosingSourceType();

-	PackageBinding currentPackage = getCurrentPackage();

-	compilationUnitScope().addTypeReference(enclosingType);

-	ReferenceBinding memberType = enclosingType.getMemberType(typeName);

-	if (memberType != null) {

-		compilationUnitScope().addTypeReference(memberType);

-		if (enclosingSourceType == null

-			? memberType.canBeSeenBy(currentPackage)

-			: memberType.canBeSeenBy(enclosingType, enclosingSourceType))

-				return memberType;

-		else

-				return new ProblemReferenceBinding(typeName, NotVisible);

-	}

-

-	// collect all superinterfaces of receiverType until the memberType is found in a supertype

-	ReferenceBinding currentType = enclosingType;

-	ReferenceBinding[][] interfacesToVisit = null;

-	int lastPosition = -1;

-	ReferenceBinding visibleMemberType = null;

-	boolean keepLooking = true;

-	boolean notVisible = false; // we could hold onto the not visible field for extra error reporting

-	while (keepLooking) {

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			if (interfacesToVisit == null)

-				interfacesToVisit = new ReferenceBinding[5][];

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-		}

-		if ((currentType = currentType.superclass()) == null)

-			break;

+		// *** Need a new problem id - TypeNotVisible?

 

 		compilationUnitScope().addTypeReference(currentType);

-		if ((memberType = currentType.getMemberType(typeName)) != null) {

-			compilationUnitScope().addTypeReference(memberType);

-			keepLooking = false;

-			if (enclosingSourceType == null

-				? memberType.canBeSeenBy(currentPackage)

-				: memberType.canBeSeenBy(enclosingType, enclosingSourceType)) {

-					if (visibleMemberType == null)

-						visibleMemberType = memberType;

-					else

-						return new ProblemReferenceBinding(typeName, Ambiguous);

-			} else {

-				notVisible = true;

-			}

+		FieldBinding field = currentType.getField(fieldName);

+		if (field != null) {

+			if (field.canBeSeenBy(currentType, invocationSite, this))

+				return field;

+			else

+				return new ProblemFieldBinding(fieldName, NotVisible);

 		}

-	}

+		// collect all superinterfaces of receiverType until the field is found in a supertype

+		ReferenceBinding[][] interfacesToVisit = null;

+		int lastPosition = -1;

+		FieldBinding visibleField = null;

+		boolean keepLooking = true;

+		boolean notVisible = false;

+		// we could hold onto the not visible field for extra error reporting

+		while (keepLooking) {

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				if (interfacesToVisit == null)

+					interfacesToVisit = new ReferenceBinding[5][];

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

+			}

+			if ((currentType = currentType.superclass()) == null)

+				break;

 

-	// walk all visible interfaces to find ambiguous references

-	if (interfacesToVisit != null) {

-		ProblemReferenceBinding ambiguous = null;

-		done : for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++) {

-				ReferenceBinding anInterface = interfaces[j];

-				if ((anInterface.tagBits & InterfaceVisited) == 0) { // if interface as not already been visited

-					anInterface.tagBits |= InterfaceVisited;

-					compilationUnitScope().addTypeReference(anInterface);

-					if ((memberType = anInterface.getMemberType(typeName)) != null) {

-						compilationUnitScope().addTypeReference(memberType);

-						if (visibleMemberType == null) {

-							visibleMemberType = memberType;

-						} else {

-							ambiguous = new ProblemReferenceBinding(typeName, Ambiguous);

-							break done;

-						}

-					} else {

-						ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

-						if (itsInterfaces != NoSuperInterfaces) {

-							if (++lastPosition == interfacesToVisit.length)

-								System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-							interfacesToVisit[lastPosition] = itsInterfaces;

-						}

-					}

+			if ((field = currentType.getField(fieldName)) != null) {

+				keepLooking = false;

+				if (field.canBeSeenBy(receiverType, invocationSite, this)) {

+					if (visibleField == null)

+						visibleField = field;

+					else

+						return new ProblemFieldBinding(fieldName, Ambiguous);

+				} else {

+					notVisible = true;

 				}

 			}

 		}

-

-		// bit reinitialization

-		for (int i = 0; i <= lastPosition; i++) {

-			ReferenceBinding[] interfaces = interfacesToVisit[i];

-			for (int j = 0, length = interfaces.length; j < length; j++)

-				interfaces[j].tagBits &= ~InterfaceVisited;

-		}

-		if (ambiguous != null) return ambiguous;

-	}

-

-	if (visibleMemberType != null)

-		return visibleMemberType;

-	if (notVisible)

-		return new ProblemReferenceBinding(typeName, NotVisible);

-	return null;

-}

-// Internal use only

-

-public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {

-	ReferenceBinding currentType = receiverType;

-	MethodBinding matchingMethod = null;

-	ObjectVector found = null;

-

-	compilationUnitScope().addTypeReference(currentType);

-	compilationUnitScope().addTypeReferences(argumentTypes);

-	if (currentType.isInterface()) {

-		MethodBinding[] currentMethods = currentType.getMethods(selector);

-		int currentLength = currentMethods.length;

-		if (currentLength == 1) {

-			matchingMethod = currentMethods[0];

-		} else if (currentLength > 1) {

-			found = new ObjectVector();

-			for (int f = 0; f < currentLength; f++)

-				found.add(currentMethods[f]);

-		}

-

-		ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

-		if (itsInterfaces != NoSuperInterfaces) {

-			ReferenceBinding[][] interfacesToVisit = new ReferenceBinding[5][];

-			int lastPosition = -1;

-			if (++lastPosition == interfacesToVisit.length)

-				System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-			interfacesToVisit[lastPosition] = itsInterfaces;

-			

-			for (int i = 0; i <= lastPosition; i++) {

+		// walk all visible interfaces to find ambiguous references

+		if (interfacesToVisit != null) {

+			ProblemFieldBinding ambiguous = null;

+			done : for (int i = 0; i <= lastPosition; i++) {

 				ReferenceBinding[] interfaces = interfacesToVisit[i];

 				for (int j = 0, length = interfaces.length; j < length; j++) {

-					currentType = interfaces[j];

-					if ((currentType.tagBits & InterfaceVisited) == 0) { // if interface as not already been visited

-						currentType.tagBits |= InterfaceVisited;

-

-						currentMethods = currentType.getMethods(selector);

-						if ((currentLength = currentMethods.length) == 1 && matchingMethod == null && found == null) {

-							matchingMethod = currentMethods[0];

-						} else if (currentLength > 0) {

-							if (found == null) {

-								found = new ObjectVector();

-								if (matchingMethod != null)

-									found.add(matchingMethod);

+					ReferenceBinding anInterface = interfaces[j];

+					if ((anInterface.tagBits & InterfaceVisited) == 0) {

+						// if interface as not already been visited

+						anInterface.tagBits |= InterfaceVisited;

+						if ((field = anInterface.getField(fieldName)) != null) {

+							if (visibleField == null) {

+								visibleField = field;

+							} else {

+								ambiguous = new ProblemFieldBinding(fieldName, Ambiguous);

+								break done;

 							}

-							for (int f = 0; f < currentLength; f++)

-								found.add(currentMethods[f]);

-						}

-

-						itsInterfaces = currentType.superInterfaces();

-						if (itsInterfaces != NoSuperInterfaces) {

-							if (++lastPosition == interfacesToVisit.length)

-								System.arraycopy(interfacesToVisit, 0, interfacesToVisit = new ReferenceBinding[lastPosition * 2][], 0, lastPosition);

-							interfacesToVisit[lastPosition] = itsInterfaces;

+						} else {

+							ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

+							if (itsInterfaces != NoSuperInterfaces) {

+								if (++lastPosition == interfacesToVisit.length)

+									System.arraycopy(

+										interfacesToVisit,

+										0,

+										interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+										0,

+										lastPosition);

+								interfacesToVisit[lastPosition] = itsInterfaces;

+							}

 						}

 					}

 				}

 			}

-

 			// bit reinitialization

 			for (int i = 0; i <= lastPosition; i++) {

 				ReferenceBinding[] interfaces = interfacesToVisit[i];

 				for (int j = 0, length = interfaces.length; j < length; j++)

 					interfaces[j].tagBits &= ~InterfaceVisited;

 			}

+			if (ambiguous != null)

+				return ambiguous;

 		}

-		currentType = (matchingMethod == null && found == null) ? getJavaLangObject() : null;

+

+		if (visibleField != null)

+			return visibleField;

+		if (notVisible)

+			return new ProblemFieldBinding(fieldName, NotVisible);

+		return null;

 	}

 

-	while (currentType != null) {

-		MethodBinding[] currentMethods = currentType.getMethods(selector);

-		int currentLength = currentMethods.length;

-		if (currentLength == 1 && matchingMethod == null && found == null) {

-			matchingMethod = currentMethods[0];

-		} else if (currentLength > 0) {

-			if (found == null) {

-				found = new ObjectVector();

-				if (matchingMethod != null)

-					found.add(matchingMethod);

+	// Internal use only

+	public ReferenceBinding findMemberType(

+		char[] typeName,

+		ReferenceBinding enclosingType) {

+		if ((enclosingType.tagBits & HasNoMemberTypes) != 0)

+			return null; // know it has no member types (nor inherited member types)

+

+		SourceTypeBinding enclosingSourceType = enclosingSourceType();

+		PackageBinding currentPackage = getCurrentPackage();

+		compilationUnitScope().addTypeReference(enclosingType);

+		ReferenceBinding memberType = enclosingType.getMemberType(typeName);

+		if (memberType != null) {

+			compilationUnitScope().addTypeReference(memberType);

+			if (enclosingSourceType == null

+				? memberType.canBeSeenBy(currentPackage)

+				: memberType.canBeSeenBy(enclosingType, enclosingSourceType))

+				return memberType;

+			else

+				return new ProblemReferenceBinding(typeName, NotVisible);

+		}

+		// collect all superinterfaces of receiverType until the memberType is found in a supertype

+		ReferenceBinding currentType = enclosingType;

+		ReferenceBinding[][] interfacesToVisit = null;

+		int lastPosition = -1;

+		ReferenceBinding visibleMemberType = null;

+		boolean keepLooking = true;

+		boolean notVisible = false;

+		// we could hold onto the not visible field for extra error reporting

+		while (keepLooking) {

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				if (interfacesToVisit == null)

+					interfacesToVisit = new ReferenceBinding[5][];

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

 			}

-			for (int f = 0; f < currentLength; f++)

-				found.add(currentMethods[f]);

-		}

-		currentType = currentType.superclass();

-	}

-

-	if (found == null)

-		return matchingMethod; // may be null - have not checked arg types or visibility

-

-	int foundSize = found.size;

-	MethodBinding[] compatible = new MethodBinding[foundSize];

-	int compatibleIndex = 0;

-	for (int i = 0; i < foundSize; i++) {

-		MethodBinding methodBinding = (MethodBinding) found.elementAt(i);

-		if (areParametersAssignable(methodBinding.parameters, argumentTypes))

-			compatible[compatibleIndex++] = methodBinding;

-	}

-	if (compatibleIndex == 1)

-		return compatible[0]; // have not checked visibility

-	if (compatibleIndex == 0)

-		return (MethodBinding) found.elementAt(0); // no good match so just use the first one found

-

-	MethodBinding[] visible = new MethodBinding[compatibleIndex];

-	int visibleIndex = 0;

-	for (int i = 0; i < compatibleIndex; i++) {

-		MethodBinding methodBinding = compatible[i];

-		if (methodBinding.canBeSeenBy(receiverType, invocationSite, this))

-			visible[visibleIndex++] = methodBinding;

-	}

-	if (visibleIndex == 1){

-		compilationUnitScope().addTypeReferences(visible[0].thrownExceptions);

-		return visible[0];

-	}

-	if (visibleIndex == 0)

-		return new ProblemMethodBinding(compatible[0].selector, argumentTypes, compatible[0].declaringClass, NotVisible);

-	if (visible[0].declaringClass.isClass())

-		return mostSpecificClassMethodBinding(visible, visibleIndex);

-	else

-		return mostSpecificInterfaceMethodBinding(visible, visibleIndex);

-}

-// Internal use only

-

-public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {

-	ReferenceBinding object = getJavaLangObject();

-	MethodBinding methodBinding = object.getExactMethod(selector, argumentTypes);

-	if (methodBinding != null) {

-		// handle the method clone() specially... cannot be protected or throw exceptions

-		if (argumentTypes == NoParameters && CharOperation.equals(selector, CLONE))

-			return new MethodBinding((methodBinding.modifiers ^ AccProtected) | AccPublic, CLONE, methodBinding.returnType, argumentTypes, null, object);

-		if (methodBinding.canBeSeenBy(receiverType, invocationSite, this))

-			return methodBinding;

-	}

-

-	// answers closest approximation, may not check argumentTypes or visibility

-	methodBinding = findMethod(object, selector, argumentTypes, invocationSite);

-	if (methodBinding == null)

-		return new ProblemMethodBinding(selector, argumentTypes, NotFound);

-	if (methodBinding.isValidBinding()) {

-		if (!areParametersAssignable(methodBinding.parameters, argumentTypes))

-			return new ProblemMethodBinding(methodBinding, selector, argumentTypes, NotFound);

-		if (!methodBinding.canBeSeenBy(receiverType, invocationSite, this))

-			return new ProblemMethodBinding(selector, argumentTypes, methodBinding.declaringClass, NotVisible);

-	}

-	return methodBinding;

-}

-// Internal use only

-

-public ReferenceBinding findType(char[] typeName, PackageBinding declarationPackage, PackageBinding invocationPackage) {

-	compilationUnitScope().addNamespaceReference(declarationPackage);

-	ReferenceBinding typeBinding = declarationPackage.getType(typeName);

-	if (typeBinding == null) return null;

-

-	if (typeBinding.isValidBinding()) {

-		compilationUnitScope().addTypeReference(typeBinding);

-		if (declarationPackage != invocationPackage && !typeBinding.canBeSeenBy(invocationPackage))

-			return new ProblemReferenceBinding(typeName, NotVisible);

-	}

-	return typeBinding;

-}

-public TypeBinding getBaseType(char[] name) {

-	// list should be optimized (with most often used first)

-	int length = name.length;

-	if (length > 2 && length < 8) {

-		switch (name[0]) {

-			case 			   'i':

-				if (length == 3 && 

-					name[1] == 'n' && 

-					name[2] == 't')

-					return IntBinding;

+			if ((currentType = currentType.superclass()) == null)

 				break;

-			case 			   'v':

-				if (length == 4 &&

-					name[1] == 'o' &&

-					name[2] == 'i' &&

-					name[3] == 'd')

-					return VoidBinding;

-				break;

-			

-			case 			   'b':

-				if (length == 7 && 

-					name[1] == 'o' && 

-					name[2] == 'o' && 

-					name[3] == 'l' &&

-					name[4] == 'e' &&

-					name[5] == 'a' &&

-					name[6] == 'n')

-					return BooleanBinding;

-				if (length == 4 &&

-					name[1] == 'y' &&

-					name[2] == 't' &&

-					name[3] == 'e')

-					return ByteBinding;

-				break;

-			case 			   'c':

-				if (length == 4 &&

-					name[1] == 'h' &&

-					name[2] == 'a' &&

-					name[3] == 'r')

-					return CharBinding;

-				break;

-			case 			   'd':

-				if (length == 6 && 

-					name[1] == 'o' &&

-					name[2] == 'u' &&

-					name[3] == 'b' &&

-					name[4] == 'l' &&

-					name[5] == 'e')

-					return DoubleBinding;

-				break;

-			case 			   'f':

-				if (length == 5 && 

-					name[1] == 'l' &&

-					name[2] == 'o' &&

-					name[3] == 'a' &&

-					name[4] == 't')

-					return FloatBinding;

-				break;

-			case 			   'l':

-				if (length == 4 &&

-					name[1] == 'o' &&

-					name[2] == 'n' &&

-					name[3] == 'g')

-					return LongBinding;

-				break;

-			case 			   's':

-				if (length == 5 && 

-					name[1] == 'h' &&

-					name[2] == 'o' &&

-					name[3] == 'r' &&

-					name[4] == 't')

-				return ShortBinding;

-		}

-	}

-	return null;	

-}

-public final PackageBinding getCurrentPackage() {

-	Scope scope, unitScope = this;

-	while ((scope = unitScope.parent) != null)

-		unitScope = scope;

-	return ((CompilationUnitScope) unitScope).fPackage;

-}

-public final ReferenceBinding getJavaIoSerializable() {

-	ReferenceBinding type = environment().getType(JAVA_IO_SERIALIZABLE);

-	if (type != null)

-		return type;

 

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_IO, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_IO_SERIALIZABLE, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangClass() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_CLASS);

-	if (type != null)

-		return type;

-

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_LANG, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_LANG_CLASS, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangCloneable() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_CLONEABLE);

-	if (type != null)

-		return type;

-

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_LANG, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_LANG_CLONEABLE, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangError() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_ERROR);

-	if (type != null)

-		return type;

-

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_LANG, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_LANG_ERROR, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangObject() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_OBJECT);

-	if (type != null)

-		return type;

-

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_LANG, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_LANG_OBJECT, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangRuntimeException() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_RUNTIMEEXCEPTION);

-	if (type != null)

-		return type;

-

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(JAVA_LANG, NotFound)); // record extra reference to pkg

-	problemReporter().isClassPathCorrect(JAVA_LANG_RUNTIMEEXCEPTION, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangString() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_STRING);

-	if (type != null)

-		return type;

-

-	problemReporter().isClassPathCorrect(JAVA_LANG_STRING, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-public final ReferenceBinding getJavaLangThrowable() {

-	ReferenceBinding type = environment().getType(JAVA_LANG_THROWABLE);

-	if (type != null)

-		return type;

-

-	problemReporter().isClassPathCorrect(JAVA_LANG_THROWABLE, referenceCompilationUnit());

-	return null; // will not get here since the above error aborts the compilation

-}

-/* Answer the type binding corresponding to the typeName argument, relative to the enclosingType.

-*/

-

-public final ReferenceBinding getMemberType(char[] typeName, ReferenceBinding enclosingType) {

-	ReferenceBinding memberType = findMemberType(typeName, enclosingType);

-	if (memberType == null)

-		return new ProblemReferenceBinding(typeName, NotFound);

-	else

-		return memberType;

-}

-/* Answer the type binding corresponding to the compoundName.

-*

-* NOTE: If a problem binding is returned, senders should extract the compound name

-* from the binding & not assume the problem applies to the entire compoundName.

-*/

-

-public final TypeBinding getType(char[][] compoundName) {

-	int typeNameLength = compoundName.length;	

-	if (typeNameLength == 1) {

-		// Would like to remove this test and require senders to specially handle base types

-		TypeBinding binding = getBaseType(compoundName[0]);

-		if (binding != null)

-			return binding;

-	}

-

-	Binding binding = getTypeOrPackage(compoundName[0], typeNameLength == 1 ? TYPE : TYPE | PACKAGE);

-	if (binding == null)

-		return new ProblemReferenceBinding(compoundName[0], NotFound);

-	if (!binding.isValidBinding()){

-		compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(compoundName[0], NotFound)); // record extra reference to pkg

-		return (ReferenceBinding) binding;

-	}

-	int currentIndex = 1;

-	boolean checkVisibility = false;

-	if (binding instanceof PackageBinding) {

-		PackageBinding packageBinding = (PackageBinding) binding;

-		compilationUnitScope().addNamespaceReference(packageBinding);

-

-		while (currentIndex < typeNameLength) {

-			binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]); // does not check visibility

-			if (binding == null)

-				return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), NotFound);

- 			if (!binding.isValidBinding())

-				return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), binding.problemId());

- 			if (!(binding instanceof PackageBinding))

- 				break;

- 			packageBinding = (PackageBinding) binding;

-			compilationUnitScope().addNamespaceReference(packageBinding);

-		}

-

-		if (binding instanceof PackageBinding)

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), NotFound);

-		checkVisibility = true;

-	}

-

-	// binding is now a ReferenceBinding

-	ReferenceBinding typeBinding = (ReferenceBinding) binding;

-	compilationUnitScope().addTypeReference(typeBinding);

-	if (checkVisibility) // handles the fall through case

-		if (!typeBinding.canBeSeenBy(this))

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), NotVisible); 

-

-	while (currentIndex < typeNameLength) {

-		typeBinding = getMemberType(compoundName[currentIndex++], typeBinding);

-		if (!typeBinding.isValidBinding())

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), typeBinding.problemId());

-	}

-	return typeBinding;

-}

-/* Answer the type binding that corresponds the given name, starting the lookup in the receiver.

-* The name provided is a simple source name (e.g., "Object" , "Point", ...)

-*/

-

-// The return type of this method could be ReferenceBinding if we did not answer base types.

-

-// NOTE: We could support looking for Base Types last in the search, however any code using

-// this feature would be extraordinarily slow.  Therefore we don't do this

-

-public final TypeBinding getType(char[] name) {

-	// Would like to remove this test and require senders to specially handle base types

-	TypeBinding binding = getBaseType(name);

-	if (binding != null)

-		return binding;

-

-	return (ReferenceBinding) getTypeOrPackage(name, TYPE);

-}

-// Added for code assist... NOT Public API

-

-public final Binding getTypeOrPackage(char[][] compoundName) {

-	int nameLength = compoundName.length;

-	if (nameLength == 1) {

-		TypeBinding binding = getBaseType(compoundName[0]);

-		if (binding != null)

-			return binding;

-	}

-

-	Binding binding = getTypeOrPackage(compoundName[0], TYPE | PACKAGE);

-	if (!binding.isValidBinding())

-		return binding;

-

-	int currentIndex = 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, 0, currentIndex), NotFound);

- 			if (!binding.isValidBinding())

-				return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), binding.problemId());

- 			if (!(binding instanceof PackageBinding))

- 				break;

- 			packageBinding = (PackageBinding) binding;

-		}

-

-		if (binding instanceof PackageBinding)

-			return binding;

-		checkVisibility = true;

-	}

-

-	// binding is now a ReferenceBinding

-	ReferenceBinding typeBinding = (ReferenceBinding) binding;

-	if (checkVisibility) // handles the fall through case

-		if (!typeBinding.canBeSeenBy(this))

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), NotVisible); 

-

-	while (currentIndex < nameLength) {

-		typeBinding = getMemberType(compoundName[currentIndex++], typeBinding); // checks visibility

-		if (!typeBinding.isValidBinding())

-			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), typeBinding.problemId());

-	}

-	return typeBinding;

-}

-/* Internal use only 

-*/

-

-final Binding getTypeOrPackage(char[] name, int mask) {

-	Scope scope = this;

-	if ((mask & TYPE) == 0) {

-		Scope next = scope;

-		while ((next = scope.parent) != null)

-			scope = next;

-	} else {

-		ReferenceBinding foundType = null;

-		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

-			switch(scope.kind) {

-				case METHOD_SCOPE :

-				case BLOCK_SCOPE :

-					ReferenceBinding localType = ((BlockScope) scope).findLocalType(name); // looks in this scope only

-					if (localType != null) {

-						if (foundType != null && foundType != localType)

-							return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

-						return localType;

-					}

-					break;

-				case CLASS_SCOPE :

-					SourceTypeBinding sourceType = ((ClassScope) scope).referenceContext.binding;

-					if (CharOperation.equals(sourceType.sourceName, name)) {

-						if (foundType != null && foundType != sourceType)

-							return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

-						return sourceType;

-					}

-

-					ReferenceBinding memberType = findMemberType(name, sourceType);

-					if (memberType != null) { // skip it if we did not find anything

-						if (memberType.problemId() == Ambiguous) {

-							if (foundType == null || foundType.problemId() == NotVisible)

-								// supercedes any potential InheritedNameHidesEnclosingName problem

-								return memberType;

-							else

-								// make the user qualify the type, likely wants the first inherited type

-								return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

-						}

-

-						if (memberType.isValidBinding()) {

-							if (sourceType == memberType.enclosingType()) { // found a valid type in the 'immediate' scope (ie. not inherited)

-								if (foundType == null)

-									return memberType;

-								if (foundType.isValidBinding()) // if a valid type was found, complain when another is found in an 'immediate' enclosing type (ie. not inherited)

-									if (foundType != memberType)

-										return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

-							}

-						}

-

-						if (foundType == null || (foundType.problemId() == NotVisible && memberType.problemId() != NotVisible))

-							// only remember the memberType if its the first one found or the previous one was not visible & memberType is...

-							foundType = memberType;

-					}

-					break;

-				case COMPILATION_UNIT_SCOPE :

-					break done;

-			}

-			scope = scope.parent;

-		}

-		if (foundType != null)

-			return foundType;

-	}

-

-	// at this point the scope is a compilation unit scope

-	CompilationUnitScope unitScope = (CompilationUnitScope) scope;

-	// ask for the imports + name

-	if ((mask & TYPE) != 0) {

-		// check single type imports.

-		ImportBinding[] imports = unitScope.imports; // copy the list, since single type imports are removed if they cannot be resolved

-		for (int i = 0, length = imports.length; i < length; i++) {

-			ImportBinding typeImport = imports[i];

-			if (!typeImport.onDemand)

-				if (CharOperation.equals(typeImport.compoundName[typeImport.compoundName.length - 1], name))

-					if (unitScope.resolveSingleTypeImport(typeImport) != null)

-						return typeImport.resolvedImport; // already know its visible

-		}

-

-		// check if the name is in the current package (answer the problem binding unless its not found in which case continue to look)

-		ReferenceBinding type = findType(name, unitScope.fPackage, unitScope.fPackage); // is always visible

-		if (type != null)

-			return type;

-

-		// check on demand imports

-		boolean foundInImport = false;

-		for (int i = 0, length = unitScope.imports.length; i < length; i++) {

-			if (unitScope.imports[i].onDemand) {

-				Binding resolvedImport = unitScope.imports[i].resolvedImport;

-				ReferenceBinding temp =

-					(resolvedImport instanceof PackageBinding)

-						? findType(name, (PackageBinding) resolvedImport, unitScope.fPackage)

-						: findDirectMemberType(name, (ReferenceBinding) resolvedImport);

-				if (temp != null && temp.isValidBinding()) {

-					if (foundInImport)

-						// Answer error binding -- import on demand conflict; name found in two import on demand packages.

-						return new ProblemReferenceBinding(name, Ambiguous);

-					type = temp;

-					foundInImport = true;

+			compilationUnitScope().addTypeReference(currentType);

+			if ((memberType = currentType.getMemberType(typeName)) != null) {

+				compilationUnitScope().addTypeReference(memberType);

+				keepLooking = false;

+				if (enclosingSourceType == null

+					? memberType.canBeSeenBy(currentPackage)

+					: memberType.canBeSeenBy(enclosingType, enclosingSourceType)) {

+					if (visibleMemberType == null)

+						visibleMemberType = memberType;

+					else

+						return new ProblemReferenceBinding(typeName, Ambiguous);

+				} else {

+					notVisible = true;

 				}

 			}

 		}

+		// walk all visible interfaces to find ambiguous references

+		if (interfacesToVisit != null) {

+			ProblemReferenceBinding ambiguous = null;

+			done : for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++) {

+					ReferenceBinding anInterface = interfaces[j];

+					if ((anInterface.tagBits & InterfaceVisited) == 0) {

+						// if interface as not already been visited

+						anInterface.tagBits |= InterfaceVisited;

+						compilationUnitScope().addTypeReference(anInterface);

+						if ((memberType = anInterface.getMemberType(typeName)) != null) {

+							compilationUnitScope().addTypeReference(memberType);

+							if (visibleMemberType == null) {

+								visibleMemberType = memberType;

+							} else {

+								ambiguous = new ProblemReferenceBinding(typeName, Ambiguous);

+								break done;

+							}

+						} else {

+							ReferenceBinding[] itsInterfaces = anInterface.superInterfaces();

+							if (itsInterfaces != NoSuperInterfaces) {

+								if (++lastPosition == interfacesToVisit.length)

+									System.arraycopy(

+										interfacesToVisit,

+										0,

+										interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+										0,

+										lastPosition);

+								interfacesToVisit[lastPosition] = itsInterfaces;

+							}

+						}

+					}

+				}

+			}

+			// bit reinitialization

+			for (int i = 0; i <= lastPosition; i++) {

+				ReferenceBinding[] interfaces = interfacesToVisit[i];

+				for (int j = 0, length = interfaces.length; j < length; j++)

+					interfaces[j].tagBits &= ~InterfaceVisited;

+			}

+			if (ambiguous != null)

+				return ambiguous;

+		}

+		if (visibleMemberType != null)

+			return visibleMemberType;

+		if (notVisible)

+			return new ProblemReferenceBinding(typeName, NotVisible);

+		return null;

+	}

 

+	// Internal use only

+	public MethodBinding findMethod(

+		ReferenceBinding receiverType,

+		char[] selector,

+		TypeBinding[] argumentTypes,

+		InvocationSite invocationSite) {

+		ReferenceBinding currentType = receiverType;

+		MethodBinding matchingMethod = null;

+		ObjectVector found = null;

+

+		compilationUnitScope().addTypeReference(currentType);

+		compilationUnitScope().addTypeReferences(argumentTypes);

+		if (currentType.isInterface()) {

+			MethodBinding[] currentMethods = currentType.getMethods(selector);

+			int currentLength = currentMethods.length;

+			if (currentLength == 1) {

+				matchingMethod = currentMethods[0];

+			} else if (currentLength > 1) {

+				found = new ObjectVector();

+				for (int f = 0; f < currentLength; f++)

+					found.add(currentMethods[f]);

+			}

+			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();

+			if (itsInterfaces != NoSuperInterfaces) {

+				ReferenceBinding[][] interfacesToVisit = new ReferenceBinding[5][];

+				int lastPosition = -1;

+				if (++lastPosition == interfacesToVisit.length)

+					System.arraycopy(

+						interfacesToVisit,

+						0,

+						interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+						0,

+						lastPosition);

+				interfacesToVisit[lastPosition] = itsInterfaces;

+

+				for (int i = 0; i <= lastPosition; i++) {

+					ReferenceBinding[] interfaces = interfacesToVisit[i];

+					for (int j = 0, length = interfaces.length; j < length; j++) {

+						currentType = interfaces[j];

+						if ((currentType.tagBits & InterfaceVisited) == 0) {

+							// if interface as not already been visited

+							currentType.tagBits |= InterfaceVisited;

+

+							currentMethods = currentType.getMethods(selector);

+							if ((currentLength = currentMethods.length) == 1

+								&& matchingMethod == null

+								&& found == null) {

+								matchingMethod = currentMethods[0];

+							} else if (currentLength > 0) {

+								if (found == null) {

+									found = new ObjectVector();

+									if (matchingMethod != null)

+										found.add(matchingMethod);

+								}

+								for (int f = 0; f < currentLength; f++)

+									found.add(currentMethods[f]);

+							}

+							itsInterfaces = currentType.superInterfaces();

+							if (itsInterfaces != NoSuperInterfaces) {

+								if (++lastPosition == interfacesToVisit.length)

+									System.arraycopy(

+										interfacesToVisit,

+										0,

+										interfacesToVisit = new ReferenceBinding[lastPosition * 2][],

+										0,

+										lastPosition);

+								interfacesToVisit[lastPosition] = itsInterfaces;

+							}

+						}

+					}

+				}

+				// bit reinitialization

+				for (int i = 0; i <= lastPosition; i++) {

+					ReferenceBinding[] interfaces = interfacesToVisit[i];

+					for (int j = 0, length = interfaces.length; j < length; j++)

+						interfaces[j].tagBits &= ~InterfaceVisited;

+				}

+			}

+			currentType =

+				(matchingMethod == null && found == null) ? getJavaLangObject() : null;

+		}

+		while (currentType != null) {

+			MethodBinding[] currentMethods = currentType.getMethods(selector);

+			int currentLength = currentMethods.length;

+			if (currentLength == 1 && matchingMethod == null && found == null) {

+				matchingMethod = currentMethods[0];

+			} else if (currentLength > 0) {

+				if (found == null) {

+					found = new ObjectVector();

+					if (matchingMethod != null)

+						found.add(matchingMethod);

+				}

+				for (int f = 0; f < currentLength; f++)

+					found.add(currentMethods[f]);

+			}

+			currentType = currentType.superclass();

+		}

+

+		if (found == null)

+			return matchingMethod;

+		// may be null - have not checked arg types or visibility

+

+		int foundSize = found.size;

+		MethodBinding[] compatible = new MethodBinding[foundSize];

+		int compatibleIndex = 0;

+		for (int i = 0; i < foundSize; i++) {

+			MethodBinding methodBinding = (MethodBinding) found.elementAt(i);

+			if (areParametersAssignable(methodBinding.parameters, argumentTypes))

+				compatible[compatibleIndex++] = methodBinding;

+		}

+		if (compatibleIndex == 1)

+			return compatible[0]; // have not checked visibility

+		if (compatibleIndex == 0)

+			return (MethodBinding) found.elementAt(0);

+		// no good match so just use the first one found

+

+		MethodBinding[] visible = new MethodBinding[compatibleIndex];

+		int visibleIndex = 0;

+		for (int i = 0; i < compatibleIndex; i++) {

+			MethodBinding methodBinding = compatible[i];

+			if (methodBinding.canBeSeenBy(receiverType, invocationSite, this))

+				visible[visibleIndex++] = methodBinding;

+		}

+		if (visibleIndex == 1) {

+			compilationUnitScope().addTypeReferences(visible[0].thrownExceptions);

+			return visible[0];

+		}

+		if (visibleIndex == 0)

+			return new ProblemMethodBinding(

+				compatible[0].selector,

+				argumentTypes,

+				compatible[0].declaringClass,

+				NotVisible);

+		if (visible[0].declaringClass.isClass())

+			return mostSpecificClassMethodBinding(visible, visibleIndex);

+		else

+			return mostSpecificInterfaceMethodBinding(visible, visibleIndex);

+	}

+

+	// Internal use only

+	public MethodBinding findMethodForArray(

+		ArrayBinding receiverType,

+		char[] selector,

+		TypeBinding[] argumentTypes,

+		InvocationSite invocationSite) {

+		ReferenceBinding object = getJavaLangObject();

+		MethodBinding methodBinding = object.getExactMethod(selector, argumentTypes);

+		if (methodBinding != null) {

+			// handle the method clone() specially... cannot be protected or throw exceptions

+			if (argumentTypes == NoParameters && CharOperation.equals(selector, CLONE))

+				return new MethodBinding(

+					(methodBinding.modifiers ^ AccProtected) | AccPublic,

+					CLONE,

+					methodBinding.returnType,

+					argumentTypes,

+					null,

+					object);

+			if (methodBinding.canBeSeenBy(receiverType, invocationSite, this))

+				return methodBinding;

+		}

+		// answers closest approximation, may not check argumentTypes or visibility

+		methodBinding = findMethod(object, selector, argumentTypes, invocationSite);

+		if (methodBinding == null)

+			return new ProblemMethodBinding(selector, argumentTypes, NotFound);

+		if (methodBinding.isValidBinding()) {

+			if (!areParametersAssignable(methodBinding.parameters, argumentTypes))

+				return new ProblemMethodBinding(

+					methodBinding,

+					selector,

+					argumentTypes,

+					NotFound);

+			if (!methodBinding.canBeSeenBy(receiverType, invocationSite, this))

+				return new ProblemMethodBinding(

+					selector,

+					argumentTypes,

+					methodBinding.declaringClass,

+					NotVisible);

+		}

+		return methodBinding;

+	}

+

+	// Internal use only

+	public ReferenceBinding findType(

+		char[] typeName,

+		PackageBinding declarationPackage,

+		PackageBinding invocationPackage) {

+		compilationUnitScope().addNamespaceReference(declarationPackage);

+		ReferenceBinding typeBinding = declarationPackage.getType(typeName);

+		if (typeBinding == null)

+			return null;

+

+		if (typeBinding.isValidBinding()) {

+			compilationUnitScope().addTypeReference(typeBinding);

+			if (declarationPackage != invocationPackage

+				&& !typeBinding.canBeSeenBy(invocationPackage))

+				return new ProblemReferenceBinding(typeName, NotVisible);

+		}

+		return typeBinding;

+	}

+

+	public TypeBinding getBaseType(char[] name) {

+		// list should be optimized (with most often used first)

+		int length = name.length;

+		if (length > 2 && length < 8) {

+			switch (name[0]) {

+				case 'i' :

+					if (length == 3 && name[1] == 'n' && name[2] == 't')

+						return IntBinding;

+					break;

+				case 'v' :

+					if (length == 4 && name[1] == 'o' && name[2] == 'i' && name[3] == 'd')

+						return VoidBinding;

+					break;

+				case 'b' :

+					if (length == 7

+						&& name[1] == 'o'

+						&& name[2] == 'o'

+						&& name[3] == 'l'

+						&& name[4] == 'e'

+						&& name[5] == 'a'

+						&& name[6] == 'n')

+						return BooleanBinding;

+					if (length == 4 && name[1] == 'y' && name[2] == 't' && name[3] == 'e')

+						return ByteBinding;

+					break;

+				case 'c' :

+					if (length == 4 && name[1] == 'h' && name[2] == 'a' && name[3] == 'r')

+						return CharBinding;

+					break;

+				case 'd' :

+					if (length == 6

+						&& name[1] == 'o'

+						&& name[2] == 'u'

+						&& name[3] == 'b'

+						&& name[4] == 'l'

+						&& name[5] == 'e')

+						return DoubleBinding;

+					break;

+				case 'f' :

+					if (length == 5

+						&& name[1] == 'l'

+						&& name[2] == 'o'

+						&& name[3] == 'a'

+						&& name[4] == 't')

+						return FloatBinding;

+					break;

+				case 'l' :

+					if (length == 4 && name[1] == 'o' && name[2] == 'n' && name[3] == 'g')

+						return LongBinding;

+					break;

+				case 's' :

+					if (length == 5

+						&& name[1] == 'h'

+						&& name[2] == 'o'

+						&& name[3] == 'r'

+						&& name[4] == 't')

+						return ShortBinding;

+			}

+		}

+		return null;

+	}

+

+	public final PackageBinding getCurrentPackage() {

+		Scope scope, unitScope = this;

+		while ((scope = unitScope.parent) != null)

+			unitScope = scope;

+		return ((CompilationUnitScope) unitScope).fPackage;

+	}

+

+	public final ReferenceBinding getJavaIoSerializable() {

+		ReferenceBinding type = environment().getType(JAVA_IO_SERIALIZABLE);

 		if (type != null)

 			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_IO, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_IO_SERIALIZABLE,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

 	}

 

-	// see if the name is a package

-	if ((mask & PACKAGE) != 0) {

-		PackageBinding packageBinding = unitScope.environment.getTopLevelPackage(name);

-		if (packageBinding != null)

-			return packageBinding;

+	public final ReferenceBinding getJavaLangClass() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_CLASS);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_CLASS,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

 	}

 

-	// Answer error binding -- could not find name

-	compilationUnitScope().addNamespaceReference(new ProblemPackageBinding(name, NotFound));

-	return new ProblemReferenceBinding(name, NotFound);

-}

-/* Answer whether the type is defined in the same compilation unit as the receiver

-*/

+	public final ReferenceBinding getJavaLangCloneable() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_CLONEABLE);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_CLONEABLE,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-public final boolean isDefinedInSameUnit(ReferenceBinding type) {

-	// find the outer most enclosing type

-	ReferenceBinding enclosingType = type;

-	while ((type = enclosingType.enclosingType()) != null)

-		enclosingType = type;

+	public final ReferenceBinding getJavaLangError() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_ERROR);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_ERROR,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-	// find the compilation unit scope

-	Scope scope, unitScope = this;

-	while ((scope = unitScope.parent) != null)

-		unitScope = scope;

+	public final ReferenceBinding getJavaLangAssertionError() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_ASSERTIONERROR);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_ASSERTIONERROR,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-	// test that the enclosingType is not part of the compilation unit

-	SourceTypeBinding[] topLevelTypes = ((CompilationUnitScope) unitScope).topLevelTypes;

-	for (int i = topLevelTypes.length; --i >= 0;)

-		if (topLevelTypes[i] == enclosingType)

-			return true;

-	return false;

-}

-public final boolean isJavaIoSerializable(TypeBinding tb){

-	//a first -none optimized version-...:-)....

-	//please modify as needed

+	public final ReferenceBinding getJavaLangObject() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_OBJECT);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_OBJECT,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-	return tb == getJavaIoSerializable();

-}

-public final boolean isJavaLangCloneable(TypeBinding tb){

-	//a first -none optimized version-...:-)....

-	//please modify as needed

+	public final ReferenceBinding getJavaLangRuntimeException() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_RUNTIMEEXCEPTION);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		// record extra reference to pkg

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_RUNTIMEEXCEPTION,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-	return tb == getJavaLangCloneable();

-}

-public final boolean isJavaLangObject(TypeBinding type) {

-	return type.id == T_JavaLangObject;

-}

-public final MethodScope methodScope() {

-	Scope scope = this;

-	do {

-		if (scope instanceof MethodScope)

-			return (MethodScope) scope;

-		scope = scope.parent;

-	} while (scope != null);

-	return null;

-}

-// Internal use only

+	public final ReferenceBinding getJavaLangString() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_STRING);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_STRING,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-/* All methods in visible are acceptable matches for the method in question...

-* The methods defined by the receiver type appear before those defined by its

-* superclass and so on. We want to find the one which matches best.

-*

-* Since the receiver type is a class, we know each method's declaring class is

-* either the receiver type or one of its superclasses. It is an error if the best match

-* is defined by a superclass, when a lesser match is defined by the receiver type

-* or a closer superclass.

-*/

+	public final ReferenceBinding getJavaLangThrowable() {

+		ReferenceBinding type = environment().getType(JAVA_LANG_THROWABLE);

+		if (type != null)

+			return type;

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(JAVA_LANG, NotFound));

+		problemReporter().isClassPathCorrect(

+			JAVA_LANG_THROWABLE,

+			referenceCompilationUnit());

+		return null; // will not get here since the above error aborts the compilation

+	}

 

-protected final MethodBinding mostSpecificClassMethodBinding(MethodBinding[] visible, int visibleSize) {

-	MethodBinding method = null;

-	MethodBinding previous = null;

-	nextVisible: for (int i = 0; i < visibleSize; i++) {

-		method = visible[i];

-		if (previous != null && method.declaringClass != previous.declaringClass)

-			break; // cannot answer a method farther up the hierarchy than the first method found

-		previous = method;

-		for (int j = 0; j < visibleSize; j++) {

-			if (i == j) continue;

-			MethodBinding next = visible[j];

-			if (!areParametersAssignable(next.parameters, method.parameters))

-				continue nextVisible;

+	/* Answer the type binding corresponding to the typeName argument, relative to the enclosingType.

+	*/

+	public final ReferenceBinding getMemberType(

+		char[] typeName,

+		ReferenceBinding enclosingType) {

+		ReferenceBinding memberType = findMemberType(typeName, enclosingType);

+		if (memberType == null)

+			return new ProblemReferenceBinding(typeName, NotFound);

+		else

+			return memberType;

+	}

+

+	/* Answer the type binding corresponding to the compoundName.

+	*

+	* NOTE: If a problem binding is returned, senders should extract the compound name

+	* from the binding & not assume the problem applies to the entire compoundName.

+	*/

+	public final TypeBinding getType(char[][] compoundName) {

+		int typeNameLength = compoundName.length;

+		if (typeNameLength == 1) {

+			// Would like to remove this test and require senders to specially handle base types

+			TypeBinding binding = getBaseType(compoundName[0]);

+			if (binding != null)

+				return binding;

 		}

-		compilationUnitScope().addTypeReferences(method.thrownExceptions);

-		return method;

-	}

-	return new ProblemMethodBinding(visible[0].selector, visible[0].parameters, Ambiguous);

-}

-// Internal use only

-

-/* All methods in visible are acceptable matches for the method in question...

-* Since the receiver type is an interface, we ignore the possibility that 2 inherited

-* but unrelated superinterfaces may define the same method in acceptable but

-* not identical ways... we just take the best match that we find since any class which

-* implements the receiver interface MUST implement all signatures for the method...

-* in which case the best match is correct.

-*

-* NOTE: This is different than javac... in the following example, the message send of

-* bar(X) in class Y is supposed to be ambiguous. But any class which implements the

-* interface I MUST implement both signatures for bar. If this class was the receiver of

-* the message send instead of the interface I, then no problem would be reported.

-*

-interface I1 {

-	void bar(J j);

-}

-interface I2 {

-//	void bar(J j);

-	void bar(Object o);

-}

-interface I extends I1, I2 {}

-interface J {}

-

-class X implements J {}

-

-class Y extends X {

-	public void foo(I i, X x) { i.bar(x); }

-}

-*/

-

-protected final MethodBinding mostSpecificInterfaceMethodBinding(MethodBinding[] visible, int visibleSize) {

-	MethodBinding method = null;

-	nextVisible: for (int i = 0; i < visibleSize; i++) {

-		method = visible[i];

-		for (int j = 0; j < visibleSize; j++) {

-			if (i == j) continue;

-			MethodBinding next = visible[j];

-			if (!areParametersAssignable(next.parameters, method.parameters))

-				continue nextVisible;

+		Binding binding =

+			getTypeOrPackage(compoundName[0], typeNameLength == 1 ? TYPE : TYPE | PACKAGE);

+		if (binding == null)

+			return new ProblemReferenceBinding(compoundName[0], NotFound);

+		if (!binding.isValidBinding()) {

+			compilationUnitScope().addNamespaceReference(

+				new ProblemPackageBinding(compoundName[0], NotFound));

+			// record extra reference to pkg

+			return (ReferenceBinding) binding;

 		}

-		compilationUnitScope().addTypeReferences(method.thrownExceptions);

-		return method;

+		int currentIndex = 1;

+		boolean checkVisibility = false;

+		if (binding instanceof PackageBinding) {

+			PackageBinding packageBinding = (PackageBinding) binding;

+			compilationUnitScope().addNamespaceReference(packageBinding);

+

+			while (currentIndex < typeNameLength) {

+				binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]);

+				// does not check visibility

+				if (binding == null)

+					return new ProblemReferenceBinding(

+						CharOperation.subarray(compoundName, 0, currentIndex),

+						NotFound);

+				if (!binding.isValidBinding())

+					return new ProblemReferenceBinding(

+						CharOperation.subarray(compoundName, 0, currentIndex),

+						binding.problemId());

+				if (!(binding instanceof PackageBinding))

+					break;

+				packageBinding = (PackageBinding) binding;

+				compilationUnitScope().addNamespaceReference(packageBinding);

+			}

+			if (binding instanceof PackageBinding)

+				return new ProblemReferenceBinding(

+					CharOperation.subarray(compoundName, 0, currentIndex),

+					NotFound);

+			checkVisibility = true;

+		}

+		// binding is now a ReferenceBinding

+		ReferenceBinding typeBinding = (ReferenceBinding) binding;

+		compilationUnitScope().addTypeReference(typeBinding);

+		if (checkVisibility) // handles the fall through case

+			if (!typeBinding.canBeSeenBy(this))

+				return new ProblemReferenceBinding(

+					CharOperation.subarray(compoundName, 0, currentIndex),

+					NotVisible);

+

+		while (currentIndex < typeNameLength) {

+			typeBinding = getMemberType(compoundName[currentIndex++], typeBinding);

+			if (!typeBinding.isValidBinding())

+				return new ProblemReferenceBinding(

+					CharOperation.subarray(compoundName, 0, currentIndex),

+					typeBinding.problemId());

+		}

+		return typeBinding;

 	}

-	return new ProblemMethodBinding(visible[0].selector, visible[0].parameters, 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; // may answer null if no class around

-}

-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; // may answer null if no method around

-}

-public abstract ProblemReporter problemReporter();

-public final CompilationUnitDeclaration referenceCompilationUnit() {

-	Scope scope, unitScope = this;

-	while ((scope = unitScope.parent) != null)

-		unitScope = scope;

-	return ((CompilationUnitScope) unitScope).referenceContext;

-}

-// start position in this scope - for ordering scopes vs. variables

-int startIndex() {

-	return 0;

-}

-}

+

+	/* Answer the type binding that corresponds the given name, starting the lookup in the receiver.

+	* The name provided is a simple source name (e.g., "Object" , "Point", ...)

+	*/

+	// The return type of this method could be ReferenceBinding if we did not answer base types.

+	// NOTE: We could support looking for Base Types last in the search, however any code using

+	// this feature would be extraordinarily slow.  Therefore we don't do this

+	public final TypeBinding getType(char[] name) {

+		// Would like to remove this test and require senders to specially handle base types

+		TypeBinding binding = getBaseType(name);

+		if (binding != null)

+			return binding;

+

+		return (ReferenceBinding) getTypeOrPackage(name, TYPE);

+	}

+

+	// Added for code assist... NOT Public API

+	public final Binding getTypeOrPackage(char[][] compoundName) {

+		int nameLength = compoundName.length;

+		if (nameLength == 1) {

+			TypeBinding binding = getBaseType(compoundName[0]);

+			if (binding != null)

+				return binding;

+		}

+		Binding binding = getTypeOrPackage(compoundName[0], TYPE | PACKAGE);

+		if (!binding.isValidBinding())

+			return binding;

+

+		int currentIndex = 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, 0, currentIndex),

+						NotFound);

+				if (!binding.isValidBinding())

+					return new ProblemReferenceBinding(

+						CharOperation.subarray(compoundName, 0, currentIndex),

+						binding.problemId());

+				if (!(binding instanceof PackageBinding))

+					break;

+				packageBinding = (PackageBinding) binding;

+			}

+			if (binding instanceof PackageBinding)

+				return binding;

+			checkVisibility = true;

+		}

+		// binding is now a ReferenceBinding

+		ReferenceBinding typeBinding = (ReferenceBinding) binding;

+		if (checkVisibility) // handles the fall through case

+			if (!typeBinding.canBeSeenBy(this))

+				return new ProblemReferenceBinding(

+					CharOperation.subarray(compoundName, 0, currentIndex),

+					NotVisible);

+

+		while (currentIndex < nameLength) {

+			typeBinding = getMemberType(compoundName[currentIndex++], typeBinding);

+			// checks visibility

+			if (!typeBinding.isValidBinding())

+				return new ProblemReferenceBinding(

+					CharOperation.subarray(compoundName, 0, currentIndex),

+					typeBinding.problemId());

+		}

+		return typeBinding;

+	}

+

+	/* Internal use only 

+	*/

+	final Binding getTypeOrPackage(char[] name, int mask) {

+		Scope scope = this;

+		if ((mask & TYPE) == 0) {

+			Scope next = scope;

+			while ((next = scope.parent) != null)

+				scope = next;

+		} else {

+			ReferenceBinding foundType = null;

+			done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

+				switch (scope.kind) {

+					case METHOD_SCOPE :

+					case BLOCK_SCOPE :

+						ReferenceBinding localType = ((BlockScope) scope).findLocalType(name);

+						// looks in this scope only

+						if (localType != null) {

+							if (foundType != null && foundType != localType)

+								return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

+							return localType;

+						}

+						break;

+					case CLASS_SCOPE :

+						SourceTypeBinding sourceType = ((ClassScope) scope).referenceContext.binding;

+						if (CharOperation.equals(sourceType.sourceName, name)) {

+							if (foundType != null && foundType != sourceType)

+								return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

+							return sourceType;

+						}

+						ReferenceBinding memberType = findMemberType(name, sourceType);

+						if (memberType != null) { // skip it if we did not find anything

+							if (memberType.problemId() == Ambiguous) {

+								if (foundType == null || foundType.problemId() == NotVisible)

+									// supercedes any potential InheritedNameHidesEnclosingName problem

+									return memberType;

+								else

+									// make the user qualify the type, likely wants the first inherited type

+									return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

+							}

+							if (memberType.isValidBinding()) {

+								if (sourceType == memberType.enclosingType()) {

+									// found a valid type in the 'immediate' scope (ie. not inherited)

+									if (foundType == null)

+										return memberType;

+									if (foundType.isValidBinding())

+										// if a valid type was found, complain when another is found in an 'immediate' enclosing type (ie. not inherited)

+										if (foundType != memberType)

+											return new ProblemReferenceBinding(name, InheritedNameHidesEnclosingName);

+								}

+							}

+							if (foundType == null

+								|| (foundType.problemId() == NotVisible && memberType.problemId() != NotVisible))

+								// only remember the memberType if its the first one found or the previous one was not visible & memberType is...

+								foundType = memberType;

+						}

+						break;

+					case COMPILATION_UNIT_SCOPE :

+						break done;

+				}

+				scope = scope.parent;

+			}

+			if (foundType != null)

+				return foundType;

+		}

+		// at this point the scope is a compilation unit scope

+		CompilationUnitScope unitScope = (CompilationUnitScope) scope;

+		// ask for the imports + name

+		if ((mask & TYPE) != 0) {

+			// check single type imports.

+			ImportBinding[] imports = unitScope.imports;

+			// copy the list, since single type imports are removed if they cannot be resolved

+			for (int i = 0, length = imports.length; i < length; i++) {

+				ImportBinding typeImport = imports[i];

+				if (!typeImport.onDemand)

+					if (CharOperation

+						.equals(typeImport.compoundName[typeImport.compoundName.length - 1], name))

+						if (unitScope.resolveSingleTypeImport(typeImport) != null)

+							return typeImport.resolvedImport; // already know its visible

+			}

+			// check if the name is in the current package (answer the problem binding unless its not found in which case continue to look)

+			ReferenceBinding type = findType(name, unitScope.fPackage, unitScope.fPackage);

+			// is always visible

+			if (type != null)

+				return type;

+

+			// check on demand imports

+			boolean foundInImport = false;

+			for (int i = 0, length = unitScope.imports.length; i < length; i++) {

+				if (unitScope.imports[i].onDemand) {

+					Binding resolvedImport = unitScope.imports[i].resolvedImport;

+					ReferenceBinding temp =

+						(resolvedImport instanceof PackageBinding)

+							? findType(name, (PackageBinding) resolvedImport, unitScope.fPackage)

+							: findDirectMemberType(name, (ReferenceBinding) resolvedImport);

+					if (temp != null && temp.isValidBinding()) {

+						if (foundInImport)

+							// Answer error binding -- import on demand conflict; name found in two import on demand packages.

+							return new ProblemReferenceBinding(name, Ambiguous);

+						type = temp;

+						foundInImport = true;

+					}

+				}

+			}

+			if (type != null)

+				return type;

+		}

+		// see if the name is a package

+		if ((mask & PACKAGE) != 0) {

+			PackageBinding packageBinding = unitScope.environment.getTopLevelPackage(name);

+			if (packageBinding != null)

+				return packageBinding;

+		}

+		// Answer error binding -- could not find name

+		compilationUnitScope().addNamespaceReference(

+			new ProblemPackageBinding(name, NotFound));

+		return new ProblemReferenceBinding(name, NotFound);

+	}

+

+	/* Answer whether the type is defined in the same compilation unit as the receiver

+	*/

+	public final boolean isDefinedInSameUnit(ReferenceBinding type) {

+		// find the outer most enclosing type

+		ReferenceBinding enclosingType = type;

+		while ((type = enclosingType.enclosingType()) != null)

+			enclosingType = type;

+

+		// find the compilation unit scope

+		Scope scope, unitScope = this;

+		while ((scope = unitScope.parent) != null)

+			unitScope = scope;

+

+		// test that the enclosingType is not part of the compilation unit

+		SourceTypeBinding[] topLevelTypes =

+			((CompilationUnitScope) unitScope).topLevelTypes;

+		for (int i = topLevelTypes.length; --i >= 0;)

+			if (topLevelTypes[i] == enclosingType)

+				return true;

+		return false;

+	}

+

+	public final boolean isJavaIoSerializable(TypeBinding tb) {

+		//a first -none optimized version-...:-)....

+		//please modify as needed

+

+		return tb == getJavaIoSerializable();

+	}

+

+	public final boolean isJavaLangCloneable(TypeBinding tb) {

+		//a first -none optimized version-...:-)....

+		//please modify as needed

+

+		return tb == getJavaLangCloneable();

+	}

+

+	public final boolean isJavaLangObject(TypeBinding type) {

+		return type.id == T_JavaLangObject;

+	}

+

+	public final MethodScope methodScope() {

+		Scope scope = this;

+		do {

+			if (scope instanceof MethodScope)

+				return (MethodScope) scope;

+			scope = scope.parent;

+		} while (scope != null);

+		return null;

+	}

+

+	// Internal use only

+	/* All methods in visible are acceptable matches for the method in question...

+	* The methods defined by the receiver type appear before those defined by its

+	* superclass and so on. We want to find the one which matches best.

+	*

+	* Since the receiver type is a class, we know each method's declaring class is

+	* either the receiver type or one of its superclasses. It is an error if the best match

+	* is defined by a superclass, when a lesser match is defined by the receiver type

+	* or a closer superclass.

+	*/

+	protected final MethodBinding mostSpecificClassMethodBinding(

+		MethodBinding[] visible,

+		int visibleSize) {

+		MethodBinding method = null;

+		MethodBinding previous = null;

+		nextVisible : for (int i = 0; i < visibleSize; i++) {

+			method = visible[i];

+			if (previous != null && method.declaringClass != previous.declaringClass)

+				break;

+			// cannot answer a method farther up the hierarchy than the first method found

+			previous = method;

+			for (int j = 0; j < visibleSize; j++) {

+				if (i == j)

+					continue;

+				MethodBinding next = visible[j];

+				if (!areParametersAssignable(next.parameters, method.parameters))

+					continue nextVisible;

+			}

+			compilationUnitScope().addTypeReferences(method.thrownExceptions);

+			return method;

+		}

+		return new ProblemMethodBinding(

+			visible[0].selector,

+			visible[0].parameters,

+			Ambiguous);

+	}

+

+	// Internal use only

+	/* All methods in visible are acceptable matches for the method in question...

+	* Since the receiver type is an interface, we ignore the possibility that 2 inherited

+	* but unrelated superinterfaces may define the same method in acceptable but

+	* not identical ways... we just take the best match that we find since any class which

+	* implements the receiver interface MUST implement all signatures for the method...

+	* in which case the best match is correct.

+	*

+	* NOTE: This is different than javac... in the following example, the message send of

+	* bar(X) in class Y is supposed to be ambiguous. But any class which implements the

+	* interface I MUST implement both signatures for bar. If this class was the receiver of

+	* the message send instead of the interface I, then no problem would be reported.

+	*

+	interface I1 {

+		void bar(J j);

+	}

+	interface I2 {

+	//	void bar(J j);

+		void bar(Object o);

+	}

+	interface I extends I1, I2 {}

+	interface J {}

+	

+	class X implements J {}

+	

+	class Y extends X {

+		public void foo(I i, X x) { i.bar(x); }

+	}

+	*/

+	protected final MethodBinding mostSpecificInterfaceMethodBinding(

+		MethodBinding[] visible,

+		int visibleSize) {

+		MethodBinding method = null;

+		nextVisible : for (int i = 0; i < visibleSize; i++) {

+			method = visible[i];

+			for (int j = 0; j < visibleSize; j++) {

+				if (i == j)

+					continue;

+				MethodBinding next = visible[j];

+				if (!areParametersAssignable(next.parameters, method.parameters))

+					continue nextVisible;

+			}

+			compilationUnitScope().addTypeReferences(method.thrownExceptions);

+			return method;

+		}

+		return new ProblemMethodBinding(

+			visible[0].selector,

+			visible[0].parameters,

+			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; // may answer null if no class around

+	}

+

+	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; // may answer null if no method around

+	}

+

+	public final CompilationUnitDeclaration referenceCompilationUnit() {

+		Scope scope, unitScope = this;

+		while ((scope = unitScope.parent) != null)

+			unitScope = scope;

+		return ((CompilationUnitScope) unitScope).referenceContext;

+	}

+	// start position in this scope - for ordering scopes vs. variables

+	int startIndex() {

+		return 0;

+	}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 4f1f13b..00767da 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -118,7 +118,7 @@
 					synthField.name = CharOperation.concat(

 						SyntheticArgumentBinding.OuterLocalPrefix,

 						actualOuterLocalVariable.name,

-						("$"/*nonNLS*/ + String.valueOf(index++)).toCharArray());

+						("$" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$

 					needRecheck = true;

 					break;

 				}

@@ -176,7 +176,7 @@
 	FieldBinding synthField = (FieldBinding) synthetics[CLASS_LITERAL].get(targetType);

 	if (synthField == null) {

 		synthField = new SyntheticFieldBinding(

-			("class$"/*nonNLS*/ + synthetics[CLASS_LITERAL].size()).toCharArray(),

+			("class$" + synthetics[CLASS_LITERAL].size()).toCharArray(), //$NON-NLS-1$

 			blockScope.getJavaLangClass(),

 			AccDefault | AccStatic | AccSynthetic,

 			this,

@@ -198,6 +198,51 @@
 	}		

 	return synthField;

 }

+

+/* Add a new synthetic field for the emulation of the assert statement.

+*	Answer the new field or the existing field if one already existed.

+*/

+public FieldBinding addSyntheticField(AssertStatement assertStatement, BlockScope blockScope) {

+	if (synthetics == null) {

+		synthetics = new Hashtable[] { new Hashtable(5), new Hashtable(5), new Hashtable(5) };

+	}

+

+	// use a different table than FIELDS, given there might be a collision between emulation of X.this$0 and X.class.

+	FieldBinding synthField = (FieldBinding) synthetics[FIELD].get("assertionEmulation"); //$NON-NLS-1$

+	if (synthField == null) {

+		synthField = new SyntheticFieldBinding(

+			"$assertionsDisabled".toCharArray(), //$NON-NLS-1$

+			BooleanBinding,

+			AccDefault | AccStatic | AccSynthetic | AccFinal,

+			this,

+			Constant.NotAConstant,

+			0);

+		synthetics[FIELD].put("assertionEmulation", synthField); //$NON-NLS-1$

+	}

+	// ensure there is not already such a field defined by the user

+	// ensure there is not already such a field defined by the user

+	boolean needRecheck;

+	int index = 0;

+	do {

+		needRecheck = false;

+		FieldBinding existingField;

+		if ((existingField = this.getField(synthField.name)) != null) {

+			TypeDeclaration typeDecl = scope.referenceContext;

+			for (int i = 0, max = typeDecl.fields.length; i < max; i++) {

+				FieldDeclaration fieldDecl = typeDecl.fields[i];

+				if (fieldDecl.binding == existingField) {

+					synthField.name = CharOperation.concat(

+						"$assertionsDisabled".toCharArray(), //$NON-NLS-1$

+						("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$

+					needRecheck = true;

+					break;

+				}

+			}

+		}

+	} while (needRecheck);

+	return synthField;

+}

+

 /* Add a new synthetic access method for read/write access to <targetField>.

 	Answer the new method or the existing method if one already existed.

 */

@@ -732,71 +777,71 @@
 	return bindings;

 }

 public String toString() {

-	String s = "(id="/*nonNLS*/+(id == NoId ? "NoId"/*nonNLS*/ : (""/*nonNLS*/+id) ) +")\n"/*nonNLS*/;

+	String s = "(id="+(id == NoId ? "NoId" : (""+id) ) +")\n"; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-4$ //$NON-NLS-1$

 

-	if (isDeprecated()) s += "deprecated "/*nonNLS*/;

-	if (isPublic()) s += "public "/*nonNLS*/;

-	if (isProtected()) s += "protected "/*nonNLS*/;

-	if (isPrivate()) s += "private "/*nonNLS*/;

-	if (isAbstract() && isClass()) s += "abstract "/*nonNLS*/;

-	if (isStatic() && isNestedType()) s += "static "/*nonNLS*/;

-	if (isFinal()) s += "final "/*nonNLS*/;

+	if (isDeprecated()) s += "deprecated "; //$NON-NLS-1$

+	if (isPublic()) s += "public "; //$NON-NLS-1$

+	if (isProtected()) s += "protected "; //$NON-NLS-1$

+	if (isPrivate()) s += "private "; //$NON-NLS-1$

+	if (isAbstract() && isClass()) s += "abstract "; //$NON-NLS-1$

+	if (isStatic() && isNestedType()) s += "static "; //$NON-NLS-1$

+	if (isFinal()) s += "final "; //$NON-NLS-1$

 

-	s += isInterface() ? "interface "/*nonNLS*/ : "class "/*nonNLS*/;

-	s += (compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED TYPE"/*nonNLS*/;

+	s += isInterface() ? "interface " : "class "; //$NON-NLS-1$ //$NON-NLS-2$

+	s += (compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED TYPE"; //$NON-NLS-1$

 

-	s += "\n\textends "/*nonNLS*/;

-	s += (superclass != null) ? superclass.debugName() : "NULL TYPE"/*nonNLS*/;

+	s += "\n\textends "; //$NON-NLS-1$

+	s += (superclass != null) ? superclass.debugName() : "NULL TYPE"; //$NON-NLS-1$

 

 	if (superInterfaces != null) {

 		if (superInterfaces != NoSuperInterfaces) {

-			s += "\n\timplements : "/*nonNLS*/;

+			s += "\n\timplements : "; //$NON-NLS-1$

 			for (int i = 0, length = superInterfaces.length; i < length; i++) {

 				if (i  > 0)

-					s += ", "/*nonNLS*/;

-				s += (superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"/*nonNLS*/;

+					s += ", "; //$NON-NLS-1$

+				s += (superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"; //$NON-NLS-1$

 			}

 		}

 	} else {

-		s += "NULL SUPERINTERFACES"/*nonNLS*/;

+		s += "NULL SUPERINTERFACES"; //$NON-NLS-1$

 	}

 

 	if (enclosingType() != null) {

-		s += "\n\tenclosing type : "/*nonNLS*/;

+		s += "\n\tenclosing type : "; //$NON-NLS-1$

 		s += enclosingType().debugName();

 	}

 

 	if (fields != null) {

 		if (fields != NoFields) {

-			s += "\n/*   fields   */"/*nonNLS*/;

+			s += "\n/*   fields   */"; //$NON-NLS-1$

 			for (int i = 0, length = fields.length; i < length; i++)

-				s += (fields[i] != null) ? "\n"/*nonNLS*/ + fields[i].toString() : "\nNULL FIELD"/*nonNLS*/;

+				s += (fields[i] != null) ? "\n" + fields[i].toString() : "\nNULL FIELD"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL FIELDS"/*nonNLS*/;

+		s += "NULL FIELDS"; //$NON-NLS-1$

 	}

 

 	if (methods != null) {

 		if (methods != NoMethods) {

-			s += "\n/*   methods   */"/*nonNLS*/;

+			s += "\n/*   methods   */"; //$NON-NLS-1$

 			for (int i = 0, length = methods.length; i < length; i++)

-				s += (methods[i] != null) ? "\n"/*nonNLS*/ + methods[i].toString() : "\nNULL METHOD"/*nonNLS*/;

+				s += (methods[i] != null) ? "\n" + methods[i].toString() : "\nNULL METHOD"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL METHODS"/*nonNLS*/;

+		s += "NULL METHODS"; //$NON-NLS-1$

 	}

 

 	if (memberTypes != null) {

 		if (memberTypes != NoMemberTypes) {

-			s += "\n/*   members   */"/*nonNLS*/;

+			s += "\n/*   members   */"; //$NON-NLS-1$

 			for (int i = 0, length = memberTypes.length; i < length; i++)

-				s += (memberTypes[i] != null) ? "\n"/*nonNLS*/ + memberTypes[i].toString() : "\nNULL TYPE"/*nonNLS*/;

+				s += (memberTypes[i] != null) ? "\n" + memberTypes[i].toString() : "\nNULL TYPE"; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	} else {

-		s += "NULL MEMBER TYPES"/*nonNLS*/;

+		s += "NULL MEMBER TYPES"; //$NON-NLS-1$

 	}

 

-	s += "\n\n\n"/*nonNLS*/;

+	s += "\n\n\n"; //$NON-NLS-1$

 	return s;

 }

 void verifyMethods(MethodVerifier verifier) {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index cef8fc3..d0db104 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -17,6 +17,7 @@
 	// Constant compound names

 	final char[][] JAVA_LANG = new char[][] {JAVA, LANG};

 	final char[][] JAVA_IO = new char[][] {JAVA, IO};

+	final char[][] JAVA_LANG_ASSERTIONERROR = new char[][] {JAVA, LANG, "AssertionError".toCharArray()}; //$NON-NLS-1$

 	final char[][] JAVA_LANG_CLASS = new char[][] {JAVA, LANG, {'C', 'l', 'a', 's', 's'}};

 	final char[][] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = new char[][] {JAVA, LANG, {'C', 'l', 'a', 's', 's', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n'}};

 	final char[][] JAVA_LANG_CLONEABLE = new char[][] {JAVA, LANG, {'C', 'l', 'o', 'n', 'e', 'a', 'b', 'l', 'e'}};

@@ -32,15 +33,15 @@
 	final char[][] JAVA_LANG_REFLECT_CONSTRUCTOR = new char[][] {JAVA, LANG, REFLECT, {'C', 'o', 'n', 's', 't', 'r', 'u', 'c', 't', 'o', 'r'}};

 	final char[][] JAVA_IO_PRINTSTREAM = new char[][] {JAVA, IO, {'P', 'r', 'i', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm'}};

 	final char[][] JAVA_IO_SERIALIZABLE = new char[][] {JAVA, IO, {'S', 'e', 'r', 'i', 'a', 'l', 'i', 'z', 'a', 'b', 'l', 'e'}};

-	final char[][] JAVA_LANG_BYTE = new char[][] {JAVA, LANG, "Byte"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_SHORT = new char[][] {JAVA, LANG, "Short"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_CHARACTER = new char[][] {JAVA, LANG, "Character"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_INTEGER = new char[][] {JAVA, LANG, "Integer"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_LONG = new char[][] {JAVA, LANG, "Long"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_FLOAT = new char[][] {JAVA, LANG, "Float"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_DOUBLE = new char[][] {JAVA, LANG, "Double"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_BOOLEAN = new char[][] {JAVA, LANG, "Boolean"/*nonNLS*/.toCharArray()};

-	final char[][] JAVA_LANG_VOID = new char[][] {JAVA, LANG, "Void"/*nonNLS*/.toCharArray()};

+	final char[][] JAVA_LANG_BYTE = new char[][] {JAVA, LANG, "Byte".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_SHORT = new char[][] {JAVA, LANG, "Short".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_CHARACTER = new char[][] {JAVA, LANG, "Character".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_INTEGER = new char[][] {JAVA, LANG, "Integer".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_LONG = new char[][] {JAVA, LANG, "Long".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_FLOAT = new char[][] {JAVA, LANG, "Float".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_DOUBLE = new char[][] {JAVA, LANG, "Double".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_BOOLEAN = new char[][] {JAVA, LANG, "Boolean".toCharArray()}; //$NON-NLS-1$

+	final char[][] JAVA_LANG_VOID = new char[][] {JAVA, LANG, "Void".toCharArray()}; //$NON-NLS-1$

 

 	// Constants used by the flow analysis

 	final int EqualOrMoreSpecific = -1;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
index 8647522..61b6336 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
@@ -52,6 +52,9 @@
 	final int T_JavaLangDouble = 32;

 	final int T_JavaLangBoolean = 33;

 	final int T_JavaLangVoid = 34;

+

+	// 1.4 feature

+	final int T_JavaLangAssertionError = 35;

 	final int NoId = Integer.MAX_VALUE;

 

 	// implicit conversions: <compileType> to <runtimeType>  (note: booleans are integers at runtime)

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
index 0ad1bf1..b592011 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
@@ -32,6 +32,6 @@
 	return null; // will not get here since the above error aborts the compilation

 }

 public String toString() {

-	return "Unresolved type "/*nonNLS*/ + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"/*nonNLS*/);

+	return "Unresolved type " + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java b/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
index 6bdad12..5006fba 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
@@ -26,9 +26,9 @@
 	return name;

 }

 public String toString() {

-	String s = (type != null) ? type.debugName() : "UNDEFINED TYPE"/*nonNLS*/;

-	s += " "/*nonNLS*/;

-	s += (name != null) ? new String(name) : "UNNAMED FIELD"/*nonNLS*/;

+	String s = (type != null) ? type.debugName() : "UNDEFINED TYPE"; //$NON-NLS-1$

+	s += " "; //$NON-NLS-1$

+	s += (name != null) ? new String(name) : "UNNAMED FIELD"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 11a9f3e..1b916af 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -13,6 +13,7 @@
 import org.eclipse.jdt.internal.compiler.util.*;

 

 import java.io.*;

+import java.util.ArrayList;

 

 public class Parser implements BindingIds, ParserBasicInformation, TerminalSymbols, CompilerModifiers, OperatorIds, TypeIds {

 	protected ProblemReporter problemReporter;

@@ -33,6 +34,9 @@
 	protected int lastIgnoredToken, nextIgnoredToken;

 	protected int lastErrorEndPosition;

 		

+	// 1.4 feature

+	protected boolean assertMode = false;

+	

 	//internal data for the automat 

 	protected final static int StackIncrement = 255;

 	protected int stateStackTop;

@@ -78,274 +82,270 @@
 	protected int dietInt = 0; // if > 0 force the none-diet-parsing mode (even if diet if requested) [field parsing with anonymous inner classes...]

 	protected int[] variablesCounter;

 	//===DATA===DATA===DATA===DATA===DATA===DATA===//

-

-	public final static byte rhs[] = {0,

-			2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

-			2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,

-			1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

-			2,2,1,1,1,1,3,4,0,1,2,1,1,1,1,

-			1,1,1,1,1,5,1,2,1,2,2,2,1,1,2,

-			2,2,4,1,1,1,1,2,1,1,1,1,1,1,1,

-			1,1,1,1,2,3,3,2,2,1,3,1,3,1,2,

-			1,1,1,3,0,1,1,1,1,1,1,1,4,1,3,

-			3,7,0,0,0,0,0,2,1,1,1,2,2,4,4,

-			5,4,4,2,1,2,3,3,1,3,3,1,3,1,4,

-			0,2,1,2,4,1,1,2,5,5,7,7,7,7,2,

-			2,3,2,2,3,1,2,1,2,1,1,2,2,1,1,

-			1,1,1,3,3,4,1,3,4,0,1,2,1,1,1,

-			1,2,3,4,0,1,1,1,1,1,1,1,1,1,1,

-			1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,

-			2,1,1,1,1,1,1,1,5,7,7,6,2,3,3,

-			4,1,2,2,1,2,3,2,5,5,7,9,9,1,1,

-			1,1,3,2,3,2,3,3,3,5,1,3,4,1,2,

-			5,2,1,1,1,1,1,1,3,1,1,3,3,3,3,

-			3,1,1,5,6,8,7,2,0,2,0,1,3,4,4,

-			1,2,3,2,1,1,2,2,3,3,4,6,6,4,4,

-			1,1,1,1,2,2,0,1,1,3,3,1,3,3,1,

-			3,3,1,5,5,4,1,3,3,3,1,3,3,1,3,

-			3,3,1,3,3,3,3,3,1,3,3,1,3,1,3,

-			1,3,1,3,1,3,1,5,1,1,3,3,1,1,1,

-			1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

-			0,1,0,1,0,1,0,1,0,1,0,1,0,2,0,

-			1,0,1,0,1,0,1,0,1,0,1,0,1,0,2,

-			0,0,1,0,1,0,1,0,1,0,1

-	};

+    public final static byte rhs[] = {0,

+            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

+            2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,

+            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

+            2,2,1,1,1,1,3,4,0,1,2,1,1,1,1,

+            1,1,1,1,1,5,1,2,1,2,2,2,1,1,2,

+            2,2,4,1,1,1,1,2,1,1,1,1,1,1,1,

+            1,1,1,1,2,3,3,2,2,1,3,1,3,1,2,

+            1,1,1,3,0,3,1,1,1,1,1,1,1,4,1,

+            3,3,7,0,0,0,0,0,2,1,1,1,2,2,4,

+            4,5,4,4,2,1,2,3,3,1,3,3,1,3,1,

+            4,0,2,1,2,4,1,1,2,5,5,7,7,7,7,

+            2,2,3,2,2,3,1,2,1,2,1,1,2,2,1,

+            1,1,1,1,3,3,4,1,3,4,0,1,2,1,1,

+            1,1,2,3,4,0,1,1,1,1,1,1,1,1,1,

+            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

+            3,3,2,1,1,1,1,1,1,1,5,7,7,6,2,

+            3,3,4,1,2,2,1,2,3,2,5,5,7,9,9,

+            1,1,1,1,3,3,5,2,3,2,3,3,3,5,1,

+            3,4,1,2,5,2,1,1,1,1,1,1,3,1,1,

+            3,3,3,3,3,1,1,5,6,8,7,2,0,2,0,

+            1,3,4,4,1,2,3,2,1,1,2,2,3,3,4,

+            6,6,4,4,1,1,1,1,2,2,0,1,1,3,3,

+            1,3,3,1,3,3,1,5,5,4,1,3,3,3,1,

+            3,3,1,3,3,3,1,3,3,3,3,3,1,3,3,

+            1,3,1,3,1,3,1,3,1,3,1,5,1,1,3,

+            3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

+            1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,

+            1,0,2,0,1,0,1,0,1,0,1,0,1,0,1,

+            0,1,0,2,0,0,1,0,1,0,1,0,1,0,1

+    };

 		

 	public  static char asb[] = null;

 	public  static char asr[] = null;

 	public  static char symbol_index[] = null;

-	private static final String UNEXPECTED_EOF = "Unexpected End Of File"/*nonNLS*/ ;

+	private static final String UNEXPECTED_EOF = "Unexpected End Of File" ; //$NON-NLS-1$

 

-	public final static String name[] = { null,

-			"++"/*nonNLS*/,

-			"--"/*nonNLS*/,

-			"=="/*nonNLS*/,

-			"<="/*nonNLS*/,

-			">="/*nonNLS*/,

-			"!="/*nonNLS*/,

-			"<<"/*nonNLS*/,

-			">>"/*nonNLS*/,

-			">>>"/*nonNLS*/,

-			"+="/*nonNLS*/,

-			"-="/*nonNLS*/,

-			"*="/*nonNLS*/,

-			"/="/*nonNLS*/,

-			"&="/*nonNLS*/,

-			"|="/*nonNLS*/,

-			"^="/*nonNLS*/,

-			"%="/*nonNLS*/,

-			"<<="/*nonNLS*/,

-			">>="/*nonNLS*/,

-			">>>="/*nonNLS*/,

-			"||"/*nonNLS*/,

-			"&&"/*nonNLS*/,

-			"+"/*nonNLS*/,

-			"-"/*nonNLS*/,

-			"!"/*nonNLS*/,

-			"%"/*nonNLS*/,

-			"^"/*nonNLS*/,

-			"&"/*nonNLS*/,

-			"*"/*nonNLS*/,

-			"|"/*nonNLS*/,

-			"~"/*nonNLS*/,

-			"/"/*nonNLS*/,

-			">"/*nonNLS*/,

-			"<"/*nonNLS*/,

-			"("/*nonNLS*/,

-			")"/*nonNLS*/,

-			"{"/*nonNLS*/,

-			"}"/*nonNLS*/,

-			"["/*nonNLS*/,

-			"]"/*nonNLS*/,

-			";"/*nonNLS*/,

-			"?"/*nonNLS*/,

-			":"/*nonNLS*/,

-			","/*nonNLS*/,

-			"."/*nonNLS*/,

-			"="/*nonNLS*/,

-			""/*nonNLS*/,

-			"$empty"/*nonNLS*/,

-			"Identifier"/*nonNLS*/,

-			"abstract"/*nonNLS*/,

-			"boolean"/*nonNLS*/,

-			"break"/*nonNLS*/,

-			"byte"/*nonNLS*/,

-			"case"/*nonNLS*/,

-			"catch"/*nonNLS*/,

-			"char"/*nonNLS*/,

-			"class"/*nonNLS*/,

-			"continue"/*nonNLS*/,

-			"default"/*nonNLS*/,

-			"do"/*nonNLS*/,

-			"double"/*nonNLS*/,

-			"else"/*nonNLS*/,

-			"extends"/*nonNLS*/,

-			"false"/*nonNLS*/,

-			"final"/*nonNLS*/,

-			"finally"/*nonNLS*/,

-			"float"/*nonNLS*/,

-			"for"/*nonNLS*/,

-			"if"/*nonNLS*/,

-			"implements"/*nonNLS*/,

-			"import"/*nonNLS*/,

-			"instanceof"/*nonNLS*/,

-			"int"/*nonNLS*/,

-			"interface"/*nonNLS*/,

-			"long"/*nonNLS*/,

-			"native"/*nonNLS*/,

-			"new"/*nonNLS*/,

-			"null"/*nonNLS*/,

-			"package"/*nonNLS*/,

-			"private"/*nonNLS*/,

-			"protected"/*nonNLS*/,

-			"public"/*nonNLS*/,

-			"return"/*nonNLS*/,

-			"short"/*nonNLS*/,

-			"static"/*nonNLS*/,

-			"strictfp"/*nonNLS*/,

-			"super"/*nonNLS*/,

-			"switch"/*nonNLS*/,

-			"synchronized"/*nonNLS*/,

-			"this"/*nonNLS*/,

-			"throw"/*nonNLS*/,

-			"throws"/*nonNLS*/,

-			"transient"/*nonNLS*/,

-			"true"/*nonNLS*/,

-			"try"/*nonNLS*/,

-			"void"/*nonNLS*/,

-			"volatile"/*nonNLS*/,

-			"while"/*nonNLS*/,

-			"IntegerLiteral"/*nonNLS*/,

-			"LongLiteral"/*nonNLS*/,

-			"FloatingPointLiteral"/*nonNLS*/,

-			"DoubleLiteral"/*nonNLS*/,

-			"CharacterLiteral"/*nonNLS*/,

-			"StringLiteral"/*nonNLS*/,

-  			UNEXPECTED_EOF,

-			"Invalid Character"/*nonNLS*/,

-			"Goal"/*nonNLS*/,

-			"MethodBody"/*nonNLS*/,

-			"ConstructorBody"/*nonNLS*/,

-			"StaticInitializer"/*nonNLS*/,

-			"ClassBodyDeclaration"/*nonNLS*/,

-			"Headers"/*nonNLS*/,

-			"BlockStatements"/*nonNLS*/,

-			"MethodPushModifiersHeader"/*nonNLS*/,

-			"CatchHeader"/*nonNLS*/,

-			"FieldDeclaration"/*nonNLS*/,

-			"ImportDeclaration"/*nonNLS*/,

-			"PackageDeclaration"/*nonNLS*/,

-			"TypeDeclaration"/*nonNLS*/,

-			"GenericMethodDeclaration"/*nonNLS*/,

-			"Expression"/*nonNLS*/,

-			"Type"/*nonNLS*/,

-			"PrimitiveType"/*nonNLS*/,

-			"ReferenceType"/*nonNLS*/,

-			"ClassOrInterfaceType"/*nonNLS*/,

-			"ArrayType"/*nonNLS*/,

-			"Name"/*nonNLS*/,

-			"Dims"/*nonNLS*/,

-			"ClassType"/*nonNLS*/,

-			"SimpleName"/*nonNLS*/,

-			"Header"/*nonNLS*/,

-			"ClassHeader"/*nonNLS*/,

-			"InterfaceHeader"/*nonNLS*/,

-			"MethodHeader"/*nonNLS*/,

-			"ConstructorHeader"/*nonNLS*/,

-			"FormalParameter"/*nonNLS*/,

-			"ImportDeclarations"/*nonNLS*/,

-			"TypeDeclarations"/*nonNLS*/,

-			"PackageDeclarationName"/*nonNLS*/,

-			"SingleTypeImportDeclarationNam"/*nonNLS*/ +

-			"e"/*nonNLS*/,

-			"TypeImportOnDemandDeclarationN"/*nonNLS*/ +

-			"ame"/*nonNLS*/,

-			"Modifiers"/*nonNLS*/,

-			"Modifier"/*nonNLS*/,

-			"ClassBody"/*nonNLS*/,

-			"ClassHeaderName"/*nonNLS*/,

-			"InterfaceTypeList"/*nonNLS*/,

-			"InterfaceType"/*nonNLS*/,

-			"ClassBodyDeclarations"/*nonNLS*/,

-			"Block"/*nonNLS*/,

-			"VariableDeclarators"/*nonNLS*/,

-			"VariableDeclarator"/*nonNLS*/,

-			"VariableDeclaratorId"/*nonNLS*/,

-			"VariableInitializer"/*nonNLS*/,

-			"ArrayInitializer"/*nonNLS*/,

-			"MethodHeaderName"/*nonNLS*/,

-			"MethodHeaderParameters"/*nonNLS*/,

-			"MethodPushModifiersHeaderName"/*nonNLS*/,

-			"ClassTypeList"/*nonNLS*/,

-			"ConstructorHeaderName"/*nonNLS*/,

-			"FormalParameterList"/*nonNLS*/,

-			"ClassTypeElt"/*nonNLS*/,

-			"StaticOnly"/*nonNLS*/,

-			"ExplicitConstructorInvocation"/*nonNLS*/,

-			"Primary"/*nonNLS*/,

-			"InterfaceBody"/*nonNLS*/,

-			"InterfaceHeaderName"/*nonNLS*/,

-			"InterfaceMemberDeclarations"/*nonNLS*/,

-			"InterfaceMemberDeclaration"/*nonNLS*/,

-			"VariableInitializers"/*nonNLS*/,

-			"BlockStatement"/*nonNLS*/,

-			"Statement"/*nonNLS*/,

-			"LocalVariableDeclaration"/*nonNLS*/,

-			"StatementWithoutTrailingSubsta"/*nonNLS*/ +

-			"tement"/*nonNLS*/,

-			"StatementNoShortIf"/*nonNLS*/,

-			"StatementExpression"/*nonNLS*/,

-			"PostIncrementExpression"/*nonNLS*/,

-			"PostDecrementExpression"/*nonNLS*/,

-			"MethodInvocation"/*nonNLS*/,

-			"ClassInstanceCreationExpressio"/*nonNLS*/ +

-			"n"/*nonNLS*/,

-			"SwitchBlock"/*nonNLS*/,

-			"SwitchBlockStatements"/*nonNLS*/,

-			"SwitchLabels"/*nonNLS*/,

-			"SwitchBlockStatement"/*nonNLS*/,

-			"SwitchLabel"/*nonNLS*/,

-			"ConstantExpression"/*nonNLS*/,

-			"StatementExpressionList"/*nonNLS*/,

-			"OnlySynchronized"/*nonNLS*/,

-			"Catches"/*nonNLS*/,

-			"Finally"/*nonNLS*/,

-			"CatchClause"/*nonNLS*/,

-			"PushLPAREN"/*nonNLS*/,

-			"PushRPAREN"/*nonNLS*/,

-			"PrimaryNoNewArray"/*nonNLS*/,

-			"FieldAccess"/*nonNLS*/,

-			"ArrayAccess"/*nonNLS*/,

-			"ClassInstanceCreationExpressio"/*nonNLS*/ +

-			"nName"/*nonNLS*/,

-			"ArgumentList"/*nonNLS*/,

-			"DimWithOrWithOutExprs"/*nonNLS*/,

-			"DimWithOrWithOutExpr"/*nonNLS*/,

-			"DimsLoop"/*nonNLS*/,

-			"OneDimLoop"/*nonNLS*/,

-			"PostfixExpression"/*nonNLS*/,

-			"UnaryExpression"/*nonNLS*/,

-			"UnaryExpressionNotPlusMinus"/*nonNLS*/,

-			"MultiplicativeExpression"/*nonNLS*/,

-			"AdditiveExpression"/*nonNLS*/,

-			"ShiftExpression"/*nonNLS*/,

-			"RelationalExpression"/*nonNLS*/,

-			"EqualityExpression"/*nonNLS*/,

-			"AndExpression"/*nonNLS*/,

-			"ExclusiveOrExpression"/*nonNLS*/,

-			"InclusiveOrExpression"/*nonNLS*/,

-			"ConditionalAndExpression"/*nonNLS*/,

-			"ConditionalOrExpression"/*nonNLS*/,

-			"ConditionalExpression"/*nonNLS*/,

-			"AssignmentExpression"/*nonNLS*/,

-			"LeftHandSide"/*nonNLS*/,

-			"AssignmentOperator"/*nonNLS*/

-	};

-

+    public final static String name[] = { null,

+            "++", //$NON-NLS-1$

+            "--", //$NON-NLS-1$

+            "==", //$NON-NLS-1$

+            "<=", //$NON-NLS-1$

+            ">=", //$NON-NLS-1$

+            "!=", //$NON-NLS-1$

+            "<<", //$NON-NLS-1$

+            ">>", //$NON-NLS-1$

+            ">>>", //$NON-NLS-1$

+            "+=", //$NON-NLS-1$

+            "-=", //$NON-NLS-1$

+            "*=", //$NON-NLS-1$

+            "/=", //$NON-NLS-1$

+            "&=", //$NON-NLS-1$

+            "|=", //$NON-NLS-1$

+            "^=", //$NON-NLS-1$

+            "%=", //$NON-NLS-1$

+            "<<=", //$NON-NLS-1$

+            ">>=", //$NON-NLS-1$

+            ">>>=", //$NON-NLS-1$

+            "||", //$NON-NLS-1$

+            "&&", //$NON-NLS-1$

+            "+", //$NON-NLS-1$

+            "-", //$NON-NLS-1$

+            "!", //$NON-NLS-1$

+            "%", //$NON-NLS-1$

+            "^", //$NON-NLS-1$

+            "&", //$NON-NLS-1$

+            "*", //$NON-NLS-1$

+            "|", //$NON-NLS-1$

+            "~", //$NON-NLS-1$

+            "/", //$NON-NLS-1$

+            ">", //$NON-NLS-1$

+            "<", //$NON-NLS-1$

+            "(", //$NON-NLS-1$

+            ")", //$NON-NLS-1$

+            "{", //$NON-NLS-1$

+            "}", //$NON-NLS-1$

+            "[", //$NON-NLS-1$

+            "]", //$NON-NLS-1$

+            ";", //$NON-NLS-1$

+            "?", //$NON-NLS-1$

+            ":", //$NON-NLS-1$

+            ",", //$NON-NLS-1$

+            ".", //$NON-NLS-1$

+            "=", //$NON-NLS-1$

+            "", //$NON-NLS-1$

+            "$empty", //$NON-NLS-1$

+            "Identifier", //$NON-NLS-1$

+            "abstract", //$NON-NLS-1$

+            "assert", //$NON-NLS-1$

+            "boolean", //$NON-NLS-1$

+            "break", //$NON-NLS-1$

+            "byte", //$NON-NLS-1$

+            "case", //$NON-NLS-1$

+            "catch", //$NON-NLS-1$

+            "char", //$NON-NLS-1$

+            "class", //$NON-NLS-1$

+            "continue", //$NON-NLS-1$

+            "default", //$NON-NLS-1$

+            "do", //$NON-NLS-1$

+            "double", //$NON-NLS-1$

+            "else", //$NON-NLS-1$

+            "extends", //$NON-NLS-1$

+            "false", //$NON-NLS-1$

+            "final", //$NON-NLS-1$

+            "finally", //$NON-NLS-1$

+            "float", //$NON-NLS-1$

+            "for", //$NON-NLS-1$

+            "if", //$NON-NLS-1$

+            "implements", //$NON-NLS-1$

+            "import", //$NON-NLS-1$

+            "instanceof", //$NON-NLS-1$

+            "int", //$NON-NLS-1$

+            "interface", //$NON-NLS-1$

+            "long", //$NON-NLS-1$

+            "native", //$NON-NLS-1$

+            "new", //$NON-NLS-1$

+            "null", //$NON-NLS-1$

+            "package", //$NON-NLS-1$

+            "private", //$NON-NLS-1$

+            "protected", //$NON-NLS-1$

+            "public", //$NON-NLS-1$

+            "return", //$NON-NLS-1$

+            "short", //$NON-NLS-1$

+            "static", //$NON-NLS-1$

+            "strictfp", //$NON-NLS-1$

+            "super", //$NON-NLS-1$

+            "switch", //$NON-NLS-1$

+            "synchronized", //$NON-NLS-1$

+            "this", //$NON-NLS-1$

+            "throw", //$NON-NLS-1$

+            "throws", //$NON-NLS-1$

+            "transient", //$NON-NLS-1$

+            "true", //$NON-NLS-1$

+            "try", //$NON-NLS-1$

+            "void", //$NON-NLS-1$

+            "volatile", //$NON-NLS-1$

+            "while", //$NON-NLS-1$

+            "IntegerLiteral", //$NON-NLS-1$

+            "LongLiteral", //$NON-NLS-1$

+            "FloatingPointLiteral", //$NON-NLS-1$

+            "DoubleLiteral", //$NON-NLS-1$

+            "CharacterLiteral", //$NON-NLS-1$

+            "StringLiteral", //$NON-NLS-1$

+            UNEXPECTED_EOF,

+            "Invalid Character",             //$NON-NLS-1$

+            "Goal", //$NON-NLS-1$

+            "MethodBody", //$NON-NLS-1$

+            "ConstructorBody", //$NON-NLS-1$

+            "StaticInitializer", //$NON-NLS-1$

+            "Initializer", //$NON-NLS-1$

+            "Headers", //$NON-NLS-1$

+            "BlockStatements", //$NON-NLS-1$

+            "MethodPushModifiersHeader", //$NON-NLS-1$

+            "CatchHeader", //$NON-NLS-1$

+            "FieldDeclaration", //$NON-NLS-1$

+            "ImportDeclaration", //$NON-NLS-1$

+            "PackageDeclaration", //$NON-NLS-1$

+            "TypeDeclaration", //$NON-NLS-1$

+            "GenericMethodDeclaration", //$NON-NLS-1$

+            "ClassBodyDeclaration", //$NON-NLS-1$

+            "Expression", //$NON-NLS-1$

+            "Type", //$NON-NLS-1$

+            "PrimitiveType", //$NON-NLS-1$

+            "ReferenceType", //$NON-NLS-1$

+            "ClassOrInterfaceType", //$NON-NLS-1$

+            "ArrayType", //$NON-NLS-1$

+            "Name", //$NON-NLS-1$

+            "Dims", //$NON-NLS-1$

+            "ClassType", //$NON-NLS-1$

+            "SimpleName", //$NON-NLS-1$

+            "Header", //$NON-NLS-1$

+            "ClassHeader", //$NON-NLS-1$

+            "InterfaceHeader", //$NON-NLS-1$

+            "MethodHeader", //$NON-NLS-1$

+            "ConstructorHeader", //$NON-NLS-1$

+            "FormalParameter", //$NON-NLS-1$

+            "ImportDeclarations", //$NON-NLS-1$

+            "TypeDeclarations", //$NON-NLS-1$

+            "PackageDeclarationName", //$NON-NLS-1$

+            "SingleTypeImportDeclarationName", //$NON-NLS-1$

+            "TypeImportOnDemandDeclarationName", //$NON-NLS-1$

+            "Modifiers", //$NON-NLS-1$

+            "Modifier", //$NON-NLS-1$

+            "ClassBody", //$NON-NLS-1$

+            "ClassHeaderName", //$NON-NLS-1$

+            "InterfaceTypeList", //$NON-NLS-1$

+            "InterfaceType", //$NON-NLS-1$

+            "ClassBodyDeclarations", //$NON-NLS-1$

+            "Block", //$NON-NLS-1$

+            "VariableDeclarators", //$NON-NLS-1$

+            "VariableDeclarator", //$NON-NLS-1$

+            "VariableDeclaratorId", //$NON-NLS-1$

+            "VariableInitializer", //$NON-NLS-1$

+            "ArrayInitializer", //$NON-NLS-1$

+            "MethodHeaderName", //$NON-NLS-1$

+            "MethodHeaderParameters", //$NON-NLS-1$

+            "MethodPushModifiersHeaderName", //$NON-NLS-1$

+            "ClassTypeList", //$NON-NLS-1$

+            "ConstructorHeaderName", //$NON-NLS-1$

+            "FormalParameterList", //$NON-NLS-1$

+            "ClassTypeElt", //$NON-NLS-1$

+            "StaticOnly", //$NON-NLS-1$

+            "ExplicitConstructorInvocation", //$NON-NLS-1$

+            "Primary", //$NON-NLS-1$

+            "InterfaceBody", //$NON-NLS-1$

+            "InterfaceHeaderName", //$NON-NLS-1$

+            "InterfaceMemberDeclarations", //$NON-NLS-1$

+            "InterfaceMemberDeclaration", //$NON-NLS-1$

+            "VariableInitializers", //$NON-NLS-1$

+            "BlockStatement", //$NON-NLS-1$

+            "Statement", //$NON-NLS-1$

+            "LocalVariableDeclaration", //$NON-NLS-1$

+            "StatementWithoutTrailingSubstatement", //$NON-NLS-1$

+            "StatementNoShortIf", //$NON-NLS-1$

+            "StatementExpression", //$NON-NLS-1$

+            "PostIncrementExpression", //$NON-NLS-1$

+            "PostDecrementExpression", //$NON-NLS-1$

+            "MethodInvocation", //$NON-NLS-1$

+            "ClassInstanceCreationExpression", //$NON-NLS-1$

+            "SwitchBlock", //$NON-NLS-1$

+            "SwitchBlockStatements", //$NON-NLS-1$

+            "SwitchLabels", //$NON-NLS-1$

+            "SwitchBlockStatement", //$NON-NLS-1$

+            "SwitchLabel", //$NON-NLS-1$

+            "ConstantExpression", //$NON-NLS-1$

+            "StatementExpressionList", //$NON-NLS-1$

+            "OnlySynchronized", //$NON-NLS-1$

+            "Catches", //$NON-NLS-1$

+            "Finally", //$NON-NLS-1$

+            "CatchClause", //$NON-NLS-1$

+            "PushLPAREN", //$NON-NLS-1$

+            "PushRPAREN", //$NON-NLS-1$

+            "PrimaryNoNewArray", //$NON-NLS-1$

+            "FieldAccess", //$NON-NLS-1$

+            "ArrayAccess", //$NON-NLS-1$

+            "ClassInstanceCreationExpressionName", //$NON-NLS-1$

+            "ArgumentList", //$NON-NLS-1$

+            "DimWithOrWithOutExprs", //$NON-NLS-1$

+            "DimWithOrWithOutExpr", //$NON-NLS-1$

+            "DimsLoop", //$NON-NLS-1$

+            "OneDimLoop", //$NON-NLS-1$

+            "PostfixExpression", //$NON-NLS-1$

+            "UnaryExpression", //$NON-NLS-1$

+            "UnaryExpressionNotPlusMinus", //$NON-NLS-1$

+            "MultiplicativeExpression", //$NON-NLS-1$

+            "AdditiveExpression", //$NON-NLS-1$

+            "ShiftExpression", //$NON-NLS-1$

+            "RelationalExpression", //$NON-NLS-1$

+            "EqualityExpression", //$NON-NLS-1$

+            "AndExpression", //$NON-NLS-1$

+            "ExclusiveOrExpression", //$NON-NLS-1$

+            "InclusiveOrExpression", //$NON-NLS-1$

+            "ConditionalAndExpression", //$NON-NLS-1$

+            "ConditionalOrExpression", //$NON-NLS-1$

+            "ConditionalExpression", //$NON-NLS-1$

+            "AssignmentExpression", //$NON-NLS-1$

+            "LeftHandSide", //$NON-NLS-1$

+            "AssignmentOperator" //$NON-NLS-1$

+    };

+    

 	public  static short check_table[] = null;

 	public  static char lhs[] =  null;

 	public  static char action[] = lhs;

-	private final static String FILEPREFIX = "parser"/*nonNLS*/;

+	private final static String FILEPREFIX = "parser"; //$NON-NLS-1$

 

 	static {

 		try{

@@ -363,9 +363,13 @@
 	this(problemReporter, false);

 }

 public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) {

+	this(problemReporter, false, false);

+}

+public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals, boolean assertMode) {

 		

 	this.problemReporter = problemReporter;

 	this.optimizeStringLiterals = optimizeStringLiterals;

+	this.assertMode = assertMode;

 	this.initializeScanner();

 	astLengthStack = new int[50];

 	expressionLengthStack = new int[30];

@@ -428,7 +432,7 @@
 	char[] chars = new char[tokens.length]; //can't be bigger

 	int ic = 0;

 	String token;

-	while (!(token = tokens[i++]).equals("}"/*nonNLS*/)) {

+	while (!(token = tokens[i++]).equals("}")) { //$NON-NLS-1$

 		int c = Integer.parseInt(token);

 		if (isShort)

 			c += 32768;

@@ -471,11 +475,11 @@
 		reader.read(contents, 0, contents.length);

 		reader.close();

 	} catch (IOException ex) {

-		System.out.println(Util.bind("parser.incorrectPath"/*nonNLS*/));

+		System.out.println(Util.bind("parser.incorrectPath")); //$NON-NLS-1$

 		return;

 	}

 	java.util.StringTokenizer st = 

-		new java.util.StringTokenizer(new String(contents), " \t\n\r[]={,;"/*nonNLS*/); 

+		new java.util.StringTokenizer(new String(contents), " \t\n\r[]={,;");  //$NON-NLS-1$

 	String[] tokens = new String[st.countTokens()];

 	int i = 0;

 	while (st.hasMoreTokens()) {

@@ -483,12 +487,12 @@
 	}

 	final String prefix = FILEPREFIX;

 	i = 0;

-	buildFileFor(prefix + (++i) + ".rsc"/*nonNLS*/, "lhs"/*nonNLS*/, tokens, false);

-	buildFileFor(prefix + (++i) + ".rsc"/*nonNLS*/, "check_table"/*nonNLS*/, tokens, true);

-	buildFileFor(prefix + (++i) + ".rsc"/*nonNLS*/, "asb"/*nonNLS*/, tokens, false);

-	buildFileFor(prefix + (++i) + ".rsc"/*nonNLS*/, "asr"/*nonNLS*/, tokens, false);

-	buildFileFor(prefix + (++i) + ".rsc"/*nonNLS*/, "symbol_index"/*nonNLS*/, tokens, false);

-	System.out.println(Util.bind("parser.moveFiles"/*nonNLS*/));

+	buildFileFor(prefix + (++i) + ".rsc", "lhs", tokens, false); //$NON-NLS-2$ //$NON-NLS-1$

+	buildFileFor(prefix + (++i) + ".rsc", "check_table", tokens, true); //$NON-NLS-2$ //$NON-NLS-1$

+	buildFileFor(prefix + (++i) + ".rsc", "asb", tokens, false); //$NON-NLS-2$ //$NON-NLS-1$

+	buildFileFor(prefix + (++i) + ".rsc", "asr", tokens, false); //$NON-NLS-2$ //$NON-NLS-1$

+	buildFileFor(prefix + (++i) + ".rsc", "symbol_index", tokens, false); //$NON-NLS-2$ //$NON-NLS-1$

+	System.out.println(Util.bind("parser.moveFiles")); //$NON-NLS-1$

 }

 /*

  * Build initial recovery state.

@@ -533,7 +537,8 @@
 				TypeDeclaration type = (TypeDeclaration) referenceContext;

 				for (int i = 0; i < type.fields.length; i++){

 					FieldDeclaration field = type.fields[i];					

-					if (field.declarationSourceStart <= scanner.initialPosition

+					if (!field.isField()

+						&& field.declarationSourceStart <= scanner.initialPosition

 						&& scanner.initialPosition <= field.declarationSourceEnd

 						&& scanner.eofPosition <= field.declarationSourceEnd+1){

 						element = new RecoveredInitializer((Initializer) field, null, 1, this);

@@ -613,8 +618,8 @@
  */

 public boolean checkAndReportBracketAnomalies(ProblemReporter problemReporter) {

 

+	scanner.wasAcr = false;

 	boolean anomaliesDetected = false;	

-	this.scanner.wasAcr = false;

 	try {

 		char[] source = scanner.source;

 		int[] leftCount = {0, 0, 0};

@@ -1143,6 +1148,13 @@
 

 	arrayInitializer(expressionLengthStack[expressionLengthPtr--]);

 }

+

+protected void consumeAssertStatement() {

+	// AssertStatement ::= 'assert' Expression ':' Expression ';'

+	expressionLengthPtr-=2;

+	pushOnAstStack(new AssertStatement(expressionStack[expressionPtr--], expressionStack[expressionPtr--], intStack[intPtr--]));

+}

+

 protected void consumeAssignment() {

 	// Assignment ::= LeftHandSide AssignmentOperator AssignmentExpression

 	//optimize the push/pop

@@ -1379,6 +1391,9 @@
 	}

 

 	//always add <clinit> (will be remove at code gen time if empty)

+	if (this.scanner.containsAssertKeyword) {

+		typeDecl.bits |= Statement.AddAssertionMASK;

+	}

 	typeDecl.addClinit();

 	typeDecl.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); 

 }

@@ -2117,6 +2132,9 @@
 	typeDecl.checkConstructors(this);

 	

 	//always add <clinit> (will be remove at code gen time if empty)

+	if (this.scanner.containsAssertKeyword) {

+		typeDecl.bits |= Statement.AddAssertionMASK;

+	}

 	typeDecl.addClinit();

 	typeDecl.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); 

 }

@@ -2699,662 +2717,678 @@
 	// PushRPAREN ::= ')'

 	pushOnIntStack(rParenPos);

 }

-// This method is part of an automatic generation : do NOT edit-modify  

-protected void consumeRule(int act) {

-	switch (act) {

-		case 29 : // System.out.println("Type ::= PrimitiveType");

-			consumePrimitiveType();

-			break;

-		case 43 : // System.out.println("ReferenceType ::= ClassOrInterfaceType");

-			consumeReferenceType();

-			break;

-		case 52 : // System.out.println("QualifiedName ::= Name DOT SimpleName");

-			consumeQualifiedName();

-			break;

-		case 53 : // System.out.println("CompilationUnit ::= EnterCompilationUnit PackageDeclarationopt ImportDeclarationsopt");

-			consumeCompilationUnit();

-			break;

-		case 54 : // System.out.println("EnterCompilationUnit ::=");

-			consumeEnterCompilationUnit();

-			break;

-		case 66 : // System.out.println("CatchHeader ::= catch LPAREN FormalParameter RPAREN LBRACE");

-			consumeCatchHeader();

-			break;

-		case 68 : // System.out.println("ImportDeclarations ::= ImportDeclarations ImportDeclaration");

-			consumeImportDeclarations();

-			break;

-		case 70 : // System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration");

-			consumeTypeDeclarations();

-			break;

-		case 71 : // System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON");

-			consumePackageDeclaration();

-			break;

-		case 72 : // System.out.println("PackageDeclarationName ::= package Name");

-			consumePackageDeclarationName();

-			break;

-		case 75 : // System.out.println("SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName SEMICOLON");

-			consumeSingleTypeImportDeclaration();

-			break;

-		case 76 : // System.out.println("SingleTypeImportDeclarationName ::= import Name");

-			consumeSingleTypeImportDeclarationName();

-			break;

-		case 77 : // System.out.println("TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName SEMICOLON");

-			consumeTypeImportOnDemandDeclaration();

-			break;

-		case 78 : // System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT MULTIPLY");

-			consumeTypeImportOnDemandDeclarationName();

-			break;

-		case 81 : // System.out.println("TypeDeclaration ::= SEMICOLON");

-			consumeEmptyTypeDeclaration();

-			break;

-		case 95 : // System.out.println("ClassDeclaration ::= ClassHeader ClassBody");

-			consumeClassDeclaration();

-			break;

-		case 96 : // System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt");

-			consumeClassHeader();

-			break;

-		case 97 : // System.out.println("ClassHeaderName ::= Modifiersopt class Identifier");

-			consumeClassHeaderName();

-			break;

-		case 98 : // System.out.println("ClassHeaderExtends ::= extends ClassType");

-			consumeClassHeaderExtends();

-			break;

-		case 99 : // System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList");

-			consumeClassHeaderImplements();

-			break;

-		case 101 : // System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA InterfaceType");

-			consumeInterfaceTypeList();

-			break;

-		case 102 : // System.out.println("InterfaceType ::= ClassOrInterfaceType");

-			consumeInterfaceType();

-			break;

-		case 105 : // System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration");

-			consumeClassBodyDeclarations();

-			break;

-		case 109 : // System.out.println("ClassBodyDeclaration ::= Diet NestedMethod Block");

-			consumeClassBodyDeclaration();

-			break;

-		case 110 : // System.out.println("Diet ::=");

-			consumeDiet();

-			break;

-		case 117 : // System.out.println("ClassMemberDeclaration ::= SEMICOLON");

-			consumeEmptyClassMemberDeclaration();

-			break;

-		case 118 : // System.out.println("FieldDeclaration ::= Modifiersopt Type VariableDeclarators SEMICOLON");

-			consumeFieldDeclaration();

-			break;

-		case 120 : // System.out.println("VariableDeclarators ::= VariableDeclarators COMMA VariableDeclarator");

-			consumeVariableDeclarators();

-			break;

-		case 123 : // System.out.println("EnterVariable ::=");

-			consumeEnterVariable();

-			break;

-		case 124 : // System.out.println("ExitVariableWithInitialization ::=");

-			consumeExitVariableWithInitialization();

-			break;

-		case 125 : // System.out.println("ExitVariableWithoutInitialization ::=");

-			consumeExitVariableWithoutInitialization();

-			break;

-		case 126 : // System.out.println("ForceNoDiet ::=");

-			consumeForceNoDiet();

-			break;

-		case 127 : // System.out.println("RestoreDiet ::=");

-			consumeRestoreDiet();

-			break;

-		case 132 : // System.out.println("MethodDeclaration ::= MethodHeader MethodBody");

-			// set to true to consume a method with a body

-			consumeMethodDeclaration(true);

-			break;

-		case 133 : // System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON");

-			// set to false to consume a method without body

-			consumeMethodDeclaration(false);

-			break;

-		case 134 : // System.out.println("MethodHeader ::= MethodHeaderName MethodHeaderParameters MethodHeaderExtendedDims");

-			consumeMethodHeader();

-			break;

-		case 135 : // System.out.println("MethodPushModifiersHeader ::= MethodPushModifiersHeaderName MethodHeaderParameters");

-			consumeMethodHeader();

-			break;

-		case 136 : // System.out.println("MethodPushModifiersHeaderName ::= Modifiers Type PushModifiers Identifier LPAREN");

-			consumeMethodPushModifiersHeaderName();

-			break;

-		case 137 : // System.out.println("MethodPushModifiersHeaderName ::= Type PushModifiers Identifier LPAREN");

-			consumeMethodPushModifiersHeaderName();

-			break;

-		case 138 : // System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN");

-			consumeMethodHeaderName();

-			break;

-		case 139 : // System.out.println("MethodHeaderParameters ::= FormalParameterListopt RPAREN");

-			consumeMethodHeaderParameters();

-			break;

-		case 140 : // System.out.println("MethodHeaderExtendedDims ::= Dimsopt");

-			consumeMethodHeaderExtendedDims();

-			break;

-		case 141 : // System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList");

-			consumeMethodHeaderThrowsClause();

-			break;

-		case 142 : // System.out.println("ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters...");

-			consumeConstructorHeader();

-			break;

-		case 143 : // System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN");

-			consumeConstructorHeaderName();

-			break;

-		case 145 : // System.out.println("FormalParameterList ::= FormalParameterList COMMA FormalParameter");

-			consumeFormalParameterList();

-			break;

-		case 146 : // System.out.println("FormalParameter ::= Modifiersopt Type VariableDeclaratorId");

-			// the boolean is used to know if the modifiers should be reset

-			consumeFormalParameter();

-			break;

-		case 148 : // System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt");

-			consumeClassTypeList();

-			break;

-		case 149 : // System.out.println("ClassTypeElt ::= ClassType");

-			consumeClassTypeElt();

-			break;

-		case 150 : // System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt RBRACE");

-			consumeMethodBody();

-			break;

-		case 151 : // System.out.println("NestedMethod ::=");

-			consumeNestedMethod();

-			break;

-		case 152 : // System.out.println("StaticInitializer ::= StaticOnly Block");

-			consumeStaticInitializer();

-			break;

-		case 153 : // System.out.println("StaticOnly ::= static");

-			consumeStaticOnly();

-			break;

-		case 154 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader ConstructorBody");

-			consumeConstructorDeclaration();

-			break;

-		case 155 : // System.out.println("ConstructorBody ::= NestedMethod LBRACE ConstructorBlockStatementsopt RBRACE");

-			consumeConstructorBody();

-			break;

-		case 158 : // System.out.println("ConstructorBlockStatementsopt ::= ExplicitConstructorInvocation BlockStatements");

-			consumeConstructorBlockStatements();

-			break;

-		case 159 : // System.out.println("ExplicitConstructorInvocation ::= this LPAREN ArgumentListopt RPAREN SEMICOLON");

-			consumeExplicitConstructorInvocation(0, ExplicitConstructorCall.This);

-			break;

-		case 160 : // System.out.println("ExplicitConstructorInvocation ::= super LPAREN ArgumentListopt RPAREN SEMICOLON");

-			consumeExplicitConstructorInvocation(0, ExplicitConstructorCall.Super);

-			break;

-		case 161 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT super LPAREN ArgumentListopt RPAREN");

-			consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.Super);

-			break;

-		case 162 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN ArgumentListopt RPAREN...");

-			consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.Super);

-			break;

-		case 163 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT this LPAREN ArgumentListopt RPAREN...");

-			consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.This);

-			break;

-		case 164 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN ArgumentListopt RPAREN...");

-			consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.This);

-			break;

-		case 165 : // System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody");

-			consumeInterfaceDeclaration();

-			break;

-		case 166 : // System.out.println("InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt");

-			consumeInterfaceHeader();

-			break;

-		case 167 : // System.out.println("InterfaceHeaderName ::= Modifiersopt interface Identifier");

-			consumeInterfaceHeaderName();

-			break;

-		case 169 : // System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList");

-			consumeInterfaceHeaderExtends();

-			break;

-		case 172 : // System.out.println("InterfaceMemberDeclarations ::= InterfaceMemberDeclarations...");

-			consumeInterfaceMemberDeclarations();

-			break;

-		case 173 : // System.out.println("InterfaceMemberDeclaration ::= SEMICOLON");

-			consumeEmptyInterfaceMemberDeclaration();

-			break;

-		case 176 : // System.out.println("InterfaceMemberDeclaration ::= InvalidMethodDeclaration");

-			ignoreMethodBody();

-			break;

-		case 177 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader ConstructorBody");

-			ignoreInvalidConstructorDeclaration(true);

-			break;

-		case 178 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader SEMICOLON");

-			ignoreInvalidConstructorDeclaration(false);

-			break;

-		case 184 : // System.out.println("ArrayInitializer ::= LBRACE ,opt RBRACE");

-			consumeEmptyArrayInitializer();

-			break;

-		case 185 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers RBRACE");

-			consumeArrayInitializer();

-			break;

-		case 186 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers COMMA RBRACE");

-			consumeArrayInitializer();

-			break;

-		case 188 : // System.out.println("VariableInitializers ::= VariableInitializers COMMA VariableInitializer");

-			consumeVariableInitializers();

-			break;

-		case 189 : // System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE");

-			consumeBlock();

-			break;

-		case 190 : // System.out.println("OpenBlock ::=");

-			consumeOpenBlock();

-			break;

-		case 192 : // System.out.println("BlockStatements ::= BlockStatements BlockStatement");

-			consumeBlockStatements();

-			break;

-		case 196 : // System.out.println("BlockStatement ::= InvalidInterfaceDeclaration");

-			ignoreInterfaceDeclaration();

-			break;

-		case 197 : // System.out.println("LocalVariableDeclarationStatement ::= LocalVariableDeclaration SEMICOLON");

-			consumeLocalVariableDeclarationStatement();

-			break;

-		case 198 : // System.out.println("LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators");

-			consumeLocalVariableDeclaration();

-			break;

-		case 199 : // System.out.println("LocalVariableDeclaration ::= Modifiers Type PushModifiers VariableDeclarators");

-			consumeLocalVariableDeclaration();

-			break;

-		case 200 : // System.out.println("PushModifiers ::=");

-			consumePushModifiers();

-			break;

-		case 223 : // System.out.println("EmptyStatement ::= SEMICOLON");

-			consumeEmptyStatement();

-			break;

-		case 224 : // System.out.println("LabeledStatement ::= Identifier COLON Statement");

-			consumeStatementLabel();

-			break;

-		case 225 : // System.out.println("LabeledStatementNoShortIf ::= Identifier COLON StatementNoShortIf");

-			consumeStatementLabel();

-			break;

-		case 226 : // System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON");

-			consumeExpressionStatement();

-			break;

-		case 234 : // System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN Statement");

-			consumeStatementIfNoElse();

-			break;

-		case 235 : // System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN StatementNoShortIf else...");

-			consumeStatementIfWithElse();

-			break;

-		case 236 : // System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression RPAREN StatementNoShortIf...");

-			consumeStatementIfWithElse();

-			break;

-		case 237 : // System.out.println("SwitchStatement ::= switch OpenBlock LPAREN Expression RPAREN SwitchBlock");

-			consumeStatementSwitch();

-			break;

-		case 238 : // System.out.println("SwitchBlock ::= LBRACE RBRACE");

-			consumeEmptySwitchBlock();

-			break;

-		case 241 : // System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements SwitchLabels RBRACE");

-			consumeSwitchBlock();

-			break;

-		case 243 : // System.out.println("SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement");

-			consumeSwitchBlockStatements();

-			break;

-		case 244 : // System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements");

-			consumeSwitchBlockStatement();

-			break;

-		case 246 : // System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel");

-			consumeSwitchLabels();

-			break;

-		case 247 : // System.out.println("SwitchLabel ::= case ConstantExpression COLON");

-			consumeCaseLabel();

-			break;

-		case 248 : // System.out.println("SwitchLabel ::= default COLON");

-			consumeDefaultLabel();

-			break;

-		case 249 : // System.out.println("WhileStatement ::= while LPAREN Expression RPAREN Statement");

-			consumeStatementWhile();

-			break;

-		case 250 : // System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression RPAREN StatementNoShortIf");

-			consumeStatementWhile();

-			break;

-		case 251 : // System.out.println("DoStatement ::= do Statement while LPAREN Expression RPAREN SEMICOLON");

-			consumeStatementDo();

-			break;

-		case 252 : // System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON...");

-			consumeStatementFor();

-			break;

-		case 253 : // System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON");

-			consumeStatementFor();

-			break;

-		case 254 : // System.out.println("ForInit ::= StatementExpressionList");

-			consumeForInit();

-			break;

-		case 258 : // System.out.println("StatementExpressionList ::= StatementExpressionList COMMA StatementExpression");

-			consumeStatementExpressionList();

-			break;

-		case 259 : // System.out.println("BreakStatement ::= break SEMICOLON");

-			consumeStatementBreak();

-			break;

-		case 260 : // System.out.println("BreakStatement ::= break Identifier SEMICOLON");

-			consumeStatementBreakWithLabel();

-			break;

-		case 261 : // System.out.println("ContinueStatement ::= continue SEMICOLON");

-			consumeStatementContinue();

-			break;

-		case 262 : // System.out.println("ContinueStatement ::= continue Identifier SEMICOLON");

-			consumeStatementContinueWithLabel();

-			break;

-		case 263 : // System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON");

-			consumeStatementReturn();

-			break;

-		case 264 : // System.out.println("ThrowStatement ::= throw Expression SEMICOLON");

-			consumeStatementThrow();

-			break;

-		case 265 : // System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN Expression RPAREN Block");

-			consumeStatementSynchronized();

-			break;

-		case 266 : // System.out.println("OnlySynchronized ::= synchronized");

-			consumeOnlySynchronized();

-			break;

-		case 267 : // System.out.println("TryStatement ::= try Block Catches");

-			consumeStatementTry(false);

-			break;

-		case 268 : // System.out.println("TryStatement ::= try Block Catchesopt Finally");

-			consumeStatementTry(true);

-			break;

-		case 270 : // System.out.println("Catches ::= Catches CatchClause");

-			consumeCatches();

-			break;

-		case 271 : // System.out.println("CatchClause ::= catch LPAREN FormalParameter RPAREN Block");

-			consumeStatementCatch();

-			break;

-		case 273 : // System.out.println("PushLPAREN ::= LPAREN");

-			consumeLeftParen();

-			break;

-		case 274 : // System.out.println("PushRPAREN ::= RPAREN");

-			consumeRightParen();

-			break;

-		case 278 : // System.out.println("PrimaryNoNewArray ::= this");

-			consumePrimaryNoNewArrayThis();

-			break;

-		case 279 : // System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN");

-			consumePrimaryNoNewArray();

-			break;

-		case 282 : // System.out.println("PrimaryNoNewArray ::= Name DOT this");

-			consumePrimaryNoNewArrayNameThis();

-			break;

-		case 283 : // System.out.println("PrimaryNoNewArray ::= Name DOT super");

-			consumePrimaryNoNewArrayNameSuper();

-			break;

-		case 284 : // System.out.println("PrimaryNoNewArray ::= Name DOT class");

-			consumePrimaryNoNewArrayName();

-			break;

-		case 285 : // System.out.println("PrimaryNoNewArray ::= ArrayType DOT class");

-			consumePrimaryNoNewArrayArrayType();

-			break;

-		case 286 : // System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class");

-			consumePrimaryNoNewArrayPrimitiveType();

-			break;

-		case 289 : // System.out.println("AllocationHeader ::= new ClassType LPAREN ArgumentListopt RPAREN");

-			consumeAllocationHeader();

-			break;

-		case 290 : // System.out.println("ClassInstanceCreationExpression ::= new ClassType LPAREN ArgumentListopt RPAREN...");

-			consumeClassInstanceCreationExpression();

-			break;

-		case 291 : // System.out.println("ClassInstanceCreationExpression ::= Primary DOT new SimpleName LPAREN...");

-			consumeClassInstanceCreationExpressionQualified();

-			break;

-		case 292 : // System.out.println("ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName new...");

-			consumeClassInstanceCreationExpressionQualified();

-			break;

-		case 293 : // System.out.println("ClassInstanceCreationExpressionName ::= Name DOT");

-			consumeClassInstanceCreationExpressionName();

-			break;

-		case 294 : // System.out.println("ClassBodyopt ::=");

-			consumeClassBodyopt();

-			break;

-		case 296 : // System.out.println("EnterAnonymousClassBody ::=");

-			consumeEnterAnonymousClassBody();

-			break;

-		case 298 : // System.out.println("ArgumentList ::= ArgumentList COMMA Expression");

-			consumeArgumentList();

-			break;

-		case 299 : // System.out.println("ArrayCreationExpression ::= new PrimitiveType DimWithOrWithOutExprs...");

-			consumeArrayCreationExpression();

-			break;

-		case 300 : // System.out.println("ArrayCreationExpression ::= new ClassOrInterfaceType DimWithOrWithOutExprs...");

-			consumeArrayCreationExpression();

-			break;

-		case 302 : // System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr");

-			consumeDimWithOrWithOutExprs();

-			break;

-		case 304 : // System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET");

-			consumeDimWithOrWithOutExpr();

-			break;

-		case 305 : // System.out.println("Dims ::= DimsLoop");

-			consumeDims();

-			break;

-		case 308 : // System.out.println("OneDimLoop ::= LBRACKET RBRACKET");

-			consumeOneDimLoop();

-			break;

-		case 309 : // System.out.println("FieldAccess ::= Primary DOT Identifier");

-			consumeFieldAccess(false);

-			break;

-		case 310 : // System.out.println("FieldAccess ::= super DOT Identifier");

-			consumeFieldAccess(true);

-			break;

-		case 311 : // System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN");

-			consumeMethodInvocationName();

-			break;

-		case 312 : // System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN ArgumentListopt RPAREN");

-			consumeMethodInvocationPrimary();

-			break;

-		case 313 : // System.out.println("MethodInvocation ::= super DOT Identifier LPAREN ArgumentListopt RPAREN");

-			consumeMethodInvocationSuper();

-			break;

-		case 314 : // System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET");

-			consumeArrayAccess(true);

-			break;

-		case 315 : // System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression RBRACKET");

-			consumeArrayAccess(false);

-			break;

-		case 317 : // System.out.println("PostfixExpression ::= Name");

-			consumePostfixExpression();

-			break;

-		case 320 : // System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS");

-			consumeUnaryExpression(OperatorExpression.PLUS, true);

-			break;

-		case 321 : // System.out.println("PostDecrementExpression ::= PostfixExpression MINUS_MINUS");

-			consumeUnaryExpression(OperatorExpression.MINUS, true);

-			break;

-		case 322 : // System.out.println("PushPosition ::=");

-			consumePushPosition();

-			break;

-		case 325 : // System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.PLUS);

-			break;

-		case 326 : // System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.MINUS);

-			break;

-		case 328 : // System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.PLUS, false);

-			break;

-		case 329 : // System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.MINUS, false);

-			break;

-		case 331 : // System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.TWIDDLE);

-			break;

-		case 332 : // System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition UnaryExpression");

-			consumeUnaryExpression(OperatorExpression.NOT);

-			break;

-		case 334 : // System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN UnaryExpression");

-			consumeCastExpression();

-			break;

-		case 335 : // System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN UnaryExpressionNotPlusMinus");

-			consumeCastExpression();

-			break;

-		case 336 : // System.out.println("CastExpression ::= PushLPAREN Expression PushRPAREN UnaryExpressionNotPlusMinus");

-			consumeCastExpressionLL1();

-			break;

-		case 338 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression MULTIPLY UnaryExpression");

-			consumeBinaryExpression(OperatorExpression.MULTIPLY);

-			break;

-		case 339 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression DIVIDE UnaryExpression");

-			consumeBinaryExpression(OperatorExpression.DIVIDE);

-			break;

-		case 340 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression REMAINDER UnaryExpression");

-			consumeBinaryExpression(OperatorExpression.REMAINDER);

-			break;

-		case 342 : // System.out.println("AdditiveExpression ::= AdditiveExpression PLUS MultiplicativeExpression");

-			consumeBinaryExpression(OperatorExpression.PLUS);

-			break;

-		case 343 : // System.out.println("AdditiveExpression ::= AdditiveExpression MINUS MultiplicativeExpression");

-			consumeBinaryExpression(OperatorExpression.MINUS);

-			break;

-		case 345 : // System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT AdditiveExpression");

-			consumeBinaryExpression(OperatorExpression.LEFT_SHIFT);

-			break;

-		case 346 : // System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT AdditiveExpression");

-			consumeBinaryExpression(OperatorExpression.RIGHT_SHIFT);

-			break;

-		case 347 : // System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT AdditiveExpression");

-			consumeBinaryExpression(OperatorExpression.UNSIGNED_RIGHT_SHIFT);

-			break;

-		case 349 : // System.out.println("RelationalExpression ::= RelationalExpression LESS ShiftExpression");

-			consumeBinaryExpression(OperatorExpression.LESS);

-			break;

-		case 350 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER ShiftExpression");

-			consumeBinaryExpression(OperatorExpression.GREATER);

-			break;

-		case 351 : // System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL ShiftExpression");

-			consumeBinaryExpression(OperatorExpression.LESS_EQUAL);

-			break;

-		case 352 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER_EQUAL ShiftExpression");

-			consumeBinaryExpression(OperatorExpression.GREATER_EQUAL);

-			break;

-		case 353 : // System.out.println("RelationalExpression ::= RelationalExpression instanceof ReferenceType");

-			consumeInstanceOfExpression(OperatorExpression.INSTANCEOF);

-			break;

-		case 355 : // System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL RelationalExpression");

-			consumeEqualityExpression(OperatorExpression.EQUAL_EQUAL);

-			break;

-		case 356 : // System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL RelationalExpression");

-			consumeEqualityExpression(OperatorExpression.NOT_EQUAL);

-			break;

-		case 358 : // System.out.println("AndExpression ::= AndExpression AND EqualityExpression");

-			consumeBinaryExpression(OperatorExpression.AND);

-			break;

-		case 360 : // System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR AndExpression");

-			consumeBinaryExpression(OperatorExpression.XOR);

-			break;

-		case 362 : // System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR ExclusiveOrExpression");

-			consumeBinaryExpression(OperatorExpression.OR);

-			break;

-		case 364 : // System.out.println("ConditionalAndExpression ::= ConditionalAndExpression AND_AND InclusiveOrExpression");

-			consumeBinaryExpression(OperatorExpression.AND_AND);

-			break;

-		case 366 : // System.out.println("ConditionalOrExpression ::= ConditionalOrExpression OR_OR ConditionalAndExpression");

-			consumeBinaryExpression(OperatorExpression.OR_OR);

-			break;

-		case 368 : // System.out.println("ConditionalExpression ::= ConditionalOrExpression QUESTION Expression COLON...");

-			consumeConditionalExpression(OperatorExpression.QUESTIONCOLON);

-			break;

-		case 371 : // System.out.println("Assignment ::= LeftHandSide AssignmentOperator AssignmentExpression");

-			consumeAssignment();

-			break;

-		case 373 : // System.out.println("Assignment ::= InvalidArrayInitializerAssignement");

-			ignoreExpressionAssignment();

-			break;

-		case 374 : // System.out.println("LeftHandSide ::= Name");

-			consumeLeftHandSide();

-			break;

-		case 377 : // System.out.println("AssignmentOperator ::= EQUAL");

-			consumeAssignmentOperator(EQUAL);

-			break;

-		case 378 : // System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL");

-			consumeAssignmentOperator(MULTIPLY);

-			break;

-		case 379 : // System.out.println("AssignmentOperator ::= DIVIDE_EQUAL");

-			consumeAssignmentOperator(DIVIDE);

-			break;

-		case 380 : // System.out.println("AssignmentOperator ::= REMAINDER_EQUAL");

-			consumeAssignmentOperator(REMAINDER);

-			break;

-		case 381 : // System.out.println("AssignmentOperator ::= PLUS_EQUAL");

-			consumeAssignmentOperator(PLUS);

-			break;

-		case 382 : // System.out.println("AssignmentOperator ::= MINUS_EQUAL");

-			consumeAssignmentOperator(MINUS);

-			break;

-		case 383 : // System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL");

-			consumeAssignmentOperator(LEFT_SHIFT);

-			break;

-		case 384 : // System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL");

-			consumeAssignmentOperator(RIGHT_SHIFT);

-			break;

-		case 385 : // System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL");

-			consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);

-			break;

-		case 386 : // System.out.println("AssignmentOperator ::= AND_EQUAL");

-			consumeAssignmentOperator(AND);

-			break;

-		case 387 : // System.out.println("AssignmentOperator ::= XOR_EQUAL");

-			consumeAssignmentOperator(XOR);

-			break;

-		case 388 : // System.out.println("AssignmentOperator ::= OR_EQUAL");

-			consumeAssignmentOperator(OR);

-			break;

-		case 395 : // System.out.println("Expressionopt ::=");

-			consumeEmptyExpression();

-			break;

-		case 399 : // System.out.println("ImportDeclarationsopt ::=");

-			consumeEmptyImportDeclarationsopt();

-			break;

-		case 400 : // System.out.println("ImportDeclarationsopt ::= ImportDeclarations");

-			consumeImportDeclarationsopt();

-			break;

-		case 401 : // System.out.println("TypeDeclarationsopt ::=");

-			consumeEmptyTypeDeclarationsopt();

-			break;

-		case 402 : // System.out.println("TypeDeclarationsopt ::= TypeDeclarations");

-			consumeTypeDeclarationsopt();

-			break;

-		case 403 : // System.out.println("ClassBodyDeclarationsopt ::=");

-			consumeEmptyClassBodyDeclarationsopt();

-			break;

-		case 404 : // System.out.println("ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations");

-			consumeClassBodyDeclarationsopt();

-			break;

-		case 405 : // System.out.println("Modifiersopt ::=");

-			consumeDefaultModifiers();

-			break;

-		case 406 : // System.out.println("Modifiersopt ::= Modifiers");

-			consumeModifiers();

-			break;

-		case 407 : // System.out.println("BlockStatementsopt ::=");

-			consumeEmptyBlockStatementsopt();

-			break;

-		case 409 : // System.out.println("Dimsopt ::=");

-			consumeEmptyDimsopt();

-			break;

-		case 411 : // System.out.println("ArgumentListopt ::=");

-			consumeEmptyArgumentListopt();

-			break;

-		case 415 : // System.out.println("FormalParameterListopt ::=");

-			consumeFormalParameterListopt();

-			break;

-		case 419 : // System.out.println("InterfaceMemberDeclarationsopt ::=");

-			consumeEmptyInterfaceMemberDeclarationsopt();

-			break;

-		case 420 : // System.out.println("InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations");

-			consumeInterfaceMemberDeclarationsopt();

-			break;

-		case 421 : // System.out.println("NestedType ::=");

-			consumeNestedType();

-			break;

-		case 422 : // System.out.println("ForInitopt ::=");

-			consumeEmptyForInitopt();

-			break;

-		case 424 : // System.out.println("ForUpdateopt ::=");

-			consumeEmptyForUpdateopt();

-			break;

-		case 428 : // System.out.println("Catchesopt ::=");

-			consumeEmptyCatchesopt();

-			break;

-		case 430 : // System.out.println("ArrayInitializeropt ::=");

-			consumeEmptyArrayInitializeropt();

-			break;

+	// This method is part of an automatic generation : do NOT edit-modify  

+	protected void consumeRule(int act) {

+		switch (act) {

+			case 29 : // System.out.println("Type ::= PrimitiveType");

+				consumePrimitiveType();

+				break;

+			case 43 : // System.out.println("ReferenceType ::= ClassOrInterfaceType");

+				consumeReferenceType();

+				break;

+			case 52 : // System.out.println("QualifiedName ::= Name DOT SimpleName");

+				consumeQualifiedName();

+				break;

+			case 53 : // System.out.println("CompilationUnit ::= EnterCompilationUnit PackageDeclarationopt ImportDeclarationsopt");

+				consumeCompilationUnit();

+				break;

+			case 54 : // System.out.println("EnterCompilationUnit ::=");

+				consumeEnterCompilationUnit();

+				break;

+			case 66 : // System.out.println("CatchHeader ::= catch LPAREN FormalParameter RPAREN LBRACE");

+				consumeCatchHeader();

+				break;

+			case 68 : // System.out.println("ImportDeclarations ::= ImportDeclarations ImportDeclaration");

+				consumeImportDeclarations();

+				break;

+			case 70 : // System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration");

+				consumeTypeDeclarations();

+				break;

+			case 71 : // System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON");

+				consumePackageDeclaration();

+				break;

+			case 72 : // System.out.println("PackageDeclarationName ::= package Name");

+				consumePackageDeclarationName();

+				break;

+			case 75 : // System.out.println("SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName SEMICOLON");

+				consumeSingleTypeImportDeclaration();

+				break;

+			case 76 : // System.out.println("SingleTypeImportDeclarationName ::= import Name");

+				consumeSingleTypeImportDeclarationName();

+				break;

+			case 77 : // System.out.println("TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName SEMICOLON");

+				consumeTypeImportOnDemandDeclaration();

+				break;

+			case 78 : // System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT MULTIPLY");

+				consumeTypeImportOnDemandDeclarationName();

+				break;

+			case 81 : // System.out.println("TypeDeclaration ::= SEMICOLON");

+				consumeEmptyTypeDeclaration();

+				break;

+			case 95 : // System.out.println("ClassDeclaration ::= ClassHeader ClassBody");

+				consumeClassDeclaration();

+				break;

+			case 96 : // System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt");

+				consumeClassHeader();

+				break;

+			case 97 : // System.out.println("ClassHeaderName ::= Modifiersopt class Identifier");

+				consumeClassHeaderName();

+				break;

+			case 98 : // System.out.println("ClassHeaderExtends ::= extends ClassType");

+				consumeClassHeaderExtends();

+				break;

+			case 99 : // System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList");

+				consumeClassHeaderImplements();

+				break;

+			case 101 : // System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA InterfaceType");

+				consumeInterfaceTypeList();

+				break;

+			case 102 : // System.out.println("InterfaceType ::= ClassOrInterfaceType");

+				consumeInterfaceType();

+				break;

+			case 105 : // System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration");

+				consumeClassBodyDeclarations();

+				break;

+			case 109 : // System.out.println("ClassBodyDeclaration ::= Diet NestedMethod Block");

+				consumeClassBodyDeclaration();

+				break;

+			case 110 : // System.out.println("Diet ::=");

+				consumeDiet();

+				break;

+			case 111 : // System.out.println("Initializer ::= Diet NestedMethod Block");

+				consumeClassBodyDeclaration();

+				break;

+			case 118 : // System.out.println("ClassMemberDeclaration ::= SEMICOLON");

+				consumeEmptyClassMemberDeclaration();

+				break;

+			case 119 : // System.out.println("FieldDeclaration ::= Modifiersopt Type VariableDeclarators SEMICOLON");

+				consumeFieldDeclaration();

+				break;

+			case 121 : // System.out.println("VariableDeclarators ::= VariableDeclarators COMMA VariableDeclarator");

+				consumeVariableDeclarators();

+				break;

+			case 124 : // System.out.println("EnterVariable ::=");

+				consumeEnterVariable();

+				break;

+			case 125 : // System.out.println("ExitVariableWithInitialization ::=");

+				consumeExitVariableWithInitialization();

+				break;

+			case 126 : // System.out.println("ExitVariableWithoutInitialization ::=");

+				consumeExitVariableWithoutInitialization();

+				break;

+			case 127 : // System.out.println("ForceNoDiet ::=");

+				consumeForceNoDiet();

+				break;

+			case 128 : // System.out.println("RestoreDiet ::=");

+				consumeRestoreDiet();

+				break;

+			case 133 : // System.out.println("MethodDeclaration ::= MethodHeader MethodBody");

+				// set to true to consume a method with a body

+				consumeMethodDeclaration(true);

+				break;

+			case 134 : // System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON");

+				// set to false to consume a method without body

+				consumeMethodDeclaration(false);

+				break;

+			case 135 : // System.out.println("MethodHeader ::= MethodHeaderName MethodHeaderParameters MethodHeaderExtendedDims");

+				consumeMethodHeader();

+				break;

+			case 136 : // System.out.println("MethodPushModifiersHeader ::= MethodPushModifiersHeaderName MethodHeaderParameters");

+				consumeMethodHeader();

+				break;

+			case 137 : // System.out.println("MethodPushModifiersHeaderName ::= Modifiers Type PushModifiers Identifier LPAREN");

+				consumeMethodPushModifiersHeaderName();

+				break;

+			case 138 : // System.out.println("MethodPushModifiersHeaderName ::= Type PushModifiers Identifier LPAREN");

+				consumeMethodPushModifiersHeaderName();

+				break;

+			case 139 : // System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN");

+				consumeMethodHeaderName();

+				break;

+			case 140 : // System.out.println("MethodHeaderParameters ::= FormalParameterListopt RPAREN");

+				consumeMethodHeaderParameters();

+				break;

+			case 141 : // System.out.println("MethodHeaderExtendedDims ::= Dimsopt");

+				consumeMethodHeaderExtendedDims();

+				break;

+			case 142 : // System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList");

+				consumeMethodHeaderThrowsClause();

+				break;

+			case 143 : // System.out.println("ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters...");

+				consumeConstructorHeader();

+				break;

+			case 144 : // System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN");

+				consumeConstructorHeaderName();

+				break;

+			case 146 : // System.out.println("FormalParameterList ::= FormalParameterList COMMA FormalParameter");

+				consumeFormalParameterList();

+				break;

+			case 147 : // System.out.println("FormalParameter ::= Modifiersopt Type VariableDeclaratorId");

+				// the boolean is used to know if the modifiers should be reset

+				consumeFormalParameter();

+				break;

+			case 149 : // System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt");

+				consumeClassTypeList();

+				break;

+			case 150 : // System.out.println("ClassTypeElt ::= ClassType");

+				consumeClassTypeElt();

+				break;

+			case 151 : // System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt RBRACE");

+				consumeMethodBody();

+				break;

+			case 152 : // System.out.println("NestedMethod ::=");

+				consumeNestedMethod();

+				break;

+			case 153 : // System.out.println("StaticInitializer ::= StaticOnly Block");

+				consumeStaticInitializer();

+				break;

+			case 154 : // System.out.println("StaticOnly ::= static");

+				consumeStaticOnly();

+				break;

+			case 155 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader ConstructorBody");

+				consumeConstructorDeclaration();

+				break;

+			case 156 : // System.out.println("ConstructorBody ::= NestedMethod LBRACE ConstructorBlockStatementsopt RBRACE");

+				consumeConstructorBody();

+				break;

+			case 159 : // System.out.println("ConstructorBlockStatementsopt ::= ExplicitConstructorInvocation BlockStatements");

+				consumeConstructorBlockStatements();

+				break;

+			case 160 : // System.out.println("ExplicitConstructorInvocation ::= this LPAREN ArgumentListopt RPAREN SEMICOLON");

+				consumeExplicitConstructorInvocation(0, ExplicitConstructorCall.This);

+				break;

+			case 161 : // System.out.println("ExplicitConstructorInvocation ::= super LPAREN ArgumentListopt RPAREN SEMICOLON");

+				consumeExplicitConstructorInvocation(0, ExplicitConstructorCall.Super);

+				break;

+			case 162 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT super LPAREN ArgumentListopt RPAREN");

+				consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.Super);

+				break;

+			case 163 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN ArgumentListopt RPAREN...");

+				consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.Super);

+				break;

+			case 164 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT this LPAREN ArgumentListopt RPAREN...");

+				consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.This);

+				break;

+			case 165 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN ArgumentListopt RPAREN...");

+				consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.This);

+				break;

+			case 166 : // System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody");

+				consumeInterfaceDeclaration();

+				break;

+			case 167 : // System.out.println("InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt");

+				consumeInterfaceHeader();

+				break;

+			case 168 : // System.out.println("InterfaceHeaderName ::= Modifiersopt interface Identifier");

+				consumeInterfaceHeaderName();

+				break;

+			case 170 : // System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList");

+				consumeInterfaceHeaderExtends();

+				break;

+			case 173 : // System.out.println("InterfaceMemberDeclarations ::= InterfaceMemberDeclarations...");

+				consumeInterfaceMemberDeclarations();

+				break;

+			case 174 : // System.out.println("InterfaceMemberDeclaration ::= SEMICOLON");

+				consumeEmptyInterfaceMemberDeclaration();

+				break;

+			case 177 : // System.out.println("InterfaceMemberDeclaration ::= InvalidMethodDeclaration");

+				ignoreMethodBody();

+				break;

+			case 178 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader ConstructorBody");

+				ignoreInvalidConstructorDeclaration(true);

+				break;

+			case 179 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader SEMICOLON");

+				ignoreInvalidConstructorDeclaration(false);

+				break;

+			case 185 : // System.out.println("ArrayInitializer ::= LBRACE ,opt RBRACE");

+				consumeEmptyArrayInitializer();

+				break;

+			case 186 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers RBRACE");

+				consumeArrayInitializer();

+				break;

+			case 187 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers COMMA RBRACE");

+				consumeArrayInitializer();

+				break;

+			case 189 : // System.out.println("VariableInitializers ::= VariableInitializers COMMA VariableInitializer");

+				consumeVariableInitializers();

+				break;

+			case 190 : // System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE");

+				consumeBlock();

+				break;

+			case 191 : // System.out.println("OpenBlock ::=");

+				consumeOpenBlock();

+				break;

+			case 193 : // System.out.println("BlockStatements ::= BlockStatements BlockStatement");

+				consumeBlockStatements();

+				break;

+			case 197 : // System.out.println("BlockStatement ::= InvalidInterfaceDeclaration");

+				ignoreInterfaceDeclaration();

+				break;

+			case 198 : // System.out.println("LocalVariableDeclarationStatement ::= LocalVariableDeclaration SEMICOLON");

+				consumeLocalVariableDeclarationStatement();

+				break;

+			case 199 : // System.out.println("LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators");

+				consumeLocalVariableDeclaration();

+				break;

+			case 200 : // System.out.println("LocalVariableDeclaration ::= Modifiers Type PushModifiers VariableDeclarators");

+				consumeLocalVariableDeclaration();

+				break;

+			case 201 : // System.out.println("PushModifiers ::=");

+				consumePushModifiers();

+				break;

+			case 225 : // System.out.println("EmptyStatement ::= SEMICOLON");

+				consumeEmptyStatement();

+				break;

+			case 226 : // System.out.println("LabeledStatement ::= Identifier COLON Statement");

+				consumeStatementLabel();

+				break;

+			case 227 : // System.out.println("LabeledStatementNoShortIf ::= Identifier COLON StatementNoShortIf");

+				consumeStatementLabel();

+				break;

+			case 228 : // System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON");

+				consumeExpressionStatement();

+				break;

+			case 236 : // System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN Statement");

+				consumeStatementIfNoElse();

+				break;

+			case 237 : // System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN StatementNoShortIf else...");

+				consumeStatementIfWithElse();

+				break;

+			case 238 : // System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression RPAREN StatementNoShortIf...");

+				consumeStatementIfWithElse();

+				break;

+			case 239 : // System.out.println("SwitchStatement ::= switch OpenBlock LPAREN Expression RPAREN SwitchBlock");

+				consumeStatementSwitch();

+				break;

+			case 240 : // System.out.println("SwitchBlock ::= LBRACE RBRACE");

+				consumeEmptySwitchBlock();

+				break;

+			case 243 : // System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements SwitchLabels RBRACE");

+				consumeSwitchBlock();

+				break;

+			case 245 : // System.out.println("SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement");

+				consumeSwitchBlockStatements();

+				break;

+			case 246 : // System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements");

+				consumeSwitchBlockStatement();

+				break;

+			case 248 : // System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel");

+				consumeSwitchLabels();

+				break;

+			case 249 : // System.out.println("SwitchLabel ::= case ConstantExpression COLON");

+				consumeCaseLabel();

+				break;

+			case 250 : // System.out.println("SwitchLabel ::= default COLON");

+				consumeDefaultLabel();

+				break;

+			case 251 : // System.out.println("WhileStatement ::= while LPAREN Expression RPAREN Statement");

+				consumeStatementWhile();

+				break;

+			case 252 : // System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression RPAREN StatementNoShortIf");

+				consumeStatementWhile();

+				break;

+			case 253 : // System.out.println("DoStatement ::= do Statement while LPAREN Expression RPAREN SEMICOLON");

+				consumeStatementDo();

+				break;

+			case 254 : // System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON...");

+				consumeStatementFor();

+				break;

+			case 255 : // System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON");

+				consumeStatementFor();

+				break;

+			case 256 : // System.out.println("ForInit ::= StatementExpressionList");

+				consumeForInit();

+				break;

+			case 260 : // System.out.println("StatementExpressionList ::= StatementExpressionList COMMA StatementExpression");

+				consumeStatementExpressionList();

+				break;

+			case 261 : // System.out.println("AssertStatement ::= assert Expression SEMICOLON");

+				consumeSimpleAssertStatement();

+				break;

+			case 262 : // System.out.println("AssertStatement ::= assert Expression COLON Expression SEMICOLON");

+				consumeAssertStatement();

+				break;

+			case 263 : // System.out.println("BreakStatement ::= break SEMICOLON");

+				consumeStatementBreak();

+				break;

+			case 264 : // System.out.println("BreakStatement ::= break Identifier SEMICOLON");

+				consumeStatementBreakWithLabel();

+				break;

+			case 265 : // System.out.println("ContinueStatement ::= continue SEMICOLON");

+				consumeStatementContinue();

+				break;

+			case 266 : // System.out.println("ContinueStatement ::= continue Identifier SEMICOLON");

+				consumeStatementContinueWithLabel();

+				break;

+			case 267 : // System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON");

+				consumeStatementReturn();

+				break;

+			case 268 : // System.out.println("ThrowStatement ::= throw Expression SEMICOLON");

+				consumeStatementThrow();

+				break;

+			case 269 : // System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN Expression RPAREN Block");

+				consumeStatementSynchronized();

+				break;

+			case 270 : // System.out.println("OnlySynchronized ::= synchronized");

+				consumeOnlySynchronized();

+				break;

+			case 271 : // System.out.println("TryStatement ::= try Block Catches");

+				consumeStatementTry(false);

+				break;

+			case 272 : // System.out.println("TryStatement ::= try Block Catchesopt Finally");

+				consumeStatementTry(true);

+				break;

+			case 274 : // System.out.println("Catches ::= Catches CatchClause");

+				consumeCatches();

+				break;

+			case 275 : // System.out.println("CatchClause ::= catch LPAREN FormalParameter RPAREN Block");

+				consumeStatementCatch();

+				break;

+			case 277 : // System.out.println("PushLPAREN ::= LPAREN");

+				consumeLeftParen();

+				break;

+			case 278 : // System.out.println("PushRPAREN ::= RPAREN");

+				consumeRightParen();

+				break;

+			case 282 : // System.out.println("PrimaryNoNewArray ::= this");

+				consumePrimaryNoNewArrayThis();

+				break;

+			case 283 : // System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN");

+				consumePrimaryNoNewArray();

+				break;

+			case 286 : // System.out.println("PrimaryNoNewArray ::= Name DOT this");

+				consumePrimaryNoNewArrayNameThis();

+				break;

+			case 287 : // System.out.println("PrimaryNoNewArray ::= Name DOT super");

+				consumePrimaryNoNewArrayNameSuper();

+				break;

+			case 288 : // System.out.println("PrimaryNoNewArray ::= Name DOT class");

+				consumePrimaryNoNewArrayName();

+				break;

+			case 289 : // System.out.println("PrimaryNoNewArray ::= ArrayType DOT class");

+				consumePrimaryNoNewArrayArrayType();

+				break;

+			case 290 : // System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class");

+				consumePrimaryNoNewArrayPrimitiveType();

+				break;

+			case 293 : // System.out.println("AllocationHeader ::= new ClassType LPAREN ArgumentListopt RPAREN");

+				consumeAllocationHeader();

+				break;

+			case 294 : // System.out.println("ClassInstanceCreationExpression ::= new ClassType LPAREN ArgumentListopt RPAREN...");

+				consumeClassInstanceCreationExpression();

+				break;

+			case 295 : // System.out.println("ClassInstanceCreationExpression ::= Primary DOT new SimpleName LPAREN...");

+				consumeClassInstanceCreationExpressionQualified();

+				break;

+			case 296 : // System.out.println("ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName new...");

+				consumeClassInstanceCreationExpressionQualified();

+				break;

+			case 297 : // System.out.println("ClassInstanceCreationExpressionName ::= Name DOT");

+				consumeClassInstanceCreationExpressionName();

+				break;

+			case 298 : // System.out.println("ClassBodyopt ::=");

+				consumeClassBodyopt();

+				break;

+			case 300 : // System.out.println("EnterAnonymousClassBody ::=");

+				consumeEnterAnonymousClassBody();

+				break;

+			case 302 : // System.out.println("ArgumentList ::= ArgumentList COMMA Expression");

+				consumeArgumentList();

+				break;

+			case 303 : // System.out.println("ArrayCreationExpression ::= new PrimitiveType DimWithOrWithOutExprs...");

+				consumeArrayCreationExpression();

+				break;

+			case 304 : // System.out.println("ArrayCreationExpression ::= new ClassOrInterfaceType DimWithOrWithOutExprs...");

+				consumeArrayCreationExpression();

+				break;

+			case 306 : // System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr");

+				consumeDimWithOrWithOutExprs();

+				break;

+			case 308 : // System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET");

+				consumeDimWithOrWithOutExpr();

+				break;

+			case 309 : // System.out.println("Dims ::= DimsLoop");

+				consumeDims();

+				break;

+			case 312 : // System.out.println("OneDimLoop ::= LBRACKET RBRACKET");

+				consumeOneDimLoop();

+				break;

+			case 313 : // System.out.println("FieldAccess ::= Primary DOT Identifier");

+				consumeFieldAccess(false);

+				break;

+			case 314 : // System.out.println("FieldAccess ::= super DOT Identifier");

+				consumeFieldAccess(true);

+				break;

+			case 315 : // System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN");

+				consumeMethodInvocationName();

+				break;

+			case 316 : // System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN ArgumentListopt RPAREN");

+				consumeMethodInvocationPrimary();

+				break;

+			case 317 : // System.out.println("MethodInvocation ::= super DOT Identifier LPAREN ArgumentListopt RPAREN");

+				consumeMethodInvocationSuper();

+				break;

+			case 318 : // System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET");

+				consumeArrayAccess(true);

+				break;

+			case 319 : // System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression RBRACKET");

+				consumeArrayAccess(false);

+				break;

+			case 321 : // System.out.println("PostfixExpression ::= Name");

+				consumePostfixExpression();

+				break;

+			case 324 : // System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS");

+				consumeUnaryExpression(OperatorExpression.PLUS, true);

+				break;

+			case 325 : // System.out.println("PostDecrementExpression ::= PostfixExpression MINUS_MINUS");

+				consumeUnaryExpression(OperatorExpression.MINUS, true);

+				break;

+			case 326 : // System.out.println("PushPosition ::=");

+				consumePushPosition();

+				break;

+			case 329 : // System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.PLUS);

+				break;

+			case 330 : // System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.MINUS);

+				break;

+			case 332 : // System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.PLUS, false);

+				break;

+			case 333 : // System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.MINUS, false);

+				break;

+			case 335 : // System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.TWIDDLE);

+				break;

+			case 336 : // System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition UnaryExpression");

+				consumeUnaryExpression(OperatorExpression.NOT);

+				break;

+			case 338 : // System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN UnaryExpression");

+				consumeCastExpression();

+				break;

+			case 339 : // System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN UnaryExpressionNotPlusMinus");

+				consumeCastExpression();

+				break;

+			case 340 : // System.out.println("CastExpression ::= PushLPAREN Expression PushRPAREN UnaryExpressionNotPlusMinus");

+				consumeCastExpressionLL1();

+				break;

+			case 342 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression MULTIPLY UnaryExpression");

+				consumeBinaryExpression(OperatorExpression.MULTIPLY);

+				break;

+			case 343 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression DIVIDE UnaryExpression");

+				consumeBinaryExpression(OperatorExpression.DIVIDE);

+				break;

+			case 344 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression REMAINDER UnaryExpression");

+				consumeBinaryExpression(OperatorExpression.REMAINDER);

+				break;

+			case 346 : // System.out.println("AdditiveExpression ::= AdditiveExpression PLUS MultiplicativeExpression");

+				consumeBinaryExpression(OperatorExpression.PLUS);

+				break;

+			case 347 : // System.out.println("AdditiveExpression ::= AdditiveExpression MINUS MultiplicativeExpression");

+				consumeBinaryExpression(OperatorExpression.MINUS);

+				break;

+			case 349 : // System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT AdditiveExpression");

+				consumeBinaryExpression(OperatorExpression.LEFT_SHIFT);

+				break;

+			case 350 : // System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT AdditiveExpression");

+				consumeBinaryExpression(OperatorExpression.RIGHT_SHIFT);

+				break;

+			case 351 : // System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT AdditiveExpression");

+				consumeBinaryExpression(OperatorExpression.UNSIGNED_RIGHT_SHIFT);

+				break;

+			case 353 : // System.out.println("RelationalExpression ::= RelationalExpression LESS ShiftExpression");

+				consumeBinaryExpression(OperatorExpression.LESS);

+				break;

+			case 354 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER ShiftExpression");

+				consumeBinaryExpression(OperatorExpression.GREATER);

+				break;

+			case 355 : // System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL ShiftExpression");

+				consumeBinaryExpression(OperatorExpression.LESS_EQUAL);

+				break;

+			case 356 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER_EQUAL ShiftExpression");

+				consumeBinaryExpression(OperatorExpression.GREATER_EQUAL);

+				break;

+			case 357 : // System.out.println("RelationalExpression ::= RelationalExpression instanceof ReferenceType");

+				consumeInstanceOfExpression(OperatorExpression.INSTANCEOF);

+				break;

+			case 359 : // System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL RelationalExpression");

+				consumeEqualityExpression(OperatorExpression.EQUAL_EQUAL);

+				break;

+			case 360 : // System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL RelationalExpression");

+				consumeEqualityExpression(OperatorExpression.NOT_EQUAL);

+				break;

+			case 362 : // System.out.println("AndExpression ::= AndExpression AND EqualityExpression");

+				consumeBinaryExpression(OperatorExpression.AND);

+				break;

+			case 364 : // System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR AndExpression");

+				consumeBinaryExpression(OperatorExpression.XOR);

+				break;

+			case 366 : // System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR ExclusiveOrExpression");

+				consumeBinaryExpression(OperatorExpression.OR);

+				break;

+			case 368 : // System.out.println("ConditionalAndExpression ::= ConditionalAndExpression AND_AND InclusiveOrExpression");

+				consumeBinaryExpression(OperatorExpression.AND_AND);

+				break;

+			case 370 : // System.out.println("ConditionalOrExpression ::= ConditionalOrExpression OR_OR ConditionalAndExpression");

+				consumeBinaryExpression(OperatorExpression.OR_OR);

+				break;

+			case 372 : // System.out.println("ConditionalExpression ::= ConditionalOrExpression QUESTION Expression COLON...");

+				consumeConditionalExpression(OperatorExpression.QUESTIONCOLON);

+				break;

+			case 375 : // System.out.println("Assignment ::= LeftHandSide AssignmentOperator AssignmentExpression");

+				consumeAssignment();

+				break;

+			case 377 : // System.out.println("Assignment ::= InvalidArrayInitializerAssignement");

+				ignoreExpressionAssignment();

+				break;

+			case 378 : // System.out.println("LeftHandSide ::= Name");

+				consumeLeftHandSide();

+				break;

+			case 381 : // System.out.println("AssignmentOperator ::= EQUAL");

+				consumeAssignmentOperator(EQUAL);

+				break;

+			case 382 : // System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL");

+				consumeAssignmentOperator(MULTIPLY);

+				break;

+			case 383 : // System.out.println("AssignmentOperator ::= DIVIDE_EQUAL");

+				consumeAssignmentOperator(DIVIDE);

+				break;

+			case 384 : // System.out.println("AssignmentOperator ::= REMAINDER_EQUAL");

+				consumeAssignmentOperator(REMAINDER);

+				break;

+			case 385 : // System.out.println("AssignmentOperator ::= PLUS_EQUAL");

+				consumeAssignmentOperator(PLUS);

+				break;

+			case 386 : // System.out.println("AssignmentOperator ::= MINUS_EQUAL");

+				consumeAssignmentOperator(MINUS);

+				break;

+			case 387 : // System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL");

+				consumeAssignmentOperator(LEFT_SHIFT);

+				break;

+			case 388 : // System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL");

+				consumeAssignmentOperator(RIGHT_SHIFT);

+				break;

+			case 389 : // System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL");

+				consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);

+				break;

+			case 390 : // System.out.println("AssignmentOperator ::= AND_EQUAL");

+				consumeAssignmentOperator(AND);

+				break;

+			case 391 : // System.out.println("AssignmentOperator ::= XOR_EQUAL");

+				consumeAssignmentOperator(XOR);

+				break;

+			case 392 : // System.out.println("AssignmentOperator ::= OR_EQUAL");

+				consumeAssignmentOperator(OR);

+				break;

+			case 399 : // System.out.println("Expressionopt ::=");

+				consumeEmptyExpression();

+				break;

+			case 403 : // System.out.println("ImportDeclarationsopt ::=");

+				consumeEmptyImportDeclarationsopt();

+				break;

+			case 404 : // System.out.println("ImportDeclarationsopt ::= ImportDeclarations");

+				consumeImportDeclarationsopt();

+				break;

+			case 405 : // System.out.println("TypeDeclarationsopt ::=");

+				consumeEmptyTypeDeclarationsopt();

+				break;

+			case 406 : // System.out.println("TypeDeclarationsopt ::= TypeDeclarations");

+				consumeTypeDeclarationsopt();

+				break;

+			case 407 : // System.out.println("ClassBodyDeclarationsopt ::=");

+				consumeEmptyClassBodyDeclarationsopt();

+				break;

+			case 408 : // System.out.println("ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations");

+				consumeClassBodyDeclarationsopt();

+				break;

+			case 409 : // System.out.println("Modifiersopt ::=");

+				consumeDefaultModifiers();

+				break;

+			case 410 : // System.out.println("Modifiersopt ::= Modifiers");

+				consumeModifiers();

+				break;

+			case 411 : // System.out.println("BlockStatementsopt ::=");

+				consumeEmptyBlockStatementsopt();

+				break;

+			case 413 : // System.out.println("Dimsopt ::=");

+				consumeEmptyDimsopt();

+				break;

+			case 415 : // System.out.println("ArgumentListopt ::=");

+				consumeEmptyArgumentListopt();

+				break;

+			case 419 : // System.out.println("FormalParameterListopt ::=");

+				consumeFormalParameterListopt();

+				break;

+			case 423 : // System.out.println("InterfaceMemberDeclarationsopt ::=");

+				consumeEmptyInterfaceMemberDeclarationsopt();

+				break;

+			case 424 : // System.out.println("InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations");

+				consumeInterfaceMemberDeclarationsopt();

+				break;

+			case 425 : // System.out.println("NestedType ::=");

+				consumeNestedType();

+				break;

+			case 426 : // System.out.println("ForInitopt ::=");

+				consumeEmptyForInitopt();

+				break;

+			case 428 : // System.out.println("ForUpdateopt ::=");

+				consumeEmptyForUpdateopt();

+				break;

+			case 432 : // System.out.println("Catchesopt ::=");

+				consumeEmptyCatchesopt();

+				break;

+			case 434 : // System.out.println("ArrayInitializeropt ::=");

+				consumeEmptyArrayInitializeropt();

+				break;

+		}

 	}

+	

+protected void consumeSimpleAssertStatement() {

+	// AssertStatement ::= 'assert' Expression ';'

+	expressionLengthPtr--;

+	pushOnAstStack(new AssertStatement(expressionStack[expressionPtr--], intStack[intPtr--]));	

 }

+	

 protected void consumeSingleTypeImportDeclaration() {

 	// SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'

 

@@ -3806,12 +3840,24 @@
 protected void consumeToken(int type) {

 	/* remember the last consumed value */

 	/* try to minimize the number of build values */

+	if (scanner.wasNonExternalizedStringLiteral) {

+		StringLiteral[] literals = this.scanner.nonNLSStrings;

+		for (int i = 0, max = literals.length; i < max; i++) {

+			problemReporter().nonExternalizedStringLiteral(literals[i]);

+		}

+		scanner.currentLine = null;

+		scanner.wasNonExternalizedStringLiteral = false;

+	}

 

 	//System.out.println(scanner.toStringAction(type));

 	switch (type) {

 

 		case TokenNameIdentifier :

 			pushIdentifier();

+			if (scanner.useAssertAsAnIndentifier) {

+				long positions = identifierPositionStack[identifierPtr];

+				problemReporter().useAssertAsAnIdentifier((int) (positions >>> 32), (int) positions);

+			}

 			break;

 

 		case TokenNameinterface :

@@ -3939,7 +3985,6 @@
 					scanner.getCurrentTokenSourceString(), 

 					scanner.startPosition, 

 					scanner.currentPosition - 1); 

-			if (scanner.wasNonExternalizedStringLiteral) problemReporter().nonExternalizedStringLiteral(stringLiteral);

 			pushOnExpressionStack(stringLiteral); 

 			break;

 		case TokenNamefalse :

@@ -3961,6 +4006,7 @@
 			endPosition = scanner.currentPosition - 1;

 			pushOnIntStack(scanner.startPosition);

 			break;

+		case TokenNameassert :

 		case TokenNameimport :

 		case TokenNamepackage :

 		case TokenNamethrow :

@@ -4294,17 +4340,17 @@
 	if (currentElement != null){

 		currentElement.topElement().updateParseTree();

 		if (VERBOSE_RECOVERY){

-			System.out.print(Util.bind("parser.syntaxRecovery"/*nonNLS*/));

-			System.out.println("--------------------------"/*nonNLS*/);		

+			System.out.print(Util.bind("parser.syntaxRecovery")); //$NON-NLS-1$

+			System.out.println("--------------------------");		 //$NON-NLS-1$

 			System.out.println(compilationUnit);		

-			System.out.println("----------------------------------"/*nonNLS*/);

+			System.out.println("----------------------------------"); //$NON-NLS-1$

 		}		

 	} else {

 		if (diet & VERBOSE_RECOVERY){

-			System.out.print(Util.bind("parser.regularParse"/*nonNLS*/));	

-			System.out.println("--------------------------"/*nonNLS*/);	

+			System.out.print(Util.bind("parser.regularParse"));	 //$NON-NLS-1$

+			System.out.println("--------------------------");	 //$NON-NLS-1$

 			System.out.println(compilationUnit);		

-			System.out.println("----------------------------------"/*nonNLS*/);

+			System.out.println("----------------------------------"); //$NON-NLS-1$

 		}

 	}

 	if (scanner.recordLineSeparator) {

@@ -4552,6 +4598,10 @@
 	firstToken = TokenNamePLUS_PLUS ;

 	scanner.linePtr = -1;	

 	scanner.recordLineSeparator = true;

+	scanner.currentLineNr= -1;

+	scanner.previousLineNr= -1;

+	scanner.currentLine= null;

+	scanner.lines= new ArrayList();

 }

 public void goForConstructorBody(){

 	//tells the scanner to go for compilation unit parsing

@@ -4644,7 +4694,7 @@
 

 	Identifier

 

-	abstract boolean break byte case catch char class 

+	abstract assert boolean break byte case catch char class 

 	continue default do double else extends false final finally float

 	for if implements import instanceof int

 	interface long native new null package private

@@ -4775,7 +4825,7 @@
 Goal ::= '==' ConstructorBody

 -- Initializer

 Goal ::= '>>' StaticInitializer

-Goal ::= '>>' ClassBodyDeclaration

+Goal ::= '>>' Initializer

 -- error recovery

 Goal ::= '>>>' Headers

 Goal ::= '*' BlockStatements

@@ -4979,6 +5029,9 @@
 Diet ::= $empty

 /.$putCase consumeDiet(); $break./

 

+Initializer ::= Diet NestedMethod Block

+/.$putCase consumeClassBodyDeclaration(); $break ./

+

 ClassMemberDeclaration -> FieldDeclaration

 ClassMemberDeclaration -> MethodDeclaration

 --1.1 feature

@@ -5279,6 +5332,7 @@
 StatementNoShortIf -> WhileStatementNoShortIf

 StatementNoShortIf -> ForStatementNoShortIf

 

+StatementWithoutTrailingSubstatement -> AssertStatement

 StatementWithoutTrailingSubstatement -> Block

 StatementWithoutTrailingSubstatement -> EmptyStatement

 StatementWithoutTrailingSubstatement -> ExpressionStatement

@@ -5373,6 +5427,13 @@
 StatementExpressionList ::= StatementExpressionList ',' StatementExpression

 /.$putCase consumeStatementExpressionList() ; $break ./

 

+-- 1.4 feature

+AssertStatement ::= 'assert' Expression ';'

+/.$putCase consumeSimpleAssertStatement() ; $break ./

+

+AssertStatement ::= 'assert' Expression ':' Expression ';'

+/.$putCase consumeAssertStatement() ; $break ./

+          

 BreakStatement ::= 'break' ';'

 /.$putCase consumeStatementBreak() ; $break ./

 

@@ -6006,21 +6067,21 @@
 	lastErrorEndPosition = -1;

 }

 public void initializeScanner(){

-	this.scanner = new Scanner(false, false, this.problemReporter.options.isNonExternalizedStringLiteralHandledAsWarning());

+	this.scanner = new Scanner(false, false, this.problemReporter.options.getNonExternalizedStringLiteralSeverity() != ProblemSeverities.Ignore , this.assertMode);

 }

 public final static void initTables() throws java.io.IOException {

 

 	final String prefix = FILEPREFIX;

 	int i = 0;

-	lhs = readTable(prefix + (++i) + ".rsc"/*nonNLS*/);

-	char[] chars = readTable(prefix + (++i) + ".rsc"/*nonNLS*/);

+	lhs = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$

+	char[] chars = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$

 	check_table = new short[chars.length];

 	for (int c = chars.length; c-- > 0;) {

 		check_table[c] = (short) (chars[c] - 32768);

 	}

-	asb = readTable(prefix + (++i) + ".rsc"/*nonNLS*/);

-	asr = readTable(prefix + (++i) + ".rsc"/*nonNLS*/);

-	symbol_index = readTable(prefix + (++i) + ".rsc"/*nonNLS*/);

+	asb = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$

+	asr = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$

+	symbol_index = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$

 	action = lhs;

 }

 public final void jumpOverMethodBody() {

@@ -6640,7 +6701,7 @@
 

 	InputStream stream = Parser.class.getResourceAsStream(filename);

 	if (stream == null) {

-		throw new java.io.IOException(Util.bind("parser.missingFile"/*nonNLS*/,filename));

+		throw new java.io.IOException(Util.bind("parser.missingFile",filename)); //$NON-NLS-1$

 	}

 

 	ByteArrayOutputStream os = new ByteArrayOutputStream(32000);

@@ -6658,7 +6719,7 @@
 

 	//minimal integrity check (even size expected)

 	if (streamLength % 2 != 0)

-		throw new java.io.IOException(Util.bind("parser.corruptedFile"/*nonNLS*/,filename));

+		throw new java.io.IOException(Util.bind("parser.corruptedFile",filename)); //$NON-NLS-1$

 

 	// convert bytes into chars

 	char[] chars = new char[streamLength / 2];

@@ -6741,9 +6802,9 @@
 		}

 	} else { //the next test is HEAVILY grammar DEPENDENT.

 		if ((length == 2)

-			&& (tokenName.equals(";"/*nonNLS*/))

-			&& (expectings[0] == "++"/*nonNLS*/)

-			&& (expectings[1] == "--"/*nonNLS*/)

+			&& (tokenName.equals(";")) //$NON-NLS-1$

+			&& (expectings[0] == "++") //$NON-NLS-1$

+			&& (expectings[1] == "--") //$NON-NLS-1$

 			&& (expressionPtr > -1)) {

 			// the ; is not the expected token ==> it ends a statement when an expression is not ended

 			problemReporter().invalidExpressionAsStatement(expressionStack[expressionPtr]);

@@ -6844,40 +6905,40 @@
 }

 public String toString() {

 

-	String s = "identifierStack : char[][] = {"/*nonNLS*/;

+	String s = "identifierStack : char[][] = {"; //$NON-NLS-1$

 	for (int i = 0; i <= identifierPtr; i++) {

-		s = s + "\""/*nonNLS*/ + String.valueOf(identifierStack[i]) + "\","/*nonNLS*/;

+		s = s + "\"" + String.valueOf(identifierStack[i]) + "\","; //$NON-NLS-1$ //$NON-NLS-2$

 	};

-	s = s + "}\n"/*nonNLS*/;

+	s = s + "}\n"; //$NON-NLS-1$

 

-	s = s + "identierLengthStack : int[] = {"/*nonNLS*/;

+	s = s + "identierLengthStack : int[] = {"; //$NON-NLS-1$

 	for (int i = 0; i <= identifierLengthPtr; i++) {

-		s = s + identifierLengthStack[i] + ","/*nonNLS*/;

+		s = s + identifierLengthStack[i] + ","; //$NON-NLS-1$

 	};

-	s = s + "}\n"/*nonNLS*/;

+	s = s + "}\n"; //$NON-NLS-1$

 

-	s = s + "astLengthStack : int[] = {"/*nonNLS*/;

+	s = s + "astLengthStack : int[] = {"; //$NON-NLS-1$

 	for (int i = 0; i <= astLengthPtr; i++) {

-		s = s + astLengthStack[i] + ","/*nonNLS*/;

+		s = s + astLengthStack[i] + ","; //$NON-NLS-1$

 	};

-	s = s + "}\n"/*nonNLS*/;

-	s = s + "astPtr : int = "/*nonNLS*/ + String.valueOf(astPtr) + "\n"/*nonNLS*/;

+	s = s + "}\n"; //$NON-NLS-1$

+	s = s + "astPtr : int = " + String.valueOf(astPtr) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$

 

-	s = s + "intStack : int[] = {"/*nonNLS*/;

+	s = s + "intStack : int[] = {"; //$NON-NLS-1$

 	for (int i = 0; i <= intPtr; i++) {

-		s = s + intStack[i] + ","/*nonNLS*/;

+		s = s + intStack[i] + ","; //$NON-NLS-1$

 	};

-	s = s + "}\n"/*nonNLS*/;

+	s = s + "}\n"; //$NON-NLS-1$

 

-	s = s + "expressionLengthStack : int[] = {"/*nonNLS*/;

+	s = s + "expressionLengthStack : int[] = {"; //$NON-NLS-1$

 	for (int i = 0; i <= expressionLengthPtr; i++) {

-		s = s + expressionLengthStack[i] + ","/*nonNLS*/;

+		s = s + expressionLengthStack[i] + ","; //$NON-NLS-1$

 	};

-	s = s + "}\n"/*nonNLS*/;

+	s = s + "}\n"; //$NON-NLS-1$

 

-	s = s + "expressionPtr : int = "/*nonNLS*/ + String.valueOf(expressionPtr) + "\n"/*nonNLS*/;

+	s = s + "expressionPtr : int = " + String.valueOf(expressionPtr) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$

 

-	s = s + "\n\n\n----------------Scanner--------------\n"/*nonNLS*/ + scanner.toString();

+	s = s + "\n\n\n----------------Scanner--------------\n" + scanner.toString(); //$NON-NLS-1$

 	return s;

 

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
index 0606e3a..349c4bb 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
@@ -10,21 +10,22 @@
 

 public interface ParserBasicInformation {

 

-	public final static int ERROR_SYMBOL = 304,

-	  MAX_NAME_LENGTH   = 36,

-	  NUM_STATES        = 586,

-	  NT_OFFSET         = 305,

-	  SCOPE_UBOUND      = -1,

-	  SCOPE_SIZE        = 0,

-	  LA_STATE_OFFSET   = 17754,

-	  MAX_LA            = 1,

-	  NUM_RULES         = 431,

-	  NUM_TERMINALS     = 104,

-	  NUM_NON_TERMINALS = 201,

-	  NUM_SYMBOLS       = 305,

-	  START_STATE       = 12614,

-	  EOFT_SYMBOL       = 156,

-	  EOLT_SYMBOL       = 156,

-	  ACCEPT_ACTION     = 17753,

-	  ERROR_ACTION      = 17754;

+	public final static int

+      ERROR_SYMBOL      = 307,

+      MAX_NAME_LENGTH   = 36,

+      NUM_STATES        = 591,

+      NT_OFFSET         = 308,

+      SCOPE_UBOUND      = -1,

+      SCOPE_SIZE        = 0,

+      LA_STATE_OFFSET   = 16965,

+      MAX_LA            = 1,

+      NUM_RULES         = 435,

+      NUM_TERMINALS     = 105,

+      NUM_NON_TERMINALS = 203,

+      NUM_SYMBOLS       = 308,

+      START_STATE       = 12259,

+      EOFT_SYMBOL       = 158,

+      EOLT_SYMBOL       = 158,

+      ACCEPT_ACTION     = 16964,

+      ERROR_ACTION      = 16965;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
index a26bdaa..6487e83 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
@@ -134,11 +134,11 @@
 }

 public String toString(int tab) {

 	StringBuffer result = new StringBuffer(tabString(tab));

-	result.append("Recovered block:\n"/*nonNLS*/);

+	result.append("Recovered block:\n"); //$NON-NLS-1$

 	result.append(blockDeclaration.toString(tab + 1));

 	if (this.statements != null) {

 		for (int i = 0; i < this.statementCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.statements[i].toString(tab + 1));

 		}

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
index 4de01e8..3e86663 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
@@ -215,7 +215,7 @@
 protected String tabString(int tab) {

 	StringBuffer result = new StringBuffer();

 	for (int i = tab; i > 0; i--) {

-		result.append("  "/*nonNLS*/);

+		result.append("  "); //$NON-NLS-1$

 	}

 	return result.toString();

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
index 7d3800c..c1efacb 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
@@ -85,11 +85,11 @@
 }

 public String toString(int tab){

 	StringBuffer buffer = new StringBuffer(tabString(tab));

-	buffer.append("Recovered field:\n"/*nonNLS*/);

+	buffer.append("Recovered field:\n"); //$NON-NLS-1$

 	buffer.append(fieldDeclaration.toString(tab + 1));

 	if (this.anonymousTypes != null) {

 		for (int i = 0; i < this.anonymousTypeCount; i++){

-			buffer.append("\n"/*nonNLS*/);

+			buffer.append("\n"); //$NON-NLS-1$

 			buffer.append(anonymousTypes[i].toString(tab + 1));

 		}

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java
index 139dead..af0493f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java
@@ -29,7 +29,7 @@
 	return this.importReference.declarationSourceEnd;

 }

 public String toString(int tab) {

-	return tabString(tab) + "Recovered import: "/*nonNLS*/ + importReference.toString();

+	return tabString(tab) + "Recovered import: " + importReference.toString(); //$NON-NLS-1$

 }

 public ImportReference updatedImportReference(){

 

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
index 36f41b9..3372925 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
@@ -161,10 +161,10 @@
 }

 public String toString(int tab) {

 	StringBuffer result = new StringBuffer(tabString(tab));

-	result.append("Recovered initializer:\n"/*nonNLS*/);

+	result.append("Recovered initializer:\n"); //$NON-NLS-1$

 	result.append(this.fieldDeclaration.toString(tab + 1));

 	if (this.initializerBody != null) {

-		result.append("\n"/*nonNLS*/);

+		result.append("\n"); //$NON-NLS-1$

 		result.append(this.initializerBody.toString(tab + 1));

 	}

 	return result.toString();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
index 3d3df3a..de77227 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
@@ -31,7 +31,7 @@
 	return this.localDeclaration.declarationSourceEnd;

 }

 public String toString(int tab) {

-	return tabString(tab) + "Recovered local variable:\n"/*nonNLS*/ + localDeclaration.toString(tab + 1);

+	return tabString(tab) + "Recovered local variable:\n" + localDeclaration.toString(tab + 1); //$NON-NLS-1$

 }

 public Statement updatedStatement(){

 	return localDeclaration;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
index d330454..49b642e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
@@ -189,16 +189,16 @@
 }

 public String toString(int tab) {

 	StringBuffer result = new StringBuffer(tabString(tab));

-	result.append("Recovered method:\n"/*nonNLS*/);

+	result.append("Recovered method:\n"); //$NON-NLS-1$

 	result.append(this.methodDeclaration.toString(tab + 1));

 	if (this.localTypes != null) {

 		for (int i = 0; i < this.localTypeCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.localTypes[i].toString(tab + 1));

 		}

 	}

 	if (this.methodBody != null) {

-		result.append("\n"/*nonNLS*/);

+		result.append("\n"); //$NON-NLS-1$

 		result.append(this.methodBody.toString(tab + 1));

 	}

 	return result.toString();

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
index 48be014..5ab597a 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java
@@ -30,7 +30,7 @@
 	return this.statement.sourceEnd;

 }

 public String toString(int tab){

-	return tabString(tab) + "Recovered statement:\n"/*nonNLS*/ + statement.toString(tab + 1);

+	return tabString(tab) + "Recovered statement:\n" + statement.toString(tab + 1); //$NON-NLS-1$

 }

 public Statement updatedStatement(){

 	return statement;

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
index e1bc17f..48bae14 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
@@ -185,27 +185,27 @@
 }

 public String toString(int tab) {

 	StringBuffer result = new StringBuffer(tabString(tab));

-	result.append("Recovered type:\n"/*nonNLS*/);

+	result.append("Recovered type:\n"); //$NON-NLS-1$

 	if (typeDeclaration instanceof AnonymousLocalTypeDeclaration) {

 		result.append(tabString(tab));

-		result.append(" "/*nonNLS*/);

+		result.append(" "); //$NON-NLS-1$

 	}

 	result.append(typeDeclaration.toString(tab + 1));

 	if (this.memberTypes != null) {

 		for (int i = 0; i < this.memberTypeCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.memberTypes[i].toString(tab + 1));

 		}

 	}

 	if (this.fields != null) {

 		for (int i = 0; i < this.fieldCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.fields[i].toString(tab + 1));

 		}

 	}

 	if (this.methods != null) {

 		for (int i = 0; i < this.methodCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.methods[i].toString(tab + 1));

 		}

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
index eb67804..83a438e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
@@ -106,19 +106,19 @@
 }

 public String toString(int tab) {

 	StringBuffer result = new StringBuffer(tabString(tab));

-	result.append("Recovered unit: [\n"/*nonNLS*/);

+	result.append("Recovered unit: [\n"); //$NON-NLS-1$

 	result.append(unitDeclaration.toString(tab + 1));

 	result.append(tabString(tab + 1));

-	result.append("]"/*nonNLS*/);

+	result.append("]"); //$NON-NLS-1$

 	if (this.imports != null) {

 		for (int i = 0; i < this.importCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.imports[i].toString(tab + 1));

 		}

 	}

 	if (this.types != null) {

 		for (int i = 0; i < this.typeCount; i++) {

-			result.append("\n"/*nonNLS*/);

+			result.append("\n"); //$NON-NLS-1$

 			result.append(this.types[i].toString(tab + 1));

 		}

 	}

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index a442132..5264792 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -4,8 +4,11 @@
  * (c) Copyright IBM Corp. 2000, 2001.

  * All Rights Reserved.

  */

-

+import java.util.ArrayList;

+import java.util.List;

+import java.util.Iterator;

 import java.io.*;

+import org.eclipse.jdt.internal.compiler.ast.StringLiteral;

 

 public class Scanner implements TerminalSymbols {

 

@@ -18,6 +21,11 @@
 	 - currentPosition-1 gives the sourceEnd position into the stream 

 	*/

 

+	// 1.4 feature

+	public boolean assertMode;

+	public boolean useAssertAsAnIndentifier = false;

+	public boolean containsAssertKeyword = false;

+	

 	public boolean recordLineSeparator;

 	public char currentCharacter;

 	public int startPosition;

@@ -62,21 +70,21 @@
 	public int linePtr = -1;

 	public boolean wasAcr = false;

 

-	public static final String END_OF_SOURCE = "End_Of_Source"/*nonNLS*/;

+	public static final String END_OF_SOURCE = "End_Of_Source"; //$NON-NLS-1$

 

-	public static final String INVALID_HEXA = "Invalid_Hexa_Literal"/*nonNLS*/;

-	public static final String INVALID_OCTAL = "Invalid_Octal_Literal"/*nonNLS*/;

+	public static final String INVALID_HEXA = "Invalid_Hexa_Literal"; //$NON-NLS-1$

+	public static final String INVALID_OCTAL = "Invalid_Octal_Literal"; //$NON-NLS-1$

 	public static final String INVALID_CHARACTER_CONSTANT = 

-		"Invalid_Character_Constant"/*nonNLS*/; 

-	public static final String INVALID_ESCAPE = "Invalid_Escape"/*nonNLS*/;

-	public static final String INVALID_INPUT = "Invalid_Input"/*nonNLS*/;

-	public static final String INVALID_UNICODE_ESCAPE = "Invalid_Unicode_Escape"/*nonNLS*/;

-	public static final String INVALID_FLOAT = "Invalid_Float_Literal"/*nonNLS*/;

+		"Invalid_Character_Constant";  //$NON-NLS-1$

+	public static final String INVALID_ESCAPE = "Invalid_Escape"; //$NON-NLS-1$

+	public static final String INVALID_INPUT = "Invalid_Input"; //$NON-NLS-1$

+	public static final String INVALID_UNICODE_ESCAPE = "Invalid_Unicode_Escape"; //$NON-NLS-1$

+	public static final String INVALID_FLOAT = "Invalid_Float_Literal"; //$NON-NLS-1$

 

-	public static final String NULL_SOURCE_STRING = "Null_Source_String"/*nonNLS*/;

-	public static final String UNTERMINATED_STRING = "Unterminated_String"/*nonNLS*/;

-	public static final String UNTERMINATED_COMMENT = "Unterminated_Comment"/*nonNLS*/;

-	public static final String INVALID_CHAR_IN_STRING = "Invalid_Char_In_String"/*nonNLS*/;

+	public static final String NULL_SOURCE_STRING = "Null_Source_String"; //$NON-NLS-1$

+	public static final String UNTERMINATED_STRING = "Unterminated_String"; //$NON-NLS-1$

+	public static final String UNTERMINATED_COMMENT = "Unterminated_Comment"; //$NON-NLS-1$

+	public static final String INVALID_CHAR_IN_STRING = "Invalid_Char_In_String"; //$NON-NLS-1$

 

 	//----------------optimized identifier managment------------------

 	static final char[] charArray_a = new char[] {'a'}, 

@@ -113,9 +121,18 @@
 	public /*static*/ final char[][][][] charArray_length = 

 		new char[OptimizedLength][TableSize][InternalTableSize][]; 

 	// support for detecting non-externalized string literals

+	int currentLineNr= -1;

+	int previousLineNr= -1;

+	NLSLine currentLine= null;

+	List lines= new ArrayList();

+	public static final String TAG_PREFIX= "//$NON-NLS-"; //$NON-NLS-1$

+	public static final int TAG_PREFIX_LENGTH= TAG_PREFIX.length();

+	public static final String TAG_POSTFIX= "$"; //$NON-NLS-1$

+	public static final int TAG_POSTFIX_LENGTH= TAG_POSTFIX.length();

+	public StringLiteral[] nonNLSStrings = null;

 	public boolean checkNonExternalizedStringLiterals = true;

-	public static char[] NonNLS_TAG = "/*nonNLS*/"/*nonNLS*/.toCharArray();

 	public boolean wasNonExternalizedStringLiteral = false;

+	

 	/*static*/ {

 		for (int i = 0; i < 6; i++) {

 			for (int j = 0; j < TableSize; j++) {

@@ -640,9 +657,14 @@
 					&& (source[currentPosition] == 'u')) {

 					isWhiteSpace = jumpOverUnicodeWhiteSpace();

 				} else {

-					if (recordLineSeparator

-						&& ((currentCharacter == '\r') || (currentCharacter == '\n')))

-						pushLineSeparator();

+					if ((currentCharacter == '\r') || (currentCharacter == '\n')) {

+						checkNonExternalizeString();

+						if (recordLineSeparator) {

+							pushLineSeparator();

+						} else {

+							linePtr++;

+						}

+					}

 					isWhiteSpace = 

 						(currentCharacter == ' ') || Character.isWhitespace(currentCharacter); 

 				}

@@ -916,15 +938,18 @@
 						}

 						throw e; // rethrow

 					}

-					if (checkNonExternalizedStringLiterals){ // check for presence of	/*nonNLS*/

-						int lookAhead = 0;

-						for (; lookAhead < 10; lookAhead++){

-							if (currentPosition + lookAhead == source.length)

-								break;

-							if (source[currentPosition + lookAhead] != NonNLS_TAG[lookAhead])

-								break;

+					if (checkNonExternalizedStringLiterals){ // check for presence of	NLS tags //$NON-NLS-?$ where ? is an int.

+						currentLineNr = linePtr;

+						if (currentLineNr != previousLineNr) {

+							currentLine= new NLSLine(currentLineNr);

+							lines.add(currentLine);

+							previousLineNr= currentLineNr;

 						}

-						this.wasNonExternalizedStringLiteral = lookAhead != 10;

+						currentLine.add(

+							new StringLiteral(

+								getCurrentTokenSourceString(), 

+								startPosition, 

+								currentPosition - 1));

 					}

 					return TokenNameStringLiteral;

 				case '/' :

@@ -992,13 +1017,18 @@
 									} //jump over the \\

 								}

 								recordComment(false);

-								if (recordLineSeparator

-									&& ((currentCharacter == '\r') || (currentCharacter == '\n')))

-									if (isUnicode) {

-										pushUnicodeLineSeparator();

+								if ((currentCharacter == '\r') || (currentCharacter == '\n')) {

+									checkNonExternalizeString();

+									if (recordLineSeparator) {

+										if (isUnicode) {

+											pushUnicodeLineSeparator();

+										} else {

+											pushLineSeparator();

+										}

 									} else {

-										pushLineSeparator();

+										linePtr++;

 									}

+								}

 								if (tokenizeComments) {

 									if (!isUnicode) {

 										currentPosition--; // reset one character behind

@@ -1006,10 +1036,10 @@
 									return TokenNameCOMMENT_LINE;

 								}

 							} catch (IndexOutOfBoundsException e) { //an eof will them be generated

-								if (tokenizeComments) {

-									currentPosition--; // reset one character behind

-									return TokenNameCOMMENT_LINE;

-								}

+									if (tokenizeComments) {

+										currentPosition--; // reset one character behind

+										return TokenNameCOMMENT_LINE;

+									}

 							}

 							break;

 						}

@@ -1030,9 +1060,14 @@
 								isJavadoc = true;

 								star = true;

 							}

-							if (recordLineSeparator

-								&& ((currentCharacter == '\r') || (currentCharacter == '\n')))

-								pushLineSeparator();

+							if ((currentCharacter == '\r') || (currentCharacter == '\n')) {

+								checkNonExternalizeString();

+								if (recordLineSeparator) {

+									pushLineSeparator();

+								} else {

+									linePtr++;

+								}

+							}

 							try { //get the next char 

 								if (((currentCharacter = source[currentPosition++]) == '\\')

 									&& (source[currentPosition] == 'u')) {

@@ -1050,9 +1085,14 @@
 								}

 								//loop until end of comment */

 								while ((currentCharacter != '/') || (!star)) {

-									if (recordLineSeparator

-										&& ((currentCharacter == '\r') || (currentCharacter == '\n')))

-										pushLineSeparator();

+									if ((currentCharacter == '\r') || (currentCharacter == '\n')) {

+										checkNonExternalizeString();

+										if (recordLineSeparator) {

+											pushLineSeparator();

+										} else {

+											linePtr++;

+										}

+									}

 									star = currentCharacter == '*';

 									//get next char

 									if (((currentCharacter = source[currentPosition++]) == '\\')

@@ -1085,7 +1125,7 @@
 					if (atEnd())

 						return TokenNameEOF;

 					//the atEnd may not be <currentPosition == source.length> if source is only some part of a real (external) stream

-					throw new InvalidInputException("Ctrl-Z"/*nonNLS*/);

+					throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$

 

 				default :

 					if (Character.isJavaIdentifierStart(currentCharacter))

@@ -1707,11 +1747,9 @@
 	newEntry6 = max;

 	return r;	

 }

-public final void pushLineSeparator() {

+public final void pushLineSeparator() throws InvalidInputException {

 	//see comment on isLineDelimiter(char) for the use of '\n' and '\r'

-

 	final int INCREMENT = 250;

-

 	//currentCharacter is at position currentPosition-1

 

 	// cr 000D

@@ -1848,6 +1886,7 @@
 	eofPosition = end + 1;

 	commentPtr = -1; // reset comment stack

 }

+

 public final void scanEscapeCharacter() throws InvalidInputException {

 	// the string with "\\u" is a legal string of two chars \ and u

 	//thus we use a direct access to the source (for regular cases).

@@ -1936,7 +1975,7 @@
 	//then the length. If there are several

 	//keywors with the same length AND the same first char, then do another

 	//disptach on the second char :-)...cool....but fast !

-

+	useAssertAsAnIndentifier = false;

 	while (getNextCharAsJavaIdentifierPart()) {};

 

 	int index, length;

@@ -1963,20 +2002,39 @@
 	firstLetter = data[index];

 	switch (firstLetter) {

 

-		case 'a' : //abstract

-			if (length == 8) {

-				if ((data[++index] == 'b')

-					&& (data[++index] == 's')

-					&& (data[++index] == 't')

-					&& (data[++index] == 'r')

-					&& (data[++index] == 'a')

-					&& (data[++index] == 'c')

-					&& (data[++index] == 't')) {

-					return TokenNameabstract;

-				}

+		case 'a' : 

+			switch(length) {

+				case 8: //abstract

+					if ((data[++index] == 'b')

+						&& (data[++index] == 's')

+						&& (data[++index] == 't')

+						&& (data[++index] == 'r')

+						&& (data[++index] == 'a')

+						&& (data[++index] == 'c')

+						&& (data[++index] == 't')) {

+							return TokenNameabstract;

+						} else {

+							return TokenNameIdentifier;

+						}

+				case 6: // assert

+					if ((data[++index] == 's')

+						&& (data[++index] == 's')

+						&& (data[++index] == 'e')

+						&& (data[++index] == 'r')

+						&& (data[++index] == 't')) {

+							if (assertMode) {

+								containsAssertKeyword = true;

+								return TokenNameassert;

+							} else {

+								useAssertAsAnIndentifier = true;

+								return TokenNameIdentifier;								

+							}

+						} else {

+							return TokenNameIdentifier;

+						}

+				default: 

+					return TokenNameIdentifier;

 			}

-			return TokenNameIdentifier;

-

 		case 'b' : //boolean break byte

 			switch (length) {

 				case 4 :

@@ -2648,6 +2706,7 @@
 	source = sourceString;

 	startPosition = -1;

 	initialPosition = currentPosition = 0;

+	containsAssertKeyword = false;

 	if (source == null) {

 		source = new char[0];

 	}

@@ -2655,9 +2714,9 @@
 }

 public String toString() {

 	if (startPosition == source.length)

-		return "EOF\n\n"/*nonNLS*/ + new String(source);

+		return "EOF\n\n" + new String(source); //$NON-NLS-1$

 	if (currentPosition > source.length)

-		return "behind the EOF :-( ....\n\n"/*nonNLS*/ + new String(source);

+		return "behind the EOF :-( ....\n\n" + new String(source); //$NON-NLS-1$

 

 	char front[] = new char[startPosition];

 	System.arraycopy(source, 0, front, 0, startPosition);

@@ -2685,228 +2744,280 @@
 		source.length - (currentPosition - 1) - 1);

 	

 	return new String(front)

-		+ "\n===============================\nStarts here -->"/*nonNLS*/

+		+ "\n===============================\nStarts here -->" //$NON-NLS-1$

 		+ new String(middle)

-		+ "<-- Ends here\n===============================\n"/*nonNLS*/

+		+ "<-- Ends here\n===============================\n" //$NON-NLS-1$

 		+ new String(end); 

 }

 public final String toStringAction(int act) {

 	switch (act) {

 		case TokenNameIdentifier :

-			return "Identifier("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Identifier(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameabstract :

-			return "abstract"/*nonNLS*/;

+			return "abstract"; //$NON-NLS-1$

 		case TokenNameboolean :

-			return "boolean"/*nonNLS*/;

+			return "boolean"; //$NON-NLS-1$

 		case TokenNamebreak :

-			return "break"/*nonNLS*/;

+			return "break"; //$NON-NLS-1$

 		case TokenNamebyte :

-			return "byte"/*nonNLS*/;

+			return "byte"; //$NON-NLS-1$

 		case TokenNamecase :

-			return "case"/*nonNLS*/;

+			return "case"; //$NON-NLS-1$

 		case TokenNamecatch :

-			return "catch"/*nonNLS*/;

+			return "catch"; //$NON-NLS-1$

 		case TokenNamechar :

-			return "char"/*nonNLS*/;

+			return "char"; //$NON-NLS-1$

 		case TokenNameclass :

-			return "class"/*nonNLS*/;

+			return "class"; //$NON-NLS-1$

 		case TokenNamecontinue :

-			return "continue"/*nonNLS*/;

+			return "continue"; //$NON-NLS-1$

 		case TokenNamedefault :

-			return "default"/*nonNLS*/;

+			return "default"; //$NON-NLS-1$

 		case TokenNamedo :

-			return "do"/*nonNLS*/;

+			return "do"; //$NON-NLS-1$

 		case TokenNamedouble :

-			return "double"/*nonNLS*/;

+			return "double"; //$NON-NLS-1$

 		case TokenNameelse :

-			return "else"/*nonNLS*/;

+			return "else"; //$NON-NLS-1$

 		case TokenNameextends :

-			return "extends"/*nonNLS*/;

+			return "extends"; //$NON-NLS-1$

 		case TokenNamefalse :

-			return "false"/*nonNLS*/;

+			return "false"; //$NON-NLS-1$

 		case TokenNamefinal :

-			return "final"/*nonNLS*/;

+			return "final"; //$NON-NLS-1$

 		case TokenNamefinally :

-			return "finally"/*nonNLS*/;

+			return "finally"; //$NON-NLS-1$

 		case TokenNamefloat :

-			return "float"/*nonNLS*/;

+			return "float"; //$NON-NLS-1$

 		case TokenNamefor :

-			return "for"/*nonNLS*/;

+			return "for"; //$NON-NLS-1$

 		case TokenNameif :

-			return "if"/*nonNLS*/;

+			return "if"; //$NON-NLS-1$

 		case TokenNameimplements :

-			return "implements"/*nonNLS*/;

+			return "implements"; //$NON-NLS-1$

 		case TokenNameimport :

-			return "import"/*nonNLS*/;

+			return "import"; //$NON-NLS-1$

 		case TokenNameinstanceof :

-			return "instanceof"/*nonNLS*/;

+			return "instanceof"; //$NON-NLS-1$

 		case TokenNameint :

-			return "int"/*nonNLS*/;

+			return "int"; //$NON-NLS-1$

 		case TokenNameinterface :

-			return "interface"/*nonNLS*/;

+			return "interface"; //$NON-NLS-1$

 		case TokenNamelong :

-			return "long"/*nonNLS*/;

+			return "long"; //$NON-NLS-1$

 		case TokenNamenative :

-			return "native"/*nonNLS*/;

+			return "native"; //$NON-NLS-1$

 		case TokenNamenew :

-			return "new"/*nonNLS*/;

+			return "new"; //$NON-NLS-1$

 		case TokenNamenull :

-			return "null"/*nonNLS*/;

+			return "null"; //$NON-NLS-1$

 		case TokenNamepackage :

-			return "package"/*nonNLS*/;

+			return "package"; //$NON-NLS-1$

 		case TokenNameprivate :

-			return "private"/*nonNLS*/;

+			return "private"; //$NON-NLS-1$

 		case TokenNameprotected :

-			return "protected"/*nonNLS*/;

+			return "protected"; //$NON-NLS-1$

 		case TokenNamepublic :

-			return "public"/*nonNLS*/;

+			return "public"; //$NON-NLS-1$

 		case TokenNamereturn :

-			return "return"/*nonNLS*/;

+			return "return"; //$NON-NLS-1$

 		case TokenNameshort :

-			return "short"/*nonNLS*/;

+			return "short"; //$NON-NLS-1$

 		case TokenNamestatic :

-			return "static"/*nonNLS*/;

+			return "static"; //$NON-NLS-1$

 		case TokenNamesuper :

-			return "super"/*nonNLS*/;

+			return "super"; //$NON-NLS-1$

 		case TokenNameswitch :

-			return "switch"/*nonNLS*/;

+			return "switch"; //$NON-NLS-1$

 		case TokenNamesynchronized :

-			return "synchronized"/*nonNLS*/;

+			return "synchronized"; //$NON-NLS-1$

 		case TokenNamethis :

-			return "this"/*nonNLS*/;

+			return "this"; //$NON-NLS-1$

 		case TokenNamethrow :

-			return "throw"/*nonNLS*/;

+			return "throw"; //$NON-NLS-1$

 		case TokenNamethrows :

-			return "throws"/*nonNLS*/;

+			return "throws"; //$NON-NLS-1$

 		case TokenNametransient :

-			return "transient"/*nonNLS*/;

+			return "transient"; //$NON-NLS-1$

 		case TokenNametrue :

-			return "true"/*nonNLS*/;

+			return "true"; //$NON-NLS-1$

 		case TokenNametry :

-			return "try"/*nonNLS*/;

+			return "try"; //$NON-NLS-1$

 		case TokenNamevoid :

-			return "void"/*nonNLS*/;

+			return "void"; //$NON-NLS-1$

 		case TokenNamevolatile :

-			return "volatile"/*nonNLS*/;

+			return "volatile"; //$NON-NLS-1$

 		case TokenNamewhile :

-			return "while"/*nonNLS*/;

+			return "while"; //$NON-NLS-1$

 

 		case TokenNameIntegerLiteral :

-			return "Integer("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Integer(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameLongLiteral :

-			return "Long("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Long(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameFloatingPointLiteral :

-			return "Float("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Float(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameDoubleLiteral :

-			return "Double("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Double(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameCharacterLiteral :

-			return "Char("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "Char(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 		case TokenNameStringLiteral :

-			return "String("/*nonNLS*/ + new String(getCurrentTokenSource()) + ")"/*nonNLS*/;

+			return "String(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 

 		case TokenNamePLUS_PLUS :

-			return "++"/*nonNLS*/;

+			return "++"; //$NON-NLS-1$

 		case TokenNameMINUS_MINUS :

-			return "--"/*nonNLS*/;

+			return "--"; //$NON-NLS-1$

 		case TokenNameEQUAL_EQUAL :

-			return "=="/*nonNLS*/;

+			return "=="; //$NON-NLS-1$

 		case TokenNameLESS_EQUAL :

-			return "<="/*nonNLS*/;

+			return "<="; //$NON-NLS-1$

 		case TokenNameGREATER_EQUAL :

-			return ">="/*nonNLS*/;

+			return ">="; //$NON-NLS-1$

 		case TokenNameNOT_EQUAL :

-			return "!="/*nonNLS*/;

+			return "!="; //$NON-NLS-1$

 		case TokenNameLEFT_SHIFT :

-			return "<<"/*nonNLS*/;

+			return "<<"; //$NON-NLS-1$

 		case TokenNameRIGHT_SHIFT :

-			return ">>"/*nonNLS*/;

+			return ">>"; //$NON-NLS-1$

 		case TokenNameUNSIGNED_RIGHT_SHIFT :

-			return ">>>"/*nonNLS*/;

+			return ">>>"; //$NON-NLS-1$

 		case TokenNamePLUS_EQUAL :

-			return "+="/*nonNLS*/;

+			return "+="; //$NON-NLS-1$

 		case TokenNameMINUS_EQUAL :

-			return "-="/*nonNLS*/;

+			return "-="; //$NON-NLS-1$

 		case TokenNameMULTIPLY_EQUAL :

-			return "*="/*nonNLS*/;

+			return "*="; //$NON-NLS-1$

 		case TokenNameDIVIDE_EQUAL :

-			return "/="/*nonNLS*/;

+			return "/="; //$NON-NLS-1$

 		case TokenNameAND_EQUAL :

-			return "&="/*nonNLS*/;

+			return "&="; //$NON-NLS-1$

 		case TokenNameOR_EQUAL :

-			return "|="/*nonNLS*/;

+			return "|="; //$NON-NLS-1$

 		case TokenNameXOR_EQUAL :

-			return "^="/*nonNLS*/;

+			return "^="; //$NON-NLS-1$

 		case TokenNameREMAINDER_EQUAL :

-			return "%="/*nonNLS*/;

+			return "%="; //$NON-NLS-1$

 		case TokenNameLEFT_SHIFT_EQUAL :

-			return "<<="/*nonNLS*/;

+			return "<<="; //$NON-NLS-1$

 		case TokenNameRIGHT_SHIFT_EQUAL :

-			return ">>="/*nonNLS*/;

+			return ">>="; //$NON-NLS-1$

 		case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL :

-			return ">>>="/*nonNLS*/;

+			return ">>>="; //$NON-NLS-1$

 		case TokenNameOR_OR :

-			return "||"/*nonNLS*/;

+			return "||"; //$NON-NLS-1$

 		case TokenNameAND_AND :

-			return "&&"/*nonNLS*/;

+			return "&&"; //$NON-NLS-1$

 		case TokenNamePLUS :

-			return "+"/*nonNLS*/;

+			return "+"; //$NON-NLS-1$

 		case TokenNameMINUS :

-			return "-"/*nonNLS*/;

+			return "-"; //$NON-NLS-1$

 		case TokenNameNOT :

-			return "!"/*nonNLS*/;

+			return "!"; //$NON-NLS-1$

 		case TokenNameREMAINDER :

-			return "%"/*nonNLS*/;

+			return "%"; //$NON-NLS-1$

 		case TokenNameXOR :

-			return "^"/*nonNLS*/;

+			return "^"; //$NON-NLS-1$

 		case TokenNameAND :

-			return "&"/*nonNLS*/;

+			return "&"; //$NON-NLS-1$

 		case TokenNameMULTIPLY :

-			return "*"/*nonNLS*/;

+			return "*"; //$NON-NLS-1$

 		case TokenNameOR :

-			return "|"/*nonNLS*/;

+			return "|"; //$NON-NLS-1$

 		case TokenNameTWIDDLE :

-			return "~"/*nonNLS*/;

+			return "~"; //$NON-NLS-1$

 		case TokenNameDIVIDE :

-			return "/"/*nonNLS*/;

+			return "/"; //$NON-NLS-1$

 		case TokenNameGREATER :

-			return ">"/*nonNLS*/;

+			return ">"; //$NON-NLS-1$

 		case TokenNameLESS :

-			return "<"/*nonNLS*/;

+			return "<"; //$NON-NLS-1$

 		case TokenNameLPAREN :

-			return "("/*nonNLS*/;

+			return "("; //$NON-NLS-1$

 		case TokenNameRPAREN :

-			return ")"/*nonNLS*/;

+			return ")"; //$NON-NLS-1$

 		case TokenNameLBRACE :

-			return "{"/*nonNLS*/;

+			return "{"; //$NON-NLS-1$

 		case TokenNameRBRACE :

-			return "}"/*nonNLS*/;

+			return "}"; //$NON-NLS-1$

 		case TokenNameLBRACKET :

-			return "["/*nonNLS*/;

+			return "["; //$NON-NLS-1$

 		case TokenNameRBRACKET :

-			return "]"/*nonNLS*/;

+			return "]"; //$NON-NLS-1$

 		case TokenNameSEMICOLON :

-			return ";"/*nonNLS*/;

+			return ";"; //$NON-NLS-1$

 		case TokenNameQUESTION :

-			return "?"/*nonNLS*/;

+			return "?"; //$NON-NLS-1$

 		case TokenNameCOLON :

-			return ":"/*nonNLS*/;

+			return ":"; //$NON-NLS-1$

 		case TokenNameCOMMA :

-			return ","/*nonNLS*/;

+			return ","; //$NON-NLS-1$

 		case TokenNameDOT :

-			return "."/*nonNLS*/;

+			return "."; //$NON-NLS-1$

 		case TokenNameEQUAL :

-			return "="/*nonNLS*/;

+			return "="; //$NON-NLS-1$

 		case TokenNameEOF :

-			return "EOF"/*nonNLS*/;

+			return "EOF"; //$NON-NLS-1$

 		default :

-			return "not-a-token"/*nonNLS*/;

+			return "not-a-token"; //$NON-NLS-1$

 	}

 }

 

 public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals) {

+	this(tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, false);

+}

+

+public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals, boolean assertMode) {

 	this.eofPosition = Integer.MAX_VALUE;

 	this.tokenizeComments = tokenizeComments;

 	this.tokenizeWhiteSpace = tokenizeWhiteSpace;

 	this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;

+	this.assertMode = assertMode;

+}

+

+private void checkNonExternalizeString()  throws InvalidInputException {

+	if (currentLine == null || currentLineNr != linePtr)

+		return;

+	parseTags(currentLine);

+}

+

+private void parseTags(NLSLine line) throws InvalidInputException {

+	String s = new String(getCurrentTokenSource());

+	int pos = s.indexOf(TAG_PREFIX);

+	int lineLength = line.size();

+	while (pos != -1) {

+		int start = pos + TAG_PREFIX_LENGTH;

+		int end = s.indexOf(TAG_POSTFIX, start);

+		String index = s.substring(start, end);

+		int i = 0;

+		try {

+			i = Integer.parseInt(index) - 1; // Tags are one based not zero based.

+		} catch (NumberFormatException e) {

+			i = -1; // we don't want to consider this as a valid NLS tag

+		}

+		int listIndex = lineLength - i - 1;

+		if (line.exists(listIndex)) {

+			line.set(listIndex, null);

+		}

+		pos = s.indexOf(TAG_PREFIX, start);

+	}

+

+	this.nonNLSStrings = new StringLiteral[lineLength];

+	int nonNLSCounter = 0;

+	for (Iterator iterator = line.iterator(); iterator.hasNext(); ) {

+		StringLiteral literal = (StringLiteral) iterator.next();

+		if (literal != null) {

+			this.nonNLSStrings[nonNLSCounter++] = literal;

+		}

+	}

+	if (nonNLSCounter == 0) {

+		this.nonNLSStrings = null;

+		currentLine = null;

+		return;

+	} 

+	wasNonExternalizedStringLiteral = true;

+	if (nonNLSCounter != lineLength) {

+		System.arraycopy(this.nonNLSStrings, 0, (this.nonNLSStrings = new StringLiteral[nonNLSCounter]), 0, nonNLSCounter);

+	}

+	currentLine = null;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java b/compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
index 40bdc7b..5cc0193 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
@@ -25,285 +25,297 @@
 import org.eclipse.jdt.internal.compiler.util.*;

 

 public class SourceTypeConverter implements CompilerModifiers {

-/*

- * Convert a source element type into a parsed type declaration

- *

- * Can optionally ignore fields & methods

- *

- * @deprecated - should use the other API with one extra boolean

- */

-public static CompilationUnitDeclaration buildCompilationUnit(

-	ISourceType sourceType,

-	boolean needFieldsAndMethods,

-	ProblemReporter problemReporter,

-	CompilationResult compilationResult) {

 

-	return buildCompilationUnit(sourceType, needFieldsAndMethods, true, problemReporter, compilationResult);

-}

-/*

- * Convert a source element type into a parsed type declaration

- *

- * Can optionally ignore fields & methods or member types

- */

-public static CompilationUnitDeclaration buildCompilationUnit(

-	ISourceType sourceType,

-	boolean needFieldsAndMethods,

-	boolean needMemberTypes,

-	ProblemReporter problemReporter,

-	CompilationResult compilationResult) {

-

-	if (sourceType.getName() == null) return null; // do a basic test that the sourceType is valid

-

-	CompilationUnitDeclaration compilationUnit = 

-		new CompilationUnitDeclaration(problemReporter, compilationResult, 0); // not filled at this point

-

-	/* only positions available */

-	int start = sourceType.getNameSourceStart();

-	int end = sourceType.getNameSourceEnd();

-		

-	/* convert package and imports */

-	if (sourceType.getPackageName() != null && sourceType.getPackageName().length > 0) // if its null then it is defined in the default package

-		compilationUnit.currentPackage = createImportReference(sourceType.getPackageName(), start, end);

-	char[][] importNames = sourceType.getImports();

-	int importCount = importNames == null ? 0 : importNames.length;

-	compilationUnit.imports = new ImportReference[importCount];

-	for (int i = 0; i < importCount; i++)

-		compilationUnit.imports[i] = createImportReference(importNames[i], start, end);

-	/* convert type */

-	compilationUnit.types = new TypeDeclaration[] {convert(sourceType, needFieldsAndMethods, needMemberTypes)}; 

-

-	return compilationUnit;

-}

-/*

- * Convert a field source element into a parsed field declaration

- */

-

-private static FieldDeclaration convert(ISourceField sourceField) {

-

-	FieldDeclaration field = new FieldDeclaration();

-

-	int start = sourceField.getNameSourceStart();

-	int end = sourceField.getNameSourceEnd();

-

-	field.name = sourceField.getName();

-	field.sourceStart = start;

-	field.sourceEnd = end;

-	field.type = createTypeReference(sourceField.getTypeName(), start, end);

-	field.declarationSourceStart = sourceField.getDeclarationSourceStart();

-	field.declarationSourceEnd = sourceField.getDeclarationSourceEnd();

-	field.modifiers = sourceField.getModifiers();

-	

-	/* conversion of field constant: if not present, then cannot generate binary against 

-		converted parse nodes */

 	/*

-	if (field.modifiers & AccFinal){

-		char[] initializationSource = sourceField.getInitializationSource();

-	}

-	*/

-	return field;

-}

-/*

- * Convert a method source element into a parsed method/constructor declaration 

- */

-private static AbstractMethodDeclaration convert(ISourceMethod sourceMethod) {

+	 * Convert a set of source element types into a parsed compilation unit declaration

+	 * The argument types are then all grouped in the same unit. The argument types must 

+	 * at least contain one type.

+	 * Can optionally ignore fields & methods or member types

+	 */

+	public static CompilationUnitDeclaration buildCompilationUnit(

+		ISourceType[] sourceTypes,

+		boolean needFieldsAndMethods,

+		boolean needMemberTypes,

+		ProblemReporter problemReporter,

+		CompilationResult compilationResult) {

 

-	AbstractMethodDeclaration method;

+		ISourceType sourceType = sourceTypes[0];

+		if (sourceType.getName() == null)

+			return null; // do a basic test that the sourceType is valid

 

-	/* only source positions available */

-	int start = sourceMethod.getNameSourceStart();

-	int end = sourceMethod.getNameSourceEnd();

+		CompilationUnitDeclaration compilationUnit =

+			new CompilationUnitDeclaration(problemReporter, compilationResult, 0);

+		// not filled at this point

 

-	if (sourceMethod.isConstructor()) {

-		ConstructorDeclaration decl = new ConstructorDeclaration();

-		decl.isDefaultConstructor = false;

-		method = decl;

-	} else {

-		MethodDeclaration decl = new MethodDeclaration();

-		/* convert return type */

-		decl.returnType = 

-			createTypeReference(sourceMethod.getReturnTypeName(), start, end); 

-		method = decl;

-	}

-	method.selector = sourceMethod.getSelector();

-	method.modifiers = sourceMethod.getModifiers();

-	method.sourceStart = start;

-	method.sourceEnd = end;

-	method.declarationSourceStart = sourceMethod.getDeclarationSourceStart();

-	method.declarationSourceEnd = sourceMethod.getDeclarationSourceEnd();

+		/* only positions available */

+		int start = sourceType.getNameSourceStart();

+		int end = sourceType.getNameSourceEnd();

 

-	/* convert arguments */

-	char[][] argumentTypeNames = sourceMethod.getArgumentTypeNames();

-	char[][] argumentNames = sourceMethod.getArgumentNames();

-	int argumentCount = argumentTypeNames == null ? 0 : argumentTypeNames.length;

-	long position = (long) start << 32 + end;

-	method.arguments = new Argument[argumentCount];

-	for (int i = 0; i < argumentCount; i++) {

-		method.arguments[i] = 

-			new Argument(

-				argumentNames[i], 

-				position, 

-				createTypeReference(argumentTypeNames[i], start, end), 

-				AccDefault); // do not care whether was final or not

-	}

-

-	/* convert thrown exceptions */

-	char[][] exceptionTypeNames = sourceMethod.getExceptionTypeNames();

-	int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length;

-	method.thrownExceptions = new TypeReference[exceptionCount];

-	for (int i = 0; i < exceptionCount; i++) {

-		method.thrownExceptions[i] = 

-			createTypeReference(exceptionTypeNames[i], start, end); 

-	}

-	return method;

-}

-/*

- * Convert a source element type into a parsed type declaration

- *

- * Can optionally ignore fields & methods

- */

-private static TypeDeclaration convert(ISourceType sourceType, boolean needFieldsAndMethods, boolean needMemberTypes) {

-

-	/* create type declaration - can be member type */

-	TypeDeclaration type;

-	if (sourceType.getEnclosingType() == null){

-		type = new TypeDeclaration();

-	} else {

-		type = new MemberTypeDeclaration();

-	}

-	type.name = sourceType.getName();

-	int start, end; // only positions available

-	type.sourceStart = start = sourceType.getNameSourceStart();

-	type.sourceEnd = end = sourceType.getNameSourceEnd();

-	type.modifiers = sourceType.getModifiers();

-	type.declarationSourceStart = sourceType.getDeclarationSourceStart();

-	type.declarationSourceEnd = sourceType.getDeclarationSourceEnd();

-

-	/* set superclass and superinterfaces */

-	if (sourceType.getSuperclassName() != null)

-		type.superclass = createTypeReference(sourceType.getSuperclassName(), start, end);

-	char[][] interfaceNames = sourceType.getInterfaceNames();

-	int interfaceCount = interfaceNames == null ? 0 : interfaceNames.length;

-	type.superInterfaces = new TypeReference[interfaceCount];

-	for (int i = 0; i < interfaceCount; i++){

-		type.superInterfaces[i] = createTypeReference(interfaceNames[i], start, end);

-	}	

-	/* convert member types */

-	if (needMemberTypes){

-		ISourceType[] sourceMemberTypes = sourceType.getMemberTypes();

-		int sourceMemberTypeCount = sourceMemberTypes == null ? 0 : sourceMemberTypes.length;

-		type.memberTypes = new MemberTypeDeclaration[sourceMemberTypeCount];

-		for (int i = 0; i < sourceMemberTypeCount; i++) {

-			type.memberTypes[i] = (MemberTypeDeclaration) convert(sourceMemberTypes[i], needFieldsAndMethods, true);

+		/* convert package and imports */

+		if (sourceType.getPackageName() != null

+			&& sourceType.getPackageName().length > 0)

+			// if its null then it is defined in the default package

+			compilationUnit.currentPackage =

+				createImportReference(sourceType.getPackageName(), start, end);

+		char[][] importNames = sourceType.getImports();

+		int importCount = importNames == null ? 0 : importNames.length;

+		compilationUnit.imports = new ImportReference[importCount];

+		for (int i = 0; i < importCount; i++)

+			compilationUnit.imports[i] = createImportReference(importNames[i], start, end);

+		/* convert type(s) */

+		int typeCount = sourceTypes.length;

+		compilationUnit.types = new TypeDeclaration[typeCount];

+		for (int i = 0; i < typeCount; i++) {

+			compilationUnit.types[i] =

+				convert(sourceTypes[i], needFieldsAndMethods, needMemberTypes);

 		}

+		return compilationUnit;

 	}

-	/* convert fields and methods */

-	if (needFieldsAndMethods) {

-		/* convert fields */

-		ISourceField[] sourceFields = sourceType.getFields();

-		int sourceFieldCount = sourceFields == null ? 0 : sourceFields.length;

-		type.fields = new FieldDeclaration[sourceFieldCount];

-		for (int i = 0; i < sourceFieldCount; i++) {

-			type.fields[i] = convert(sourceFields[i]);

+	

+	/*

+	 * Convert a field source element into a parsed field declaration

+	 */

+	private static FieldDeclaration convert(ISourceField sourceField) {

+

+		FieldDeclaration field = new FieldDeclaration();

+

+		int start = sourceField.getNameSourceStart();

+		int end = sourceField.getNameSourceEnd();

+

+		field.name = sourceField.getName();

+		field.sourceStart = start;

+		field.sourceEnd = end;

+		field.type = createTypeReference(sourceField.getTypeName(), start, end);

+		field.declarationSourceStart = sourceField.getDeclarationSourceStart();

+		field.declarationSourceEnd = sourceField.getDeclarationSourceEnd();

+		field.modifiers = sourceField.getModifiers();

+

+		/* conversion of field constant: if not present, then cannot generate binary against 

+			converted parse nodes */

+		/*

+		if (field.modifiers & AccFinal){

+			char[] initializationSource = sourceField.getInitializationSource();

+		}

+		*/

+		return field;

+	}

+

+	/*

+	 * Convert a method source element into a parsed method/constructor declaration 

+	 */

+	private static AbstractMethodDeclaration convert(ISourceMethod sourceMethod) {

+

+		AbstractMethodDeclaration method;

+

+		/* only source positions available */

+		int start = sourceMethod.getNameSourceStart();

+		int end = sourceMethod.getNameSourceEnd();

+

+		if (sourceMethod.isConstructor()) {

+			ConstructorDeclaration decl = new ConstructorDeclaration();

+			decl.isDefaultConstructor = false;

+			method = decl;

+		} else {

+			MethodDeclaration decl = new MethodDeclaration();

+			/* convert return type */

+			decl.returnType =

+				createTypeReference(sourceMethod.getReturnTypeName(), start, end);

+			method = decl;

+		}

+		method.selector = sourceMethod.getSelector();

+		method.modifiers = sourceMethod.getModifiers();

+		method.sourceStart = start;

+		method.sourceEnd = end;

+		method.declarationSourceStart = sourceMethod.getDeclarationSourceStart();

+		method.declarationSourceEnd = sourceMethod.getDeclarationSourceEnd();

+

+		/* convert arguments */

+		char[][] argumentTypeNames = sourceMethod.getArgumentTypeNames();

+		char[][] argumentNames = sourceMethod.getArgumentNames();

+		int argumentCount = argumentTypeNames == null ? 0 : argumentTypeNames.length;

+		long position = (long) start << 32 + end;

+		method.arguments = new Argument[argumentCount];

+		for (int i = 0; i < argumentCount; i++) {

+			method.arguments[i] =

+				new Argument(

+					argumentNames[i],

+					position,

+					createTypeReference(argumentTypeNames[i], start, end),

+					AccDefault);

+			// do not care whether was final or not

 		}

 

-		/* convert methods - need to add default constructor if necessary */

-		ISourceMethod[] sourceMethods = sourceType.getMethods();

-		int sourceMethodCount = sourceMethods == null ? 0 : sourceMethods.length;

+		/* convert thrown exceptions */

+		char[][] exceptionTypeNames = sourceMethod.getExceptionTypeNames();

+		int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length;

+		method.thrownExceptions = new TypeReference[exceptionCount];

+		for (int i = 0; i < exceptionCount; i++) {

+			method.thrownExceptions[i] =

+				createTypeReference(exceptionTypeNames[i], start, end);

+		}

+		return method;

+	}

 

-		/* source type has a constructor ?           */

-		/* by default, we assume that one is needed. */

-		int neededCount = 1;

-		for (int i = 0; i < sourceMethodCount; i++) {

-			if (sourceMethods[i].isConstructor()) {

-				neededCount = 0; // Does not need the extra constructor since one constructor already exists.

-				break;

+	/*

+	 * Convert a source element type into a parsed type declaration

+	 *

+	 * Can optionally ignore fields & methods

+	 */

+	private static TypeDeclaration convert(

+		ISourceType sourceType,

+		boolean needFieldsAndMethods,

+		boolean needMemberTypes) {

+		/* create type declaration - can be member type */

+		TypeDeclaration type;

+		if (sourceType.getEnclosingType() == null) {

+			type = new TypeDeclaration();

+		} else {

+			type = new MemberTypeDeclaration();

+		}

+		type.name = sourceType.getName();

+		int start, end; // only positions available

+		type.sourceStart = start = sourceType.getNameSourceStart();

+		type.sourceEnd = end = sourceType.getNameSourceEnd();

+		type.modifiers = sourceType.getModifiers();

+		type.declarationSourceStart = sourceType.getDeclarationSourceStart();

+		type.declarationSourceEnd = sourceType.getDeclarationSourceEnd();

+

+		/* set superclass and superinterfaces */

+		if (sourceType.getSuperclassName() != null)

+			type.superclass =

+				createTypeReference(sourceType.getSuperclassName(), start, end);

+		char[][] interfaceNames = sourceType.getInterfaceNames();

+		int interfaceCount = interfaceNames == null ? 0 : interfaceNames.length;

+		type.superInterfaces = new TypeReference[interfaceCount];

+		for (int i = 0; i < interfaceCount; i++) {

+			type.superInterfaces[i] = createTypeReference(interfaceNames[i], start, end);

+		}

+		/* convert member types */

+		if (needMemberTypes) {

+			ISourceType[] sourceMemberTypes = sourceType.getMemberTypes();

+			int sourceMemberTypeCount =

+				sourceMemberTypes == null ? 0 : sourceMemberTypes.length;

+			type.memberTypes = new MemberTypeDeclaration[sourceMemberTypeCount];

+			for (int i = 0; i < sourceMemberTypeCount; i++) {

+				type.memberTypes[i] =

+					(MemberTypeDeclaration) convert(sourceMemberTypes[i],

+						needFieldsAndMethods,

+						true);

 			}

 		}

-		type.methods = 

-			new AbstractMethodDeclaration[sourceMethodCount + neededCount]; 

-		if (neededCount != 0){ // add default constructor in first position

-			type.methods[0] = type.createsInternalConstructor(false, false);

+		/* convert fields and methods */

+		if (needFieldsAndMethods) {

+			/* convert fields */

+			ISourceField[] sourceFields = sourceType.getFields();

+			int sourceFieldCount = sourceFields == null ? 0 : sourceFields.length;

+			type.fields = new FieldDeclaration[sourceFieldCount];

+			for (int i = 0; i < sourceFieldCount; i++) {

+				type.fields[i] = convert(sourceFields[i]);

+			}

+

+			/* convert methods - need to add default constructor if necessary */

+			ISourceMethod[] sourceMethods = sourceType.getMethods();

+			int sourceMethodCount = sourceMethods == null ? 0 : sourceMethods.length;

+

+			/* source type has a constructor ?           */

+			/* by default, we assume that one is needed. */

+			int neededCount = 1;

+			for (int i = 0; i < sourceMethodCount; i++) {

+				if (sourceMethods[i].isConstructor()) {

+					neededCount = 0;

+					// Does not need the extra constructor since one constructor already exists.

+					break;

+				}

+			}

+			type.methods = new AbstractMethodDeclaration[sourceMethodCount + neededCount];

+			if (neededCount != 0) { // add default constructor in first position

+				type.methods[0] = type.createsInternalConstructor(false, false);

+			}

+			for (int i = 0; i < sourceMethodCount; i++) {

+				type.methods[neededCount + i] = convert(sourceMethods[i]);

+			}

 		}

-		for (int i = 0; i < sourceMethodCount; i++) {

-			type.methods[neededCount + i] = convert(sourceMethods[i]);

-		}

+		return type;

 	}

-	return type;

-}

-/*

- * Build an import reference from an import name, e.g. java.lang.*

- */

-private static ImportReference createImportReference(

-	char[] importName, 

-	int start, 

-	int end) {

 

-	/* count identifiers */

-	int max = importName.length;

-	int identCount = 0;

-	for (int i = 0; i < max; i++) {

-		if (importName[i] == '.') identCount++;

-	}

-	/* import on demand? */

-	boolean onDemand = importName[max-1] == '*';

-	if (!onDemand) identCount++; // one more ident than dots

+	/*

+	 * Build an import reference from an import name, e.g. java.lang.*

+	 */

+	private static ImportReference createImportReference(

+		char[] importName,

+		int start,

+		int end) {

 

-	long[] positions = new long[identCount];

-	long position = (long) start << 32 + end;

-	for (int i = 0; i < identCount; i++){

-		positions[i] = position;

-	}

-	return new ImportReference( 

-		CharOperation.splitOn('.', importName, 0, max - (onDemand ? 3 : 1)),

-		positions,

-		onDemand);

-}

-/*

- * Build a type reference from a readable name, e.g. java.lang.Object[][]

- */

-private static TypeReference createTypeReference(

-	char[] typeSignature, 

-	int start, 

-	int end) {

-

-	/* count identifiers and dimensions */

-	int max = typeSignature.length;

-	int dimStart = max;

-	int dim = 0;

-	int identCount = 1;

-	for (int i = 0; i < max; i++) {

-		switch (typeSignature[i]) {

-			case '[' :

-				if (dim == 0)

-					dimStart = i;

-				dim++;

-				break;

-			case '.' :

+		/* count identifiers */

+		int max = importName.length;

+		int identCount = 0;

+		for (int i = 0; i < max; i++) {

+			if (importName[i] == '.')

 				identCount++;

-				break;

 		}

-	}

-	/* rebuild identifiers and dimensions */

-	if (identCount == 1) { // simple type reference

-		if (dim == 0) {

-			return new SingleTypeReference(typeSignature, (long)start << 32  + end);

-		} else {

-			char[] identifier = new char[dimStart];

-			System.arraycopy(typeSignature, 0, identifier, 0, dimStart);

-			return new ArrayTypeReference(identifier, dim, (long)start << 32  + end);

-		}

-	} else { // qualified type reference

+		/* import on demand? */

+		boolean onDemand = importName[max - 1] == '*';

+		if (!onDemand)

+			identCount++; // one more ident than dots

+

 		long[] positions = new long[identCount];

-		long pos = (long)start << 32  + end;

-		for(int i = 0; i < identCount; i++){

-			positions[i] = pos;

+		long position = (long) start << 32 + end;

+		for (int i = 0; i < identCount; i++) {

+			positions[i] = position;

 		}

-		char[][] identifiers = CharOperation.splitOn('.', typeSignature, 0, dimStart - 1);

-		if (dim == 0){

-			return new QualifiedTypeReference(identifiers, positions);

-		} else {

-			return new ArrayQualifiedTypeReference(identifiers, dim, positions);			

+		return new ImportReference(

+			CharOperation.splitOn('.', importName, 0, max - (onDemand ? 3 : 1)),

+			positions,

+			onDemand);

+	}

+

+	/*

+	 * Build a type reference from a readable name, e.g. java.lang.Object[][]

+	 */

+	private static TypeReference createTypeReference(

+		char[] typeSignature,

+		int start,

+		int end) {

+

+		/* count identifiers and dimensions */

+		int max = typeSignature.length;

+		int dimStart = max;

+		int dim = 0;

+		int identCount = 1;

+		for (int i = 0; i < max; i++) {

+			switch (typeSignature[i]) {

+				case '[' :

+					if (dim == 0)

+						dimStart = i;

+					dim++;

+					break;

+				case '.' :

+					identCount++;

+					break;

+			}

+		}

+		/* rebuild identifiers and dimensions */

+		if (identCount == 1) { // simple type reference

+			if (dim == 0) {

+				return new SingleTypeReference(typeSignature, (long) start << 32 + end);

+			} else {

+				char[] identifier = new char[dimStart];

+				System.arraycopy(typeSignature, 0, identifier, 0, dimStart);

+				return new ArrayTypeReference(identifier, dim, (long) start << 32 + end);

+			}

+		} else { // qualified type reference

+			long[] positions = new long[identCount];

+			long pos = (long) start << 32 + end;

+			for (int i = 0; i < identCount; i++) {

+				positions[i] = pos;

+			}

+			char[][] identifiers =

+				CharOperation.splitOn('.', typeSignature, 0, dimStart - 1);

+			if (dim == 0) {

+				return new QualifiedTypeReference(identifiers, positions);

+			} else {

+				return new ArrayQualifiedTypeReference(identifiers, dim, positions);

+			}

 		}

 	}

-}

-}

+}
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalSymbols.java b/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalSymbols.java
index f281179..713b717 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalSymbols.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalSymbols.java
@@ -10,109 +10,110 @@
 

 public interface TerminalSymbols {

 

-	public final static int

-	  TokenNameIdentifier = 5,

-	  TokenNameabstract = 92,

-	  TokenNameboolean = 18,

-	  TokenNamebreak = 118,

-	  TokenNamebyte = 19,

-	  TokenNamecase = 211,

-	  TokenNamecatch = 225,

-	  TokenNamechar = 20,

-	  TokenNameclass = 163,

-	  TokenNamecontinue = 119,

-	  TokenNamedefault = 212,

-	  TokenNamedo = 120,

-	  TokenNamedouble = 21,

-	  TokenNameelse = 213,

-	  TokenNameextends = 241,

-	  TokenNamefalse = 37,

-	  TokenNamefinal = 93,

-	  TokenNamefinally = 226,

-	  TokenNamefloat = 22,

-	  TokenNamefor = 121,

-	  TokenNameif = 122,

-	  TokenNameimplements = 265,

-	  TokenNameimport = 190,

-	  TokenNameinstanceof = 65,

-	  TokenNameint = 23,

-	  TokenNameinterface = 184,

-	  TokenNamelong = 24,

-	  TokenNamenative = 94,

-	  TokenNamenew = 33,

-	  TokenNamenull = 38,

-	  TokenNamepackage = 214,

-	  TokenNameprivate = 95,

-	  TokenNameprotected = 96,

-	  TokenNamepublic = 97,

-	  TokenNamereturn = 123,

-	  TokenNameshort = 25,

-	  TokenNamestatic = 98,

-	  TokenNamestrictfp = 99,

-	  TokenNamesuper = 35,

-	  TokenNameswitch = 124,

-	  TokenNamesynchronized = 84,

-	  TokenNamethis = 36,

-	  TokenNamethrow = 125,

-	  TokenNamethrows = 227,

-	  TokenNametransient = 100,

-	  TokenNametrue = 39,

-	  TokenNametry = 126,

-	  TokenNamevoid = 26,

-	  TokenNamevolatile = 101,

-	  TokenNamewhile = 117,

-	  TokenNameIntegerLiteral = 40,

-	  TokenNameLongLiteral = 41,

-	  TokenNameFloatingPointLiteral = 42,

-	  TokenNameDoubleLiteral = 43,

-	  TokenNameCharacterLiteral = 44,

-	  TokenNameStringLiteral = 45,

-	  TokenNamePLUS_PLUS = 1,

-	  TokenNameMINUS_MINUS = 2,

-	  TokenNameEQUAL_EQUAL = 32,

-	  TokenNameLESS_EQUAL = 66,

-	  TokenNameGREATER_EQUAL = 67,

-	  TokenNameNOT_EQUAL = 34,

-	  TokenNameLEFT_SHIFT = 13,

-	  TokenNameRIGHT_SHIFT = 11,

-	  TokenNameUNSIGNED_RIGHT_SHIFT = 12,

-	  TokenNamePLUS_EQUAL = 166,

-	  TokenNameMINUS_EQUAL = 167,

-	  TokenNameMULTIPLY_EQUAL = 168,

-	  TokenNameDIVIDE_EQUAL = 169,

-	  TokenNameAND_EQUAL = 170,

-	  TokenNameOR_EQUAL = 171,

-	  TokenNameXOR_EQUAL = 172,

-	  TokenNameREMAINDER_EQUAL = 173,

-	  TokenNameLEFT_SHIFT_EQUAL = 174,

-	  TokenNameRIGHT_SHIFT_EQUAL = 175,

-	  TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 176,

-	  TokenNameOR_OR = 79,

-	  TokenNameAND_AND = 78,

-	  TokenNamePLUS = 3,

-	  TokenNameMINUS = 4,

-	  TokenNameNOT = 71,

-	  TokenNameREMAINDER = 8,

-	  TokenNameXOR = 63,

-	  TokenNameAND = 62,

-	  TokenNameMULTIPLY = 7,

-	  TokenNameOR = 70,

-	  TokenNameTWIDDLE = 72,

-	  TokenNameDIVIDE = 9,

-	  TokenNameGREATER = 68,

-	  TokenNameLESS = 69,

-	  TokenNameLPAREN = 10,

-	  TokenNameRPAREN = 86,

-	  TokenNameLBRACE = 109,

-	  TokenNameRBRACE = 102,

-	  TokenNameLBRACKET = 14,

-	  TokenNameRBRACKET = 164,

-	  TokenNameSEMICOLON = 64,

-	  TokenNameQUESTION = 80,

-	  TokenNameCOLON = 153,

-	  TokenNameCOMMA = 88,

-	  TokenNameDOT = 6,

-	  TokenNameEQUAL = 165,

-	  TokenNameEOF = 156,

-	  TokenNameERROR = 304;

+    public final static int

+      TokenNameIdentifier = 5,

+      TokenNameabstract = 98,

+      TokenNameassert = 118,

+      TokenNameboolean = 18,

+      TokenNamebreak = 119,

+      TokenNamebyte = 19,

+      TokenNamecase = 211,

+      TokenNamecatch = 225,

+      TokenNamechar = 20,

+      TokenNameclass = 165,

+      TokenNamecontinue = 120,

+      TokenNamedefault = 212,

+      TokenNamedo = 121,

+      TokenNamedouble = 21,

+      TokenNameelse = 213,

+      TokenNameextends = 243,

+      TokenNamefalse = 37,

+      TokenNamefinal = 99,

+      TokenNamefinally = 226,

+      TokenNamefloat = 22,

+      TokenNamefor = 122,

+      TokenNameif = 123,

+      TokenNameimplements = 267,

+      TokenNameimport = 191,

+      TokenNameinstanceof = 65,

+      TokenNameint = 23,

+      TokenNameinterface = 180,

+      TokenNamelong = 24,

+      TokenNamenative = 100,

+      TokenNamenew = 32,

+      TokenNamenull = 38,

+      TokenNamepackage = 214,

+      TokenNameprivate = 101,

+      TokenNameprotected = 102,

+      TokenNamepublic = 103,

+      TokenNamereturn = 124,

+      TokenNameshort = 25,

+      TokenNamestatic = 94,

+      TokenNamestrictfp = 104,

+      TokenNamesuper = 34,

+      TokenNameswitch = 125,

+      TokenNamesynchronized = 85,

+      TokenNamethis = 35,

+      TokenNamethrow = 126,

+      TokenNamethrows = 227,

+      TokenNametransient = 105,

+      TokenNametrue = 39,

+      TokenNametry = 127,

+      TokenNamevoid = 26,

+      TokenNamevolatile = 106,

+      TokenNamewhile = 117,

+      TokenNameIntegerLiteral = 40,

+      TokenNameLongLiteral = 41,

+      TokenNameFloatingPointLiteral = 42,

+      TokenNameDoubleLiteral = 43,

+      TokenNameCharacterLiteral = 44,

+      TokenNameStringLiteral = 45,

+      TokenNamePLUS_PLUS = 1,

+      TokenNameMINUS_MINUS = 2,

+      TokenNameEQUAL_EQUAL = 33,

+      TokenNameLESS_EQUAL = 66,

+      TokenNameGREATER_EQUAL = 67,

+      TokenNameNOT_EQUAL = 36,

+      TokenNameLEFT_SHIFT = 14,

+      TokenNameRIGHT_SHIFT = 11,

+      TokenNameUNSIGNED_RIGHT_SHIFT = 12,

+      TokenNamePLUS_EQUAL = 168,

+      TokenNameMINUS_EQUAL = 169,

+      TokenNameMULTIPLY_EQUAL = 170,

+      TokenNameDIVIDE_EQUAL = 171,

+      TokenNameAND_EQUAL = 172,

+      TokenNameOR_EQUAL = 173,

+      TokenNameXOR_EQUAL = 174,

+      TokenNameREMAINDER_EQUAL = 175,

+      TokenNameLEFT_SHIFT_EQUAL = 176,

+      TokenNameRIGHT_SHIFT_EQUAL = 177,

+      TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 178,

+      TokenNameOR_OR = 80,

+      TokenNameAND_AND = 79,

+      TokenNamePLUS = 3,

+      TokenNameMINUS = 4,

+      TokenNameNOT = 71,

+      TokenNameREMAINDER = 9,

+      TokenNameXOR = 63,

+      TokenNameAND = 62,

+      TokenNameMULTIPLY = 8,

+      TokenNameOR = 70,

+      TokenNameTWIDDLE = 72,

+      TokenNameDIVIDE = 10,

+      TokenNameGREATER = 68,

+      TokenNameLESS = 69,

+      TokenNameLPAREN = 7,

+      TokenNameRPAREN = 86,

+      TokenNameLBRACE = 110,

+      TokenNameRBRACE = 95,

+      TokenNameLBRACKET = 15,

+      TokenNameRBRACKET = 166,

+      TokenNameSEMICOLON = 64,

+      TokenNameQUESTION = 81,

+      TokenNameCOLON = 154,

+      TokenNameCOMMA = 90,

+      TokenNameDOT = 6,

+      TokenNameEQUAL = 167,

+      TokenNameEOF = 158,

+      TokenNameERROR = 307;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index 48eab10..85a6eef 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index 434680d..8f2dd39 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index b9da6ff..99fc9e4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index f60de39..7d532e6 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index d180c8d..bfe7cb4 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.java b/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.java
index 1d4776d..f5a5c19 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.java
@@ -45,7 +45,7 @@
 	//sanity .....

 	if ((startPosition > endPosition)

 		|| ((startPosition <= 0) && (endPosition <= 0)))

-		return Util.bind("problem.noSourceInformation"/*nonNLS*/);

+		return Util.bind("problem.noSourceInformation"); //$NON-NLS-1$

 

 	//regular behavior....(slow code)

 

@@ -111,8 +111,8 @@
 	//resize underneathto remove 'null' chars

 	System.arraycopy(underneath, 0, underneath = new char[pos], 0, pos);

 

-	return " "/*nonNLS*/ + Util.bind("problem.atLine"/*nonNLS*/,String.valueOf(line)) +

-	"\n\t"/*nonNLS*/ + new String(extract) + "\n\t"/*nonNLS*/ + new String(underneath);

+	return " " + Util.bind("problem.atLine",String.valueOf(line)) + //$NON-NLS-2$ //$NON-NLS-1$

+	"\n\t" + new String(extract) + "\n\t" + new String(underneath); //$NON-NLS-2$ //$NON-NLS-1$

 }

 /**

  * Answer back the original arguments recorded into the problem.

@@ -212,13 +212,13 @@
 }

 public String toString() {

 

-	String s = "Pb("/*nonNLS*/ + (id & IgnoreCategoriesMask) + ") "/*nonNLS*/;

+	String s = "Pb(" + (id & IgnoreCategoriesMask) + ") "; //$NON-NLS-1$ //$NON-NLS-2$

 	if (message != null) {

 		s += message;

 	} else {

 		if (arguments != null)

 			for (int i = 0; i < arguments.length; i++)

-				s += " "/*nonNLS*/ + arguments[i];

+				s += " " + arguments[i]; //$NON-NLS-1$

 	}

 	return s;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.java b/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.java
index 418bb8f..4038510 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.java
@@ -70,9 +70,9 @@
 	String message = 

 		messageTemplates[(id & ProblemIrritants.IgnoreCategoriesMask)]; 

 	if (message == null) {

-		return "Unable to retrieve the error message for problem id: "/*nonNLS*/

+		return "Unable to retrieve the error message for problem id: " //$NON-NLS-1$

 			+ id

-			+ ". Check compiler resources."/*nonNLS*/; 

+			+ ". Check compiler resources.";  //$NON-NLS-1$

 	}

 

 	int length = message.length();

@@ -87,9 +87,9 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					return "Corrupted compiler resources for problem id: "/*nonNLS*/

+					return "Corrupted compiler resources for problem id: " //$NON-NLS-1$

 						+ (id & ProblemIrritants.IgnoreCategoriesMask)

-						+ ". Check compiler resources."/*nonNLS*/; 

+						+ ". Check compiler resources.";  //$NON-NLS-1$

 				}

 			} else {

 				output.append(message.substring(end, length));

@@ -115,7 +115,7 @@
  * to the current Locale.

  */

 public static String[] loadMessageTemplates(Locale loc) {

-	ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.messages"/*nonNLS*/, loc);

+	ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.messages", loc); //$NON-NLS-1$

 	String[] templates = new String[500];

 	for (int i = 0, max = templates.length; i < max; i++) {

 		try {

diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
index e413005..e7ef1c0 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
@@ -273,7 +273,11 @@
 	final int CodeSnippetMissingClass = Internal + 420;

 	final int CodeSnippetMissingMethod = Internal + 421;

 	final int NonExternalizedStringLiteral = Internal + 261;

-

+	final int CannotUseSuperInCodeSnippet = Internal + 422;

+	

 	//constant pool

 	final int TooManyConstantsInConstantPool = Internal + 430;

+	

+	// identifiers 1.4 assert feature

+	final int UseAssertAsAnIdentifier = Internal + 440;

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index df2222c..1998f1f 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -167,7 +167,7 @@
 	this.handle(

 		FinalFieldAssignment,

 		new String[] {

-			(field.declaringClass == null ? "array"/*nonNLS*/ : new String(field.declaringClass.readableName())),

+			(field.declaringClass == null ? "array" : new String(field.declaringClass.readableName())), //$NON-NLS-1$

 			new String(field.readableName())},

 		location.sourceStart(),

 		location.sourceEnd());

@@ -249,6 +249,14 @@
 		reference.sourceStart,

 		reference.sourceEnd);

 }

+public void cannotUseSuperInCodeSnippet(int start, int end) {

+	this.handle(

+		CannotUseSuperInCodeSnippet,

+		new String[0],

+		Error | Abort,

+		start,

+		end);

+}

 public void caseExpressionMustBeConstant(Expression expression) {

 	this.handle(

 		NonConstantExpression,

@@ -428,7 +436,14 @@
 				return Warning;

 			}

 			return Ignore;

-		

+		case UseAssertAsAnIdentifier :

+			if ((errorThreshold & AssertUsedAsAnIdentifier) != 0){

+				return Error;

+			}

+			if ((warningThreshold & AssertUsedAsAnIdentifier) != 0){

+				return Warning;

+			}

+			return Ignore;		

 		default:

 			return Error;

 	}

@@ -459,10 +474,10 @@
 			final int radix;

 			if ((source[1] == 'x') || (source[1] == 'X')) {

 				radix = 16;

-				Radix = "Hexa"/*nonNLS*/;

+				Radix = "Hexa"; //$NON-NLS-1$

 			} else {

 				radix = 8;

-				Radix = "Octal"/*nonNLS*/;

+				Radix = "Octal"; //$NON-NLS-1$

 			}

 			//look for the first digit that is incorrect

 			int place = -1;

@@ -475,7 +490,7 @@
 

 			this.handle(

 				NumericValueOutOfRange,

-				new String[] {Radix + " "/*nonNLS*/ + new String(source) + " (digit "/*nonNLS*/ + new String(new char[] {source[place]}) + ")"/*nonNLS*/},

+				new String[] {Radix + " " + new String(source) + " (digit " + new String(new char[] {source[place]}) + ")"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

 				lit.sourceStart,

 				lit.sourceEnd);

 			return;

@@ -640,7 +655,7 @@
 	StringBuffer buffer = new StringBuffer();

 	for (int i = 0, length = params.length; i < length; i++) {

 		if (i != 0)

-			buffer.append(", "/*nonNLS*/);

+			buffer.append(", "); //$NON-NLS-1$

 		buffer.append(new String(params[i].readableName()));

 	}

 

@@ -653,7 +668,7 @@
 public void errorThisSuperInStatic(AstNode reference) {

 	this.handle(

 		ThisInStaticContext,

-		new String[] {reference.isSuper() ? "super"/*nonNLS*/ : "this"/*nonNLS*/},

+		new String[] {reference.isSuper() ? "super" : "this"}, //$NON-NLS-2$ //$NON-NLS-1$

 		reference.sourceStart,

 		reference.sourceEnd);

 }

@@ -789,7 +804,7 @@
 public void hierarchyCircularity(SourceTypeBinding sourceType, ReferenceBinding superType, TypeReference reference) {

 	int start = 0;

 	int end = 0;

-	String typeName = ""/*nonNLS*/;

+	String typeName = ""; //$NON-NLS-1$

 

 	if (reference == null) {	// can only happen when java.lang.Object is busted

 		start = sourceType.sourceStart();

@@ -1073,7 +1088,7 @@
 			.append('.')

 			.append(inheritedMethods[i].readableName());

 		if (i != 0)

-			methodSignatures.append(", "/*nonNLS*/);

+			methodSignatures.append(", "); //$NON-NLS-1$

 	}

 

 	this.handle(

@@ -1188,7 +1203,7 @@
 

 	this.handle(

 		flag,

-		new String[] {new String(enclosingType.readableName()) + "."/*nonNLS*/ + new String(type.readableName())},

+		new String[] {new String(enclosingType.readableName()) + "." + new String(type.readableName())}, //$NON-NLS-1$

 		expression.sourceStart,

 		expression.sourceEnd);

 }

@@ -1399,7 +1414,7 @@
 		InvalidOperator,

 		new String[] {

 			expression.operatorToString(),

-			new String(leftType.readableName()) + ", "/*nonNLS*/ + new String(rightType.readableName())},

+			new String(leftType.readableName()) + ", " + new String(rightType.readableName())}, //$NON-NLS-1$

 		expression.sourceStart,

 		expression.sourceEnd);

 }

@@ -1408,7 +1423,7 @@
 		InvalidOperator,

 		new String[] {

 			assign.operatorToString(),

-			new String(leftType.readableName()) + ", "/*nonNLS*/ + new String(rightType.readableName())},

+			new String(leftType.readableName()) + ", " + new String(rightType.readableName())}, //$NON-NLS-1$

 		assign.sourceStart,

 		assign.sourceEnd);

 }

@@ -1604,7 +1619,7 @@
 		methodDecl.sourceEnd());

 }

 public void needImplementation() {

-	this.abortDueToInternalError(Util.bind("abort.missingCode"/*nonNLS*/));

+	this.abortDueToInternalError(Util.bind("abort.missingCode")); //$NON-NLS-1$

 }

 public void needToEmulateFieldReadAccess(FieldBinding field, AstNode location) {

 	this.handle(

@@ -1720,7 +1735,7 @@
 	StringBuffer buffer = new StringBuffer();

 	for (int i = 0, length = params.length; i < length; i++) {

 		if (i != 0)

-			buffer.append(", "/*nonNLS*/);

+			buffer.append(", "); //$NON-NLS-1$

 		buffer.append(new String(params[i].readableName()));

 	}

 	return buffer.toString();

@@ -1750,20 +1765,20 @@
 	StringBuffer list = new StringBuffer(20);

 	for (int i = 0, max = possibleTokens.length; i < max; i++) {

 		if (i > 0)

-			list.append(", "/*nonNLS*/);

+			list.append(", "); //$NON-NLS-1$

 		list.append('"');

 		list.append(possibleTokens[i]);

 		list.append('"');

 	}

 

 	//extract the literal when it's a literal  

-	if ((errorTokenName.equals("IntegerLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("LongLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("FloatingPointLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("DoubleLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("StringLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("CharacterLiteral"/*nonNLS*/)) ||

-		(errorTokenName.equals("Identifier"/*nonNLS*/))) {

+	if ((errorTokenName.equals("IntegerLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("LongLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("FloatingPointLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("DoubleLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("StringLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("CharacterLiteral")) || //$NON-NLS-1$

+		(errorTokenName.equals("Identifier"))) { //$NON-NLS-1$

 			errorTokenName = new String(currentTokenSource);

 	}

 

@@ -2155,6 +2170,15 @@
 		localDecl.sourceStart,

 		localDecl.sourceEnd);

 }

+

+public void useAssertAsAnIdentifier(int sourceStart, int sourceEnd) {

+	this.handle(

+		UseAssertAsAnIdentifier,

+		new String[0],

+		sourceStart,

+		sourceEnd);	

+}

+

 public void variableTypeCannotBeVoid(AbstractVariableDeclaration varDecl) {

 	this.handle(

 		VariableTypeCannotBeVoid,

diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index dd7f42f..9dcfcf9 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -231,5 +231,7 @@
 

 420 = Code snippet support cannot find the class {0}

 421 = Code snippet support cannot find the method {0}.{1}({2}) 

+422 = super cannot be used in the code snippet code

+430 = Too many constants, the constant pool for {0} would exceed 65536 entries.

 

-430 = Too many constants, the constant pool for {0} would exceed 65536 entries.
\ No newline at end of file
+440 = 'assert' will be a reserved keyword from release 1.4 on.
\ No newline at end of file
diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/CharOperation.java b/compiler/org/eclipse/jdt/internal/compiler/util/CharOperation.java
index a66de9c..116c38b 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/CharOperation.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/CharOperation.java
@@ -542,7 +542,7 @@
 final static public String toString(char[][] array) {

 	char[] result = concatWith(array, '.');

 	if (result == null)

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	return new String(result);

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.java b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.java
index e1b870d..90c20e7 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.java
@@ -77,11 +77,11 @@
 	return elementSize;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	Object object;

 	for (int i = 0, length = valueTable.length; i < length; i++)

 		if ((object = valueTable[i]) != null)

-			s += keyTable[i] + " -> "/*nonNLS*/ + object.toString() + "\n"/*nonNLS*/;

+			s += keyTable[i] + " -> " + object.toString() + "\n"; //$NON-NLS-2$ //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
index 8143a93..1191c2c 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
@@ -78,11 +78,11 @@
 	return elementSize;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	Object object;

 	for (int i = 0, length = valueTable.length; i < length; i++)

 		if ((object = valueTable[i]) != null)

-			s += new String(keyTable[i]) + " -> "/*nonNLS*/ + object.toString() + "\n"/*nonNLS*/;

+			s += new String(keyTable[i]) + " -> " + object.toString() + "\n"; //$NON-NLS-2$ //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.java b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.java
index 2e4308f..8990383 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.java
@@ -79,11 +79,11 @@
 	return elementSize;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	PackageBinding pkg;

 	for (int i = 0, length = valueTable.length; i < length; i++)

 		if ((pkg = valueTable[i]) != null)

-			s += pkg.toString() + "\n"/*nonNLS*/;

+			s += pkg.toString() + "\n"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfType.java b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfType.java
index 487b841..60bdc8e 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfType.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfType.java
@@ -79,11 +79,11 @@
 	return elementSize;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	ReferenceBinding type;

 	for (int i = 0, length = valueTable.length; i < length; i++)

 		if ((type = valueTable[i]) != null)

-			s += type.toString() + "\n"/*nonNLS*/;

+			s += type.toString() + "\n"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/ObjectVector.java b/compiler/org/eclipse/jdt/internal/compiler/util/ObjectVector.java
index c47e0ab..a30e68d 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/ObjectVector.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/ObjectVector.java
@@ -61,9 +61,9 @@
 	size = 0;

 }

 public String toString() {

-	String s = ""/*nonNLS*/;

+	String s = ""; //$NON-NLS-1$

 	for (int i = 0; i < size; i++)

-		s += elements[i].toString() + "\n"/*nonNLS*/;

+		s += elements[i].toString() + "\n"; //$NON-NLS-1$

 	return s;

 }

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.java b/compiler/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.java
index 1cb38e3..0b7f0d2 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.java
@@ -57,7 +57,7 @@
 public String toString() {

 	StringBuffer buffer = new StringBuffer();

 	for (int i = 0; i < size; i++) {

-		buffer.append(elements[i]).append("\n"/*nonNLS*/);

+		buffer.append(elements[i]).append("\n"); //$NON-NLS-1$

 	}

 	return buffer.toString();

 }

diff --git a/compiler/org/eclipse/jdt/internal/compiler/util/Util.java b/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
index 1e4bcdc..fe77483 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
@@ -11,7 +11,7 @@
 public class Util {

 	/* Bundle containing messages */

 	protected static ResourceBundle bundle;

-	private final static String bundleName = "org.eclipse.jdt.internal.compiler.util.messages"/*nonNLS*/;

+	private final static String bundleName = "org.eclipse.jdt.internal.compiler.util.messages"; //$NON-NLS-1$

 	static {

 		relocalize();

 	}

@@ -35,14 +35,14 @@
  */

 public static String bind(String id, String[] bindings) {

 	if (id == null)

-		return "No message available"/*nonNLS*/;

+		return "No message available"; //$NON-NLS-1$

 	String message = null;

 	try {

 		message = bundle.getString(id);

 	} catch (MissingResourceException e) {

 		// If we got an exception looking for the message, fail gracefully by just returning

 		// the id we were looking for.  In most cases this is semi-informative so is not too bad.

-		return "Missing message: "/*nonNLS*/ + id + " in: "/*nonNLS*/ + bundleName;

+		return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	if (bindings == null)

 		return message;

@@ -61,7 +61,7 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);

+					output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$

 				}

 			} else {

 				output.append(message.substring(end, length));

@@ -87,6 +87,6 @@
 	bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault());

 }

 public static void main(String[] arg){

-	System.out.println(bind("test"/*nonNLS*/));

+	System.out.println(bind("test")); //$NON-NLS-1$

 }

 }
\ No newline at end of file
diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
index 00f8dd7..7a9857e 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.java
@@ -26,7 +26,7 @@
 		int codeSnippetEnd) {

 	super(environment, policy, settings, requestor, problemFactory);

 	this.parser = 

-		new CodeSnippetParser(problemReporter, evaluationContext, this.options.parseLiteralExpressionsAsConstants, codeSnippetStart, codeSnippetEnd);

+		new CodeSnippetParser(problemReporter, evaluationContext, this.options.parseLiteralExpressionsAsConstants, this.options.getAssertMode(), codeSnippetStart, codeSnippetEnd);

 	this.parseThreshold = 1; // fully parse only the code snippet compilation unit

 }

 }

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetConstantPool.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetConstantPool.java
index 0d3d923..8052270 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetConstantPool.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetConstantPool.java
@@ -15,82 +15,82 @@
 public class CodeSnippetConstantPool extends ConstantPool implements TypeConstants {

 

 	// predefined type constant names

-	final static char[][] JAVA_LANG_REFLECT_FIELD = new char[][] {JAVA, LANG, REFLECT, "Field"/*nonNLS*/.toCharArray()};

-	final static char[][] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char[][] {JAVA, LANG, REFLECT, "AccessibleObject"/*nonNLS*/.toCharArray()};

-	final static char[][] JAVA_LANG_REFLECT_METHOD = new char[][] {JAVA, LANG, REFLECT, "Method"/*nonNLS*/.toCharArray()};

-	final static char[][] JAVA_LANG_REFLECT_ARRAY = new char[][] {JAVA, LANG, REFLECT, "Array"/*nonNLS*/.toCharArray()};

+	final static char[][] JAVA_LANG_REFLECT_FIELD = new char[][] {JAVA, LANG, REFLECT, "Field".toCharArray()}; //$NON-NLS-1$

+	final static char[][] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char[][] {JAVA, LANG, REFLECT, "AccessibleObject".toCharArray()}; //$NON-NLS-1$

+	final static char[][] JAVA_LANG_REFLECT_METHOD = new char[][] {JAVA, LANG, REFLECT, "Method".toCharArray()}; //$NON-NLS-1$

+	final static char[][] JAVA_LANG_REFLECT_ARRAY = new char[][] {JAVA, LANG, REFLECT, "Array".toCharArray()}; //$NON-NLS-1$

 

 	// predefined methods constant names

-	final static char[] GETDECLAREDFIELD_NAME = "getDeclaredField"/*nonNLS*/.toCharArray();

-	final static char[] GETDECLAREDFIELD_SIGNATURE = "(Ljava/lang/String;)Ljava/lang/reflect/Field;"/*nonNLS*/.toCharArray();

-	final static char[] SETACCESSIBLE_NAME = "setAccessible"/*nonNLS*/.toCharArray();

-	final static char[] SETACCESSIBLE_SIGNATURE = "(Z)V"/*nonNLS*/.toCharArray();

-	final static char[] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "java/lang/reflect/Field"/*nonNLS*/.toCharArray();

-	final static char[] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "java/lang/reflect/AccessibleObject"/*nonNLS*/.toCharArray();

-	final static char[] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "java/lang/reflect/Array"/*nonNLS*/.toCharArray();

-	final static char[] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "java/lang/reflect/Method"/*nonNLS*/.toCharArray();

-	final static char[] GET_INT_METHOD_NAME = "getInt"/*nonNLS*/.toCharArray();

-	final static char[] GET_LONG_METHOD_NAME = "getLong"/*nonNLS*/.toCharArray();

-	final static char[] GET_DOUBLE_METHOD_NAME = "getDouble"/*nonNLS*/.toCharArray();

-	final static char[] GET_FLOAT_METHOD_NAME = "getFloat"/*nonNLS*/.toCharArray();

-	final static char[] GET_BYTE_METHOD_NAME = "getByte"/*nonNLS*/.toCharArray();

-	final static char[] GET_CHAR_METHOD_NAME = "getChar"/*nonNLS*/.toCharArray();

-	final static char[] GET_BOOLEAN_METHOD_NAME = "getBoolean"/*nonNLS*/.toCharArray();

-	final static char[] GET_OBJECT_METHOD_NAME = "get"/*nonNLS*/.toCharArray();

-	final static char[] GET_SHORT_METHOD_NAME = "getShort"/*nonNLS*/.toCharArray();

-	final static char[] ARRAY_NEWINSTANCE_NAME = "newInstance"/*nonNLS*/.toCharArray();

-	final static char[] GET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;)I"/*nonNLS*/.toCharArray();

-	final static char[] GET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;)J"/*nonNLS*/.toCharArray();

-	final static char[] GET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;)D"/*nonNLS*/.toCharArray();

-	final static char[] GET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;)F"/*nonNLS*/.toCharArray();

-	final static char[] GET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;)B"/*nonNLS*/.toCharArray();

-	final static char[] GET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;)C"/*nonNLS*/.toCharArray();

-	final static char[] GET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;)Z"/*nonNLS*/.toCharArray();

-	final static char[] GET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;)Ljava/lang/Object;"/*nonNLS*/.toCharArray();

-	final static char[] GET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;)S"/*nonNLS*/.toCharArray();

-	final static char[] SET_INT_METHOD_NAME = "setInt"/*nonNLS*/.toCharArray();

-	final static char[] SET_LONG_METHOD_NAME = "setLong"/*nonNLS*/.toCharArray();

-	final static char[] SET_DOUBLE_METHOD_NAME = "setDouble"/*nonNLS*/.toCharArray();

-	final static char[] SET_FLOAT_METHOD_NAME = "setFloat"/*nonNLS*/.toCharArray();

-	final static char[] SET_BYTE_METHOD_NAME = "setByte"/*nonNLS*/.toCharArray();

-	final static char[] SET_CHAR_METHOD_NAME = "setChar"/*nonNLS*/.toCharArray();

-	final static char[] SET_BOOLEAN_METHOD_NAME = "setBoolean"/*nonNLS*/.toCharArray();

-	final static char[] SET_OBJECT_METHOD_NAME = "set"/*nonNLS*/.toCharArray();

-	final static char[] SET_SHORT_METHOD_NAME = "setShort"/*nonNLS*/.toCharArray();

-	final static char[] GETCLASS_OBJECT_METHOD_NAME = "getClass"/*nonNLS*/.toCharArray();

-	final static char[] SET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;I)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;J)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;D)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;F)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;B)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;C)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;Z)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;Ljava/lang/Object;)V"/*nonNLS*/.toCharArray();

-	final static char[] SET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;S)V"/*nonNLS*/.toCharArray();

-	final static char[] GETDECLAREDMETHOD_NAME = "getDeclaredMethod"/*nonNLS*/.toCharArray();

-	final static char[] GETDECLAREDMETHOD_SIGNATURE = "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"/*nonNLS*/.toCharArray();

-	final static char[] ARRAY_NEWINSTANCE_SIGNATURE = "(Ljava/lang/Class;[I)Ljava/lang/Object;"/*nonNLS*/.toCharArray();

-	final static char[] GETCLASS_OBJECT_METHOD_SIGNATURE = "()Ljava/lang/Class;"/*nonNLS*/.toCharArray();

-	final static char[] INVOKE_METHOD_METHOD_NAME = "invoke"/*nonNLS*/.toCharArray();

-	final static char[] INVOKE_METHOD_METHOD_SIGNATURE = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;"/*nonNLS*/.toCharArray();

-	final static char[] BYTEVALUE_BYTE_METHOD_NAME = "byteValue"/*nonNLS*/.toCharArray();

-	final static char[] BYTEVALUE_BYTE_METHOD_SIGNATURE = "()B"/*nonNLS*/.toCharArray();

-	final static char[] SHORTVALUE_SHORT_METHOD_NAME = "shortValue"/*nonNLS*/.toCharArray();

-	final static char[] DOUBLEVALUE_DOUBLE_METHOD_NAME = "doubleValue"/*nonNLS*/.toCharArray();

-	final static char[] FLOATVALUE_FLOAT_METHOD_NAME = "floatValue"/*nonNLS*/.toCharArray();

-	final static char[] INTVALUE_INTEGER_METHOD_NAME = "intValue"/*nonNLS*/.toCharArray();

-	final static char[] CHARVALUE_CHARACTER_METHOD_NAME = "charValue"/*nonNLS*/.toCharArray();

-	final static char[] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "booleanValue"/*nonNLS*/.toCharArray();

-	final static char[] LONGVALUE_LONG_METHOD_NAME = "longValue"/*nonNLS*/.toCharArray();

-	final static char[] SHORTVALUE_SHORT_METHOD_SIGNATURE = "()S"/*nonNLS*/.toCharArray();

-	final static char[] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "()D"/*nonNLS*/.toCharArray();

-	final static char[] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "()F"/*nonNLS*/.toCharArray();

-	final static char[] INTVALUE_INTEGER_METHOD_SIGNATURE = "()I"/*nonNLS*/.toCharArray();

-	final static char[] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "()C"/*nonNLS*/.toCharArray();

-	final static char[] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "()Z"/*nonNLS*/.toCharArray();

-	final static char[] LONGVALUE_LONG_METHOD_SIGNATURE = "()J"/*nonNLS*/.toCharArray();

-	final static char[] GETDECLAREDCONSTRUCTOR_NAME = "getDeclaredConstructor"/*nonNLS*/.toCharArray();

-	final static char[] GETDECLAREDCONSTRUCTOR_SIGNATURE = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;"/*nonNLS*/.toCharArray();

+	final static char[] GETDECLAREDFIELD_NAME = "getDeclaredField".toCharArray(); //$NON-NLS-1$

+	final static char[] GETDECLAREDFIELD_SIGNATURE = "(Ljava/lang/String;)Ljava/lang/reflect/Field;".toCharArray(); //$NON-NLS-1$

+	final static char[] SETACCESSIBLE_NAME = "setAccessible".toCharArray(); //$NON-NLS-1$

+	final static char[] SETACCESSIBLE_SIGNATURE = "(Z)V".toCharArray(); //$NON-NLS-1$

+	final static char[] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "java/lang/reflect/Field".toCharArray(); //$NON-NLS-1$

+	final static char[] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "java/lang/reflect/AccessibleObject".toCharArray(); //$NON-NLS-1$

+	final static char[] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "java/lang/reflect/Array".toCharArray(); //$NON-NLS-1$

+	final static char[] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "java/lang/reflect/Method".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_INT_METHOD_NAME = "getInt".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_LONG_METHOD_NAME = "getLong".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_DOUBLE_METHOD_NAME = "getDouble".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_FLOAT_METHOD_NAME = "getFloat".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_BYTE_METHOD_NAME = "getByte".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_CHAR_METHOD_NAME = "getChar".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_BOOLEAN_METHOD_NAME = "getBoolean".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_OBJECT_METHOD_NAME = "get".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_SHORT_METHOD_NAME = "getShort".toCharArray(); //$NON-NLS-1$

+	final static char[] ARRAY_NEWINSTANCE_NAME = "newInstance".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;)I".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;)J".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;)D".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;)F".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;)B".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;)C".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;)Z".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$

+	final static char[] GET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;)S".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_INT_METHOD_NAME = "setInt".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_LONG_METHOD_NAME = "setLong".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_DOUBLE_METHOD_NAME = "setDouble".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_FLOAT_METHOD_NAME = "setFloat".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_BYTE_METHOD_NAME = "setByte".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_CHAR_METHOD_NAME = "setChar".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_BOOLEAN_METHOD_NAME = "setBoolean".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_OBJECT_METHOD_NAME = "set".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_SHORT_METHOD_NAME = "setShort".toCharArray(); //$NON-NLS-1$

+	final static char[] GETCLASS_OBJECT_METHOD_NAME = "getClass".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;I)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;J)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;D)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;F)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;B)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;C)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;Z)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;Ljava/lang/Object;)V".toCharArray(); //$NON-NLS-1$

+	final static char[] SET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;S)V".toCharArray(); //$NON-NLS-1$

+	final static char[] GETDECLAREDMETHOD_NAME = "getDeclaredMethod".toCharArray(); //$NON-NLS-1$

+	final static char[] GETDECLAREDMETHOD_SIGNATURE = "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;".toCharArray(); //$NON-NLS-1$

+	final static char[] ARRAY_NEWINSTANCE_SIGNATURE = "(Ljava/lang/Class;[I)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$

+	final static char[] GETCLASS_OBJECT_METHOD_SIGNATURE = "()Ljava/lang/Class;".toCharArray(); //$NON-NLS-1$

+	final static char[] INVOKE_METHOD_METHOD_NAME = "invoke".toCharArray(); //$NON-NLS-1$

+	final static char[] INVOKE_METHOD_METHOD_SIGNATURE = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$

+	final static char[] BYTEVALUE_BYTE_METHOD_NAME = "byteValue".toCharArray(); //$NON-NLS-1$

+	final static char[] BYTEVALUE_BYTE_METHOD_SIGNATURE = "()B".toCharArray(); //$NON-NLS-1$

+	final static char[] SHORTVALUE_SHORT_METHOD_NAME = "shortValue".toCharArray(); //$NON-NLS-1$

+	final static char[] DOUBLEVALUE_DOUBLE_METHOD_NAME = "doubleValue".toCharArray(); //$NON-NLS-1$

+	final static char[] FLOATVALUE_FLOAT_METHOD_NAME = "floatValue".toCharArray(); //$NON-NLS-1$

+	final static char[] INTVALUE_INTEGER_METHOD_NAME = "intValue".toCharArray(); //$NON-NLS-1$

+	final static char[] CHARVALUE_CHARACTER_METHOD_NAME = "charValue".toCharArray(); //$NON-NLS-1$

+	final static char[] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "booleanValue".toCharArray(); //$NON-NLS-1$

+	final static char[] LONGVALUE_LONG_METHOD_NAME = "longValue".toCharArray(); //$NON-NLS-1$

+	final static char[] SHORTVALUE_SHORT_METHOD_SIGNATURE = "()S".toCharArray(); //$NON-NLS-1$

+	final static char[] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "()D".toCharArray(); //$NON-NLS-1$

+	final static char[] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "()F".toCharArray(); //$NON-NLS-1$

+	final static char[] INTVALUE_INTEGER_METHOD_SIGNATURE = "()I".toCharArray(); //$NON-NLS-1$

+	final static char[] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "()C".toCharArray(); //$NON-NLS-1$

+	final static char[] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "()Z".toCharArray(); //$NON-NLS-1$

+	final static char[] LONGVALUE_LONG_METHOD_SIGNATURE = "()J".toCharArray(); //$NON-NLS-1$

+	final static char[] GETDECLAREDCONSTRUCTOR_NAME = "getDeclaredConstructor".toCharArray(); //$NON-NLS-1$

+	final static char[] GETDECLAREDCONSTRUCTOR_SIGNATURE = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;".toCharArray(); //$NON-NLS-1$

 	

 	// predefined constant index for well known types

 	final static int JAVA_LANG_REFLECT_FIELD_TYPE = 0;

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
index 4d43bb9..c841c05 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java
@@ -23,8 +23,8 @@
 /**

  * Creates a new code snippet parser.

  */

-public CodeSnippetParser(ProblemReporter problemReporter, EvaluationContext evaluationContext, boolean optimizeStringLiterals, int codeSnippetStart, int codeSnippetEnd) {

-	super(problemReporter, optimizeStringLiterals);

+public CodeSnippetParser(ProblemReporter problemReporter, EvaluationContext evaluationContext, boolean optimizeStringLiterals, boolean assertMode, int codeSnippetStart, int codeSnippetEnd) {

+	super(problemReporter, optimizeStringLiterals, assertMode);

 	this.codeSnippetStart = codeSnippetStart;

 	this.codeSnippetEnd = codeSnippetEnd;

 	this.evaluationContext = evaluationContext;

@@ -140,7 +140,8 @@
 	if (isSuperAccess) {

 		//considerates the fieldReference beginning at the 'super' ....	

 		fr.sourceStart = intStack[intPtr--];

-		fr.receiver = new SuperReference(fr.sourceStart, endPosition);

+		problemReporter().codeSnippetMissingClass(null,0, 0);

+		fr.receiver = new CodeSnippetSuperReference(fr.sourceStart, endPosition, evaluationContext);

 		pushOnExpressionStack(fr);

 	} else {

 		//optimize push/pop

@@ -281,6 +282,7 @@
 		methodDecl.statements = newStatements;

 	}

 }

+

 protected void consumeMethodInvocationName() {

 	// MethodInvocation ::= Name '(' ArgumentListopt ')'

 

@@ -308,6 +310,20 @@
 		super.consumeMethodInvocationName();

 	}

 }

+

+protected void consumeMethodInvocationSuper() {

+	// MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'

+

+	MessageSend m = newMessageSend();

+	m.sourceStart = intStack[intPtr--];

+	m.sourceEnd = rParenPos;

+	m.nameSourcePosition = identifierPositionStack[identifierPtr];

+	m.selector = identifierStack[identifierPtr--];

+	identifierLengthPtr--;

+	m.receiver = new CodeSnippetSuperReference(m.sourceStart, endPosition, this.evaluationContext);

+	pushOnExpressionStack(m);

+}

+

 protected void consumePrimaryNoNewArrayThis() {

 	// PrimaryNoNewArray ::= 'this'

 

@@ -315,7 +331,7 @@
 		&& scanner.startPosition <= codeSnippetEnd + 1

 		&& isTopLevelType()) {

 		pushOnExpressionStack(

-			new CodeSnippetThisReference(intStack[intPtr--], endPosition, evaluationContext, false));

+			new CodeSnippetThisReference(intStack[intPtr--], endPosition, this.evaluationContext, false));

 	} else {

 		super.consumePrimaryNoNewArrayThis();

 	}

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
index 3f9fe37..f9f24ff 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
@@ -501,17 +501,24 @@
 		return super.reportError(scope);

 	}

 

-	if (binding instanceof ProblemFieldBinding && ((ProblemFieldBinding) binding).problemId() == NotFound){

-		// will not support innerclass emulation inside delegate

-		binding = scope.getField(delegateThis.type, this.tokens[0], this);

-		if (!binding.isValidBinding()) return super.reportError(scope);

-		return checkFieldAccess(scope);

-	}

-

-	if (binding instanceof ProblemBinding && ((ProblemBinding) binding).problemId() == NotFound){

+	if ((binding instanceof ProblemFieldBinding && ((ProblemFieldBinding) binding).problemId() == NotFound)

+		|| (binding instanceof ProblemBinding && ((ProblemBinding) binding).problemId() == NotFound)){

 		// will not support innerclass emulation inside delegate

 		FieldBinding fieldBinding = scope.getField(delegateThis.type, this.tokens[0], this);

-		if (!fieldBinding.isValidBinding()) return super.reportError(scope);

+		if (!fieldBinding.isValidBinding()) {

+			if (((ProblemFieldBinding) fieldBinding).problemId() == NotVisible) {

+				// manage the access to a private field of the enclosing type

+				CodeSnippetScope localScope = new CodeSnippetScope(scope);

+				binding = localScope.getFieldForCodeSnippet(delegateThis.type, this.tokens[0], this);

+				if (binding.isValidBinding()) {

+					return checkFieldAccess(scope);						

+				} else {

+					return super.reportError(scope);

+				}

+			} else {

+				return super.reportError(scope);

+			}

+		}

 		binding = fieldBinding;

 		return checkFieldAccess(scope);

 	}

@@ -529,7 +536,6 @@
 

 	return super.reportError(scope);

 }

-

 public TypeBinding resolveTypeVisibility(BlockScope scope) {

 	// field and/or local are done before type lookups

 

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
index 11c3f67..c4ebc48 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.java
@@ -21,6 +21,15 @@
 public CodeSnippetReturnStatement(Expression expr, int s, int e, EvaluationContext evaluationContext) {

 	super(expr, s, e);

 }

+

+public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {

+	FlowInfo info = super.analyseCode(currentScope, flowContext, flowInfo);

+	// we need to remove this optimization in order to prevent the inlining of the return bytecode

+	// 1GH0AU7: ITPJCORE:ALL - Eval - VerifyError in scrapbook page

+	this.expression.bits &= ~ValueForReturnMASK;

+	return info;

+}

+

 /**

  * Dump the suitable return bytecode for a return statement

  *

@@ -82,12 +91,12 @@
 		if ((this.expressionType = this.expression.resolveType(scope)) != null) {

 			TypeBinding javaLangClass = scope.getJavaLangClass();

 			if (!javaLangClass.isValidBinding()) {

-				scope.problemReporter().codeSnippetMissingClass("java.lang.Class"/*nonNLS*/, this.sourceStart, this.sourceEnd);

+				scope.problemReporter().codeSnippetMissingClass("java.lang.Class", this.sourceStart, this.sourceEnd); //$NON-NLS-1$

 				return;

 			}

 			TypeBinding javaLangObject = scope.getJavaLangObject();

 			if (!javaLangObject.isValidBinding()) {

-				scope.problemReporter().codeSnippetMissingClass("java.lang.Object"/*nonNLS*/, this.sourceStart, this.sourceEnd);

+				scope.problemReporter().codeSnippetMissingClass("java.lang.Object", this.sourceStart, this.sourceEnd); //$NON-NLS-1$

 				return;

 			}

 			TypeBinding[] argumentTypes = new TypeBinding[] {javaLangObject, javaLangClass};

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
index c06b48e..2c64fb0 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
@@ -17,20 +17,20 @@
 public class CodeSnippetSkeleton implements IBinaryType, EvaluationConstants {

 	IBinaryMethod[] methods = new IBinaryMethod[] {

 		new BinaryMethodSkeleton(

-			"<init>"/*nonNLS*/.toCharArray(),

-			"()V"/*nonNLS*/.toCharArray(),

+			"<init>".toCharArray(), //$NON-NLS-1$

+			"()V".toCharArray(), //$NON-NLS-1$

 			new char[][] {},

 			true

 		),

 		new BinaryMethodSkeleton(

-			"run"/*nonNLS*/.toCharArray(),

-			"()V"/*nonNLS*/.toCharArray(),

-			new char[][] {"java/lang/Throwable"/*nonNLS*/.toCharArray()},

+			"run".toCharArray(), //$NON-NLS-1$

+			"()V".toCharArray(), //$NON-NLS-1$

+			new char[][] {"java/lang/Throwable".toCharArray()}, //$NON-NLS-1$

 			false

 		),

 		new BinaryMethodSkeleton(

-			"setResult"/*nonNLS*/.toCharArray(),

-			"(Ljava/lang/Object;Ljava/lang/Class;)V"/*nonNLS*/.toCharArray(),

+			"setResult".toCharArray(), //$NON-NLS-1$

+			"(Ljava/lang/Object;Ljava/lang/Class;)V".toCharArray(), //$NON-NLS-1$

 			new char[][] {},

 			false

 		)

@@ -87,7 +87,7 @@
 	return null;

 }

 public char[] getFileName() {

-	return CharOperation.concat(CODE_SNIPPET_NAME, ".java"/*nonNLS*/.toCharArray());

+	return CharOperation.concat(CODE_SNIPPET_NAME, ".java".toCharArray()); //$NON-NLS-1$

 }

 public char[][] getInterfaceNames() {

 	return null;

@@ -116,4 +116,8 @@
 public boolean isInterface() {

 	return false;

 }

+

+public char[] sourceFileName() {

+	return null;

+}

 }

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
index 47fe023..ad99110 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java
@@ -75,6 +75,6 @@
 }

 public String toStringExpression(){

 	char[] declaringType = this.evaluationContext.declaringTypeName;

-	return "("/*nonNLS*/ + (declaringType == null ? "<NO DECLARING TYPE>"/*nonNLS*/ : new String(declaringType)) + ")this"/*nonNLS*/;

+	return "(" + (declaringType == null ? "<NO DECLARING TYPE>" : new String(declaringType)) + ")this"; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$

 }

 }

diff --git a/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java b/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
index fd96616..dc64f69 100644
--- a/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
+++ b/eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java
@@ -66,42 +66,42 @@
 

 	// package declaration

 	if (this.packageName != null && this.packageName.length != 0) {

-		buffer.append("package "/*nonNLS*/);

+		buffer.append("package "); //$NON-NLS-1$

 		buffer.append(this.packageName);

-		buffer.append(";"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+		buffer.append(";").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 		this.lineNumberOffset++;

 	}

 

 	// import declarations

 	char[][] imports = this.imports;

 	for (int i = 0; i < imports.length; i++) {

-		buffer.append("import "/*nonNLS*/);

+		buffer.append("import "); //$NON-NLS-1$

 		buffer.append(imports[i]);

 		buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

 		this.lineNumberOffset++;

 	}

 

 	// class declaration

-	buffer.append("public class "/*nonNLS*/);

+	buffer.append("public class "); //$NON-NLS-1$

 	buffer.append(this.className);

 

 	// super class is either a global variable class or the CodeSnippet class

 	if (this.varClassName != null) {

-		buffer.append(" extends "/*nonNLS*/);

+		buffer.append(" extends "); //$NON-NLS-1$

 		buffer.append(this.varClassName);

 	} else {

-		buffer.append(" extends "/*nonNLS*/);

+		buffer.append(" extends "); //$NON-NLS-1$

 		buffer.append(PACKAGE_NAME);

-		buffer.append("."/*nonNLS*/);

+		buffer.append("."); //$NON-NLS-1$

 		buffer.append(ROOT_CLASS_NAME);

 	}

-	buffer.append(" {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+	buffer.append(" {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	this.lineNumberOffset++;

 

 	if (this.declaringTypeName != null){

-		buffer.append("  "/*nonNLS*/);

+		buffer.append("  "); //$NON-NLS-1$

 		buffer.append(this.declaringTypeName);

-		buffer.append(" "/*nonNLS*/);

+		buffer.append(" "); //$NON-NLS-1$

 		buffer.append(DELEGATE_THIS); // val$this

 		buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

 		this.lineNumberOffset++;

@@ -109,9 +109,9 @@
 	// add some storage location for local variable persisted state

 	if (localVarNames != null) {

 		for (int i = 0, max = localVarNames.length; i < max; i++) {

-			buffer.append("    "/*nonNLS*/);

+			buffer.append("    "); //$NON-NLS-1$

 			buffer.append(localVarTypeNames[i]);

-			buffer.append(" "/*nonNLS*/);

+			buffer.append(" "); //$NON-NLS-1$

 			buffer.append(LOCAL_VAR_PREFIX); // val$...

 			buffer.append(localVarNames[i]);

 			buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

@@ -119,7 +119,7 @@
 		}

 	}

 	// run() method declaration

-	buffer.append("public void run() throws Throwable {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+	buffer.append("public void run() throws Throwable {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	this.lineNumberOffset++;

 	startPosOffset = buffer.length();

 	buffer.append(codeSnippet);

@@ -173,7 +173,7 @@
 			// Remove completion on generated method

 			if (CharOperation.equals(declaringTypePackageName, CodeSnippetToCuMapper.this.packageName) 

 					&& CharOperation.equals(declaringTypeName, CodeSnippetToCuMapper.this.className)

-					&& CharOperation.equals(selector, "run"/*nonNLS*/.toCharArray())) return;

+					&& CharOperation.equals(selector, "run".toCharArray())) return; //$NON-NLS-1$

 			originalRequestor.acceptMethod(declaringTypePackageName, declaringTypeName, selector, parameterPackageNames, parameterTypeNames, returnTypePackageName, returnTypeName, completionName, modifiers, completionStart - startPosOffset, completionEnd - startPosOffset);

 		}

 		public void acceptModifier(char[] modifierName, int completionStart, int completionEnd) {

diff --git a/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java b/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
index 5100445..dd900b7 100644
--- a/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
+++ b/eval/org/eclipse/jdt/internal/eval/EvaluationConstants.java
@@ -7,19 +7,19 @@
 import org.eclipse.jdt.internal.compiler.util.CharOperation;

 

 public interface EvaluationConstants {

-	public static final char[] CODE_SNIPPET_CLASS_NAME_PREFIX = "CodeSnippet_"/*nonNLS*/.toCharArray();

-	public static final char[] GLOBAL_VARS_CLASS_NAME_PREFIX = "GlobalVariables_"/*nonNLS*/.toCharArray();

-	public static final char[] PACKAGE_NAME = "org.eclipse.jdt.internal.eval.target"/*nonNLS*/.toCharArray();

-	public static final char[] CODE_SNIPPET_NAME = "org/eclipse/jdt/internal/eval/target/CodeSnippet"/*nonNLS*/.toCharArray();

-	public static final char[] ROOT_CLASS_NAME = "CodeSnippet"/*nonNLS*/.toCharArray();

-	public static final String ROOT_FULL_CLASS_NAME = new String(PACKAGE_NAME) + "."/*nonNLS*/ + new String(ROOT_CLASS_NAME);

-	public static final char[] SETRESULT_SELECTOR = "setResult"/*nonNLS*/.toCharArray();

-	public static final char[] SETRESULT_ARGUMENTS = "Ljava.lang.Object;Ljava.lang.Class;"/*nonNLS*/.toCharArray();

+	public static final char[] CODE_SNIPPET_CLASS_NAME_PREFIX = "CodeSnippet_".toCharArray(); //$NON-NLS-1$

+	public static final char[] GLOBAL_VARS_CLASS_NAME_PREFIX = "GlobalVariables_".toCharArray(); //$NON-NLS-1$

+	public static final char[] PACKAGE_NAME = "org.eclipse.jdt.internal.eval.target".toCharArray(); //$NON-NLS-1$

+	public static final char[] CODE_SNIPPET_NAME = "org/eclipse/jdt/internal/eval/target/CodeSnippet".toCharArray(); //$NON-NLS-1$

+	public static final char[] ROOT_CLASS_NAME = "CodeSnippet".toCharArray(); //$NON-NLS-1$

+	public static final String ROOT_FULL_CLASS_NAME = new String(PACKAGE_NAME) + "." + new String(ROOT_CLASS_NAME); //$NON-NLS-1$

+	public static final char[] SETRESULT_SELECTOR = "setResult".toCharArray(); //$NON-NLS-1$

+	public static final char[] SETRESULT_ARGUMENTS = "Ljava.lang.Object;Ljava.lang.Class;".toCharArray(); //$NON-NLS-1$

 	public static final char[][] ROOT_COMPOUND_NAME = CharOperation.arrayConcat(CharOperation.splitOn('.', PACKAGE_NAME), ROOT_CLASS_NAME);

-	public static final String RUN_METHOD = "run"/*nonNLS*/;

-	public static final String RESULT_VALUE_FIELD = "resultValue"/*nonNLS*/;

-	public static final String RESULT_TYPE_FIELD = "resultType"/*nonNLS*/;

-	public final static char[] LOCAL_VAR_PREFIX = "val$"/*nonNLS*/.toCharArray();

-	public final static char[] DELEGATE_THIS = "val$this"/*nonNLS*/.toCharArray();

+	public static final String RUN_METHOD = "run"; //$NON-NLS-1$

+	public static final String RESULT_VALUE_FIELD = "resultValue"; //$NON-NLS-1$

+	public static final String RESULT_TYPE_FIELD = "resultType"; //$NON-NLS-1$

+	public final static char[] LOCAL_VAR_PREFIX = "val$".toCharArray(); //$NON-NLS-1$

+	public final static char[] DELEGATE_THIS = "val$this".toCharArray(); //$NON-NLS-1$

 	

 }

diff --git a/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java b/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
index bf2c011..15bb206 100644
--- a/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
+++ b/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java
@@ -77,7 +77,7 @@
  *		set of options used to configure the code assist engine.

  */

 public void complete(char[] codeSnippet, int completionPosition, ISearchableNameEnvironment environment, ICompletionRequestor requestor, ConfigurableOption[] options) {

-	final char[] className = "CodeSnippetCompletion"/*nonNLS*/.toCharArray();

+	final char[] className = "CodeSnippetCompletion".toCharArray(); //$NON-NLS-1$

 	final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(

 		codeSnippet, 

 		this.packageName, 

@@ -91,7 +91,7 @@
 	);

 	ICompilationUnit sourceUnit = new ICompilationUnit() {

 		public char[] getFileName() {

-			return CharOperation.concat(className, "java"/*nonNLS*/.toCharArray(), '.');

+			return CharOperation.concat(className, "java".toCharArray(), '.'); //$NON-NLS-1$

 		}

 		public char[] getContents() {

 			return mapper.getCUSource();

@@ -204,7 +204,7 @@
 			if (TIMING) {

 				long start = System.currentTimeMillis();

 				classes = evaluator.getClasses();

-				System.out.println("Time to compile ["/*nonNLS*/ + new String(codeSnippet) + "] was "/*nonNLS*/ + (System.currentTimeMillis() - start) + "ms"/*nonNLS*/);

+				System.out.println("Time to compile [" + new String(codeSnippet) + "] was " + (System.currentTimeMillis() - start) + "ms"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 			} else {

 				classes = evaluator.getClasses();

 			}

@@ -362,50 +362,50 @@
  */

 public static String getCodeSnippetSource() {

 	return

-		"package org.eclipse.jdt.internal.eval.target;\n"/*nonNLS*/ +

-		"\n"/*nonNLS*/ +

-		"/*\n"/*nonNLS*/ +

-		" * (c) Copyright IBM Corp. 2000, 2001.\n"/*nonNLS*/ +

-		" * All Rights Reserved.\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"/**\n"/*nonNLS*/ +

-		" * The root of all code snippet classes. Code snippet classes\n"/*nonNLS*/ +

-		" * are supposed to overide the run() method.\n"/*nonNLS*/ +

-		" * <p>\n"/*nonNLS*/ +

-		" * IMPORTANT NOTE:\n"/*nonNLS*/ +

-		" * All methods in this class must be public since this class is going to be loaded by the\n"/*nonNLS*/ +

-		" * bootstrap class loader, and the other code snippet support classes might be loaded by \n"/*nonNLS*/ +

-		" * another class loader (so their runtime packages are going to be different).\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"public class CodeSnippet {\n"/*nonNLS*/ +

-		"	private Class resultType = void.class;\n"/*nonNLS*/ +

-		"	private Object resultValue = null;\n"/*nonNLS*/ +

-		"/**\n"/*nonNLS*/ +

-		" * Returns the result type of the code snippet evaluation.\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"public Class getResultType() {\n"/*nonNLS*/ +

-		"	return this.resultType;\n"/*nonNLS*/ +

-		"}\n"/*nonNLS*/ +

-		"/**\n"/*nonNLS*/ +

-		" * Returns the result value of the code snippet evaluation.\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"public Object getResultValue() {\n"/*nonNLS*/ +

-		"	return this.resultValue;\n"/*nonNLS*/ +

-		"}\n"/*nonNLS*/ +

-		"/**\n"/*nonNLS*/ +

-		" * The code snippet. Subclasses must override this method with a transformed code snippet\n"/*nonNLS*/ +

-		" * that stores the result using setResult(Class, Object).\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"public void run() {\n"/*nonNLS*/ +

-		"}\n"/*nonNLS*/ +

-		"/**\n"/*nonNLS*/ +

-		" * Stores the result type and value of the code snippet evaluation.\n"/*nonNLS*/ +

-		" */\n"/*nonNLS*/ +

-		"public void setResult(Object resultValue, Class resultType) {\n"/*nonNLS*/ +

-		"	this.resultValue = resultValue;\n"/*nonNLS*/ +

-		"	this.resultType = resultType;\n"/*nonNLS*/ +

-		"}\n"/*nonNLS*/ +

-		"}\n"/*nonNLS*/;

+		"package org.eclipse.jdt.internal.eval.target;\n" + //$NON-NLS-1$

+		"\n" + //$NON-NLS-1$

+		"/*\n" + //$NON-NLS-1$

+		" * (c) Copyright IBM Corp. 2000, 2001.\n" + //$NON-NLS-1$

+		" * All Rights Reserved.\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"/**\n" + //$NON-NLS-1$

+		" * The root of all code snippet classes. Code snippet classes\n" + //$NON-NLS-1$

+		" * are supposed to overide the run() method.\n" + //$NON-NLS-1$

+		" * <p>\n" + //$NON-NLS-1$

+		" * IMPORTANT NOTE:\n" + //$NON-NLS-1$

+		" * All methods in this class must be public since this class is going to be loaded by the\n" + //$NON-NLS-1$

+		" * bootstrap class loader, and the other code snippet support classes might be loaded by \n" + //$NON-NLS-1$

+		" * another class loader (so their runtime packages are going to be different).\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"public class CodeSnippet {\n" + //$NON-NLS-1$

+		"	private Class resultType = void.class;\n" + //$NON-NLS-1$

+		"	private Object resultValue = null;\n" + //$NON-NLS-1$

+		"/**\n" + //$NON-NLS-1$

+		" * Returns the result type of the code snippet evaluation.\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"public Class getResultType() {\n" + //$NON-NLS-1$

+		"	return this.resultType;\n" + //$NON-NLS-1$

+		"}\n" + //$NON-NLS-1$

+		"/**\n" + //$NON-NLS-1$

+		" * Returns the result value of the code snippet evaluation.\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"public Object getResultValue() {\n" + //$NON-NLS-1$

+		"	return this.resultValue;\n" + //$NON-NLS-1$

+		"}\n" + //$NON-NLS-1$

+		"/**\n" + //$NON-NLS-1$

+		" * The code snippet. Subclasses must override this method with a transformed code snippet\n" + //$NON-NLS-1$

+		" * that stores the result using setResult(Class, Object).\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"public void run() {\n" + //$NON-NLS-1$

+		"}\n" + //$NON-NLS-1$

+		"/**\n" + //$NON-NLS-1$

+		" * Stores the result type and value of the code snippet evaluation.\n" + //$NON-NLS-1$

+		" */\n" + //$NON-NLS-1$

+		"public void setResult(Object resultValue, Class resultType) {\n" + //$NON-NLS-1$

+		"	this.resultValue = resultValue;\n" + //$NON-NLS-1$

+		"	this.resultType = resultType;\n" + //$NON-NLS-1$

+		"}\n" + //$NON-NLS-1$

+		"}\n"; //$NON-NLS-1$

 }

 /**

  * Returns the imports of this evaluation context. An import is the name of a package

@@ -440,7 +440,7 @@
 private String getSupportClassFileName(String simpleName) {

 	char separator = File.separatorChar;

 	char[][] compoundPackageName = CharOperation.splitOn('.', PACKAGE_NAME);

-	return new String(CharOperation.concatWith(compoundPackageName, separator)) + separator + simpleName + ".class"/*nonNLS*/;

+	return new String(CharOperation.concatWith(compoundPackageName, separator)) + separator + simpleName + ".class"; //$NON-NLS-1$

 }

 /**

  * Creates a new global variable with the given name, type and initializer.

@@ -487,7 +487,7 @@
 	ISelectionRequestor requestor,

 	ConfigurableOption[] options) {

 		

-	final char[] className = "CodeSnippetSelection"/*nonNLS*/.toCharArray();

+	final char[] className = "CodeSnippetSelection".toCharArray(); //$NON-NLS-1$

 	final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(

 		codeSnippet, 

 		this.packageName, 

@@ -501,7 +501,7 @@
 	);

 	ICompilationUnit sourceUnit = new ICompilationUnit() {

 		public char[] getFileName() {

-			return CharOperation.concat(className, "java"/*nonNLS*/.toCharArray(), '.');

+			return CharOperation.concat(className, "java".toCharArray(), '.'); //$NON-NLS-1$

 		}

 		public char[] getContents() {

 			return mapper.getCUSource();

diff --git a/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java b/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
index e0f7ee3..1d0e393 100644
--- a/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
+++ b/eval/org/eclipse/jdt/internal/eval/EvaluationResult.java
@@ -187,37 +187,37 @@
 	StringBuffer buffer = new StringBuffer();

 	switch (this.evaluationType) {

 		case T_CODE_SNIPPET:

-			buffer.append("Code snippet"/*nonNLS*/);

+			buffer.append("Code snippet"); //$NON-NLS-1$

 			break;

 		case T_IMPORT:

-			buffer.append("Import"/*nonNLS*/);

+			buffer.append("Import"); //$NON-NLS-1$

 			break;

 		case T_INTERNAL:

-			buffer.append("Internal problem"/*nonNLS*/);

+			buffer.append("Internal problem"); //$NON-NLS-1$

 			break;

 		case T_PACKAGE:

-			buffer.append("Package"/*nonNLS*/);

+			buffer.append("Package"); //$NON-NLS-1$

 			break;

 		case T_VARIABLE:

-			buffer.append("Global variable"/*nonNLS*/);

+			buffer.append("Global variable"); //$NON-NLS-1$

 			break;

 	}

-	buffer.append(": "/*nonNLS*/);

+	buffer.append(": "); //$NON-NLS-1$

 	buffer.append(this.evaluationID);

-	buffer.append("\n"/*nonNLS*/);

+	buffer.append("\n"); //$NON-NLS-1$

 	if (hasProblems()) {

-		buffer.append("Problems:\n"/*nonNLS*/);

+		buffer.append("Problems:\n"); //$NON-NLS-1$

 		for (int i = 0; i < this.problems.length; i++) {

 			buffer.append(this.problems[i].toString());

 		}

 	} else {

 		if (hasValue()) {

-			buffer.append("("/*nonNLS*/);

+			buffer.append("("); //$NON-NLS-1$

 			buffer.append(this.typeName);

-			buffer.append(") "/*nonNLS*/);

+			buffer.append(") "); //$NON-NLS-1$

 			buffer.append(this.displayString);

 		} else {

-			buffer.append("(No explicit return value)"/*nonNLS*/);

+			buffer.append("(No explicit return value)"); //$NON-NLS-1$

 		}

 	}

 	return buffer.toString();

diff --git a/eval/org/eclipse/jdt/internal/eval/Evaluator.java b/eval/org/eclipse/jdt/internal/eval/Evaluator.java
index f838a69..fcb8e0f 100644
--- a/eval/org/eclipse/jdt/internal/eval/Evaluator.java
+++ b/eval/org/eclipse/jdt/internal/eval/Evaluator.java
@@ -113,7 +113,7 @@
 	compiler.compile(new ICompilationUnit[] {new ICompilationUnit() {

 		public char[] getFileName() {

 			 // Name of class is name of CU

-			return CharOperation.concat(Evaluator.this.getClassName(), ".java"/*nonNLS*/.toCharArray());

+			return CharOperation.concat(Evaluator.this.getClassName(), ".java".toCharArray()); //$NON-NLS-1$

 		}

 		public char[] getContents() {

 			return source;

diff --git a/eval/org/eclipse/jdt/internal/eval/GlobalVariable.java b/eval/org/eclipse/jdt/internal/eval/GlobalVariable.java
index 8b994fa..272dbbd 100644
--- a/eval/org/eclipse/jdt/internal/eval/GlobalVariable.java
+++ b/eval/org/eclipse/jdt/internal/eval/GlobalVariable.java
@@ -52,13 +52,13 @@
 public String toString() {

 	StringBuffer buffer = new StringBuffer();

 	buffer.append(this.typeName);

-	buffer.append(" "/*nonNLS*/);

+	buffer.append(" "); //$NON-NLS-1$

 	buffer.append(this.name);

 	if (this.initializer != null) {

-		buffer.append("= "/*nonNLS*/);

+		buffer.append("= "); //$NON-NLS-1$

 		buffer.append(this.initializer);

 	}

-	buffer.append(";"/*nonNLS*/);

+	buffer.append(";"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java b/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
index 2e31731..0d3c582 100644
--- a/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
+++ b/eval/org/eclipse/jdt/internal/eval/VariablesEvaluator.java
@@ -176,7 +176,7 @@
 	// package declaration

 	char[] packageName = getPackageName();

 	if (packageName.length != 0) {

-		buffer.append("package "/*nonNLS*/);

+		buffer.append("package "); //$NON-NLS-1$

 		buffer.append(packageName);

 		buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

 		lineNumberOffset++;

@@ -185,20 +185,20 @@
 	// import declarations

 	char[][] imports = this.context.imports;

 	for (int i = 0; i < imports.length; i++) {

-		buffer.append("import "/*nonNLS*/);

+		buffer.append("import "); //$NON-NLS-1$

 		buffer.append(imports[i]);

 		buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

 		lineNumberOffset++;

 	}

 

 	// class declaration

-	buffer.append("public class "/*nonNLS*/);

+	buffer.append("public class "); //$NON-NLS-1$

 	buffer.append(getClassName());

-	buffer.append(" extends "/*nonNLS*/);

+	buffer.append(" extends "); //$NON-NLS-1$

 	buffer.append(PACKAGE_NAME);

-	buffer.append("."/*nonNLS*/);

+	buffer.append("."); //$NON-NLS-1$

 	buffer.append(ROOT_CLASS_NAME);

-	buffer.append(" {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+	buffer.append(" {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	lineNumberOffset++;

 	startPosOffset = buffer.length();

 

@@ -207,10 +207,10 @@
 	VariablesInfo installedVars = this.context.installedVars;

 	for (int i = 0; i < this.context.variableCount; i++){

 		GlobalVariable var = vars[i];

-		buffer.append("\tpublic static "/*nonNLS*/);

+		buffer.append("\tpublic static "); //$NON-NLS-1$

 		var.declarationStart = buffer.length();

 		buffer.append(var.typeName);

-		buffer.append(" "/*nonNLS*/);

+		buffer.append(" "); //$NON-NLS-1$

 		char[] varName = var.name;

 		buffer.append(varName);

 		buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

@@ -218,7 +218,7 @@
 	}

 

 	// field initializations

-	buffer.append("\tstatic {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+	buffer.append("\tstatic {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	lineNumberOffset++;

 	for (int i = 0; i < this.context.variableCount; i++){

 		GlobalVariable var = vars[i];

@@ -228,40 +228,40 @@
 			// Initialize with initializer if there was no previous value

 			char[] initializer = var.initializer;

 			if (initializer != null) {

-				buffer.append("\t\ttry {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+				buffer.append("\t\ttry {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 				lineNumberOffset++;

 				var.initializerLineStart = lineNumberOffset;

-				buffer.append("\t\t\t"/*nonNLS*/);

+				buffer.append("\t\t\t"); //$NON-NLS-1$

 				var.initializerStart = buffer.length();

 				buffer.append(varName);

-				buffer.append("= "/*nonNLS*/);

+				buffer.append("= "); //$NON-NLS-1$

 				var.initExpressionStart = buffer.length();

 				buffer.append(initializer);

 				lineNumberOffset += numberOfCRs(initializer);

 				buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

-				buffer.append("\t\t} catch (Throwable e) {"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

-				buffer.append("\t\t\te.printStackTrace();"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

-				buffer.append("\t\t}"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+				buffer.append("\t\t} catch (Throwable e) {").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

+				buffer.append("\t\t\te.printStackTrace();").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

+				buffer.append("\t\t}").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 				lineNumberOffset += 4; // 4 CRs

 			}

 		} else {

 			// Initialize with previous value if name and type are the same

-			buffer.append("\t\t"/*nonNLS*/);

+			buffer.append("\t\t"); //$NON-NLS-1$

 			buffer.append(varName);

-			buffer.append("= "/*nonNLS*/);

+			buffer.append("= "); //$NON-NLS-1$

 			char[] installedPackageName = installedVars.packageName;

 			if (installedPackageName != null && installedPackageName.length != 0) {

 				buffer.append(installedPackageName);

-				buffer.append("."/*nonNLS*/);

+				buffer.append("."); //$NON-NLS-1$

 			}

 			buffer.append(installedVars.className);

-			buffer.append("."/*nonNLS*/);

+			buffer.append("."); //$NON-NLS-1$

 			buffer.append(varName);

 			buffer.append(';').append(JavaModelManager.LINE_SEPARATOR);

 			lineNumberOffset++;

 		}

 	}

-	buffer.append("\t}"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+	buffer.append("\t}").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	

 	// end of class declaration

 	buffer.append('}').append(JavaModelManager.LINE_SEPARATOR);

diff --git a/formatter/org/eclipse/jdt/internal/formatter/CodeFormatter.java b/formatter/org/eclipse/jdt/internal/formatter/CodeFormatter.java
index 8c5dac5..8a638a7 100644
--- a/formatter/org/eclipse/jdt/internal/formatter/CodeFormatter.java
+++ b/formatter/org/eclipse/jdt/internal/formatter/CodeFormatter.java
@@ -1,14 +1,18 @@
 package org.eclipse.jdt.internal.formatter;

 

 /*

- * (c) Copyright IBM Corp. 2000, 2001.

- * All Rights Reserved.

+ * Licensed Materials - Property of IBM,

+ * WebSphere Studio Workbench

+ * (c) Copyright IBM Corp 2000

  */

-import org.eclipse.jdt.internal.compiler.*;

-import org.eclipse.jdt.internal.compiler.parser.*;

-import org.eclipse.jdt.internal.formatter.impl.*;

-import java.util.*;

-

+import org.eclipse.jdt.internal.compiler.parser.InvalidInputException;

+import org.eclipse.jdt.internal.compiler.parser.Parser;

+import org.eclipse.jdt.internal.compiler.parser.Scanner;

+import org.eclipse.jdt.internal.compiler.parser.TerminalSymbols;

+import org.eclipse.jdt.internal.compiler.ConfigurableOption;

+import org.eclipse.jdt.internal.formatter.impl.FormatterOptions;

+import org.eclipse.jdt.internal.formatter.impl.SplitLine;

+import java.util.Locale;

 /** <h2>How to format a piece of code ?</h2>

  * <ul><li>Create an instance of <code>CodeFormatter</code>

  * <li>Use the method <code>void format(aString)</code>

@@ -18,112 +22,112 @@
 

 public class CodeFormatter implements TerminalSymbols {

 

-	public FormatterOptions options;

+ public FormatterOptions options;

 

-	/** 

-	 * Represents a block in the <code>constructions</code> stack.

-	 */

-	public static final int BLOCK = TerminalSymbols.TokenNameLBRACE;

-	/** 

-	 * Represents a block following a control statement in the <code>constructions</code> stack.

-	 */

-	public static final int NONINDENT_BLOCK = -100;

-	/** 

-	 * Contains the formatted output.

-	 */

-	StringBuffer formattedSource;

-	/** 

-	 * Contains the current line.<br>

-	 * Will be dumped at the next "newline"

-	 */

-	StringBuffer currentLineBuffer;

+ /** 

+  * Represents a block in the <code>constructions</code> stack.

+  */

+ public static final int BLOCK = TerminalSymbols.TokenNameLBRACE;

+ /** 

+  * Represents a block following a control statement in the <code>constructions</code> stack.

+  */

+ public static final int NONINDENT_BLOCK = -100;

+ /** 

+  * Contains the formatted output.

+  */

+ StringBuffer formattedSource;

+ /** 

+  * Contains the current line.<br>

+  * Will be dumped at the next "newline"

+  */

+ StringBuffer currentLineBuffer;

 

-	/** 

-	 * Used during the formatting to get each token.

-	 */

-	Scanner scanner;

+ /** 

+  * Used during the formatting to get each token.

+  */

+ Scanner scanner;

 

-	/** 

-	 * Contains the tokens responsible for the current indentation level

-	 * and the blocks not closed yet.

-	 */

-	private int[] constructions;

-	/** 

-	 * Index in the <code>constructions</code> array.

-	 */

-	private int constructionsCount;

-	/** 

-	 * Level of indentation of the current token (number of tab char put in front of it).

-	 */

-	private int indentationLevel;

+ /** 

+  * Contains the tokens responsible for the current indentation level

+  * and the blocks not closed yet.

+  */

+ private int[] constructions;

+ /** 

+  * Index in the <code>constructions</code> array.

+  */

+ private int constructionsCount;

+ /** 

+  * Level of indentation of the current token (number of tab char put in front of it).

+  */

+ private int indentationLevel;

 

-	/** 

-	 * Regular level of indentation of all the lines

-	 */

-	private int initialIndentationLevel;

+ /** 

+  * Regular level of indentation of all the lines

+  */

+ private int initialIndentationLevel;

 

-	/** 

-	 * Used to split a line.

-	 */

-	Scanner splitScanner;

-	/** 

-	 * To remember the offset between the beginning of the line and the

-	 * beginning of the comment.

-	 */

-	int currentCommentOffset;

-	int currentLineIndentationLevel;

-	int maxLineSize = 30;

-	private boolean containsOpenCloseBraces;

-	private int indentationLevelForOpenCloseBraces;

+ /** 

+  * Used to split a line.

+  */

+ Scanner splitScanner;

+ /** 

+  * To remember the offset between the beginning of the line and the

+  * beginning of the comment.

+  */

+ int currentCommentOffset;

+ int currentLineIndentationLevel;

+ int maxLineSize = 30;

+ private boolean containsOpenCloseBraces;

+ private int indentationLevelForOpenCloseBraces;

 

-	/**

-	 * Collections of positions to map

-	 */

-	private int[] positionsToMap;

-	

-	/**

-	 * Collections of mapped positions

-	 */

-	private int[] mappedPositions;

+ /**

+  * Collections of positions to map

+  */

+ private int[] positionsToMap;

+ 

+ /**

+  * Collections of mapped positions

+  */

+ private int[] mappedPositions;

 

-	private int indexToMap;

+ private int indexToMap;

 

-	private int indexInMap;

-	

-	private int globalDelta;

+ private int indexInMap;

+ 

+ private int globalDelta;

 

-	private int lineDelta;

+ private int lineDelta;

 

-	private int splitDelta;

+ private int splitDelta;

 

-	private int beginningOfLineIndex;

+ private int beginningOfLineIndex;

 /** 

  * Creates a new instance of Code Formatter using the FormattingOptions object

  * given as argument

  * @deprecated Use CodeFormatter(ConfigurableOption[]) instead

  */

 public CodeFormatter() {

-	this(null);

+ this(null);

 }

 /** 

  * Creates a new instance of Code Formatter using the given settings.

  */

 public CodeFormatter(ConfigurableOption[] settings) {

 

-	// initialize internal state

-	constructionsCount = 0;

-	constructions = new int[10];

-	currentLineIndentationLevel = indentationLevel = initialIndentationLevel;

-	currentCommentOffset = -1;

-	

-	// initialize primary and secondary scanners

-	scanner = new Scanner(true,true);		// regular scanner for forming lines

-	scanner.recordLineSeparator = true;		// to remind of the position of the beginning of the line.

-	splitScanner = new Scanner(true,true);	// secondary scanner to split long lines formed by primary scanning

+ // initialize internal state

+ constructionsCount = 0;

+ constructions = new int[10];

+ currentLineIndentationLevel = indentationLevel = initialIndentationLevel;

+ currentCommentOffset = -1;

+ 

+ // initialize primary and secondary scanners

+ scanner = new Scanner(true,true);  // regular scanner for forming lines

+ scanner.recordLineSeparator = true;  // to remind of the position of the beginning of the line.

+ splitScanner = new Scanner(true,true); // secondary scanner to split long lines formed by primary scanning

 

-	// initialize current line buffer

-	currentLineBuffer = new StringBuffer();

-	this.options = new FormatterOptions(settings);

+ // initialize current line buffer

+ currentLineBuffer = new StringBuffer();

+ this.options = new FormatterOptions(settings);

 }

 /** 

  * Sets the behaviour of the formatter about the braces using the given flag.<br>

@@ -136,754 +140,761 @@
 

  /**  */

 public void addNewLineOnOpeningBrace(boolean flag) {

-	options.setNewLineBeforeOpeningBraceMode(flag);

+ options.setNewLineBeforeOpeningBraceMode(flag);

 }

 /**

  * Returns true if a lineSeparator has to be inserted before <code>operator</code>

  * false otherwise.

  */

 private static boolean breakLineBeforeOperator(int operator) {

-	switch (operator) {

-		case TokenNameCOMMA :

-		case TokenNameSEMICOLON :

-		case TokenNameEQUAL :

-			return false;

-		default :

-			return true;

-	}

+ switch (operator) {

+  case TokenNameCOMMA :

+  case TokenNameSEMICOLON :

+  case TokenNameEQUAL :

+   return false;

+  default :

+   return true;

+ }

 }

 /** 

  * Returns the end of the source code.

  */

 private final String copyRemainingSource() {

-	char str[] = scanner.source;

-	int startPosition = scanner.startPosition;

-	int length = str.length - startPosition;

-	StringBuffer bufr = new StringBuffer(length);

-	if (startPosition < str.length) {

-		bufr.append(str, startPosition, length);

-	}

-	return (bufr.toString());

+ char str[] = scanner.source;

+ int startPosition = scanner.startPosition;

+ int length = str.length - startPosition;

+ StringBuffer bufr = new StringBuffer(length);

+ if (startPosition < str.length) {

+  bufr.append(str, startPosition, length);

+ }

+ return (bufr.toString());

 }

 /**

  * Inserts <code>tabCount</code> tab character or their equivalent number of spaces.

  */

 private void dumpTab(int tabCount) {

-	if (options.indentWithTab) {

-		for (int j = 0; j < tabCount; j++) {

-			formattedSource.append('\t');

-			increaseSplitDelta(1);

-		}

-	} else {

-		for (int i = 0, max = options.tabSize * tabCount; i < max; i++) {

-			formattedSource.append(' ');

-			increaseSplitDelta(1);

-		}

-	}

+ if (options.indentWithTab) {

+  for (int j = 0; j < tabCount; j++) {

+   formattedSource.append('\t');

+   increaseSplitDelta(1);

+  }

+ } else {

+  for (int i = 0, max = options.tabSize * tabCount; i < max; i++) {

+   formattedSource.append(' ');

+   increaseSplitDelta(1);

+  }

+ }

 }

 /**

  * Dumps <code>currentLineBuffer</code> into the formatted string.

  */

 private void flushBuffer() {

-	String currentString = currentLineBuffer.toString();

-	splitDelta = 0;

-	beginningOfLineIndex = formattedSource.length();	

-	if (options.maxLineLength!=0){

-		if (containsOpenCloseBraces) {

-			containsOpenCloseBraces = false;

-			outputLine(currentString,

-				false,

-				indentationLevelForOpenCloseBraces,

-				0,

-				-1,

-				null,

-				0);

-				indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

-		} else {

-			outputLine(currentString,

-				false,

-				currentLineIndentationLevel,

-				0,

-				-1,

-				null,

-				0);

-		}		

-	} else {

-		formattedSource.append(currentString);

-	}

+ String currentString = currentLineBuffer.toString();

+ splitDelta = 0;

+ beginningOfLineIndex = formattedSource.length(); 

+ if (options.maxLineLength!=0){

+  if (containsOpenCloseBraces) {

+   containsOpenCloseBraces = false;

+   outputLine(currentString,

+    false,

+    indentationLevelForOpenCloseBraces,

+    0,

+    -1,

+    null,

+    0);

+    indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

+  } else {

+   outputLine(currentString,

+    false,

+    currentLineIndentationLevel,

+    0,

+    -1,

+    null,

+    0);

+  }  

+ } else {

+  formattedSource.append(currentString);

+ }

 }

 /** 

  * Formats the input string.

  */

 private void format() {

-	int token = 0;

-	int previousToken = 0;

-	int previousCompilableToken = 0;

+ int token = 0;

+ int previousToken = 0;

+ int previousCompilableToken = 0;

 

-	int indentationOffset = 0;

+ int indentationOffset = 0;

 

-	int newLinesInWhitespace = 0;

-	// number of new lines in the previous whitespace token

-	// (used to leave blank lines before comments)

-	int pendingNewLines = 0;

-	boolean expectingOpenBrace = false;

-	boolean clearNonBlockIndents = false;

-	// true if all indentations till the 1st { (usefull after } or ;)

-	boolean pendingSpace = true;

-	boolean pendingNewlineAfterParen = false;

-	// true when a cr is to be put after a ) (in conditional statements)

-	boolean inAssignment = false;

-	boolean inArrayAssignment = false;

-	boolean inThrowsClause = false;

-	boolean inClassOrInterfaceHeader = false;

+ int newLinesInWhitespace = 0;

+ // number of new lines in the previous whitespace token

+ // (used to leave blank lines before comments)

+ int pendingNewLines = 0;

+ boolean expectingOpenBrace = false;

+ boolean clearNonBlockIndents = false;

+ // true if all indentations till the 1st { (usefull after } or ;)

+ boolean pendingSpace = true;

+ boolean pendingNewlineAfterParen = false;

+ // true when a cr is to be put after a ) (in conditional statements)

+ boolean inAssignment = false;

+ boolean inArrayAssignment = false;

+ boolean inThrowsClause = false;

+ boolean inClassOrInterfaceHeader = false;

 

-	// openBracketCount is used to count the number of open brackets not closed yet.

-	int openBracketCount = 0;

-	

-	int unarySignModifier = 0;

+ // openBracketCount is used to count the number of open brackets not closed yet.

+ int openBracketCount = 0;

+ 

+  int unarySignModifier = 0;

 

-	// openParenthesis[0] is used to count the parenthesis not belonging to a condition

-	// (eg foo();). parenthesis in for (...) are count elsewhere in the array.

-	int openParenthesisCount = 1;

-	int[] openParenthesis = new int[10];

+ // openParenthesis[0] is used to count the parenthesis not belonging to a condition

+ // (eg foo();). parenthesis in for (...) are count elsewhere in the array.

+ int openParenthesisCount = 1;

+ int[] openParenthesis = new int[10];

 

-	// tokenBeforeColon is used to know what token goes along with the current :

-	// it can be case or ?

-	int tokenBeforeColonCount = 0;

-	int[] tokenBeforeColon = new int[10];

+ // tokenBeforeColon is used to know what token goes along with the current :

+ // it can be case or ?

+ int tokenBeforeColonCount = 0;

+ int[] tokenBeforeColon = new int[10];

 

-	constructionsCount = 0; // initializes the constructions count.

+ constructionsCount = 0; // initializes the constructions count.

 

-	// contains DO if in a DO..WHILE statement, UNITIALIZED otherwise.

-	int nlicsToken = 0;

+ // contains DO if in a DO..WHILE statement, UNITIALIZED otherwise.

+ int nlicsToken = 0;

 

-	// fix for 1FF17XY: LFCOM:ALL - Format problem on not matching } and else 

-	boolean specialElse = false;

+ // fix for 1FF17XY: LFCOM:ALL - Format problem on not matching } and else 

+ boolean specialElse = false;

 

-	// OPTION (IndentationLevel): initial indentation level may be non-zero.

-	currentLineIndentationLevel += constructionsCount;

+ // OPTION (IndentationLevel): initial indentation level may be non-zero.

+ currentLineIndentationLevel += constructionsCount;

 

-	

-	// An InvalidInputException exception might cause the termination of this loop.

-	try {

-		while (true) {

-			// Get the next token.  Catch invalid input and output it

-			// with minimal formatting, also catch end of input and

-			// exit the loop.

-			try {

-				token = scanner.getNextToken();

-			} catch (InvalidInputException e) {

-				if (!handleInvalidToken(e)) {

-					throw e;

-				}

-				token = 0;

-			}

-			if (token == Scanner.TokenNameEOF)

-				break;

+ 

+ // An InvalidInputException exception might cause the termination of this loop.

+ try {

+  while (true) {

+   // Get the next token.  Catch invalid input and output it

+   // with minimal formatting, also catch end of input and

+   // exit the loop.

+   try {

+    token = scanner.getNextToken();

+   } catch (InvalidInputException e) {

+    if (!handleInvalidToken(e)) {

+     throw e;

+    }

+    token = 0;

+   }

+   if (token == Scanner.TokenNameEOF)

+    break;

 

-			/* ## MODIFYING the indentation level before generating new lines

-			and indentation in the output string

-			*/

+   /* ## MODIFYING the indentation level before generating new lines

+   and indentation in the output string

+   */

 

-			// Removes all the indentations made by statements not followed by a block

-			// except if the current token is ELSE, CATCH or if we are in a switch/case

+   // Removes all the indentations made by statements not followed by a block

+   // except if the current token is ELSE, CATCH or if we are in a switch/case

 

-			if (clearNonBlockIndents && (token != Scanner.TokenNameWHITESPACE)) {

+   if (clearNonBlockIndents && (token != Scanner.TokenNameWHITESPACE)) {

 

-				switch (token) {

-					case TokenNameelse :

-						if (constructionsCount > 0 && constructions[constructionsCount-1] == TokenNameelse){

-							pendingNewLines = 1;

-							specialElse = true;

-						}

-						indentationLevel += popInclusiveUntil(TokenNameif);

-						break;

-					case TokenNamecatch :

-						indentationLevel += popInclusiveUntil(TokenNamecatch);

-						break;

-					case TokenNamefinally :

-						indentationLevel += popInclusiveUntil(TokenNamecatch);

-						break;

-					case TokenNamewhile :

-						if (nlicsToken == TokenNamedo) {

-							indentationLevel += pop(TokenNamedo);

-							break;

-						}

-					default :

-						indentationLevel += popExclusiveUntilBlockOrCase();

-						// clear until a CASE, DEFAULT or BLOCK is encountered.

-						// Thus, the indentationLevel is correctly cleared either

-						// in a switch/case statement or in any other situation.

-				}

-				clearNonBlockIndents = false;

-			}

+    switch (token) {

+     case TokenNameelse :

+      if (constructionsCount > 0 && constructions[constructionsCount-1] == TokenNameelse){

+       pendingNewLines = 1;

+       specialElse = true;

+      }

+      indentationLevel += popInclusiveUntil(TokenNameif);

+      break;

+     case TokenNamecatch :

+      indentationLevel += popInclusiveUntil(TokenNamecatch);

+      break;

+     case TokenNamefinally :

+      indentationLevel += popInclusiveUntil(TokenNamecatch);

+      break;

+     case TokenNamewhile :

+      if (nlicsToken == TokenNamedo) {

+       indentationLevel += pop(TokenNamedo);

+       break;

+      }

+     default :

+      indentationLevel += popExclusiveUntilBlockOrCase();

+      // clear until a CASE, DEFAULT or BLOCK is encountered.

+      // Thus, the indentationLevel is correctly cleared either

+      // in a switch/case statement or in any other situation.

+    }

+    clearNonBlockIndents = false;

+   }

 

-			// returns to the indentation level created by the SWITCH keyword

-			// if the current token is a CASE or a DEFAULT

+   // returns to the indentation level created by the SWITCH keyword

+   // if the current token is a CASE or a DEFAULT

 

-			if (token == TokenNamecase || token == TokenNamedefault) {

-				indentationLevel += pop(TokenNamecase);

-			}

+   if (token == TokenNamecase || token == TokenNamedefault) {

+    indentationLevel += pop(TokenNamecase);

+   }

 

-			if (token == Scanner.TokenNamethrows) {

-				inThrowsClause = true;

-			}

+   if (token == Scanner.TokenNamethrows) {

+    inThrowsClause = true;

+   }

 

-			if (token == Scanner.TokenNameclass || token == Scanner.TokenNameinterface) {

-				inClassOrInterfaceHeader = true;

-			}

-			/* ## APPEND newlines and indentations to the output string

-			*/

+   if (token == Scanner.TokenNameclass || token == Scanner.TokenNameinterface) {

+    inClassOrInterfaceHeader = true;

+   }

+   /* ## APPEND newlines and indentations to the output string

+   */

 

-			// Do not add a new line between ELSE and IF, if the option elseIfOnSameLine is true.

-			// Fix for 1ETLWPZ: IVJCOM:ALL - incorrect "else if" formatting

-			if (pendingNewlineAfterParen && previousCompilableToken == TokenNameelse && token == TokenNameif && options.compactElseIfMode){

-				pendingNewlineAfterParen = false;

-				pendingNewLines = 0;

-				indentationLevel += pop(TokenNameelse);

-				// because else if is now one single statement,

-				// the indentation level after it is increased by one and not by 2

-				// (else = 1 indent, if = 1 indent, but else if = 1 indent, not 2).

-			}

-			

-			// Add a newline & indent to the formatted source string if

-			// a for/if-else/while statement was scanned and there is no block

-			// following it.

-			

-			pendingNewlineAfterParen = pendingNewlineAfterParen || (previousCompilableToken == TokenNameRPAREN && token == TokenNameLBRACE);

-			if (pendingNewlineAfterParen && token != Scanner.TokenNameWHITESPACE) {

-				pendingNewlineAfterParen = false;

+   // Do not add a new line between ELSE and IF, if the option elseIfOnSameLine is true.

+   // Fix for 1ETLWPZ: IVJCOM:ALL - incorrect "else if" formatting

+   if (pendingNewlineAfterParen && previousCompilableToken == TokenNameelse && token == TokenNameif && options.compactElseIfMode){

+    pendingNewlineAfterParen = false;

+    pendingNewLines = 0;

+    indentationLevel += pop(TokenNameelse);

+    // because else if is now one single statement,

+    // the indentation level after it is increased by one and not by 2

+    // (else = 1 indent, if = 1 indent, but else if = 1 indent, not 2).

+   }

+   

+   // Add a newline & indent to the formatted source string if

+   // a for/if-else/while statement was scanned and there is no block

+   // following it.

+   

+   pendingNewlineAfterParen = pendingNewlineAfterParen || (previousCompilableToken == TokenNameRPAREN && token == TokenNameLBRACE);

+   if (pendingNewlineAfterParen && token != Scanner.TokenNameWHITESPACE) {

+    pendingNewlineAfterParen = false;

 

-				// Do to add a newline & indent sequence if the current token is an

-				// open brace or a period or if the current token is a semi-colon and the

-				// previous token is a close paren.

-				// add a new line if a parenthesis belonging to a for() statement

-				// has been closed and the current token is not an opening brace

+    // Do to add a newline & indent sequence if the current token is an

+    // open brace or a period or if the current token is a semi-colon and the

+    // previous token is a close paren.

+    // add a new line if a parenthesis belonging to a for() statement

+    // has been closed and the current token is not an opening brace

 

-				if (token != TokenNameLBRACE && !isComment(token)

-				// to avoid adding new line between else and a comment

-						&& token != TokenNameDOT

-						&& ! (previousCompilableToken == TokenNameRPAREN

-							&& token == TokenNameSEMICOLON)) {

-					newLine(1);

-					currentLineIndentationLevel += indentationLevel;

-					pendingNewLines = 0;

-					pendingSpace = false;

-				} else {

-					if (token == TokenNameLBRACE && options.newLineBeforeOpeningBraceMode) {

-						newLine(1);

-						currentLineIndentationLevel = indentationLevel;

-						pendingNewLines = 0;

-						pendingSpace = false;

-					}

-				}

-			}

+    if (token != TokenNameLBRACE && !isComment(token)

+    // to avoid adding new line between else and a comment

+      && token != TokenNameDOT

+      && ! (previousCompilableToken == TokenNameRPAREN

+       && token == TokenNameSEMICOLON)) {

+     newLine(1);

+     currentLineIndentationLevel = indentationLevel;

+     pendingNewLines = 0;

+     pendingSpace = false;

+    } else {

+     if (token == TokenNameLBRACE && options.newLineBeforeOpeningBraceMode) {

+      newLine(1);

+      if (constructionsCount > 0

+       && constructions[constructionsCount - 1] != BLOCK

+       && constructions[constructionsCount - 1] != NONINDENT_BLOCK) {

+       currentLineIndentationLevel = indentationLevel - 1;

+      } else {

+       currentLineIndentationLevel = indentationLevel;

+      }

+      pendingNewLines = 0;

+      pendingSpace = false;

+     }

+    }

+   }

 

-			// see PR 1G5G8EC

-			if (token == TokenNameLBRACE && inThrowsClause) {

-				inThrowsClause = false;      

-				if (options.newLineBeforeOpeningBraceMode) {

-					newLine(1);

-					currentLineIndentationLevel = indentationLevel;

-					pendingNewLines = 0;

-					pendingSpace = false;

-				}

-			}

-			

-			// see PR 1G5G82G

-			if (token == TokenNameLBRACE && inClassOrInterfaceHeader) {

-				inClassOrInterfaceHeader = false;

-				if (options.newLineBeforeOpeningBraceMode) {

-					newLine(1);

-					currentLineIndentationLevel = indentationLevel;

-					pendingNewLines = 0;

-					pendingSpace = false;

-				}

-			}            

-			// Add pending new lines to the formatted source string.

-			// Note: pending new lines are not added if the current token

-			// is a single line comment or whitespace.

-			// if the comment is between parenthesis, there is no blank line preservation

-			// (if it's a one-line comment, a blank line is added after it).

+   if (token == TokenNameLBRACE

+    && options.newLineBeforeOpeningBraceMode

+    && constructionsCount > 0

+    && constructions[constructionsCount - 1] == TokenNamedo) {

+    newLine(1);

+    currentLineIndentationLevel = indentationLevel - 1;

+    pendingNewLines = 0;

+    pendingSpace = false;

+   }

 

-			if (((pendingNewLines > 0 && (!isComment(token)))

-					|| (newLinesInWhitespace > 0

-							&& (openParenthesisCount <= 1 && isComment(token)))

-					|| (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE))

-				&& token != Scanner.TokenNameWHITESPACE) {

+   // see PR 1G5G8EC

+   if (token == TokenNameLBRACE && inThrowsClause) {

+    inThrowsClause = false;      

+    if (options.newLineBeforeOpeningBraceMode) {

+     newLine(1);

+     currentLineIndentationLevel = indentationLevel;

+     pendingNewLines = 0;

+     pendingSpace = false;

+    }

+   }

+   

+   // see PR 1G5G82G

+   if (token == TokenNameLBRACE && inClassOrInterfaceHeader) {

+    inClassOrInterfaceHeader = false;

+    if (options.newLineBeforeOpeningBraceMode) {

+     newLine(1);

+     currentLineIndentationLevel = indentationLevel;

+     pendingNewLines = 0;

+     pendingSpace = false;

+    }

+   }            

+   // Add pending new lines to the formatted source string.

+   // Note: pending new lines are not added if the current token

+   // is a single line comment or whitespace.

+   // if the comment is between parenthesis, there is no blank line preservation

+   // (if it's a one-line comment, a blank line is added after it).

 

-				// Do not add newline & indent between an adjoining close brace and

-				// close paren.  Anonymous inner classes may use this form.

+   if (((pendingNewLines > 0 && (!isComment(token)))

+     || (newLinesInWhitespace > 0

+       && (openParenthesisCount <= 1 && isComment(token)))

+     || (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE))

+    && token != Scanner.TokenNameWHITESPACE) {

 

-				boolean closeBraceAndCloseParen = 

-						previousToken == TokenNameRBRACE && token == TokenNameRPAREN; 

+    // Do not add newline & indent between an adjoining close brace and

+    // close paren.  Anonymous inner classes may use this form.

 

-				// OPTION (NewLineInCompoundStatement): do not add newline & indent

-				// between close brace and else, (do) while, catch, and finally if

-				// newlineInCompoundStatement is true.

+    boolean closeBraceAndCloseParen = 

+      previousToken == TokenNameRBRACE && token == TokenNameRPAREN; 

 

-				boolean nlicsOption = 

-						previousToken == TokenNameRBRACE

-							&& !options.newlineInControlStatementMode

-							&& (token == TokenNameelse

-								|| (token == TokenNamewhile && nlicsToken == TokenNamedo)

-								|| token == TokenNamecatch

-								|| token == TokenNamefinally);

+    // OPTION (NewLineInCompoundStatement): do not add newline & indent

+    // between close brace and else, (do) while, catch, and finally if

+    // newlineInCompoundStatement is true.

 

-				// Do not add a newline & indent between a close brace and semi-colon.

 

-				boolean semiColonAndCloseBrace = 

-						previousToken == TokenNameRBRACE && token == TokenNameSEMICOLON; 

+    boolean nlicsOption = 

+      previousToken == TokenNameRBRACE

+       && !options.newlineInControlStatementMode

+       && (token == TokenNameelse

+        || (token == TokenNamewhile && nlicsToken == TokenNamedo)

+        || token == TokenNamecatch

+        || token == TokenNamefinally);

 

-				// Do not add a new line & indent between a multiline comment and a opening brace

+    // Do not add a newline & indent between a close brace and semi-colon.

 

-				boolean commentAndOpenBrace = previousToken == Scanner.TokenNameCOMMENT_BLOCK && token == TokenNameLBRACE;

-				

-				// Do not add a newline & indent between a close brace and a colon (in array assignments, for example).

-				

-				boolean commaAndCloseBrace =

-						previousToken == TokenNameRBRACE && token == TokenNameCOMMA; 

+    boolean semiColonAndCloseBrace = 

+      previousToken == TokenNameRBRACE && token == TokenNameSEMICOLON; 

 

-				// Add a newline and indent, if appropriate.

+    // Do not add a new line & indent between a multiline comment and a opening brace

 

-				if (specialElse || (!commentAndOpenBrace && !closeBraceAndCloseParen && !nlicsOption && !semiColonAndCloseBrace && !commaAndCloseBrace)) {

-					// if clearAllBlankLinesMode=false, leaves the blank lines

-					// inserted by the user

-					// if clearAllBlankLinesMode=true, removes all of then

-					// and insert only blank lines required by the formatting.

-					if (!options.clearAllBlankLinesMode) {

-						pendingNewLines = 

-								(pendingNewLines < newLinesInWhitespace)

+    boolean commentAndOpenBrace = previousToken == Scanner.TokenNameCOMMENT_BLOCK && token == TokenNameLBRACE;

+    

+    // Do not add a newline & indent between a close brace and a colon (in array assignments, for example).

+    

+    boolean commaAndCloseBrace =

+      previousToken == TokenNameRBRACE && token == TokenNameCOMMA; 

+

+    // Add a newline and indent, if appropriate.

+

+    if (specialElse || (!commentAndOpenBrace && !closeBraceAndCloseParen && !nlicsOption && !semiColonAndCloseBrace && !commaAndCloseBrace)) {

+     // if clearAllBlankLinesMode=false, leaves the blank lines

+     // inserted by the user

+     // if clearAllBlankLinesMode=true, removes all of then

+     // and insert only blank lines required by the formatting.

+     if (!options.clearAllBlankLinesMode) {

+      pendingNewLines = 

+        (pendingNewLines < newLinesInWhitespace)

 //                              (isComment(token))

-									? newLinesInWhitespace 

-									: pendingNewLines;

-						pendingNewLines = (pendingNewLines > 2) ? 2 : pendingNewLines;

-					}

+         ? newLinesInWhitespace 

+         : pendingNewLines;

+      pendingNewLines = (pendingNewLines > 2) ? 2 : pendingNewLines;

+     }

 

-					if (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE) {

-						containsOpenCloseBraces = true;

-						indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

-						if (isComment(previousToken)) {

-							newLine(pendingNewLines);

-						} else {

+     if (previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE) {

+      containsOpenCloseBraces = true;

+      indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

+      if (isComment(previousToken)) {

+       newLine(pendingNewLines);

+      } else {

 /*                          if (!(constructionsCount > 1

-								&& constructions[constructionsCount-1] == NONINDENT_BLOCK

-								&& (constructions[constructionsCount-2] == TokenNamefor 

-									|| constructions[constructionsCount-2] == TokenNamewhile))) {*/

-							if (options.newLineInEmptyBlockMode) {

-								if (inArrayAssignment) {

-									newLine(1); // array assigment with an empty block

-								} else {

-									newLine(pendingNewLines);

-								}

-							}

+        && constructions[constructionsCount-1] == NONINDENT_BLOCK

+        && (constructions[constructionsCount-2] == TokenNamefor 

+         || constructions[constructionsCount-2] == TokenNamewhile))) {*/

+       if (options.newLineInEmptyBlockMode) {

+        if (inArrayAssignment) {

+         newLine(1); // array assigment with an empty block

+        } else {

+         newLine(pendingNewLines);

+        }

+       }

 //                          }

-						}

-					} else {

-						// see PR 1FKKC3U: LFCOM:WINNT - Format problem with a comment before the ';'

-						if (!((previousToken == Scanner.TokenNameCOMMENT_BLOCK || previousToken == Scanner.TokenNameCOMMENT_JAVADOC) && token == TokenNameSEMICOLON)) {

-							newLine(pendingNewLines);                       

-						}

-					}

-					if (((previousCompilableToken == TokenNameSEMICOLON)

-							|| (previousCompilableToken == TokenNameLBRACE)

-							|| (previousCompilableToken == TokenNameRBRACE)

-							|| (isComment(previousToken)))

-						&& (token == TokenNameRBRACE)) {

-						indentationOffset = -1;

-						indentationLevel += popExclusiveUntilBlock();

-					}

+      }

+     } else {

+      // see PR 1FKKC3U: LFCOM:WINNT - Format problem with a comment before the ';'

+      if (!((previousToken == Scanner.TokenNameCOMMENT_BLOCK || previousToken == Scanner.TokenNameCOMMENT_JAVADOC) && token == TokenNameSEMICOLON)) {

+       newLine(pendingNewLines);                       

+      }

+     }

+     if (((previousCompilableToken == TokenNameSEMICOLON)

+       || (previousCompilableToken == TokenNameLBRACE)

+       || (previousCompilableToken == TokenNameRBRACE)

+       || (isComment(previousToken)))

+      && (token == TokenNameRBRACE)) {

+      indentationOffset = -1;

+      indentationLevel += popExclusiveUntilBlock();

+     }

 

-					if (previousToken == Scanner.TokenNameCOMMENT_LINE && inAssignment) {

-						// PR 1FI5IPO

-						currentLineIndentationLevel++;

-					} else {

-						currentLineIndentationLevel = indentationLevel + indentationOffset;

-					}

+     if (previousToken == Scanner.TokenNameCOMMENT_LINE && inAssignment) {

+      // PR 1FI5IPO

+      currentLineIndentationLevel++;

+     } else {

+      currentLineIndentationLevel = indentationLevel + indentationOffset;

+     }

 

-					pendingSpace = false;

-					indentationOffset = 0;

-				}

-				pendingNewLines = 0;

-				newLinesInWhitespace = 0;

-				specialElse = false;

+     pendingSpace = false;

+     indentationOffset = 0;

+    }

+    pendingNewLines = 0;

+    newLinesInWhitespace = 0;

+    specialElse = false;

 

-				if (nlicsToken == TokenNamedo && token == TokenNamewhile) {

-					nlicsToken = 0;

-				}

-			}

+    if (nlicsToken == TokenNamedo && token == TokenNamewhile) {

+     nlicsToken = 0;

+    }

+   }

 

-			switch (token) {

-				case TokenNameelse :

-				case TokenNamefinally :

-					expectingOpenBrace = true;

-					pendingNewlineAfterParen = true;

-					indentationLevel += pushControlStatement(token);

-					break;

-				case TokenNamecase :

-				case TokenNamedefault :

-					if (tokenBeforeColonCount == tokenBeforeColon.length) {

-						System.arraycopy(

-								tokenBeforeColon, 

-								0, 

-								(tokenBeforeColon = new int[tokenBeforeColonCount * 2]), 

-								0, 

-								tokenBeforeColonCount); 

-					}

-					tokenBeforeColon[tokenBeforeColonCount++] = TokenNamecase;

-					indentationLevel += pushControlStatement(TokenNamecase);

-					break;

-				case TokenNameQUESTION :

-					if (tokenBeforeColonCount == tokenBeforeColon.length) {

-						System.arraycopy(

-								tokenBeforeColon, 

-								0, 

-								(tokenBeforeColon = new int[tokenBeforeColonCount * 2]), 

-								0, 

-								tokenBeforeColonCount); 

-					}

-					tokenBeforeColon[tokenBeforeColonCount++] = token;

-					break;

-				case TokenNameswitch :

-				case TokenNamefor :

-				case TokenNameif :

-				case TokenNamewhile :

-					if (openParenthesisCount == openParenthesis.length) {

-						System.arraycopy(

-								openParenthesis, 

-								0, 

-								(openParenthesis = new int[openParenthesisCount * 2]), 

-								0, 

-								openParenthesisCount); 

-					}

-					openParenthesis[openParenthesisCount++] = 0;

-					expectingOpenBrace = true;

-					

-					indentationLevel += pushControlStatement(token);

-					break;

-				case TokenNametry :

-					pendingNewlineAfterParen = true;

-				case TokenNamecatch :

-					// several CATCH statements can be contiguous.

-					// a CATCH is encountered pop until first CATCH (if a CATCH follows a TRY it works the same way,

-					// as CATCH and TRY are the same token in the stack).

-					expectingOpenBrace = true;

-					indentationLevel += pushControlStatement(TokenNamecatch);

-					break;

+   switch (token) {

+    case TokenNameelse :

+    case TokenNamefinally :

+     expectingOpenBrace = true;

+     pendingNewlineAfterParen = true;

+     indentationLevel += pushControlStatement(token);

+     break;

+    case TokenNamecase :

+    case TokenNamedefault :

+     if (tokenBeforeColonCount == tokenBeforeColon.length) {

+      System.arraycopy(

+        tokenBeforeColon, 

+        0, 

+        (tokenBeforeColon = new int[tokenBeforeColonCount * 2]), 

+        0, 

+        tokenBeforeColonCount); 

+     }

+     tokenBeforeColon[tokenBeforeColonCount++] = TokenNamecase;

+     indentationLevel += pushControlStatement(TokenNamecase);

+     break;

+    case TokenNameQUESTION :

+     if (tokenBeforeColonCount == tokenBeforeColon.length) {

+      System.arraycopy(

+        tokenBeforeColon, 

+        0, 

+        (tokenBeforeColon = new int[tokenBeforeColonCount * 2]), 

+        0, 

+        tokenBeforeColonCount); 

+     }

+     tokenBeforeColon[tokenBeforeColonCount++] = token;

+     break;

+    case TokenNameswitch :

+    case TokenNamefor :

+    case TokenNameif :

+    case TokenNamewhile :

+     if (openParenthesisCount == openParenthesis.length) {

+      System.arraycopy(

+        openParenthesis, 

+        0, 

+        (openParenthesis = new int[openParenthesisCount * 2]), 

+        0, 

+        openParenthesisCount); 

+     }

+     openParenthesis[openParenthesisCount++] = 0;

+     expectingOpenBrace = true;

+     

+     indentationLevel += pushControlStatement(token);

+     break;

+    case TokenNametry :

+     pendingNewlineAfterParen = true;

+    case TokenNamecatch :

+     // several CATCH statements can be contiguous.

+     // a CATCH is encountered pop until first CATCH (if a CATCH follows a TRY it works the same way,

+     // as CATCH and TRY are the same token in the stack).

+     expectingOpenBrace = true;

+     indentationLevel += pushControlStatement(TokenNamecatch);

+     break;

 

-				case TokenNamedo :

-					expectingOpenBrace = true;

-					indentationLevel += pushControlStatement(token);

-					nlicsToken = token;

-					break;

-				case TokenNamenew :

+    case TokenNamedo :

+     expectingOpenBrace = true;

+     indentationLevel += pushControlStatement(token);

+     nlicsToken = token;

+     break;

+    case TokenNamenew :

+     break;

+    case TokenNameLPAREN :

 

-					// The flag inAssigment is used to properly format

-					// array assignments, and if a non-array assignment

-					// statement is in progress, it is no longer

-					// beneficial to know this, so set the flag to false.

+     // Put a space between the previous and current token if the

+     // previous token was not a keyword, open paren, logical

+     // compliment (eg: !), semi-colon, open brace, close brace,

+     // super, or this.

 

-/*                  if (!inArrayAssignment) {

-						inAssignment = false;

-					}*/

-					break;

-				case TokenNameLPAREN :

+     if (previousCompilableToken != TokenNameLBRACKET

+      && previousToken != TokenNameIdentifier

+      && previousToken != 0

+      && previousToken != TokenNameNOT

+      && previousToken != TokenNameLPAREN

+      && previousToken != TokenNameTWIDDLE

+      && previousToken != TokenNameSEMICOLON

+      && previousToken != TokenNameLBRACE

+      && previousToken != TokenNameRBRACE

+      && previousToken != TokenNamesuper

+      && previousToken != TokenNamethis) {

+      space();

+     }

 

-					// Put a space between the previous and current token if the

-					// previous token was not a keyword, open paren, logical

-					// compliment (eg: !), semi-colon, open brace, close brace,

-					// super, or this.

+     // If in a for/if/while statement, increase the parenthesis count

+     // for the current openParenthesisCount

+     // else increase the count for stand alone parenthesis.

+     if (openParenthesisCount > 0)

+      openParenthesis[openParenthesisCount - 1]++;

+     else

+      openParenthesis[0]++;

 

-					if (previousCompilableToken != TokenNameLBRACKET

-						&& previousToken != TokenNameIdentifier

-						&& previousToken != 0

-						&& previousToken != TokenNameNOT

-						&& previousToken != TokenNameLPAREN

-						&& previousToken != TokenNameTWIDDLE

-						&& previousToken != TokenNameSEMICOLON

-						&& previousToken != TokenNameLBRACE

-						&& previousToken != TokenNameRBRACE

-						&& previousToken != TokenNamesuper

-						&& previousToken != TokenNamethis) {

-						space();

-					}

+     pendingSpace = false;

+     break;

+    case TokenNameRPAREN :

 

-					// If in a for/if/while statement, increase the parenthesis count

-					// for the current openParenthesisCount

-					// else increase the count for stand alone parenthesis.

-					if (openParenthesisCount > 0)

-						openParenthesis[openParenthesisCount - 1]++;

-					else

-						openParenthesis[0]++;

+     // Decrease the parenthesis count

+     // if there is no more unclosed parenthesis,

+     // a new line and indent may be append (depending on the next token).

 

-					pendingSpace = false;

-					break;

-				case TokenNameRPAREN :

+     if ((openParenthesisCount > 1)

+      && (openParenthesis[openParenthesisCount - 1] > 0)) {

+      openParenthesis[openParenthesisCount - 1]--;

+      if (openParenthesis[openParenthesisCount - 1] <= 0) {

+       pendingNewlineAfterParen = true;

+       inAssignment = false;

+       openParenthesisCount--;

 

-					// Decrease the parenthesis count

-					// if there is no more unclosed parenthesis,

-					// a new line and indent may be append (depending on the next token).

+      }

+     } else {

+      openParenthesis[0]--;

+     }

 

-					if ((openParenthesisCount > 1)

-						&& (openParenthesis[openParenthesisCount - 1] > 0)) {

-						openParenthesis[openParenthesisCount - 1]--;

-						if (openParenthesis[openParenthesisCount - 1] <= 0) {

-							pendingNewlineAfterParen = true;

-							inAssignment = false;

-							openParenthesisCount--;

-

-						}

-					} else {

-						openParenthesis[0]--;

-					}

-

-					pendingSpace = false;

-					break;

-				case TokenNameLBRACE :

-					if ((previousCompilableToken == TokenNameRBRACKET) || (previousCompilableToken == TokenNameEQUAL)) {

+     pendingSpace = false;

+     break;

+    case TokenNameLBRACE :

+     if ((previousCompilableToken == TokenNameRBRACKET) || (previousCompilableToken == TokenNameEQUAL)) {

 //                  if (previousCompilableToken == TokenNameRBRACKET) {

-						inArrayAssignment = true;

-						inAssignment = false;

-					}

-					if (inArrayAssignment) {

-						indentationLevel += pushBlock();

-					} else {

-						// Add new line and increase indentation level after open brace.

-						pendingNewLines = 1;

-						indentationLevel += pushBlock();

-					}

-					break;

-				case TokenNameRBRACE :

-					if (previousCompilableToken == TokenNameRPAREN) {

-						pendingSpace = false;

-					}

-					if (inArrayAssignment) {

-						inArrayAssignment = false;

-						pendingNewLines = 1;

-						indentationLevel += popInclusiveUntilBlock();

-					} else {

-						pendingNewLines = 1;

-						indentationLevel += popInclusiveUntilBlock();

+      inArrayAssignment = true;

+      inAssignment = false;

+     }

+     if (inArrayAssignment) {

+      indentationLevel += pushBlock();

+     } else {

+      // Add new line and increase indentation level after open brace.

+      pendingNewLines = 1;

+      indentationLevel += pushBlock();

+     }

+     break;

+    case TokenNameRBRACE :

+     if (previousCompilableToken == TokenNameRPAREN) {

+      pendingSpace = false;

+     }

+     if (inArrayAssignment) {

+      inArrayAssignment = false;

+      pendingNewLines = 1;

+      indentationLevel += popInclusiveUntilBlock();

+     } else {

+      pendingNewLines = 1;

+      indentationLevel += popInclusiveUntilBlock();

 

-						if (previousCompilableToken == TokenNameRPAREN){

-							// fix for 1FGDDV6: LFCOM:WIN98 - Weird splitting on message expression

-							currentLineBuffer.append(options.lineSeparatorSequence);

-							increaseLineDelta(options.lineSeparatorSequence.length);                            

-						}

+      if (previousCompilableToken == TokenNameRPAREN){

+       // fix for 1FGDDV6: LFCOM:WIN98 - Weird splitting on message expression

+       currentLineBuffer.append(options.lineSeparatorSequence);

+       increaseLineDelta(options.lineSeparatorSequence.length);                            

+      }

 

-						if (constructionsCount > 0) {

-							switch (constructions[constructionsCount - 1]) {

-								case TokenNamefor :

-									//indentationLevel += popExclusiveUntilBlock();

-									//break;

-								case TokenNameswitch :

-								case TokenNameif :

-								case TokenNameelse :

-								case TokenNametry :

-								case TokenNamecatch :

-								case TokenNamefinally :

-								case TokenNamewhile :

-								case TokenNamedo :

-									clearNonBlockIndents = true;

-								default :

-									break;

-							}

-						}

+      if (constructionsCount > 0) {

+       switch (constructions[constructionsCount - 1]) {

+        case TokenNamefor :

+         //indentationLevel += popExclusiveUntilBlock();

+         //break;

+        case TokenNameswitch :

+        case TokenNameif :

+        case TokenNameelse :

+        case TokenNametry :

+        case TokenNamecatch :

+        case TokenNamefinally :

+        case TokenNamewhile :

+        case TokenNamedo :

+         clearNonBlockIndents = true;

+        default :

+         break;

+       }

+      }

 

-					}

-					break;

-				case TokenNameLBRACKET :

-					openBracketCount++;

-					pendingSpace = false;

-					break;

-				case TokenNameRBRACKET :

-					openBracketCount-=(openBracketCount>0)?1:0;

-					// if there is no left bracket to close, the right bracket is ignored.

-					pendingSpace = false;

-					break;

-				case TokenNameCOMMA :

-				case TokenNameDOT :

-					pendingSpace = false;

-					break;

-				case TokenNameSEMICOLON :

+     }

+     break;

+    case TokenNameLBRACKET :

+     openBracketCount++;

+     pendingSpace = false;

+     break;

+    case TokenNameRBRACKET :

+     openBracketCount-=(openBracketCount>0)?1:0;

+     // if there is no left bracket to close, the right bracket is ignored.

+     pendingSpace = false;

+     break;

+    case TokenNameCOMMA :

+    case TokenNameDOT :

+     pendingSpace = false;

+     break;

+    case TokenNameSEMICOLON :

 

-					// Do not generate line terminators in the definition of

-					// the for statement.

-					// if not in this case, jump a line and reduce indentation after the brace

-					// if the block it closes belongs to a conditional statement (if, while, do...).

+     // Do not generate line terminators in the definition of

+     // the for statement.

+     // if not in this case, jump a line and reduce indentation after the brace

+     // if the block it closes belongs to a conditional statement (if, while, do...).

 

-					if (openParenthesisCount <= 1) {

-						pendingNewLines = 1;

-						if (expectingOpenBrace) {

-							clearNonBlockIndents = true;

-							expectingOpenBrace = false;

-						}

-					}

-					inAssignment = false;

-					pendingSpace = false;

-					break;

-				case TokenNamePLUS_PLUS :

-				case TokenNameMINUS_MINUS :

+     if (openParenthesisCount <= 1) {

+      pendingNewLines = 1;

+      if (expectingOpenBrace) {

+       clearNonBlockIndents = true;

+       expectingOpenBrace = false;

+      }

+     }

+     inAssignment = false;

+     pendingSpace = false;

+     break;

+    case TokenNamePLUS_PLUS :

+    case TokenNameMINUS_MINUS :

 

-					// Do not put a space between a post-increment/decrement

-					// and the identifier being modified.

+     // Do not put a space between a post-increment/decrement

+     // and the identifier being modified.

 

-					if (previousToken == TokenNameIdentifier

-						|| previousToken == TokenNameRBRACKET) {

-						pendingSpace = false;

-					}

-					break;

-				case TokenNamePLUS : // previously ADDITION

-				case TokenNameMINUS :

+     if (previousToken == TokenNameIdentifier

+      || previousToken == TokenNameRBRACKET) {

+      pendingSpace = false;

+     }

+     break;

+    case TokenNamePLUS : // previously ADDITION

+    case TokenNameMINUS :

 

-					// Handle the unary operators plus and minus via a 3-state flag.

+     // Handle the unary operators plus and minus via a flag

 

-					if (!isLiteralToken(previousToken)

-						&& previousToken != TokenNameIdentifier

-						&& previousToken != TokenNameRPAREN

-						&& previousToken != TokenNameRBRACKET) {

-						unarySignModifier = 2;

-					}

-					break;

-				case TokenNameCOLON :

+     if (!isLiteralToken(previousToken)

+      && previousToken != TokenNameIdentifier

+      && previousToken != TokenNameRPAREN

+      && previousToken != TokenNameRBRACKET) {

+      unarySignModifier = 1;

+     }

+     break;

+    case TokenNameCOLON :

+     // In a switch/case statement, add a newline & indent

+     // when a colon is encountered.

+     if (tokenBeforeColonCount > 0) {

+      if (tokenBeforeColon[tokenBeforeColonCount - 1] == TokenNamecase) {

+       pendingNewLines = 1;

+      }

+      tokenBeforeColonCount--;

+     }

+     break;

+    case TokenNameEQUAL :

+     inAssignment = true;

+     break;

+    case Scanner.TokenNameCOMMENT_LINE :

+     pendingNewLines = 1;

+     if (inAssignment) {

+      currentLineIndentationLevel++;

+     }

+     break; // a line is always inserted after a one-line comment

+    case Scanner.TokenNameCOMMENT_JAVADOC :

+    case Scanner.TokenNameCOMMENT_BLOCK :

+     currentCommentOffset = getCurrentCommentOffset();

+     if (openParenthesis[0]==0 && openBracketCount < 1){

+      pendingNewLines = 1;

+      // a new line is inserted only if the comment is not between parenthesis.

+     }

+     break;

+    case Scanner.TokenNameWHITESPACE :

 

-					// In a switch/case statement, add a newline & indent

-					// when a colon is encountered.

-					if (tokenBeforeColonCount > 0) {

-						if (tokenBeforeColon[tokenBeforeColonCount - 1] == TokenNamecase) {

-							pendingNewLines = 1;

-						}

-						tokenBeforeColonCount--;

-					}

-					break;

-				case TokenNameEQUAL :

-					inAssignment = true;

-					break;

-				case Scanner.TokenNameCOMMENT_LINE :

-					pendingNewLines = 1;

-					if (inAssignment) {

-						currentLineIndentationLevel++;

-					}

-					break; // a line is always inserted after a one-line comment

-				case Scanner.TokenNameCOMMENT_JAVADOC :

-				case Scanner.TokenNameCOMMENT_BLOCK :

-					currentCommentOffset = getCurrentCommentOffset();

-					if (openParenthesis[0]==0 && openBracketCount < 1){

-						pendingNewLines = 1;

-						// a new line is inserted only if the comment is not between parenthesis.

-					}

-					break;

-				case Scanner.TokenNameWHITESPACE :

+     // Count the number of line terminators in the whitespace so

+     // line spacing can be preserved near comments.

 

-					// Count the number of line terminators in the whitespace so

-					// line spacing can be preserved near comments.

+     char[] source = scanner.source;

+     newLinesInWhitespace = 0;

+     for (

+      int i = scanner.startPosition, max = scanner.currentPosition; 

+      i < max; 

+      i++) {

+      if (source[i] == '\n') {

+       newLinesInWhitespace++;

+      }

+     }

+     increaseLineDelta(scanner.startPosition - scanner.currentPosition);

+     break;

+    default :

+     if ((token == TokenNameIdentifier)

+      || isLiteralToken(token)

+      || token == TokenNamesuper

+      || token == TokenNamethis) {

 

-					char[] source = scanner.source;

-					newLinesInWhitespace = 0;

-					for (

-						int i = scanner.startPosition, max = scanner.currentPosition; 

-						i < max; 

-						i++) {

-						if (source[i] == '\n') {

-							newLinesInWhitespace++;

-						}

-					}

-					increaseLineDelta(scanner.startPosition - scanner.currentPosition);

-					break;

-				default :

-					if ((token == TokenNameIdentifier)

-						|| isLiteralToken(token)

-						|| token == TokenNamesuper

-						|| token == TokenNamethis) {

+      // Do not put a space between a unary operator

+      // (eg: ++, --, +, -) and the identifier being modified.

+      if (previousToken == TokenNamePLUS_PLUS

+       || previousToken == TokenNameMINUS_MINUS

+       || (previousToken == TokenNamePLUS && unarySignModifier > 0)

+       || (previousToken == TokenNameMINUS && unarySignModifier > 0)) {

+       pendingSpace = false;

+      }

+      unarySignModifier = 0;

+     }

+     break;

+   }

 

-						// Do not put a space between a unary operator

-						// (eg: ++, --, +, -) and the identifier being modified.

+   // Do not output whitespace tokens.

 

-						unarySignModifier -= (unarySignModifier > 0) ? 1 : 0;

-						if (previousToken == TokenNamePLUS_PLUS

-							|| previousToken == TokenNameMINUS_MINUS

-							|| (unarySignModifier > 0)) {

-							pendingSpace = false;

-						}

-					}

-					break;

-			}

+   if (token != Scanner.TokenNameWHITESPACE) {

 

-			// Do not output whitespace tokens.

+    /* Add pending space to the formatted source string.

+    Do not output a space under the following circumstances:

+    1) this is the first pass

+    2) previous token is an open paren

+    3) previous token is a period

+    4) previous token is the logical compliment (eg: !)

+    5) previous token is the bitwise compliment (eg: ~)

+    6) previous token is the open bracket (eg: [)

+    7) in an assignment statement, if the previous token is an 

+    open brace or the current token is a close brace

+    8) previous token is a single line comment

+    */

 

-			if (token != Scanner.TokenNameWHITESPACE) {

+    boolean openAndCloseBrace = previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE;

 

-				/* Add pending space to the formatted source string.

-				Do not output a space under the following circumstances:

-				1) this is the first pass

-				2) previous token is an open paren

-				3) previous token is a period

-				4) previous token is the logical compliment (eg: !)

-				5) previous token is the bitwise compliment (eg: ~)

-				6) previous token is the open bracket (eg: [)

-				7) in an assignment statement, if the previous token is an 

-				open brace or the current token is a close brace

-				8) previous token is a single line comment

-				*/

+    // to be replaced by a nicer condition.

+   

+    if (pendingSpace

+     && insertSpaceAfter(previousToken)

+     && ! (inAssignment

+      && (previousToken == TokenNameLBRACE || token == TokenNameRBRACE))

+     && previousToken != Scanner.TokenNameCOMMENT_LINE) {

+     if ((! (options.compactAssignmentMode && token == TokenNameEQUAL)) && !openAndCloseBrace)

+      space();

+    }

 

-				boolean openAndCloseBrace = previousCompilableToken == TokenNameLBRACE && token == TokenNameRBRACE;

+    // Add the next token to the formatted source string.

 

-				// to be replaced by a nicer condition.

-			

-				if (pendingSpace

-					&& insertSpaceAfter(previousToken)

-					&& ! (inAssignment

-						&& (previousToken == TokenNameLBRACE || token == TokenNameRBRACE))

-					&& previousToken != Scanner.TokenNameCOMMENT_LINE) {

-					if ((! (options.compactAssignmentMode && token == TokenNameEQUAL)) && !openAndCloseBrace)

-						space();

-				}

+    outputCurrentToken(token);

+    if (token == Scanner.TokenNameCOMMENT_LINE && openParenthesisCount > 1){

+     pendingNewLines = 0;

+     currentLineBuffer.append(options.lineSeparatorSequence);

+     increaseLineDelta(options.lineSeparatorSequence.length);                    

+    }

+    pendingSpace = true;

+   }

 

-				// Add the next token to the formatted source string.

+   // Whitespace tokens do not need to be remembered.

 

-				outputCurrentToken(token);

-				if (token == Scanner.TokenNameCOMMENT_LINE && openParenthesisCount > 1){

-					pendingNewLines = 0;

-					currentLineBuffer.append(options.lineSeparatorSequence);

-					increaseLineDelta(options.lineSeparatorSequence.length);                    

-				}

-				pendingSpace = true;

-			}

+   if (token != Scanner.TokenNameWHITESPACE) {

+    previousToken = token;

+    if (token != Scanner.TokenNameCOMMENT_BLOCK

+     && token != Scanner.TokenNameCOMMENT_LINE

+     && token != Scanner.TokenNameCOMMENT_JAVADOC) {

+     previousCompilableToken = token;

+    }

+   }

 

-			// Whitespace tokens do not need to be remembered.

-

-			if (token != Scanner.TokenNameWHITESPACE) {

-				previousToken = token;

-				if (token != Scanner.TokenNameCOMMENT_BLOCK

-					&& token != Scanner.TokenNameCOMMENT_LINE

-					&& token != Scanner.TokenNameCOMMENT_JAVADOC) {

-					previousCompilableToken = token;

-				}

-			}

-

-		}

-		output(copyRemainingSource());

-		flushBuffer(); // dump the last token of the source in the formatted output.

-	} catch (InvalidInputException e) {

-		output(copyRemainingSource());

-		flushBuffer(); // dump the last token of the source in the formatted output.

-	}

+  }

+  output(copyRemainingSource());

+  flushBuffer(); // dump the last token of the source in the formatted output.

+ } catch (InvalidInputException e) {

+  output(copyRemainingSource());

+  flushBuffer(); // dump the last token of the source in the formatted output.

+ }

 }

 /** 

  * Formats a given source string, starting indenting it at depth 0

  * using default options.

  */

 public static String format(String sourceString) {

-	return format(sourceString, 0, null);

+ return format(sourceString, 0, null);

 }

 /** 

  * Formats a given source string, starting indenting it at a particular 

  * depth and using the given options

  */

 public static String format(String sourceString, int initialIndentationLevel, ConfigurableOption[] options) {

-	CodeFormatter formatter = new CodeFormatter(options);

-	formatter.setInitialIndentationLevel(initialIndentationLevel);

-	return formatter.formatSourceString(sourceString);

+ CodeFormatter formatter = new CodeFormatter(options);

+ formatter.setInitialIndentationLevel(initialIndentationLevel);

+ return formatter.formatSourceString(sourceString);

 }

 /** 

  * Formats the char array <code>sourceString</code>,

@@ -891,58 +902,66 @@
  * @return the formatted ouput.

  */

 public String formatSourceString(String sourceString) {

-	char[] sourceChars = sourceString.toCharArray();

-	formattedSource = new StringBuffer(sourceChars.length);

-	scanner.setSourceBuffer(sourceChars);

-	format();

-	return formattedSource.toString();

+ char[] sourceChars = sourceString.toCharArray();

+ formattedSource = new StringBuffer(sourceChars.length);

+ scanner.setSourceBuffer(sourceChars);

+ format();

+ return formattedSource.toString();

 }

 /**

  * Returns the number of characters and tab char between the beginning of the line

  * and the beginning of the comment.

  */

 private int getCurrentCommentOffset() {

-	int linePtr = scanner.linePtr;

-	// if there is no beginning of line, return 0.

-	if (linePtr < 0)

-		return 0;

-	int offset = 0;

-	int beginningOfLine = scanner.lineEnds[linePtr];

-	int currentStartPosition = scanner.startPosition;

-	char[] source = scanner.source;

-	

-	// find the position of the beginning of the line containing the comment

-	while (beginningOfLine > currentStartPosition) {

-		if (linePtr > 0) {

-			beginningOfLine = scanner.lineEnds[--linePtr];

-		} else {

-			beginningOfLine = 0;

-			break;

-		}

-	}

+ int linePtr = scanner.linePtr;

+ // if there is no beginning of line, return 0.

+ if (linePtr < 0)

+  return 0;

+ int offset = 0;

+ int beginningOfLine = scanner.lineEnds[linePtr];

+ int currentStartPosition = scanner.startPosition;

+ char[] source = scanner.source;

+ 

+ // find the position of the beginning of the line containing the comment

+ while (beginningOfLine > currentStartPosition) {

+  if (linePtr > 0) {

+   beginningOfLine = scanner.lineEnds[--linePtr];

+  } else {

+   beginningOfLine = 0;

+   break;

+  }

+ }

 

-	for (int i = beginningOfLine ; i < currentStartPosition ; i++){

-		char currentCharacter = source[i];

-		switch(currentCharacter){

-			case '\t':

-				offset += options.tabSize;

-			case '\n':

-			case '\r':

-				break;

-			default:

-				offset++;

-		}

-	}

-	

-	return offset;

+ for (int i = beginningOfLine ; i < currentStartPosition ; i++){

+  char currentCharacter = source[i];

+  switch(currentCharacter){

+   case '\t':

+    offset += options.tabSize;

+   case '\n':

+   case '\r':

+    break;

+   default:

+    offset++;

+  }

+ }

+ 

+ return offset;

 }

 /**

- * Returns an array of descriptions for the configurable options.

- * The descriptions may be changed and passed back to a different

- * compiler.

+ * Returns all the options of the Code Formatter to be shown by the UI

+ *

+ * @param locale java.util.Locale

+ * @return org.eclipse.jdt.internal.compiler.java.ConfigurableOption[]

  */

 public static ConfigurableOption[] getDefaultOptions(Locale locale) {

-	return new FormatterOptions().getConfigurableOptions(locale);

+ String[] ids = ConfigurableOption.getIDs(CodeFormatter.class.getName(),locale);

+ 

+ ConfigurableOption[] result = new ConfigurableOption[ids.length];

+ for(int i = 0 ; i < ids.length ; i++){

+  result[i] = new ConfigurableOption(ids[i],locale);

+ }

+ 

+ return result;

 }

 /**

  * Returns the array of mapped positions.

@@ -950,7 +969,7 @@
  * @return int[]

  */

 public int[] getMappedPositions() {

-	return mappedPositions;

+ return mappedPositions;

 }

 /**

  * Returns the priority of the token given as argument<br>

@@ -959,104 +978,104 @@
  * @param token the token of which the priority is requested

  */

 private static int getTokenPriority(int token) {

-	switch (token) {

-		case TokenNameextends:

-		case TokenNameimplements:

-		case TokenNamethrows:

-			return 10;

-		case TokenNameSEMICOLON : // ;

-			return 20; 

-		case TokenNameCOMMA : // ,

-			return 25;

-		case TokenNameEQUAL : // =

-			return 30; 

-		case TokenNameAND_AND : // && 

-		case TokenNameOR_OR : // || 

-			return 40;

-		case TokenNameQUESTION : // ? 

-		case TokenNameCOLON : // :

-			return 50; // it's better cutting on ?: than on ;

-		case TokenNameEQUAL_EQUAL : // == 

-		case TokenNameNOT_EQUAL : // != 

-			return 60;

-		case TokenNameLESS : // < 

-		case TokenNameLESS_EQUAL : // <= 

-		case TokenNameGREATER : // > 

-		case TokenNameGREATER_EQUAL : // >= 

-		case TokenNameinstanceof : // instanceof

-			return 70;

-		case TokenNamePLUS : // + 

-		case TokenNameMINUS : // - 

-			return 80;

-		case TokenNameMULTIPLY : // * 

-		case TokenNameDIVIDE : // / 

-		case TokenNameREMAINDER : // % 

-			return 90;

-		case TokenNameLEFT_SHIFT : // << 

-		case TokenNameRIGHT_SHIFT : // >> 

-		case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> 

-			return 100;

-		case TokenNameAND : // &

-		case TokenNameOR : // | 

-		case TokenNameXOR : // ^ 

-			return 110;

-		case TokenNameMULTIPLY_EQUAL : // *= 

-		case TokenNameDIVIDE_EQUAL : // /= 

-		case TokenNameREMAINDER_EQUAL : // %= 

-		case TokenNamePLUS_EQUAL : // += 

-		case TokenNameMINUS_EQUAL : // -= 

-		case TokenNameLEFT_SHIFT_EQUAL : // <<= 

-		case TokenNameRIGHT_SHIFT_EQUAL : // >>= 

-		case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>=

-		case TokenNameAND_EQUAL : // &= 

-		case TokenNameXOR_EQUAL : // ^= 

-		case TokenNameOR_EQUAL : // |= 

-			return 120;

-		case TokenNameDOT : // .

-			return 130;

-		default :

-			return Integer.MAX_VALUE;

-	}

+ switch (token) {

+  case TokenNameextends:

+  case TokenNameimplements:

+  case TokenNamethrows:

+   return 10;

+  case TokenNameSEMICOLON : // ;

+   return 20; 

+  case TokenNameCOMMA : // ,

+   return 25;

+  case TokenNameEQUAL : // =

+   return 30; 

+  case TokenNameAND_AND : // && 

+  case TokenNameOR_OR : // || 

+   return 40;

+  case TokenNameQUESTION : // ? 

+  case TokenNameCOLON : // :

+   return 50; // it's better cutting on ?: than on ;

+  case TokenNameEQUAL_EQUAL : // == 

+  case TokenNameNOT_EQUAL : // != 

+   return 60;

+  case TokenNameLESS : // < 

+  case TokenNameLESS_EQUAL : // <= 

+  case TokenNameGREATER : // > 

+  case TokenNameGREATER_EQUAL : // >= 

+  case TokenNameinstanceof : // instanceof

+   return 70;

+  case TokenNamePLUS : // + 

+  case TokenNameMINUS : // - 

+   return 80;

+  case TokenNameMULTIPLY : // * 

+  case TokenNameDIVIDE : // / 

+  case TokenNameREMAINDER : // % 

+   return 90;

+  case TokenNameLEFT_SHIFT : // << 

+  case TokenNameRIGHT_SHIFT : // >> 

+  case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> 

+   return 100;

+  case TokenNameAND : // &

+  case TokenNameOR : // | 

+  case TokenNameXOR : // ^ 

+   return 110;

+  case TokenNameMULTIPLY_EQUAL : // *= 

+  case TokenNameDIVIDE_EQUAL : // /= 

+  case TokenNameREMAINDER_EQUAL : // %= 

+  case TokenNamePLUS_EQUAL : // += 

+  case TokenNameMINUS_EQUAL : // -= 

+  case TokenNameLEFT_SHIFT_EQUAL : // <<= 

+  case TokenNameRIGHT_SHIFT_EQUAL : // >>= 

+  case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>=

+  case TokenNameAND_EQUAL : // &= 

+  case TokenNameXOR_EQUAL : // ^= 

+  case TokenNameOR_EQUAL : // |= 

+   return 120;

+  case TokenNameDOT : // .

+   return 130;

+  default :

+   return Integer.MAX_VALUE;

+ }

 }

 /**

  * Handles the exception raised when an invalid token is encountered.

  * Returns true if the exception has been handled, false otherwise.

  */

 private boolean handleInvalidToken(Exception e) {

-	if (e.getMessage().equals(Scanner.INVALID_CHARACTER_CONSTANT)

-		|| e.getMessage().equals(Scanner.INVALID_CHAR_IN_STRING)

-		|| e.getMessage().equals(Scanner.INVALID_ESCAPE)) {

-		return true;

-	}

-		return false;

+ if (e.getMessage().equals(Scanner.INVALID_CHARACTER_CONSTANT)

+  || e.getMessage().equals(Scanner.INVALID_CHAR_IN_STRING)

+  || e.getMessage().equals(Scanner.INVALID_ESCAPE)) {

+  return true;

+ }

+  return false;

 }

 private final void increaseGlobalDelta(int offset) {

-	globalDelta += offset;

+ globalDelta += offset;

 }

 private final void increaseLineDelta(int offset) {

-	lineDelta += offset;

+ lineDelta += offset;

 }

 private final void increaseSplitDelta(int offset) {

-	splitDelta += offset;

+ splitDelta += offset;

 }

 /**

  * Returns true if a space has to be inserted after <code>operator</code>

  * false otherwise.

  */

 private boolean insertSpaceAfter(int token) {

-	switch (token){

-		case TokenNameLPAREN:

-		case TokenNameNOT:

-		case TokenNameTWIDDLE:

-		case TokenNameDOT :

-		case 0: // no token

-		case TokenNameLBRACKET:

-		case Scanner.TokenNameCOMMENT_LINE:

-			return false;

-		default:

-			return true;

-	}

-		

+ switch (token){

+  case TokenNameLPAREN:

+  case TokenNameNOT:

+  case TokenNameTWIDDLE:

+  case TokenNameDOT :

+  case 0: // no token

+  case TokenNameLBRACKET:

+  case Scanner.TokenNameCOMMENT_LINE:

+   return false;

+  default:

+   return true;

+ }

+  

 }

 /**

  * Returns true if a space has to be inserted before <code>operator</code>

@@ -1065,29 +1084,29 @@
  * (to know if the compact assignment mode is on).

  */

 private boolean insertSpaceBefore(int token) {

-	switch (token) {

-		case TokenNameEQUAL:

-			return (!options.compactAssignmentMode);

-		default :

-			return false;

-	}

+ switch (token) {

+  case TokenNameEQUAL:

+   return (!options.compactAssignmentMode);

+  default :

+   return false;

+ }

 }

 private static boolean isComment(int token) {

-	boolean result =

-	token == Scanner.TokenNameCOMMENT_BLOCK ||

-	token == Scanner.TokenNameCOMMENT_LINE ||

-	token == Scanner.TokenNameCOMMENT_JAVADOC;

-	return result;

+ boolean result =

+ token == Scanner.TokenNameCOMMENT_BLOCK ||

+ token == Scanner.TokenNameCOMMENT_LINE ||

+ token == Scanner.TokenNameCOMMENT_JAVADOC;

+ return result;

 }

 private static boolean isLiteralToken(int token) {

-	boolean result =

-		  token == TokenNameIntegerLiteral ||

-		  token == TokenNameLongLiteral ||

-		  token == TokenNameFloatingPointLiteral ||

-		  token == TokenNameDoubleLiteral ||

-		  token == TokenNameCharacterLiteral ||

-		  token == TokenNameStringLiteral;

-	return result;

+ boolean result =

+    token == TokenNameIntegerLiteral ||

+    token == TokenNameLongLiteral ||

+    token == TokenNameFloatingPointLiteral ||

+    token == TokenNameDoubleLiteral ||

+    token == TokenNameCharacterLiteral ||

+    token == TokenNameStringLiteral;

+ return result;

 }

 /**

  * If the length of <code>oneLineBuffer</code> exceeds <code>maxLineLength</code>,

@@ -1096,241 +1115,241 @@
  */

 private void newLine(int newLineCount) {

 

-	// format current line

-	splitDelta = 0;

-	beginningOfLineIndex = formattedSource.length();

-	String currentLine = currentLineBuffer.toString();

-	if (containsOpenCloseBraces) {

-		containsOpenCloseBraces = false;

-		outputLine(currentLine,

-			false,

-			indentationLevelForOpenCloseBraces,

-			0,

-			-1,

-			null,

-			0);

-		indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

-	} else {

-		outputLine(currentLine,

-			false,

-			currentLineIndentationLevel,

-			0,

-			-1,

-			null,

-			0);

-	}

-	// dump line break(s)

-	for (int i = 0; i < newLineCount; i++) {

-		formattedSource.append(options.lineSeparatorSequence);

-		increaseSplitDelta(options.lineSeparatorSequence.length);

-	}

-	// reset formatter for next line

-	int currentLength = currentLine.length();

-	currentLineBuffer = new StringBuffer(

-							currentLength > maxLineSize

-								? maxLineSize = currentLength

-								: maxLineSize);

-	

-	increaseGlobalDelta(splitDelta);

-	increaseGlobalDelta(lineDelta);

-	lineDelta = 0;

-	currentLineIndentationLevel = initialIndentationLevel;

+ // format current line

+ splitDelta = 0;

+ beginningOfLineIndex = formattedSource.length();

+ String currentLine = currentLineBuffer.toString();

+ if (containsOpenCloseBraces) {

+  containsOpenCloseBraces = false;

+  outputLine(currentLine,

+   false,

+   indentationLevelForOpenCloseBraces,

+   0,

+   -1,

+   null,

+   0);

+  indentationLevelForOpenCloseBraces = currentLineIndentationLevel;

+ } else {

+  outputLine(currentLine,

+   false,

+   currentLineIndentationLevel,

+   0,

+   -1,

+   null,

+   0);

+ }

+ // dump line break(s)

+ for (int i = 0; i < newLineCount; i++) {

+  formattedSource.append(options.lineSeparatorSequence);

+  increaseSplitDelta(options.lineSeparatorSequence.length);

+ }

+ // reset formatter for next line

+ int currentLength = currentLine.length();

+ currentLineBuffer = new StringBuffer(

+       currentLength > maxLineSize

+        ? maxLineSize = currentLength

+        : maxLineSize);

+ 

+ increaseGlobalDelta(splitDelta);

+ increaseGlobalDelta(lineDelta);

+ lineDelta = 0;

+ currentLineIndentationLevel = initialIndentationLevel;

 }

 private String operatorString(int operator) {

-	switch (operator) {

-		case TokenNameextends :

-			return "extends"/*nonNLS*/;

+ switch (operator) {

+  case TokenNameextends :

+   return "extends"; //$NON-NLS-1$

 

-		case TokenNameimplements :

-			return "implements"/*nonNLS*/;

+  case TokenNameimplements :

+   return "implements"; //$NON-NLS-1$

 

-		case TokenNamethrows :

-			return "throws"/*nonNLS*/;

+  case TokenNamethrows :

+   return "throws"; //$NON-NLS-1$

 

-		case TokenNameSEMICOLON : // ;

-			return ";"/*nonNLS*/;

+  case TokenNameSEMICOLON : // ;

+   return ";"; //$NON-NLS-1$

 

-		case TokenNameCOMMA : // ,

-			return ","/*nonNLS*/;

+  case TokenNameCOMMA : // ,

+   return ","; //$NON-NLS-1$

 

-		case TokenNameEQUAL : // =

-			return "="/*nonNLS*/;

+  case TokenNameEQUAL : // =

+   return "="; //$NON-NLS-1$

 

-		case TokenNameAND_AND : // && (15.22)

-			return "&&"/*nonNLS*/;

+  case TokenNameAND_AND : // && (15.22)

+   return "&&"; //$NON-NLS-1$

 

-		case TokenNameOR_OR : // || (15.23)

-			return "||"/*nonNLS*/;

+  case TokenNameOR_OR : // || (15.23)

+   return "||"; //$NON-NLS-1$

 

-		case TokenNameQUESTION : // ? (15.24)

-			return "?"/*nonNLS*/;

+  case TokenNameQUESTION : // ? (15.24)

+   return "?"; //$NON-NLS-1$

 

-		case TokenNameCOLON : // : (15.24)

-			return ":"/*nonNLS*/;

+  case TokenNameCOLON : // : (15.24)

+   return ":"; //$NON-NLS-1$

 

-		case TokenNameEQUAL_EQUAL : // == (15.20, 15.20.1, 15.20.2, 15.20.3)

-			return "=="/*nonNLS*/;

+  case TokenNameEQUAL_EQUAL : // == (15.20, 15.20.1, 15.20.2, 15.20.3)

+   return "=="; //$NON-NLS-1$

 

-		case TokenNameNOT_EQUAL : // != (15.20, 15.20.1, 15.20.2, 15.20.3)

-			return "!="/*nonNLS*/;

+  case TokenNameNOT_EQUAL : // != (15.20, 15.20.1, 15.20.2, 15.20.3)

+   return "!="; //$NON-NLS-1$

 

-		case TokenNameLESS : // < (15.19.1)

-			return "<"/*nonNLS*/;

+  case TokenNameLESS : // < (15.19.1)

+   return "<"; //$NON-NLS-1$

 

-		case TokenNameLESS_EQUAL : // <= (15.19.1)

-			return "<="/*nonNLS*/;

+  case TokenNameLESS_EQUAL : // <= (15.19.1)

+   return "<="; //$NON-NLS-1$

 

-		case TokenNameGREATER : // > (15.19.1)

-			return ">"/*nonNLS*/;

+  case TokenNameGREATER : // > (15.19.1)

+   return ">"; //$NON-NLS-1$

 

-		case TokenNameGREATER_EQUAL : // >= (15.19.1)

-			return ">="/*nonNLS*/;

+  case TokenNameGREATER_EQUAL : // >= (15.19.1)

+   return ">="; //$NON-NLS-1$

 

-		case TokenNameinstanceof : // instanceof

-			return "instanceof"/*nonNLS*/;

+  case TokenNameinstanceof : // instanceof

+   return "instanceof"; //$NON-NLS-1$

 

-		case TokenNamePLUS : // + (15.17, 15.17.2)

-			return "+"/*nonNLS*/;

+  case TokenNamePLUS : // + (15.17, 15.17.2)

+   return "+"; //$NON-NLS-1$

 

-		case TokenNameMINUS : // - (15.17.2)

-			return "-"/*nonNLS*/;

+  case TokenNameMINUS : // - (15.17.2)

+   return "-"; //$NON-NLS-1$

 

-		case TokenNameMULTIPLY : // * (15.16.1)

-			return "*"/*nonNLS*/;

+  case TokenNameMULTIPLY : // * (15.16.1)

+   return "*"; //$NON-NLS-1$

 

-		case TokenNameDIVIDE : // / (15.16.2)

-			return "/"/*nonNLS*/;

+  case TokenNameDIVIDE : // / (15.16.2)

+   return "/"; //$NON-NLS-1$

 

-		case TokenNameREMAINDER : // % (15.16.3)

-			return "%"/*nonNLS*/;

+  case TokenNameREMAINDER : // % (15.16.3)

+   return "%"; //$NON-NLS-1$

 

-		case TokenNameLEFT_SHIFT : // << (15.18)

-			return "<<"/*nonNLS*/;

+  case TokenNameLEFT_SHIFT : // << (15.18)

+   return "<<"; //$NON-NLS-1$

 

-		case TokenNameRIGHT_SHIFT : // >> (15.18)

-			return ">>"/*nonNLS*/;

+  case TokenNameRIGHT_SHIFT : // >> (15.18)

+   return ">>"; //$NON-NLS-1$

 

-		case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> (15.18)

-			return ">>>"/*nonNLS*/;

+  case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> (15.18)

+   return ">>>"; //$NON-NLS-1$

 

-		case TokenNameAND : // & (15.21, 15.21.1, 15.21.2)

-			return "&"/*nonNLS*/;

+  case TokenNameAND : // & (15.21, 15.21.1, 15.21.2)

+   return "&"; //$NON-NLS-1$

 

-		case TokenNameOR : // | (15.21, 15.21.1, 15.21.2)

-			return "|"/*nonNLS*/;

+  case TokenNameOR : // | (15.21, 15.21.1, 15.21.2)

+   return "|"; //$NON-NLS-1$

 

-		case TokenNameXOR : // ^ (15.21, 15.21.1, 15.21.2)

-			return "^"/*nonNLS*/;

+  case TokenNameXOR : // ^ (15.21, 15.21.1, 15.21.2)

+   return "^"; //$NON-NLS-1$

 

-		case TokenNameMULTIPLY_EQUAL : // *= (15.25.2)

-			return "*="/*nonNLS*/;

+  case TokenNameMULTIPLY_EQUAL : // *= (15.25.2)

+   return "*="; //$NON-NLS-1$

 

-		case TokenNameDIVIDE_EQUAL : // /= (15.25.2)

-			return "/="/*nonNLS*/;

+  case TokenNameDIVIDE_EQUAL : // /= (15.25.2)

+   return "/="; //$NON-NLS-1$

 

-		case TokenNameREMAINDER_EQUAL : // %= (15.25.2)

-			return "%="/*nonNLS*/;

+  case TokenNameREMAINDER_EQUAL : // %= (15.25.2)

+   return "%="; //$NON-NLS-1$

 

-		case TokenNamePLUS_EQUAL : // += (15.25.2)

-			return "+="/*nonNLS*/;

+  case TokenNamePLUS_EQUAL : // += (15.25.2)

+   return "+="; //$NON-NLS-1$

 

-		case TokenNameMINUS_EQUAL : // -= (15.25.2)

-			return "-="/*nonNLS*/;

+  case TokenNameMINUS_EQUAL : // -= (15.25.2)

+   return "-="; //$NON-NLS-1$

 

-		case TokenNameLEFT_SHIFT_EQUAL : // <<= (15.25.2)

-			return "<<="/*nonNLS*/;

+  case TokenNameLEFT_SHIFT_EQUAL : // <<= (15.25.2)

+   return "<<="; //$NON-NLS-1$

 

-		case TokenNameRIGHT_SHIFT_EQUAL : // >>= (15.25.2)

-			return ">>="/*nonNLS*/;

+  case TokenNameRIGHT_SHIFT_EQUAL : // >>= (15.25.2)

+   return ">>="; //$NON-NLS-1$

 

-		case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= (15.25.2)

-			return ">>>="/*nonNLS*/;

+  case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= (15.25.2)

+   return ">>>="; //$NON-NLS-1$

 

-		case TokenNameAND_EQUAL : // &= (15.25.2)

-			return "&="/*nonNLS*/;

+  case TokenNameAND_EQUAL : // &= (15.25.2)

+   return "&="; //$NON-NLS-1$

 

-		case TokenNameXOR_EQUAL : // ^= (15.25.2)

-			return "^="/*nonNLS*/;

+  case TokenNameXOR_EQUAL : // ^= (15.25.2)

+   return "^="; //$NON-NLS-1$

 

-		case TokenNameOR_EQUAL : // |= (15.25.2)

-			return "|="/*nonNLS*/;

+  case TokenNameOR_EQUAL : // |= (15.25.2)

+   return "|="; //$NON-NLS-1$

 

-		case TokenNameDOT : // .

-			return "."/*nonNLS*/;

+  case TokenNameDOT : // .

+   return "."; //$NON-NLS-1$

 

-		default :

-			return ""/*nonNLS*/;

-	}

+  default :

+   return ""; //$NON-NLS-1$

+ }

 }

 /** 

  * Appends <code>stringToOutput</code> to the formatted output.<br>

  * If it contains \n, append a LINE_SEPARATOR and indent after it.

  */

 private void output(String stringToOutput) {

-	char currentCharacter;

-	for (int i = 0, max = stringToOutput.length(); i < max; i++) {

-		currentCharacter = stringToOutput.charAt(i);

-		if (currentCharacter != '\t') {

-			currentLineBuffer.append(currentCharacter);

-		}

-	}

-	updateMappedPositions(scanner.startPosition);

+ char currentCharacter;

+ for (int i = 0, max = stringToOutput.length(); i < max; i++) {

+  currentCharacter = stringToOutput.charAt(i);

+  if (currentCharacter != '\t') {

+   currentLineBuffer.append(currentCharacter);

+  }

+ }

+ updateMappedPositions(scanner.startPosition);

 }

 /** 

  * Appends <code>token</code> to the formatted output.<br>

  * If it contains <code>\n</code>, append a LINE_SEPARATOR and indent after it.

  */

 private void outputCurrentToken(int token) {

-	char[] source = scanner.source;

-	int startPosition = scanner.startPosition;

+ char[] source = scanner.source;

+ int startPosition = scanner.startPosition;

 

-	switch(token) {

-		case Scanner.TokenNameCOMMENT_JAVADOC :

-		case Scanner.TokenNameCOMMENT_BLOCK :

-		case Scanner.TokenNameCOMMENT_LINE :

-			boolean endOfLine = false;

-			int currentCommentOffset = getCurrentCommentOffset();

-			int beginningOfLineSpaces = 0;

-			for (int i = startPosition, max = scanner.currentPosition; i < max; i++) {

-				char currentCharacter = source[i];

-				switch(currentCharacter) {

-					case '\r' :

-					case '\n' :

-						 endOfLine = true;

-						 currentLineBuffer.append(currentCharacter);

-						 beginningOfLineSpaces = 0;

-						 break;

-					case '\t' :

-						if (endOfLine) {

-							// we remove a maximum of currentCommentOffset characters (tabs are converted to space numbers).

-							beginningOfLineSpaces+=options.tabSize;

-							if (beginningOfLineSpaces > currentCommentOffset)

-								currentLineBuffer.append(currentCharacter);						

-						} else {

-							currentLineBuffer.append(currentCharacter);

-						}

-						break;

-					case ' ' :

-						if (endOfLine) {

-							// we remove a maximum of currentCommentOffset characters (tabs are converted to space numbers).

-							beginningOfLineSpaces++;

-							if (beginningOfLineSpaces > currentCommentOffset)

-								currentLineBuffer.append(currentCharacter);						

-						} else {

-							currentLineBuffer.append(currentCharacter);

-						}

-						break;

-					default:

-						beginningOfLineSpaces = 0;

-						currentLineBuffer.append(currentCharacter);

-						endOfLine = false;

-				}

-			}

-			break;

-		default:

-			currentLineBuffer.append(source, startPosition, scanner.currentPosition - startPosition);

-	}

-	updateMappedPositions(startPosition);

+ switch(token) {

+  case Scanner.TokenNameCOMMENT_JAVADOC :

+  case Scanner.TokenNameCOMMENT_BLOCK :

+  case Scanner.TokenNameCOMMENT_LINE :

+   boolean endOfLine = false;

+   int currentCommentOffset = getCurrentCommentOffset();

+   int beginningOfLineSpaces = 0;

+   for (int i = startPosition, max = scanner.currentPosition; i < max; i++) {

+    char currentCharacter = source[i];

+    switch(currentCharacter) {

+     case '\r' :

+     case '\n' :

+       endOfLine = true;

+       currentLineBuffer.append(currentCharacter);

+       beginningOfLineSpaces = 0;

+       break;

+     case '\t' :

+      if (endOfLine) {

+       // we remove a maximum of currentCommentOffset characters (tabs are converted to space numbers).

+       beginningOfLineSpaces+=options.tabSize;

+       if (beginningOfLineSpaces > currentCommentOffset)

+        currentLineBuffer.append(currentCharacter);      

+      } else {

+       currentLineBuffer.append(currentCharacter);

+      }

+      break;

+     case ' ' :

+      if (endOfLine) {

+       // we remove a maximum of currentCommentOffset characters (tabs are converted to space numbers).

+       beginningOfLineSpaces++;

+       if (beginningOfLineSpaces > currentCommentOffset)

+        currentLineBuffer.append(currentCharacter);      

+      } else {

+       currentLineBuffer.append(currentCharacter);

+      }

+      break;

+     default:

+      beginningOfLineSpaces = 0;

+      currentLineBuffer.append(currentCharacter);

+      endOfLine = false;

+    }

+   }

+   break;

+  default:

+   currentLineBuffer.append(source, startPosition, scanner.currentPosition - startPosition);

+ }

+ updateMappedPositions(startPosition);

 }

 /**

  * Outputs <code>currentString</code>:<br>

@@ -1342,244 +1361,244 @@
  * @param operator value of the operator belonging to <code>currentString</code>.

  */

 private void outputLine(

-	String currentString, 

-	boolean preIndented, 

-	int depth, 

-	int operator, 

-	int substringIndex, 

-	int[] startSubstringIndexes, 

-	int offsetInGlobalLine) {

+ String currentString, 

+ boolean preIndented, 

+ int depth, 

+ int operator, 

+ int substringIndex, 

+ int[] startSubstringIndexes, 

+ int offsetInGlobalLine) {

 

-	boolean emptyFirstSubString = false;

-	String operatorString = operatorString(operator);

-	boolean placeOperatorBehind = !breakLineBeforeOperator(operator);

-	boolean placeOperatorAhead = !placeOperatorBehind;

+ boolean emptyFirstSubString = false;

+ String operatorString = operatorString(operator);

+ boolean placeOperatorBehind = !breakLineBeforeOperator(operator);

+ boolean placeOperatorAhead = !placeOperatorBehind;

 

-	// dump prefix operator?

-	if (placeOperatorAhead) {

-		if (!preIndented) {

-			dumpTab(depth);

-			preIndented = true;

-		}

-		if (operator != 0) {

-			if (insertSpaceBefore(operator)) {

-				formattedSource.append(' ');

-				increaseSplitDelta(1);

-			}

-			formattedSource.append(operatorString);

-			increaseSplitDelta(operatorString.length());

+ // dump prefix operator?

+ if (placeOperatorAhead) {

+  if (!preIndented) {

+   dumpTab(depth);

+   preIndented = true;

+  }

+  if (operator != 0) {

+   if (insertSpaceBefore(operator)) {

+    formattedSource.append(' ');

+    increaseSplitDelta(1);

+   }

+   formattedSource.append(operatorString);

+   increaseSplitDelta(operatorString.length());

 

-			if (insertSpaceAfter(operator)

-				&& operator != TokenNameimplements

-				&& operator != TokenNameextends

-				&& operator != TokenNamethrows) {

-				formattedSource.append(' ');

-				increaseSplitDelta(1);

-			}

-		}

-	}

-	SplitLine splitLine = null;

-	if (options.maxLineLength == 0

-		|| currentString.length() < options.maxLineLength

-		|| (splitLine = split(currentString, offsetInGlobalLine)) == null) {

-		// depending on the type of operator, outputs new line before of after dumping it

-		// indent before postfix operator

-		// indent also when the line cannot be split

+   if (insertSpaceAfter(operator)

+    && operator != TokenNameimplements

+    && operator != TokenNameextends

+    && operator != TokenNamethrows) {

+    formattedSource.append(' ');

+    increaseSplitDelta(1);

+   }

+  }

+ }

+ SplitLine splitLine = null;

+ if (options.maxLineLength == 0

+  || currentString.length() < options.maxLineLength

+  || (splitLine = split(currentString, offsetInGlobalLine)) == null) {

+  // depending on the type of operator, outputs new line before of after dumping it

+  // indent before postfix operator

+  // indent also when the line cannot be split

 

-		if (operator == TokenNameextends

-			|| operator == TokenNameimplements

-			|| operator == TokenNamethrows) {

-			formattedSource.append(' ');

-			increaseSplitDelta(1);

-		}

+  if (operator == TokenNameextends

+   || operator == TokenNameimplements

+   || operator == TokenNamethrows) {

+   formattedSource.append(' ');

+   increaseSplitDelta(1);

+  }

 

-		if (placeOperatorBehind) {

-			if (!preIndented) {

-				dumpTab(depth);

-			}

-		}

+  if (placeOperatorBehind) {

+   if (!preIndented) {

+    dumpTab(depth);

+   }

+  }

 

-		boolean containsMultiLineComment = currentString.lastIndexOf("/*"/*nonNLS*/) != -1;

-		int numberOfSpaces = 0;

-		int max = currentString.length();

-		updateMappedPositionsWhileSplitting(

-			beginningOfLineIndex, 

-			beginningOfLineIndex + max); 

-		for (int i = 0; i < max; i++) {

-			char currentChar = currentString.charAt(i);

-			switch (currentChar) {

-				case '\r' :

-					break;

-				case '\n' :

-					if (i != max - 1) {

-						// fix for 1FFYL5C: LFCOM:ALL - Incorrect indentation when split with a comment inside a condition

-						// a substring cannot end with a lineSeparatorSequence,

-						// except if it has been added by format() after a one-line comment

-						formattedSource.append(options.lineSeparatorSequence);

-						increaseSplitDelta(options.lineSeparatorSequence.length);

+  boolean containsMultiLineComment = currentString.lastIndexOf("/*") != -1; //$NON-NLS-1$

+  int numberOfSpaces = 0;

+  int max = currentString.length();

+  updateMappedPositionsWhileSplitting(

+   beginningOfLineIndex, 

+   beginningOfLineIndex + max); 

+  for (int i = 0; i < max; i++) {

+   char currentChar = currentString.charAt(i);

+   switch (currentChar) {

+    case '\r' :

+     break;

+    case '\n' :

+     if (i != max - 1) {

+      // fix for 1FFYL5C: LFCOM:ALL - Incorrect indentation when split with a comment inside a condition

+      // a substring cannot end with a lineSeparatorSequence,

+      // except if it has been added by format() after a one-line comment

+      formattedSource.append(options.lineSeparatorSequence);

+      increaseSplitDelta(options.lineSeparatorSequence.length);

 

-						if (containsMultiLineComment) {

-							// fix for 1FGGQCN: LFCOM:ALL - Space management in comments for the formatter

-							dumpTab(currentLineIndentationLevel);

-						} else {

-							// 1FGDDV6: LFCOM:WIN98 - Weird splitting on message expression

-							dumpTab(depth - 1);

-						}

-					}

-					break;

-				default :

-					formattedSource.append(currentChar);

-			}

-		}

+      if (containsMultiLineComment) {

+       // fix for 1FGGQCN: LFCOM:ALL - Space management in comments for the formatter

+       dumpTab(currentLineIndentationLevel);

+      } else {

+       // 1FGDDV6: LFCOM:WIN98 - Weird splitting on message expression

+       dumpTab(depth - 1);

+      }

+     }

+     break;

+    default :

+     formattedSource.append(currentChar);

+   }

+  }

 

-		// update positions inside the mappedPositions table

-		if (substringIndex != -1) {

-			int startPosition = 

-				beginningOfLineIndex + startSubstringIndexes[substringIndex]; 

-			updateMappedPositionsWhileSplitting(startPosition, startPosition + max);

+  // update positions inside the mappedPositions table

+  if (substringIndex != -1) {

+   int startPosition = 

+    beginningOfLineIndex + startSubstringIndexes[substringIndex]; 

+   updateMappedPositionsWhileSplitting(startPosition, startPosition + max);

 

-			// compute the splitDelta resulting with the operator and blank removal

-			if (substringIndex + 1 != startSubstringIndexes.length) {

-				increaseSplitDelta(

-					startSubstringIndexes[substringIndex]

-						+ max

-						- startSubstringIndexes[substringIndex

-						+ 1]); 

-			}

-		}

-		// dump postfix operator?

-		if (placeOperatorBehind) {

-			if (insertSpaceBefore(operator)) {

-				formattedSource.append(' ');

-				if (operator != 0) {

-					increaseSplitDelta(1);

-				}

-			}

-			formattedSource.append(operatorString);

-			if (operator != 0) {

-				increaseSplitDelta(operatorString.length());

-			}

-		}

-		return;

-	}

+   // compute the splitDelta resulting with the operator and blank removal

+   if (substringIndex + 1 != startSubstringIndexes.length) {

+    increaseSplitDelta(

+     startSubstringIndexes[substringIndex]

+      + max

+      - startSubstringIndexes[substringIndex

+      + 1]); 

+   }

+  }

+  // dump postfix operator?

+  if (placeOperatorBehind) {

+   if (insertSpaceBefore(operator)) {

+    formattedSource.append(' ');

+    if (operator != 0) {

+     increaseSplitDelta(1);

+    }

+   }

+   formattedSource.append(operatorString);

+   if (operator != 0) {

+    increaseSplitDelta(operatorString.length());

+   }

+  }

+  return;

+ }

 

-	// fix for 1FG0BA3: LFCOM:WIN98 - Weird splitting on interfaces

-	// extends has to stand alone on a line when currentString has been split.

-	if (options.maxLineLength != 0

-		&& splitLine != null

-		&& (operator == TokenNameextends

-			|| operator == TokenNameimplements

-			|| operator == TokenNamethrows)) {

-		formattedSource.append(options.lineSeparatorSequence);

-		increaseSplitDelta(options.lineSeparatorSequence.length);

+ // fix for 1FG0BA3: LFCOM:WIN98 - Weird splitting on interfaces

+ // extends has to stand alone on a line when currentString has been split.

+ if (options.maxLineLength != 0

+  && splitLine != null

+  && (operator == TokenNameextends

+   || operator == TokenNameimplements

+   || operator == TokenNamethrows)) {

+  formattedSource.append(options.lineSeparatorSequence);

+  increaseSplitDelta(options.lineSeparatorSequence.length);

 

-		dumpTab(depth + 1);

-	} else {

-		if (operator == TokenNameextends

-			|| operator == TokenNameimplements

-			|| operator == TokenNamethrows) {

-			formattedSource.append(' ');

-			increaseSplitDelta(1);

-		}

-	}

+  dumpTab(depth + 1);

+ } else {

+  if (operator == TokenNameextends

+   || operator == TokenNameimplements

+   || operator == TokenNamethrows) {

+   formattedSource.append(' ');

+   increaseSplitDelta(1);

+  }

+ }

 

-	// perform actual splitting

-	String result[] = splitLine.substrings;

-	int[] splitOperators = splitLine.operators;

-	int[] splitLineStartIndexes = splitLine.startSubstringsIndexes;

+ // perform actual splitting

+ String result[] = splitLine.substrings;

+ int[] splitOperators = splitLine.operators;

+ int[] splitLineStartIndexes = splitLine.startSubstringsIndexes;

 

-	if (result[0].length() == 0) {

-		// when the substring 0 is null, the substring 1 is correctly indented.

-		depth--;

-		emptyFirstSubString = true;

-	}

-	// the operator going in front of the result[0] string is the operator parameter

+ if (result[0].length() == 0) {

+  // when the substring 0 is null, the substring 1 is correctly indented.

+  depth--;

+  emptyFirstSubString = true;

+ }

+ // the operator going in front of the result[0] string is the operator parameter

 

-	for (int i = 0, max = result.length; i < max; i++) {

-		// the new depth is the current one if this is the first substring,

-		// the current one + 1 otherwise.

+ for (int i = 0, max = result.length; i < max; i++) {

+  // the new depth is the current one if this is the first substring,

+  // the current one + 1 otherwise.

 

-		// if the substring is a comment, use the current indentation Level instead of the depth

-		// (-1 because the ouputline increases depth).

-		// (fix for 1FFC72R: LFCOM:ALL - Incorrect line split in presence of line comments)

-		String currentResult = result[i];

+  // if the substring is a comment, use the current indentation Level instead of the depth

+  // (-1 because the ouputline increases depth).

+  // (fix for 1FFC72R: LFCOM:ALL - Incorrect line split in presence of line comments)

+  String currentResult = result[i];

 

-		if (currentResult.length() != 0 || splitOperators[i] != 0) {

-			int newDepth = 

-				(currentResult.startsWith("/*"/*nonNLS*/) || currentResult.startsWith("//"/*nonNLS*/))

-					? indentationLevel - 1

-					: depth; 

-			outputLine(

-				currentResult, 

-				i == 0 || (i == 1 && emptyFirstSubString) ? preIndented : false, 

-				i == 0 ? newDepth : newDepth + 1, 

-				splitOperators[i], 

-				i, 

-				splitLine.startSubstringsIndexes, 

-				currentString.indexOf(currentResult)); 

-			if (i != max - 1) {

-				formattedSource.append(options.lineSeparatorSequence);

-				increaseSplitDelta(options.lineSeparatorSequence.length);

-			}

-		}

-	}

-	if (result.length == splitOperators.length - 1) {

-	    int lastOperator = splitOperators[result.length];

-	    String lastOperatorString = operatorString(lastOperator);

-		formattedSource.append(options.lineSeparatorSequence);

-		increaseSplitDelta(options.lineSeparatorSequence.length);

+  if (currentResult.length() != 0 || splitOperators[i] != 0) {

+   int newDepth = 

+    (currentResult.startsWith("/*") || currentResult.startsWith("//")) //$NON-NLS-2$ //$NON-NLS-1$

+     ? indentationLevel - 1

+     : depth; 

+   outputLine(

+    currentResult, 

+    i == 0 || (i == 1 && emptyFirstSubString) ? preIndented : false, 

+    i == 0 ? newDepth : newDepth + 1, 

+    splitOperators[i], 

+    i, 

+    splitLine.startSubstringsIndexes, 

+    currentString.indexOf(currentResult)); 

+   if (i != max - 1) {

+    formattedSource.append(options.lineSeparatorSequence);

+    increaseSplitDelta(options.lineSeparatorSequence.length);

+   }

+  }

+ }

+ if (result.length == splitOperators.length - 1) {

+     int lastOperator = splitOperators[result.length];

+     String lastOperatorString = operatorString(lastOperator);

+  formattedSource.append(options.lineSeparatorSequence);

+  increaseSplitDelta(options.lineSeparatorSequence.length);

 

-		if (breakLineBeforeOperator(lastOperator)) {

-			dumpTab(depth + 1);

-			if (lastOperator != 0) {

-				if (insertSpaceBefore(lastOperator)) {

-					formattedSource.append(' ');

-					increaseSplitDelta(1);

-				}

-				formattedSource.append(lastOperatorString);

-				increaseSplitDelta(lastOperatorString.length());

+  if (breakLineBeforeOperator(lastOperator)) {

+   dumpTab(depth + 1);

+   if (lastOperator != 0) {

+    if (insertSpaceBefore(lastOperator)) {

+     formattedSource.append(' ');

+     increaseSplitDelta(1);

+    }

+    formattedSource.append(lastOperatorString);

+    increaseSplitDelta(lastOperatorString.length());

 

-				if (insertSpaceAfter(lastOperator)

-					&& lastOperator != TokenNameimplements

-					&& lastOperator != TokenNameextends

-					&& lastOperator != TokenNamethrows) {

-					formattedSource.append(' ');

-					increaseSplitDelta(1);

-				}

-			}

-		}

-	}

-	if (placeOperatorBehind) {

-		if (insertSpaceBefore(operator)) {

-			formattedSource.append(' ');

-			increaseSplitDelta(1);

-		}

-		formattedSource.append(operatorString);

-		//increaseSplitDelta(operatorString.length());

-	}

+    if (insertSpaceAfter(lastOperator)

+     && lastOperator != TokenNameimplements

+     && lastOperator != TokenNameextends

+     && lastOperator != TokenNamethrows) {

+     formattedSource.append(' ');

+     increaseSplitDelta(1);

+    }

+   }

+  }

+ }

+ if (placeOperatorBehind) {

+  if (insertSpaceBefore(operator)) {

+   formattedSource.append(' ');

+   increaseSplitDelta(1);

+  }

+  formattedSource.append(operatorString);

+  //increaseSplitDelta(operatorString.length());

+ }

 }

 /**

  * Pops the top statement of the stack if it is <code>token</code>

  */

 private int pop(int token) {

-	int delta=0;

-	if ((constructionsCount>0) && (constructions[constructionsCount-1]==token)){

-		delta--;

-		constructionsCount--;

-	}

-	return delta;

+ int delta=0;

+ if ((constructionsCount>0) && (constructions[constructionsCount-1]==token)){

+  delta--;

+  constructionsCount--;

+ }

+ return delta;

 }

 /**

  * Pops the top statement of the stack if it is a <code>BLOCK</code> or a <code>NONINDENT_BLOCK</code>.

  */

 private int popBlock() {

-	int delta=0;

-	if ((constructionsCount>0) && ((constructions[constructionsCount-1]==BLOCK) || (constructions[constructionsCount-1]==NONINDENT_BLOCK))){

-		if (constructions[constructionsCount-1]==BLOCK)

-			delta--;

-		constructionsCount--;

-	}

-	return delta;

+ int delta=0;

+ if ((constructionsCount>0) && ((constructions[constructionsCount-1]==BLOCK) || (constructions[constructionsCount-1]==NONINDENT_BLOCK))){

+  if (constructions[constructionsCount-1]==BLOCK)

+   delta--;

+  constructionsCount--;

+ }

+ return delta;

 }

 /**

  * Pops elements until the stack is empty or the top element is <code>token</code>.<br>

@@ -1587,14 +1606,14 @@
  * @param token the token to be left as the top of the stack

  */

 private int popExclusiveUntil(int token) {

-	int delta=0;

-	int startCount=constructionsCount;

-	for (int i = startCount-1; i >= 0 && constructions[i] != token; i--){

-		if (constructions[i]!=NONINDENT_BLOCK)

-			delta--;

-		constructionsCount--;

-	}

-	return delta;

+ int delta=0;

+ int startCount=constructionsCount;

+ for (int i = startCount-1; i >= 0 && constructions[i] != token; i--){

+  if (constructions[i]!=NONINDENT_BLOCK)

+   delta--;

+  constructionsCount--;

+ }

+ return delta;

 }

 /**

  * Pops elements until the stack is empty or the top element is

@@ -1602,13 +1621,13 @@
  * Does not remove it from the stack.

  */

 private int popExclusiveUntilBlock(){

-	int startCount=constructionsCount;

-	int delta=0;

-	for (int i = startCount-1; i >= 0 && constructions[i] != BLOCK && constructions[i] != NONINDENT_BLOCK; i--){

-		constructionsCount--;

-		delta--;

-	}

-	return delta;

+ int startCount=constructionsCount;

+ int delta=0;

+ for (int i = startCount-1; i >= 0 && constructions[i] != BLOCK && constructions[i] != NONINDENT_BLOCK; i--){

+  constructionsCount--;

+  delta--;

+ }

+ return delta;

 }

 /**

  * Pops elements until the stack is empty or the top element is

@@ -1616,13 +1635,13 @@
  * Does not remove it from the stack.

  */

 private int popExclusiveUntilBlockOrCase(){

-	int startCount=constructionsCount;

-	int delta=0;

-	for (int i = startCount-1; i >= 0 && constructions[i] != BLOCK && constructions[i] != NONINDENT_BLOCK && constructions[i]!=TokenNamecase; i--){

-		constructionsCount--;

-		delta--;

-	}

-	return delta;

+ int startCount=constructionsCount;

+ int delta=0;

+ for (int i = startCount-1; i >= 0 && constructions[i] != BLOCK && constructions[i] != NONINDENT_BLOCK && constructions[i]!=TokenNamecase; i--){

+  constructionsCount--;

+  delta--;

+ }

+ return delta;

 }

 /**

  * Pops elements until the stack is empty or the top element is <code>token</code>.<br>

@@ -1630,19 +1649,19 @@
  * @param token the token to remove from the stack

  */

 private int popInclusiveUntil(int token) {

-	int startCount=constructionsCount;

-	int delta=0;

-	for (int i = startCount-1; i >= 0 && constructions[i] != token; i--){

-		if (constructions[i]!=NONINDENT_BLOCK)

-			delta--;

-		constructionsCount--;

-	}

-	if (constructionsCount>0){

-		if (constructions[constructionsCount-1]!=NONINDENT_BLOCK)

-			delta--;

-		constructionsCount--;

-	}

-	return delta;

+ int startCount=constructionsCount;

+ int delta=0;

+ for (int i = startCount-1; i >= 0 && constructions[i] != token; i--){

+  if (constructions[i]!=NONINDENT_BLOCK)

+   delta--;

+  constructionsCount--;

+ }

+ if (constructionsCount>0){

+  if (constructions[constructionsCount-1]!=NONINDENT_BLOCK)

+   delta--;

+  constructionsCount--;

+ }

+ return delta;

 }

 /**

  * Pops elements until the stack is empty or the top element is

@@ -1650,18 +1669,18 @@
  * Does not remove it from the stack.

  */

 private int popInclusiveUntilBlock() {

-	int startCount=constructionsCount;

-	int delta=0;

-	for (int i = startCount-1; i >= 0 && (constructions[i] != BLOCK && constructions[i]!=NONINDENT_BLOCK); i--){

-		delta--;

-		constructionsCount--;

-	}

-	if (constructionsCount>0){

-		if (constructions[constructionsCount-1]==BLOCK)

-			delta--;

-		constructionsCount--;

-	}

-	return delta;

+ int startCount=constructionsCount;

+ int delta=0;

+ for (int i = startCount-1; i >= 0 && (constructions[i] != BLOCK && constructions[i]!=NONINDENT_BLOCK); i--){

+  delta--;

+  constructionsCount--;

+ }

+ if (constructionsCount>0){

+  if (constructions[constructionsCount-1]==BLOCK)

+   delta--;

+  constructionsCount--;

+ }

+ return delta;

 }

 /** 

  * Pushes a block in the stack.<br>

@@ -1670,45 +1689,45 @@
  * Creates a new bigger array if the current one is full.

  */

 private int pushBlock() {

-	int delta = 0;

-	if (constructionsCount == constructions.length)

-		System

-				.arraycopy(constructions, 

-					0, 

-					(constructions = new int[constructionsCount * 2]), 

-					0, 

-					constructionsCount); 

+ int delta = 0;

+ if (constructionsCount == constructions.length)

+  System

+    .arraycopy(constructions, 

+     0, 

+     (constructions = new int[constructionsCount * 2]), 

+     0, 

+     constructionsCount); 

 

-	if ((constructionsCount == 0)

-		|| (constructions[constructionsCount - 1] == BLOCK)

-		|| (constructions[constructionsCount - 1] == NONINDENT_BLOCK)

-		|| (constructions[constructionsCount - 1] == TokenNamecase)) {

-		delta++;

-		constructions[constructionsCount++] = BLOCK;

-	}

-	else {

-		constructions[constructionsCount++] = NONINDENT_BLOCK;

-	}

-	return delta;

+ if ((constructionsCount == 0)

+  || (constructions[constructionsCount - 1] == BLOCK)

+  || (constructions[constructionsCount - 1] == NONINDENT_BLOCK)

+  || (constructions[constructionsCount - 1] == TokenNamecase)) {

+  delta++;

+  constructions[constructionsCount++] = BLOCK;

+ }

+ else {

+  constructions[constructionsCount++] = NONINDENT_BLOCK;

+ }

+ return delta;

 }

 /** 

  * Pushes <code>token</code>.<br>

  * Creates a new bigger array if the current one is full.

  */

 private int pushControlStatement(int token) {

-	if (constructionsCount == constructions.length)

-		System.arraycopy(constructions, 0, (constructions = new int[constructionsCount * 2]), 0, constructionsCount);

-	constructions[constructionsCount++] = token;

-	return 1;

+ if (constructionsCount == constructions.length)

+  System.arraycopy(constructions, 0, (constructions = new int[constructionsCount * 2]), 0, constructionsCount);

+ constructions[constructionsCount++] = token;

+ return 1;

 }

 private static boolean separateFirstArgumentOn(int currentToken) {

-	//return (currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON);

-	return currentToken != TokenNameif

-		&& currentToken != TokenNameLPAREN

-		&& currentToken != TokenNameNOT

-		&& currentToken != TokenNamewhile

-		&& currentToken != TokenNamefor

-		&& currentToken != TokenNameswitch; 

+ //return (currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON);

+ return currentToken != TokenNameif

+  && currentToken != TokenNameLPAREN

+  && currentToken != TokenNameNOT

+  && currentToken != TokenNamewhile

+  && currentToken != TokenNamefor

+  && currentToken != TokenNameswitch; 

 }

 /** 

  * Sets the behaviour of the formatter about the braces

@@ -1724,7 +1743,7 @@
  * @see addNewLineOnOpeningBrace(boolean)

  */

 public void setBraceIndentationLevel(int newBraceIndentationLevel) {

-	options.setNewLineBeforeOpeningBraceMode(newBraceIndentationLevel==0);

+ options.setNewLineBeforeOpeningBraceMode(newBraceIndentationLevel==0);

 }

 /**

  * Sets the behaviour of the formatter regarding the whitespaces

@@ -1735,7 +1754,7 @@
  * @deprecated backward compatibility with VAJ

  */

 public void setClearBlankLines(boolean newClearBlankLines) {

-	options.setClearAllBlankLinesMode(newClearBlankLines);

+ options.setClearAllBlankLinesMode(newClearBlankLines);

 }

 /** 

  * Sets the number of consecutive spaces used to replace the tab char

@@ -1745,7 +1764,7 @@
  * @deprecated backward compatibility with VAJ

  */

 public void setIndentationLength(int newIndentationLength) {

-	options.setTabSize(newIndentationLength);

+ options.setTabSize(newIndentationLength);

 }

 /** 

  * Sets the initial indentation level

@@ -1754,7 +1773,7 @@
  * @deprecated

  */

 public void setInitialIndentationLevel(int newIndentationLevel) {

-	this.initialIndentationLevel = currentLineIndentationLevel = indentationLevel = newIndentationLevel;

+ this.initialIndentationLevel = currentLineIndentationLevel = indentationLevel = newIndentationLevel;

 }

 /** 

  * Sets the behaviour of the scanner.<br>

@@ -1767,7 +1786,7 @@
  * @deprecated backward compatibility with VAJ

  */

 public void setNewlineInCompoundStatement(boolean flag) {

-	options.setNewlineInControlStatementMode(flag);

+ options.setNewlineInControlStatementMode(flag);

 }

 /**

  * Set the positions to map. The mapped positions should be retrieved using the

@@ -1776,17 +1795,17 @@
  * @param positions int[]

  */

 public void setPositionsToMap(int[] positions) {

-	positionsToMap = positions;

-	lineDelta = 0;

-	globalDelta = 0;

-	mappedPositions = new int[positions.length];

+ positionsToMap = positions;

+ lineDelta = 0;

+ globalDelta = 0;

+ mappedPositions = new int[positions.length];

 }

 /** 

  * Appends a space character to the current line buffer.

  */

 private void space() {

-	currentLineBuffer.append(' ');

-	increaseLineDelta(1);

+ currentLineBuffer.append(' ');

+ increaseLineDelta(1);

 }

 /**

  * Splits <code>stringToSplit</code> on the top level token<br>

@@ -1796,7 +1815,7 @@
  * or null if the string cannot be split

  */

 public SplitLine split(String stringToSplit) {

-	return split(stringToSplit, 0);

+ return split(stringToSplit, 0);

 }

 /**

  * Splits <code>stringToSplit</code> on the top level token<br>

@@ -1806,476 +1825,476 @@
  * or null if the string cannot be split

  */

 public SplitLine split(String stringToSplit, int offsetInGlobalLine) {

-	// local variables

-	int currentToken = 0;

-	int splitTokenType = 0;

-	int splitTokenDepth = Integer.MAX_VALUE;

-	int splitTokenPriority = Integer.MAX_VALUE;

+ // local variables

+ int currentToken = 0;

+ int splitTokenType = 0;

+ int splitTokenDepth = Integer.MAX_VALUE;

+ int splitTokenPriority = Integer.MAX_VALUE;

 

-	int[] substringsStartPositions = new int[10];

-	// contains the start position of substrings

-	int[] substringsEndPositions = new int[10];

-	// contains the start position of substrings

-	int substringsCount = 1; // index in the substringsStartPosition array

-	int[] splitOperators = new int[10];

-	// contains the start position of substrings

-	int splitOperatorsCount = 0; // index in the substringsStartPosition array

-	int[] openParenthesisPosition = new int[10];

-	int openParenthesisPositionCount = 0;

-	int position = 0;

-	int lastOpenParenthesisPosition = -1;

-	// used to remember the position of the 1st open parenthesis

-	// needed for a pattern like: A.B(C); we want formatted like A.B( split C);

-	// setup the scanner with a new source

-	int lastCommentStartPosition = -1;

-	// to remember the start position of the last comment

-	int firstTokenOnLine = -1;

-	// to remember the first token of the line

-	int previousToken = -1;

-	// to remember the previous token.

-	splitScanner.setSourceBuffer(stringToSplit.toCharArray());

+ int[] substringsStartPositions = new int[10];

+ // contains the start position of substrings

+ int[] substringsEndPositions = new int[10];

+ // contains the start position of substrings

+ int substringsCount = 1; // index in the substringsStartPosition array

+ int[] splitOperators = new int[10];

+ // contains the start position of substrings

+ int splitOperatorsCount = 0; // index in the substringsStartPosition array

+ int[] openParenthesisPosition = new int[10];

+ int openParenthesisPositionCount = 0;

+ int position = 0;

+ int lastOpenParenthesisPosition = -1;

+ // used to remember the position of the 1st open parenthesis

+ // needed for a pattern like: A.B(C); we want formatted like A.B( split C);

+ // setup the scanner with a new source

+ int lastCommentStartPosition = -1;

+ // to remember the start position of the last comment

+ int firstTokenOnLine = -1;

+ // to remember the first token of the line

+ int previousToken = -1;

+ // to remember the previous token.

+ splitScanner.setSourceBuffer(stringToSplit.toCharArray());

 

-	try {

-		// start the loop

-		while (true) {

-			// takes the next token

-			try {

-				if (currentToken != Scanner.TokenNameWHITESPACE)

-					previousToken = currentToken;

-				currentToken = splitScanner.getNextToken();

-			} catch (InvalidInputException e) {

-				if (!handleInvalidToken(e))

-					throw e;

-				currentToken = 0; // this value is not modify when an exception is raised.

-			}

-			if (currentToken == TokenNameEOF)

-				break;

-				

-			if (firstTokenOnLine == -1){

-				firstTokenOnLine = currentToken;

-			}

-			

-				

-			switch (currentToken) {

-				case TokenNameRBRACE:

-				case TokenNameRPAREN :

-					if (openParenthesisPositionCount > 0) {

-						if (openParenthesisPositionCount == 1 && lastOpenParenthesisPosition < openParenthesisPosition[0]) {

-							lastOpenParenthesisPosition = openParenthesisPosition[0];

-						} else

-							if ((splitTokenDepth == Integer.MAX_VALUE)

-								|| (splitTokenDepth > openParenthesisPositionCount

-									&& openParenthesisPositionCount == 1)) {

-								splitTokenType = 0;

-								splitTokenDepth = openParenthesisPositionCount;

-								splitTokenPriority = Integer.MAX_VALUE;

-								substringsStartPositions[0] = 0;

-								// better token means the whole line until now is the first substring

-								substringsCount = 1; // resets the count of substrings

+ try {

+  // start the loop

+  while (true) {

+   // takes the next token

+   try {

+    if (currentToken != Scanner.TokenNameWHITESPACE)

+     previousToken = currentToken;

+    currentToken = splitScanner.getNextToken();

+   } catch (InvalidInputException e) {

+    if (!handleInvalidToken(e))

+     throw e;

+    currentToken = 0; // this value is not modify when an exception is raised.

+   }

+   if (currentToken == TokenNameEOF)

+    break;

+    

+   if (firstTokenOnLine == -1){

+    firstTokenOnLine = currentToken;

+   }

+   

+    

+   switch (currentToken) {

+    case TokenNameRBRACE:

+    case TokenNameRPAREN :

+     if (openParenthesisPositionCount > 0) {

+      if (openParenthesisPositionCount == 1 && lastOpenParenthesisPosition < openParenthesisPosition[0]) {

+       lastOpenParenthesisPosition = openParenthesisPosition[0];

+      } else

+       if ((splitTokenDepth == Integer.MAX_VALUE)

+        || (splitTokenDepth > openParenthesisPositionCount

+         && openParenthesisPositionCount == 1)) {

+        splitTokenType = 0;

+        splitTokenDepth = openParenthesisPositionCount;

+        splitTokenPriority = Integer.MAX_VALUE;

+        substringsStartPositions[0] = 0;

+        // better token means the whole line until now is the first substring

+        substringsCount = 1; // resets the count of substrings

 

-								substringsEndPositions[0] = openParenthesisPosition[0];

-								// substring ends on operator start

-								position = openParenthesisPosition[0];

-								// the string mustn't be cut before the closing parenthesis but after the opening one.

-								splitOperatorsCount = 1; // resets the count of split operators

-								splitOperators[0] = 0;

-							}

-						openParenthesisPositionCount--;

-					}

-					break;

-				case TokenNameLBRACE:

-				case TokenNameLPAREN :

-					if (openParenthesisPositionCount == openParenthesisPosition.length) {

-						System.arraycopy(

-								openParenthesisPosition, 

-								0, 

-								(openParenthesisPosition = new int[openParenthesisPositionCount * 2]), 

-								0, 

-								openParenthesisPositionCount); 

-					}

-					openParenthesisPosition[openParenthesisPositionCount++] = splitScanner.currentPosition;

-					if (currentToken == TokenNameLPAREN && previousToken == TokenNameRPAREN){

-						openParenthesisPosition[openParenthesisPositionCount - 1] = splitScanner.startPosition;

-					}

-					break;

-				case TokenNameSEMICOLON : // ;

-				case TokenNameCOMMA : // ,

-				case TokenNameEQUAL : // =

-					if (openParenthesisPositionCount < splitTokenDepth

-						|| (openParenthesisPositionCount == splitTokenDepth

-							&& splitTokenPriority > getTokenPriority(currentToken))) {

-						// the current token is better than the one we currently have

-						// (in level or in priority if same level)

-						// reset the substringsCount

-						splitTokenDepth = openParenthesisPositionCount;

-						splitTokenType = currentToken;

-						splitTokenPriority = getTokenPriority(currentToken);

-						substringsStartPositions[0] = 0;

-						// better token means the whole line until now is the first substring

+        substringsEndPositions[0] = openParenthesisPosition[0];

+        // substring ends on operator start

+        position = openParenthesisPosition[0];

+        // the string mustn't be cut before the closing parenthesis but after the opening one.

+        splitOperatorsCount = 1; // resets the count of split operators

+        splitOperators[0] = 0;

+       }

+      openParenthesisPositionCount--;

+     }

+     break;

+    case TokenNameLBRACE:

+    case TokenNameLPAREN :

+     if (openParenthesisPositionCount == openParenthesisPosition.length) {

+      System.arraycopy(

+        openParenthesisPosition, 

+        0, 

+        (openParenthesisPosition = new int[openParenthesisPositionCount * 2]), 

+        0, 

+        openParenthesisPositionCount); 

+     }

+     openParenthesisPosition[openParenthesisPositionCount++] = splitScanner.currentPosition;

+     if (currentToken == TokenNameLPAREN && previousToken == TokenNameRPAREN){

+      openParenthesisPosition[openParenthesisPositionCount - 1] = splitScanner.startPosition;

+     }

+     break;

+    case TokenNameSEMICOLON : // ;

+    case TokenNameCOMMA : // ,

+    case TokenNameEQUAL : // =

+     if (openParenthesisPositionCount < splitTokenDepth

+      || (openParenthesisPositionCount == splitTokenDepth

+       && splitTokenPriority > getTokenPriority(currentToken))) {

+      // the current token is better than the one we currently have

+      // (in level or in priority if same level)

+      // reset the substringsCount

+      splitTokenDepth = openParenthesisPositionCount;

+      splitTokenType = currentToken;

+      splitTokenPriority = getTokenPriority(currentToken);

+      substringsStartPositions[0] = 0;

+      // better token means the whole line until now is the first substring

 

-						if (separateFirstArgumentOn(firstTokenOnLine)

-							&& openParenthesisPositionCount > 0) {

-							substringsCount = 2; // resets the count of substrings

+      if (separateFirstArgumentOn(firstTokenOnLine)

+       && openParenthesisPositionCount > 0) {

+       substringsCount = 2; // resets the count of substrings

 

-							substringsEndPositions[0] = openParenthesisPosition[splitTokenDepth - 1];

-							substringsStartPositions[1] = openParenthesisPosition[splitTokenDepth - 1];

-							substringsEndPositions[1] = splitScanner.startPosition;

-							splitOperatorsCount = 2; // resets the count of split operators

-							splitOperators[0] = 0;

-							splitOperators[1] = currentToken;

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-						} else {

-							substringsCount = 1; // resets the count of substrings

+       substringsEndPositions[0] = openParenthesisPosition[splitTokenDepth - 1];

+       substringsStartPositions[1] = openParenthesisPosition[splitTokenDepth - 1];

+       substringsEndPositions[1] = splitScanner.startPosition;

+       splitOperatorsCount = 2; // resets the count of split operators

+       splitOperators[0] = 0;

+       splitOperators[1] = currentToken;

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+      } else {

+       substringsCount = 1; // resets the count of substrings

 

-							substringsEndPositions[0] = splitScanner.startPosition;

-							// substring ends on operator start

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-							splitOperatorsCount = 1; // resets the count of split operators

-							splitOperators[0] = currentToken;

-						}

-					} else {

-						if ((openParenthesisPositionCount == splitTokenDepth

-								&& splitTokenPriority == getTokenPriority(currentToken))

-							&& splitTokenType!=TokenNameEQUAL && currentToken != TokenNameEQUAL) {

-							// fix for 1FG0BCN: LFCOM:WIN98 - Missing one indentation after split

-							// take only the 1st = into account.

-							// if another token with the same priority is found,

-							// push the start position of the substring and

-							// push the token into the stack.

-							// create a new array object if the current one is full.

-							if (substringsCount == substringsStartPositions.length) {

-								System.arraycopy(

-										substringsStartPositions, 

-										0, 

-										(substringsStartPositions = new int[substringsCount * 2]), 

-										0, 

-										substringsCount); 

-								System.arraycopy(

-										substringsEndPositions, 

-										0, 

-										(substringsEndPositions = new int[substringsCount * 2]), 

-										0, 

-										substringsCount); 

-							}

-							if (splitOperatorsCount == splitOperators.length) {

-								System.arraycopy(

-										splitOperators, 

-										0, 

-										(splitOperators = new int[splitOperatorsCount * 2]), 

-										0, 

-										splitOperatorsCount); 

-							}

-							substringsStartPositions[substringsCount] = position;

-							substringsEndPositions[substringsCount++] = splitScanner.startPosition;

-							// substring ends on operator start

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-							splitOperators[splitOperatorsCount++] = currentToken;

-						}

-					}

-					break;

-					

-				case TokenNameCOLON : // : (15.24)

-					// see 1FK7C5R, we only split on a colon, when it is associated with a question-mark.

-					// indeed it might appear also behind a case statement, and we do not to break at this point.

-					if ((splitOperatorsCount == 0) || splitOperators[splitOperatorsCount-1] != TokenNameQUESTION){

-						break;

-					}

-				case TokenNameextends :

-				case TokenNameimplements :

-				case TokenNamethrows :

+       substringsEndPositions[0] = splitScanner.startPosition;

+       // substring ends on operator start

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+       splitOperatorsCount = 1; // resets the count of split operators

+       splitOperators[0] = currentToken;

+      }

+     } else {

+      if ((openParenthesisPositionCount == splitTokenDepth

+        && splitTokenPriority == getTokenPriority(currentToken))

+       && splitTokenType!=TokenNameEQUAL && currentToken != TokenNameEQUAL) {

+       // fix for 1FG0BCN: LFCOM:WIN98 - Missing one indentation after split

+       // take only the 1st = into account.

+       // if another token with the same priority is found,

+       // push the start position of the substring and

+       // push the token into the stack.

+       // create a new array object if the current one is full.

+       if (substringsCount == substringsStartPositions.length) {

+        System.arraycopy(

+          substringsStartPositions, 

+          0, 

+          (substringsStartPositions = new int[substringsCount * 2]), 

+          0, 

+          substringsCount); 

+        System.arraycopy(

+          substringsEndPositions, 

+          0, 

+          (substringsEndPositions = new int[substringsCount * 2]), 

+          0, 

+          substringsCount); 

+       }

+       if (splitOperatorsCount == splitOperators.length) {

+        System.arraycopy(

+          splitOperators, 

+          0, 

+          (splitOperators = new int[splitOperatorsCount * 2]), 

+          0, 

+          splitOperatorsCount); 

+       }

+       substringsStartPositions[substringsCount] = position;

+       substringsEndPositions[substringsCount++] = splitScanner.startPosition;

+       // substring ends on operator start

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+       splitOperators[splitOperatorsCount++] = currentToken;

+      }

+     }

+     break;

+     

+    case TokenNameCOLON : // : (15.24)

+     // see 1FK7C5R, we only split on a colon, when it is associated with a question-mark.

+     // indeed it might appear also behind a case statement, and we do not to break at this point.

+     if ((splitOperatorsCount == 0) || splitOperators[splitOperatorsCount-1] != TokenNameQUESTION){

+      break;

+     }

+    case TokenNameextends :

+    case TokenNameimplements :

+    case TokenNamethrows :

 

-				case TokenNameDOT : // .

-				case TokenNameMULTIPLY : // * (15.16.1)

-				case TokenNameDIVIDE : // / (15.16.2)

-				case TokenNameREMAINDER : // % (15.16.3)

-				case TokenNamePLUS : // + (15.17, 15.17.2)

-				case TokenNameMINUS : // - (15.17.2)

-				case TokenNameLEFT_SHIFT : // << (15.18)

-				case TokenNameRIGHT_SHIFT : // >> (15.18)

-				case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> (15.18)

-				case TokenNameLESS : // < (15.19.1)

-				case TokenNameLESS_EQUAL : // <= (15.19.1)

-				case TokenNameGREATER : // > (15.19.1)

-				case TokenNameGREATER_EQUAL : // >= (15.19.1)

-				case TokenNameinstanceof : // instanceof

-				case TokenNameEQUAL_EQUAL : // == (15.20, 15.20.1, 15.20.2, 15.20.3)

-				case TokenNameNOT_EQUAL : // != (15.20, 15.20.1, 15.20.2, 15.20.3)

-				case TokenNameAND : // & (15.21, 15.21.1, 15.21.2)

-				case TokenNameOR : // | (15.21, 15.21.1, 15.21.2)

-				case TokenNameXOR : // ^ (15.21, 15.21.1, 15.21.2)

-				case TokenNameAND_AND : // && (15.22)

-				case TokenNameOR_OR : // || (15.23)

-				case TokenNameQUESTION : // ? (15.24)

-				case TokenNameMULTIPLY_EQUAL : // *= (15.25.2)

-				case TokenNameDIVIDE_EQUAL : // /= (15.25.2)

-				case TokenNameREMAINDER_EQUAL : // %= (15.25.2)

-				case TokenNamePLUS_EQUAL : // += (15.25.2)

-				case TokenNameMINUS_EQUAL : // -= (15.25.2)

-				case TokenNameLEFT_SHIFT_EQUAL : // <<= (15.25.2)

-				case TokenNameRIGHT_SHIFT_EQUAL : // >>= (15.25.2)

-				case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= (15.25.2)

-				case TokenNameAND_EQUAL : // &= (15.25.2)

-				case TokenNameXOR_EQUAL : // ^= (15.25.2)

-				case TokenNameOR_EQUAL : // |= (15.25.2)

+    case TokenNameDOT : // .

+    case TokenNameMULTIPLY : // * (15.16.1)

+    case TokenNameDIVIDE : // / (15.16.2)

+    case TokenNameREMAINDER : // % (15.16.3)

+    case TokenNamePLUS : // + (15.17, 15.17.2)

+    case TokenNameMINUS : // - (15.17.2)

+    case TokenNameLEFT_SHIFT : // << (15.18)

+    case TokenNameRIGHT_SHIFT : // >> (15.18)

+    case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> (15.18)

+    case TokenNameLESS : // < (15.19.1)

+    case TokenNameLESS_EQUAL : // <= (15.19.1)

+    case TokenNameGREATER : // > (15.19.1)

+    case TokenNameGREATER_EQUAL : // >= (15.19.1)

+    case TokenNameinstanceof : // instanceof

+    case TokenNameEQUAL_EQUAL : // == (15.20, 15.20.1, 15.20.2, 15.20.3)

+    case TokenNameNOT_EQUAL : // != (15.20, 15.20.1, 15.20.2, 15.20.3)

+    case TokenNameAND : // & (15.21, 15.21.1, 15.21.2)

+    case TokenNameOR : // | (15.21, 15.21.1, 15.21.2)

+    case TokenNameXOR : // ^ (15.21, 15.21.1, 15.21.2)

+    case TokenNameAND_AND : // && (15.22)

+    case TokenNameOR_OR : // || (15.23)

+    case TokenNameQUESTION : // ? (15.24)

+    case TokenNameMULTIPLY_EQUAL : // *= (15.25.2)

+    case TokenNameDIVIDE_EQUAL : // /= (15.25.2)

+    case TokenNameREMAINDER_EQUAL : // %= (15.25.2)

+    case TokenNamePLUS_EQUAL : // += (15.25.2)

+    case TokenNameMINUS_EQUAL : // -= (15.25.2)

+    case TokenNameLEFT_SHIFT_EQUAL : // <<= (15.25.2)

+    case TokenNameRIGHT_SHIFT_EQUAL : // >>= (15.25.2)

+    case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= (15.25.2)

+    case TokenNameAND_EQUAL : // &= (15.25.2)

+    case TokenNameXOR_EQUAL : // ^= (15.25.2)

+    case TokenNameOR_EQUAL : // |= (15.25.2)

 

-					if ((openParenthesisPositionCount < splitTokenDepth

-						|| (openParenthesisPositionCount == splitTokenDepth

-							&& splitTokenPriority > getTokenPriority(currentToken)))

-						&&

-							!((currentToken == TokenNamePLUS || currentToken == TokenNameMINUS)

-								&& (previousToken == TokenNameLBRACE || previousToken == TokenNameLBRACKET || splitScanner.startPosition == 0))){

-						// the current token is better than the one we currently have

-						// (in level or in priority if same level)

-						// reset the substringsCount

-						splitTokenDepth = openParenthesisPositionCount;

-						splitTokenType = currentToken;

-						splitTokenPriority = getTokenPriority(currentToken);

-						substringsStartPositions[0] = 0;

-						// better token means the whole line until now is the first substring

+     if ((openParenthesisPositionCount < splitTokenDepth

+      || (openParenthesisPositionCount == splitTokenDepth

+       && splitTokenPriority > getTokenPriority(currentToken)))

+      &&

+       !((currentToken == TokenNamePLUS || currentToken == TokenNameMINUS)

+        && (previousToken == TokenNameLBRACE || previousToken == TokenNameLBRACKET || splitScanner.startPosition == 0))){

+      // the current token is better than the one we currently have

+      // (in level or in priority if same level)

+      // reset the substringsCount

+      splitTokenDepth = openParenthesisPositionCount;

+      splitTokenType = currentToken;

+      splitTokenPriority = getTokenPriority(currentToken);

+      substringsStartPositions[0] = 0;

+      // better token means the whole line until now is the first substring

 

-						if (separateFirstArgumentOn(firstTokenOnLine)

-							&& openParenthesisPositionCount > 0) {

-							substringsCount = 2; // resets the count of substrings

+      if (separateFirstArgumentOn(firstTokenOnLine)

+       && openParenthesisPositionCount > 0) {

+       substringsCount = 2; // resets the count of substrings

 

-							substringsEndPositions[0] = openParenthesisPosition[splitTokenDepth - 1];

-							substringsStartPositions[1] = openParenthesisPosition[splitTokenDepth - 1];

-							substringsEndPositions[1] = splitScanner.startPosition;

-							splitOperatorsCount = 3; // resets the count of split operators

-							splitOperators[0] = 0;

-							splitOperators[1] = 0;

-							splitOperators[2] = currentToken;

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-						} else {

-							substringsCount = 1; // resets the count of substrings

+       substringsEndPositions[0] = openParenthesisPosition[splitTokenDepth - 1];

+       substringsStartPositions[1] = openParenthesisPosition[splitTokenDepth - 1];

+       substringsEndPositions[1] = splitScanner.startPosition;

+       splitOperatorsCount = 3; // resets the count of split operators

+       splitOperators[0] = 0;

+       splitOperators[1] = 0;

+       splitOperators[2] = currentToken;

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+      } else {

+       substringsCount = 1; // resets the count of substrings

 

-							substringsEndPositions[0] = splitScanner.startPosition;

-							// substring ends on operator start

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-							splitOperatorsCount = 2; // resets the count of split operators

-							splitOperators[0] = 0;

-							// nothing for first operand since operator will be inserted in front of the second operand

-							splitOperators[1] = currentToken;

+       substringsEndPositions[0] = splitScanner.startPosition;

+       // substring ends on operator start

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+       splitOperatorsCount = 2; // resets the count of split operators

+       splitOperators[0] = 0;

+       // nothing for first operand since operator will be inserted in front of the second operand

+       splitOperators[1] = currentToken;

 

-						}

-					} else {

-						if (openParenthesisPositionCount == splitTokenDepth

-							&& splitTokenPriority == getTokenPriority(currentToken)) {

-							// if another token with the same priority is found,

-							// push the start position of the substring and

-							// push the token into the stack.

-							// create a new array object if the current one is full.

-							if (substringsCount == substringsStartPositions.length) {

-								System.arraycopy(

-										substringsStartPositions, 

-										0, 

-										(substringsStartPositions = new int[substringsCount * 2]), 

-										0, 

-										substringsCount); 

-								System.arraycopy(

-										substringsEndPositions, 

-										0, 

-										(substringsEndPositions = new int[substringsCount * 2]), 

-										0, 

-										substringsCount); 

-							}

-							if (splitOperatorsCount == splitOperators.length) {

-								System.arraycopy(

-										splitOperators, 

-										0, 

-										(splitOperators = new int[splitOperatorsCount * 2]), 

-										0, 

-										splitOperatorsCount); 

-							}

-							substringsStartPositions[substringsCount] = position;

-							substringsEndPositions[substringsCount++] = splitScanner.startPosition;

-							// substring ends on operator start

-							position = splitScanner.currentPosition;

-							// next substring will start from operator end

-							splitOperators[splitOperatorsCount++] = currentToken;

-						}

-					}

-					default :

-						break;

-			}

-			if (isComment(currentToken)) {

-				lastCommentStartPosition = splitScanner.startPosition;

-			} else {

-				lastCommentStartPosition = -1;

-			}

-		}

-	} catch (InvalidInputException e) {

-		return null;

-	}

-	// if the string cannot be split, return null.

-	if (splitOperatorsCount == 0)

-		return null;

+      }

+     } else {

+      if (openParenthesisPositionCount == splitTokenDepth

+       && splitTokenPriority == getTokenPriority(currentToken)) {

+       // if another token with the same priority is found,

+       // push the start position of the substring and

+       // push the token into the stack.

+       // create a new array object if the current one is full.

+       if (substringsCount == substringsStartPositions.length) {

+        System.arraycopy(

+          substringsStartPositions, 

+          0, 

+          (substringsStartPositions = new int[substringsCount * 2]), 

+          0, 

+          substringsCount); 

+        System.arraycopy(

+          substringsEndPositions, 

+          0, 

+          (substringsEndPositions = new int[substringsCount * 2]), 

+          0, 

+          substringsCount); 

+       }

+       if (splitOperatorsCount == splitOperators.length) {

+        System.arraycopy(

+          splitOperators, 

+          0, 

+          (splitOperators = new int[splitOperatorsCount * 2]), 

+          0, 

+          splitOperatorsCount); 

+       }

+       substringsStartPositions[substringsCount] = position;

+       substringsEndPositions[substringsCount++] = splitScanner.startPosition;

+       // substring ends on operator start

+       position = splitScanner.currentPosition;

+       // next substring will start from operator end

+       splitOperators[splitOperatorsCount++] = currentToken;

+      }

+     }

+     default :

+      break;

+   }

+   if (isComment(currentToken)) {

+    lastCommentStartPosition = splitScanner.startPosition;

+   } else {

+    lastCommentStartPosition = -1;

+   }

+  }

+ } catch (InvalidInputException e) {

+  return null;

+ }

+ // if the string cannot be split, return null.

+ if (splitOperatorsCount == 0)

+  return null;

 

-	// ## SPECIAL CASES BEGIN

-	if (((splitOperatorsCount == 2 && splitOperators[1] == TokenNameDOT && splitTokenDepth == 0 && lastOpenParenthesisPosition > -1)

-			|| (splitOperatorsCount > 2 && splitOperators[1] == TokenNameDOT && splitTokenDepth == 0 && lastOpenParenthesisPosition > -1 && lastOpenParenthesisPosition <= options.maxLineLength)

-			|| (separateFirstArgumentOn(firstTokenOnLine) && splitTokenDepth > 0 && lastOpenParenthesisPosition > -1))

-		&& (lastOpenParenthesisPosition<splitScanner.source.length && splitScanner.source[lastOpenParenthesisPosition]!=')')){

-			// fix for 1FH4J2H: LFCOM:WINNT - Formatter - Empty parenthesis should not be broken on two lines

-		// only one split on a top level .

-		// or more than one split on . and substring before open parenthesis fits one line.

-		// or split inside parenthesis and first token is not a for/while/if

-		SplitLine sl = split(stringToSplit.substring(lastOpenParenthesisPosition), lastOpenParenthesisPosition);

-		if (sl == null || sl.operators[0] != TokenNameCOMMA) {

-			// trim() is used to remove the extra blanks at the end of the substring. See PR 1FGYPI1

-			return new SplitLine(

-					new int[] {0, 0}, 

-					new String[] {

-						stringToSplit.substring(0, lastOpenParenthesisPosition).trim(), 

-						stringToSplit.substring(lastOpenParenthesisPosition)},

-					new int[] {offsetInGlobalLine, lastOpenParenthesisPosition + offsetInGlobalLine}); 

-		} else {

-			

-			// right substring can be split and is split on comma

-			// copy substrings and operators

-			// except if the 1st string is empty.

+ // ## SPECIAL CASES BEGIN

+ if (((splitOperatorsCount == 2 && splitOperators[1] == TokenNameDOT && splitTokenDepth == 0 && lastOpenParenthesisPosition > -1)

+   || (splitOperatorsCount > 2 && splitOperators[1] == TokenNameDOT && splitTokenDepth == 0 && lastOpenParenthesisPosition > -1 && lastOpenParenthesisPosition <= options.maxLineLength)

+   || (separateFirstArgumentOn(firstTokenOnLine) && splitTokenDepth > 0 && lastOpenParenthesisPosition > -1))

+  && (lastOpenParenthesisPosition<splitScanner.source.length && splitScanner.source[lastOpenParenthesisPosition]!=')')){

+   // fix for 1FH4J2H: LFCOM:WINNT - Formatter - Empty parenthesis should not be broken on two lines

+  // only one split on a top level .

+  // or more than one split on . and substring before open parenthesis fits one line.

+  // or split inside parenthesis and first token is not a for/while/if

+  SplitLine sl = split(stringToSplit.substring(lastOpenParenthesisPosition), lastOpenParenthesisPosition);

+  if (sl == null || sl.operators[0] != TokenNameCOMMA) {

+   // trim() is used to remove the extra blanks at the end of the substring. See PR 1FGYPI1

+   return new SplitLine(

+     new int[] {0, 0}, 

+     new String[] {

+      stringToSplit.substring(0, lastOpenParenthesisPosition).trim(), 

+      stringToSplit.substring(lastOpenParenthesisPosition)},

+     new int[] {offsetInGlobalLine, lastOpenParenthesisPosition + offsetInGlobalLine}); 

+  } else {

+   

+   // right substring can be split and is split on comma

+   // copy substrings and operators

+   // except if the 1st string is empty.

 

-			int startIndex = (sl.substrings[0].length()==0)?1:0;

+   int startIndex = (sl.substrings[0].length()==0)?1:0;

 

-			int subStringsLength = sl.substrings.length + 1 - startIndex;

-			String[] result = new String[subStringsLength];

-			int[] startIndexes = new int[subStringsLength];

-			int operatorsLength = sl.operators.length + 1 - startIndex;

-			int[] operators = new int[operatorsLength];

+   int subStringsLength = sl.substrings.length + 1 - startIndex;

+   String[] result = new String[subStringsLength];

+   int[] startIndexes = new int[subStringsLength];

+   int operatorsLength = sl.operators.length + 1 - startIndex;

+   int[] operators = new int[operatorsLength];

 

-			result[0] = stringToSplit.substring(0, lastOpenParenthesisPosition);

-			operators[0] = 0;

+   result[0] = stringToSplit.substring(0, lastOpenParenthesisPosition);

+   operators[0] = 0;

 

-			System.arraycopy(sl.startSubstringsIndexes, startIndex, startIndexes, 1, subStringsLength - 1);

-			for (int i = subStringsLength - 1; i >= 0; i--) {

-				startIndexes[i] += offsetInGlobalLine;

-			}

-			System.arraycopy(sl.substrings, startIndex, result, 1, subStringsLength - 1);

-			System.arraycopy(sl.operators, startIndex, operators, 1, operatorsLength - 1);

+   System.arraycopy(sl.startSubstringsIndexes, startIndex, startIndexes, 1, subStringsLength - 1);

+   for (int i = subStringsLength - 1; i >= 0; i--) {

+    startIndexes[i] += offsetInGlobalLine;

+   }

+   System.arraycopy(sl.substrings, startIndex, result, 1, subStringsLength - 1);

+   System.arraycopy(sl.operators, startIndex, operators, 1, operatorsLength - 1);

 

-			return new SplitLine(operators, result, startIndexes);

-		}

-	}

+   return new SplitLine(operators, result, startIndexes);

+  }

+ }

 

-	// if the last token is a comment and the substring before the comment fits on a line,

-	// split before the comment and return the result.

-	if (lastCommentStartPosition > -1

-		&& lastCommentStartPosition < options.maxLineLength

-		&& splitTokenPriority > 50) {

-		int end = lastCommentStartPosition;

-		int start = lastCommentStartPosition;

-		if (stringToSplit.charAt(end - 1) == ' ') {

-			end--;

-		}

-		if (start != end && stringToSplit.charAt(start) == ' ') {

-			start++;

-		}

-		return new SplitLine(

-				new int[] {0, 0}, 

-				new String[] {

-					stringToSplit.substring(0, end), 

-					stringToSplit.substring(start)},

-				new int[] {0, start}); 

-	}

+ // if the last token is a comment and the substring before the comment fits on a line,

+ // split before the comment and return the result.

+ if (lastCommentStartPosition > -1

+  && lastCommentStartPosition < options.maxLineLength

+  && splitTokenPriority > 50) {

+  int end = lastCommentStartPosition;

+  int start = lastCommentStartPosition;

+  if (stringToSplit.charAt(end - 1) == ' ') {

+   end--;

+  }

+  if (start != end && stringToSplit.charAt(start) == ' ') {

+   start++;

+  }

+  return new SplitLine(

+    new int[] {0, 0}, 

+    new String[] {

+     stringToSplit.substring(0, end), 

+     stringToSplit.substring(start)},

+    new int[] {0, start}); 

+ }

 

-	if (position != stringToSplit.length()) {

-		

-		if (substringsCount == substringsStartPositions.length) {

-			System.arraycopy(

-					substringsStartPositions, 

-					0, 

-					(substringsStartPositions = new int[substringsCount * 2]), 

-					0, 

-					substringsCount); 

-			System.arraycopy(

-					substringsEndPositions, 

-					0, 

-					(substringsEndPositions = new int[substringsCount * 2]), 

-					0, 

-					substringsCount); 

-		}

-		// avoid empty extra substring, e.g. line terminated with a semi-colon

-		substringsStartPositions[substringsCount] = position;

-		substringsEndPositions[substringsCount++] = stringToSplit.length();

-	}

-	

-	if (splitOperatorsCount == splitOperators.length) {

-		System.arraycopy(

-				splitOperators, 

-				0, 

-				(splitOperators = new int[splitOperatorsCount * 2]), 

-				0, 

-				splitOperatorsCount); 

-	}

+ if (position != stringToSplit.length()) {

+  

+  if (substringsCount == substringsStartPositions.length) {

+   System.arraycopy(

+     substringsStartPositions, 

+     0, 

+     (substringsStartPositions = new int[substringsCount * 2]), 

+     0, 

+     substringsCount); 

+   System.arraycopy(

+     substringsEndPositions, 

+     0, 

+     (substringsEndPositions = new int[substringsCount * 2]), 

+     0, 

+     substringsCount); 

+  }

+  // avoid empty extra substring, e.g. line terminated with a semi-colon

+  substringsStartPositions[substringsCount] = position;

+  substringsEndPositions[substringsCount++] = stringToSplit.length();

+ }

+ 

+ if (splitOperatorsCount == splitOperators.length) {

+  System.arraycopy(

+    splitOperators, 

+    0, 

+    (splitOperators = new int[splitOperatorsCount * 2]), 

+    0, 

+    splitOperatorsCount); 

+ }

 

-	splitOperators[splitOperatorsCount] = 0;

+ splitOperators[splitOperatorsCount] = 0;

 

-	// the last element of the stack is the position of the end of StringToSPlit

-	// +1 because the substring method excludes the last character

-	String[] result = new String[substringsCount];

-	for (int i = 0; i < substringsCount; i++) {

-		int start = substringsStartPositions[i];

-		int end = substringsEndPositions[i];

-		if (stringToSplit.charAt(start) == ' ') {

-			start++;

-			substringsStartPositions[i]++;

-		}

-		if (end != start && stringToSplit.charAt(end - 1) == ' ') {

-			end--;

-		}

+ // the last element of the stack is the position of the end of StringToSPlit

+ // +1 because the substring method excludes the last character

+ String[] result = new String[substringsCount];

+ for (int i = 0; i < substringsCount; i++) {

+  int start = substringsStartPositions[i];

+  int end = substringsEndPositions[i];

+  if (stringToSplit.charAt(start) == ' ') {

+   start++;

+   substringsStartPositions[i]++;

+  }

+  if (end != start && stringToSplit.charAt(end - 1) == ' ') {

+   end--;

+  }

 

-		result[i] = stringToSplit.substring(start, end);

-		substringsStartPositions[i] += offsetInGlobalLine;

-	}

-	if (splitOperatorsCount > substringsCount) {

-		System.arraycopy(substringsStartPositions, 0, (substringsStartPositions = new int[splitOperatorsCount]), 0, substringsCount);

-		System.arraycopy(substringsEndPositions, 0, (substringsEndPositions = new int[splitOperatorsCount]), 0, substringsCount);

-		for (int i = substringsCount; i < splitOperatorsCount; i++) {

-			substringsStartPositions[i] = position;

-			substringsEndPositions[i] = position;

-		}

-		System.arraycopy(splitOperators, 0, (splitOperators = new int[splitOperatorsCount]), 0, splitOperatorsCount);

-	} else {

-		System.arraycopy(substringsStartPositions, 0, (substringsStartPositions = new int[substringsCount]), 0, substringsCount);

-		System.arraycopy(substringsEndPositions, 0, (substringsEndPositions = new int[substringsCount]), 0, substringsCount);	

-		System.arraycopy(splitOperators, 0, (splitOperators = new int[substringsCount]), 0, substringsCount);

-	}

-	

-	SplitLine splitLine = new SplitLine(splitOperators, result, substringsStartPositions);

-	return splitLine;

+  result[i] = stringToSplit.substring(start, end);

+  substringsStartPositions[i] += offsetInGlobalLine;

+ }

+ if (splitOperatorsCount > substringsCount) {

+  System.arraycopy(substringsStartPositions, 0, (substringsStartPositions = new int[splitOperatorsCount]), 0, substringsCount);

+  System.arraycopy(substringsEndPositions, 0, (substringsEndPositions = new int[splitOperatorsCount]), 0, substringsCount);

+  for (int i = substringsCount; i < splitOperatorsCount; i++) {

+   substringsStartPositions[i] = position;

+   substringsEndPositions[i] = position;

+  }

+  System.arraycopy(splitOperators, 0, (splitOperators = new int[splitOperatorsCount]), 0, splitOperatorsCount);

+ } else {

+  System.arraycopy(substringsStartPositions, 0, (substringsStartPositions = new int[substringsCount]), 0, substringsCount);

+  System.arraycopy(substringsEndPositions, 0, (substringsEndPositions = new int[substringsCount]), 0, substringsCount); 

+  System.arraycopy(splitOperators, 0, (splitOperators = new int[substringsCount]), 0, substringsCount);

+ }

+ 

+ SplitLine splitLine = new SplitLine(splitOperators, result, substringsStartPositions);

+ return splitLine;

 

 }

 private void updateMappedPositions(int startPosition) {

-	if (positionsToMap == null)	return;

-	char[] source = scanner.source;

-	int sourceLength = source.length;

-	while (indexToMap < positionsToMap.length && positionsToMap[indexToMap] <= startPosition) {

-		int posToMap = positionsToMap[indexToMap];

-		if (posToMap < 0 || posToMap >= sourceLength){ // protection against out of bounds position

-			indexToMap = positionsToMap.length; // no more mapping

-			return;

-		}

-		if (Character.isWhitespace(source[posToMap])) {

-			mappedPositions[indexToMap] = startPosition + globalDelta + lineDelta;

-		} else {

-			mappedPositions[indexToMap] = posToMap + globalDelta + lineDelta;

-		}

-		indexToMap++;

-	}

+ if (positionsToMap == null) return;

+ char[] source = scanner.source;

+ int sourceLength = source.length;

+ while (indexToMap < positionsToMap.length && positionsToMap[indexToMap] <= startPosition) {

+  int posToMap = positionsToMap[indexToMap];

+  if (posToMap < 0 || posToMap >= sourceLength){ // protection against out of bounds position

+   indexToMap = positionsToMap.length; // no more mapping

+   return;

+  }

+  if (Character.isWhitespace(source[posToMap])) {

+   mappedPositions[indexToMap] = startPosition + globalDelta + lineDelta;

+  } else {

+   mappedPositions[indexToMap] = posToMap + globalDelta + lineDelta;

+  }

+  indexToMap++;

+ }

 }

 private void updateMappedPositionsWhileSplitting(int startPosition, int endPosition) {

-	if (mappedPositions == null || mappedPositions.length == indexInMap) return;

+ if (mappedPositions == null || mappedPositions.length == indexInMap) return;

 

-	while(indexInMap < mappedPositions.length

-		&& startPosition <= mappedPositions[indexInMap]

-		&& mappedPositions[indexInMap] < endPosition

-		&& indexInMap < indexToMap) {

-			mappedPositions[indexInMap]+= splitDelta;

-			indexInMap++;

-	}

+ while(indexInMap < mappedPositions.length

+  && startPosition <= mappedPositions[indexInMap]

+  && mappedPositions[indexInMap] < endPosition

+  && indexInMap < indexToMap) {

+   mappedPositions[indexInMap]+= splitDelta;

+   indexInMap++;

+ }

 }

 }

diff --git a/formatter/org/eclipse/jdt/internal/formatter/impl/FormatterOptions.java b/formatter/org/eclipse/jdt/internal/formatter/impl/FormatterOptions.java
index fd6b7ae..175d967 100644
--- a/formatter/org/eclipse/jdt/internal/formatter/impl/FormatterOptions.java
+++ b/formatter/org/eclipse/jdt/internal/formatter/impl/FormatterOptions.java
@@ -8,8 +8,21 @@
 import org.eclipse.jdt.internal.formatter.*;

 import java.util.*;

 

-public class FormatterOptions {

+public class FormatterOptions {	

 

+	/**

+	 * Option IDs

+	 */

+	public static final String OPTION_InsertNewlineBeforeOpeningBrace = CodeFormatter.class.getName() + ".newlineOpeningBrace"; //$NON-NLS-1$

+	public static final String OPTION_InsertNewlineInControlStatement = CodeFormatter.class.getName() + ".newlineControlStatement"; //$NON-NLS-1$

+	public static final String OPTION_InsertNewLineBetweenElseAndIf = CodeFormatter.class.getName() + ".newlineElseIf"; //$NON-NLS-1$

+	public static final String OPTION_InsertNewLineInEmptyBlock = CodeFormatter.class.getName() + ".newlineEmptyBlock"; //$NON-NLS-1$

+	public static final String OPTION_ClearAllBlankLines = CodeFormatter.class.getName() + ".newlineClearAll"; //$NON-NLS-1$

+	public static final String OPTION_SplitLineExceedingLength = CodeFormatter.class.getName() + ".lineSplit"; //$NON-NLS-1$

+	public static final String OPTION_CompactAssignment = CodeFormatter.class.getName() + ".compactAssignment"; //$NON-NLS-1$

+	public static final String OPTION_TabulationChar = CodeFormatter.class.getName() + ".tabulationChar"; //$NON-NLS-1$

+	public static final String OPTION_TabulationSize = CodeFormatter.class.getName() + ".tabulationSize"; //$NON-NLS-1$

+	

 	// by default, do not insert blank line before opening brace

 	public boolean newLineBeforeOpeningBraceMode = false;

 

@@ -31,7 +44,7 @@
 	public boolean compactElseIfMode = false; // if true, else and if are kept on the same line.

 	public boolean newLineInEmptyBlockMode = true; // if false, no new line in {} if it's empty.

 	

-	public char[] lineSeparatorSequence = System.getProperty("line.separator"/*nonNLS*/).toCharArray();

+	public char[] lineSeparatorSequence = System.getProperty("line.separator").toCharArray(); //$NON-NLS-1$

 /** 

  * Initializing the formatter options with default settings

  */

@@ -42,7 +55,8 @@
  */

 public FormatterOptions(ConfigurableOption[] settings){

 	if (settings == null) return;

-	// filter options which are related to the compiler component

+

+	// filter options which are related to the formatter component

 	String componentName = CodeFormatter.class.getName();

 	for (int i = 0, max = settings.length; i < max; i++){

 		if (settings[i].getComponentName().equals(componentName)){

@@ -50,26 +64,7 @@
 		}

 	}

 }

-/**

- * Returns all the options of the Code Formatter to be shown by the UI

- *

- * @param locale java.util.Locale

- * @return com.ibm.compiler.java.ConfigurableOption[]

- */

-public ConfigurableOption[] getConfigurableOptions(Locale locale) {

-	String componentName = CodeFormatter.class.getName();

-	return new ConfigurableOption[] {

-		new ConfigurableOption(componentName, "newline.openingBrace"/*nonNLS*/,  locale, newLineBeforeOpeningBraceMode ? 0 : 1),

-		new ConfigurableOption(componentName, "newline.controlStatement"/*nonNLS*/,  locale, newlineInControlStatementMode ? 0 : 1),

-		new ConfigurableOption(componentName, "newline.clearAll"/*nonNLS*/,  locale, clearAllBlankLinesMode ? 0 : 1),

-		new ConfigurableOption(componentName, "newline.elseIf"/*nonNLS*/,  locale, compactElseIfMode ? 0 : 1),

-		new ConfigurableOption(componentName, "newline.emptyBlock"/*nonNLS*/,  locale, newLineInEmptyBlockMode ? 0 : 1),

-		new ConfigurableOption(componentName, "line.split"/*nonNLS*/,  locale, maxLineLength),

-		new ConfigurableOption(componentName, "style.compactAssignment"/*nonNLS*/,  locale, compactAssignmentMode ? 0 : 1),

-		new ConfigurableOption(componentName, "tabulation.char"/*nonNLS*/,  locale, indentWithTab ? 0 : 1),

-		new ConfigurableOption(componentName, "tabulation.size"/*nonNLS*/,  locale, tabSize)	

-	};

-}

+

 /**

  * 

  * @return int

@@ -160,37 +155,36 @@
  * @param newValue <CODE>int</CODE>

  */

 public void setOption(ConfigurableOption setting) {

-

-	switch (setting.getID()) {

-		case 1 : // insert blank line before opening brace

-			setNewLineBeforeOpeningBraceMode(setting.getCurrentValueIndex() == 0);

-			break;

-		case 2 : // insert blank line behind keywords (ELSE, CATCH, FINALLY,...) in control statements

-			setNewlineInControlStatementMode(setting.getCurrentValueIndex() == 0);

-			break;

-		case 3 : // flush all blank lines

-			setClearAllBlankLinesMode(setting.getCurrentValueIndex() == 0);

-			break;

-		case 4 : // puts else if on the same line

-			setCompactElseIfMode(setting.getCurrentValueIndex() == 0);

-		break;

-		case 5 : // add a new line inside an empty block.

-			setNewLineInEmptyBlockMode(setting.getCurrentValueIndex() == 0);

-		break;

-		case 6 : // line splitting will occur when line exceeds this length (0 -> no splitting)

-			setMaxLineLength(setting.getCurrentValueIndex());

-			break;

-		case 7 : // if isTrue, assignments look like x= 12 (not like x = 12);

-			setCompactAssignmentMode(setting.getCurrentValueIndex() == 0);

-			break;

-		case 9 : // should use tab or spaces to indent

-			setIndentationUsesTab(setting.getCurrentValueIndex() == 0);

-			break;

-		case 10 : // amount of spaces for a tabulation

-			setTabSize(setting.getCurrentValueIndex());

-			break;

+	

+	String optionID = setting.getID();

+	

+	if(optionID.equals(OPTION_InsertNewlineBeforeOpeningBrace)){

+		setNewLineBeforeOpeningBraceMode(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_InsertNewlineInControlStatement)){

+		setNewlineInControlStatementMode(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_ClearAllBlankLines)){

+		setClearAllBlankLinesMode(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_InsertNewLineBetweenElseAndIf)){

+		setCompactElseIfMode(setting.getValueIndex() == 1);

+	}else if(optionID.equals(OPTION_InsertNewLineInEmptyBlock)){

+		setNewLineInEmptyBlockMode(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_SplitLineExceedingLength)){

+		try {

+			setMaxLineLength(Integer.parseInt(setting.getValue()));

+		} catch(NumberFormatException e){

+		}

+	}else if(optionID.equals(OPTION_CompactAssignment)){

+		setCompactAssignmentMode(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_TabulationChar)){

+		setIndentationUsesTab(setting.getValueIndex() == 0);

+	}else if(optionID.equals(OPTION_TabulationSize)){

+		try {

+			setTabSize(Integer.parseInt(setting.getValue()));

+		} catch(NumberFormatException e){

+		}

 	}

 }

+

 public void setReuseExistingLayoutMode(boolean flag) {

 }

 public void setTabSize(int size) {

diff --git a/formatter/org/eclipse/jdt/internal/formatter/impl/SplitLine.java b/formatter/org/eclipse/jdt/internal/formatter/impl/SplitLine.java
index 912da60..dfaab42 100644
--- a/formatter/org/eclipse/jdt/internal/formatter/impl/SplitLine.java
+++ b/formatter/org/eclipse/jdt/internal/formatter/impl/SplitLine.java
@@ -45,151 +45,151 @@
 

 	switch (currentOperator){

 		case TokenNameextends:

-			operatorString="extends"/*nonNLS*/;

+			operatorString="extends"; //$NON-NLS-1$

 			break;

 		case TokenNameimplements:

-			operatorString="implements"/*nonNLS*/;

+			operatorString="implements"; //$NON-NLS-1$

 			break;

 		case TokenNamethrows:

-			operatorString="throws"/*nonNLS*/;

+			operatorString="throws"; //$NON-NLS-1$

 			break;

 		case TokenNameSEMICOLON : // ;

-			operatorString=";"/*nonNLS*/;

+			operatorString=";"; //$NON-NLS-1$

 			break;

 		case TokenNameCOMMA : // ,

-			operatorString=","/*nonNLS*/;

+			operatorString=","; //$NON-NLS-1$

 			break;

 		case TokenNameEQUAL : // =

-			operatorString="="/*nonNLS*/;

+			operatorString="="; //$NON-NLS-1$

 			break;

 		case TokenNameAND_AND : // && (15.22)

-			operatorString="&&"/*nonNLS*/;

+			operatorString="&&"; //$NON-NLS-1$

 			break;

 		case TokenNameOR_OR : // || (15.23)

-			operatorString="||"/*nonNLS*/;

+			operatorString="||"; //$NON-NLS-1$

 			break;

 		case TokenNameQUESTION : // ? (15.24)

-			operatorString="?"/*nonNLS*/;

+			operatorString="?"; //$NON-NLS-1$

 			break;

 

 		case TokenNameCOLON : // : (15.24)

-			operatorString=":"/*nonNLS*/;

+			operatorString=":"; //$NON-NLS-1$

 			break;

 		case TokenNameEQUAL_EQUAL : // == (15.20, 15.20.1, 15.20.2, 15.20.3)

-			operatorString="=="/*nonNLS*/;

+			operatorString="=="; //$NON-NLS-1$

 			break;

 

 		case TokenNameNOT_EQUAL : // != (15.20, 15.20.1, 15.20.2, 15.20.3)

-			operatorString="!="/*nonNLS*/;

+			operatorString="!="; //$NON-NLS-1$

 			break;

 

 		case TokenNameLESS : // < (15.19.1)

-			operatorString="<"/*nonNLS*/;

+			operatorString="<"; //$NON-NLS-1$

 			break;

 

 		case TokenNameLESS_EQUAL : // <= (15.19.1)

-			operatorString="<="/*nonNLS*/;

+			operatorString="<="; //$NON-NLS-1$

 			break;

 

 		case TokenNameGREATER : // > (15.19.1)

-			operatorString=">"/*nonNLS*/;

+			operatorString=">"; //$NON-NLS-1$

 			break;

 

 		case TokenNameGREATER_EQUAL : // >= (15.19.1)

-			operatorString=">="/*nonNLS*/;

+			operatorString=">="; //$NON-NLS-1$

 			break;

 

 		case TokenNameinstanceof : // instanceof

-			operatorString="instanceof"/*nonNLS*/;

+			operatorString="instanceof"; //$NON-NLS-1$

 			break;

 		case TokenNamePLUS : // + (15.17, 15.17.2)

-			operatorString="+"/*nonNLS*/;

+			operatorString="+"; //$NON-NLS-1$

 			break;

 

 		case TokenNameMINUS : // - (15.17.2)

-			operatorString="-"/*nonNLS*/;

+			operatorString="-"; //$NON-NLS-1$

 			break;

 		case TokenNameMULTIPLY : // * (15.16.1)

-			operatorString="*"/*nonNLS*/;

+			operatorString="*"; //$NON-NLS-1$

 			break;

 

 		case TokenNameDIVIDE : // / (15.16.2)

-			operatorString="/"/*nonNLS*/;

+			operatorString="/"; //$NON-NLS-1$

 			break;

 

 		case TokenNameREMAINDER : // % (15.16.3)

-			operatorString="%"/*nonNLS*/;

+			operatorString="%"; //$NON-NLS-1$

 			break;

 		case TokenNameLEFT_SHIFT : // << (15.18)

-			operatorString="<<"/*nonNLS*/;

+			operatorString="<<"; //$NON-NLS-1$

 			break;

 

 		case TokenNameRIGHT_SHIFT : // >> (15.18)

-			operatorString=">>"/*nonNLS*/;

+			operatorString=">>"; //$NON-NLS-1$

 			break;

 

 		case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> (15.18)

-			operatorString=">>>"/*nonNLS*/;

+			operatorString=">>>"; //$NON-NLS-1$

 			break;

 		case TokenNameAND : // & (15.21, 15.21.1, 15.21.2)

-			operatorString="&"/*nonNLS*/;

+			operatorString="&"; //$NON-NLS-1$

 			break;

 

 		case TokenNameOR : // | (15.21, 15.21.1, 15.21.2)

-			operatorString="|"/*nonNLS*/;

+			operatorString="|"; //$NON-NLS-1$

 			break;

 

 		case TokenNameXOR : // ^ (15.21, 15.21.1, 15.21.2)

-			operatorString="^"/*nonNLS*/;

+			operatorString="^"; //$NON-NLS-1$

 			break;

 		case TokenNameMULTIPLY_EQUAL : // *= (15.25.2)

-			operatorString="*="/*nonNLS*/;

+			operatorString="*="; //$NON-NLS-1$

 			break;

 

 		case TokenNameDIVIDE_EQUAL : // /= (15.25.2)

-			operatorString="/="/*nonNLS*/;

+			operatorString="/="; //$NON-NLS-1$

 			break;

 		case TokenNameREMAINDER_EQUAL : // %= (15.25.2)

-			operatorString="%="/*nonNLS*/;

+			operatorString="%="; //$NON-NLS-1$

 			break;

 

 		case TokenNamePLUS_EQUAL : // += (15.25.2)

-			operatorString="+="/*nonNLS*/;

+			operatorString="+="; //$NON-NLS-1$

 			break;

 

 		case TokenNameMINUS_EQUAL : // -= (15.25.2)

-			operatorString="-="/*nonNLS*/;

+			operatorString="-="; //$NON-NLS-1$

 			break;

 

 		case TokenNameLEFT_SHIFT_EQUAL : // <<= (15.25.2)

-			operatorString="<<="/*nonNLS*/;

+			operatorString="<<="; //$NON-NLS-1$

 			break;

 

 		case TokenNameRIGHT_SHIFT_EQUAL : // >>= (15.25.2)

-			operatorString=">>="/*nonNLS*/;

+			operatorString=">>="; //$NON-NLS-1$

 			break;

 

 		case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= (15.25.2)

-			operatorString=">>>="/*nonNLS*/;

+			operatorString=">>>="; //$NON-NLS-1$

 			break;

 

 		case TokenNameAND_EQUAL : // &= (15.25.2)

-			operatorString="&="/*nonNLS*/;

+			operatorString="&="; //$NON-NLS-1$

 			break;

 

 		case TokenNameXOR_EQUAL : // ^= (15.25.2)

-			operatorString="^="/*nonNLS*/;

+			operatorString="^="; //$NON-NLS-1$

 			break;

 

 		case TokenNameOR_EQUAL : // |= (15.25.2)

-			operatorString="|="/*nonNLS*/;

+			operatorString="|="; //$NON-NLS-1$

 			break;

 		case TokenNameDOT : // .

-			operatorString="."/*nonNLS*/;

+			operatorString="."; //$NON-NLS-1$

 			break;

 

 		default:

-			operatorString=""/*nonNLS*/;

+			operatorString=""; //$NON-NLS-1$

 	}

 		if (placeOperatorAhead){

 			result.append(operatorString);

@@ -200,6 +200,6 @@
 		}

 		result.append('\n');

 	}

-	return ""/*nonNLS*/;

+	return ""; //$NON-NLS-1$

 }

 }

diff --git a/formatter/org/eclipse/jdt/internal/formatter/options.properties b/formatter/org/eclipse/jdt/internal/formatter/options.properties
deleted file mode 100644
index 9a9b3d8..0000000
--- a/formatter/org/eclipse/jdt/internal/formatter/options.properties
+++ /dev/null
@@ -1,59 +0,0 @@
-newline.openingBrace.number=1

-newline.openingBrace.category=Newline

-newline.openingBrace.name=I&nsert new line before opening brace

-newline.openingBrace.possibleValues=2|Insert|Do not insert

-newline.openingBrace.description=When Insert, a new line is inserted before an opening brace, otherwise nothing is inserted

-

-newline.controlStatement.number=2

-newline.controlStatement.category=Newline

-newline.controlStatement.name=Insert new &line in control statement

-newline.controlStatement.possibleValues=2|Insert|Do not insert

-newline.controlStatement.description=When Insert, a new line is inserted between } and else, catch, finally

-

-newline.clearAll.number=3

-newline.clearAll.category=Newline

-newline.clearAll.name=Clear all &blank lines

-newline.clearAll.possibleValues=2|Clear|Preserve one

-newline.clearAll.description=When Clear, all blank lines are removed. When Preserve one, only one is kept and all others removed.

-

-newline.elseIf.number=4

-newline.elseIf.category=Newline

-newline.elseIf.name=&Keep else if on the same line

-newline.elseIf.possibleValues=2|Yes|No

-newline.elseIf.description=When Yes, a blank line is inserted between a else and a if when they are contiguous

-

-newline.emptyBlock.number=5

-newline.emptyBlock.category=Newline

-newline.emptyBlock.name=In&sert a new line inside an empty block

-newline.emptyBlock.possibleValues=2|Insert|Do not insert

-newline.emptyBlock.description=When insert, a line break is inserted between contiguous { and }, if } is not followed by a keyword.

-

-line.split.number=6

-line.split.category=Line splitting

-line.split.name=Ma&ximum line length

-line.split.possibleValues=-1

-line.split.description=Enable splitting of long lines (exceeding the configurable length). Length of 0 will disable line splitting

-

-style.compactAssignment.number=7

-style.compactAssignment.category=Style

-style.compactAssignment.name=&Compact assignment

-style.compactAssignment.possibleValues=2|Compact|Normal

-style.compactAssignment.description=Assignments can be formatted asymmetrically, e.g. 'int x= 2;', when Normal, a space is inserted before the assignment operator

-

-style.reuseExistingLayout.number=8

-style.reuseExistingLayout.category=Style

-style.reuseExistingLayout.name=&Reuse existing layout

-style.reuseExistingLayout.possibleValues=2|Reuse|Do not reuse

-style.reuseExistingLayout.description=If the user has formatted his code a certain way, the formatter does not try to reformat it

-

-tabulation.char.number=9

-tabulation.char.category=Style

-tabulation.char.name=Indentation is represented by &tab

-tabulation.char.possibleValues=2|Tab|Spaces

-tabulation.char.description=Either choose to indent with tab characters or spaces

-

-tabulation.size.number=10

-tabulation.size.category=Style

-tabulation.size.name=&Amount of spaces representing a tab

-tabulation.size.possibleValues=-1

-tabulation.size.description=Tabulation size in term of space characters
\ No newline at end of file
diff --git a/model/org/eclipse/jdt/core/Flags.java b/model/org/eclipse/jdt/core/Flags.java
index b2a1737..2df2d84 100644
--- a/model/org/eclipse/jdt/core/Flags.java
+++ b/model/org/eclipse/jdt/core/Flags.java
@@ -169,20 +169,20 @@
 	public static String toString(int flags) {

 		StringBuffer sb = new StringBuffer();

 

-		if (isPublic(flags))	sb.append("public "/*nonNLS*/);

-		if (isProtected(flags)) sb.append("protected "/*nonNLS*/);

-		if (isPrivate(flags))	sb.append("private "/*nonNLS*/);

-		if (isStatic(flags)) sb.append("static "/*nonNLS*/);

-		if (isAbstract(flags)) sb.append("abstract "/*nonNLS*/);

-		if (isFinal(flags)) sb.append("final "/*nonNLS*/);

-		if (isNative(flags)) sb.append("native "/*nonNLS*/);

-		if (isSynchronized(flags)) sb.append("synchronized "/*nonNLS*/);

-		if (isTransient(flags)) sb.append("transient "/*nonNLS*/);

-		if (isVolatile(flags)) sb.append("volatile "/*nonNLS*/);

-		if (isStrictfp(flags)) sb.append("strictfp "/*nonNLS*/);

+		if (isPublic(flags))	sb.append("public "); //$NON-NLS-1$

+		if (isProtected(flags)) sb.append("protected "); //$NON-NLS-1$

+		if (isPrivate(flags))	sb.append("private "); //$NON-NLS-1$

+		if (isStatic(flags)) sb.append("static "); //$NON-NLS-1$

+		if (isAbstract(flags)) sb.append("abstract "); //$NON-NLS-1$

+		if (isFinal(flags)) sb.append("final "); //$NON-NLS-1$

+		if (isNative(flags)) sb.append("native "); //$NON-NLS-1$

+		if (isSynchronized(flags)) sb.append("synchronized "); //$NON-NLS-1$

+		if (isTransient(flags)) sb.append("transient "); //$NON-NLS-1$

+		if (isVolatile(flags)) sb.append("volatile "); //$NON-NLS-1$

+		if (isStrictfp(flags)) sb.append("strictfp "); //$NON-NLS-1$

 

 		int len = sb.length();

-		if (len == 0) return ""/*nonNLS*/;

+		if (len == 0) return ""; //$NON-NLS-1$

 		sb.setLength(len-1);

 		return sb.toString();

 	}

diff --git a/model/org/eclipse/jdt/core/IJavaModelMarker.java b/model/org/eclipse/jdt/core/IJavaModelMarker.java
index 30af205..cbe4641 100644
--- a/model/org/eclipse/jdt/core/IJavaModelMarker.java
+++ b/model/org/eclipse/jdt/core/IJavaModelMarker.java
@@ -19,7 +19,7 @@
 	 * This can be used to recognize those markers in the workspace that flag problems 

 	 * detected by the Java tooling during compilation.

 	 */

-	public static final String JAVA_MODEL_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".problem"/*nonNLS*/;

+	public static final String JAVA_MODEL_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".problem"; //$NON-NLS-1$

 

 

 	/**

@@ -28,19 +28,19 @@
 	 * problems detected by the Java tooling (such as a cycle in the build path, a problem

 	 * detected by the outliner, or a problem detected during a code completion)

 	 */

-	public static final String TRANSIENT_PROBLEM = JavaCore.PLUGIN_ID + ".transient_problem"/*nonNLS*/;

+	public static final String TRANSIENT_PROBLEM = JavaCore.PLUGIN_ID + ".transient_problem"; //$NON-NLS-1$

     

 	/** 

 	 * Id marker attribute (value <code>"id"</code>).

 	 * Reserved for future use.

 	 */

-	 public static final String ID = "id"/*nonNLS*/;

+	 public static final String ID = "id"; //$NON-NLS-1$

 

 	/** 

 	 * Flags marker attribute (value <code>"flags"</code>).

 	 * Reserved for future use.

 	 */

-	 public static final String FLAGS = "flags"/*nonNLS*/;

+	 public static final String FLAGS = "flags"; //$NON-NLS-1$

 

 	/** 

 	 * Cycle detected marker attribute (value <code>"cycleDetected"</code>).

@@ -48,11 +48,11 @@
 	 * The value of this attribute is the name of the project that caused a 

 	 * cycle in the projects classpaths.

 	 */

-	 public static final String CYCLE_DETECTED = "cycleDetected"/*nonNLS*/;

+	 public static final String CYCLE_DETECTED = "cycleDetected"; //$NON-NLS-1$

 	/**

 	 * Build path problem marker type (value <code>"org.eclipse.jdt.core.buildpath_problem"</code>).

 	 * This can be used to recognize those markers in the workspace that flag problems 

 	 * detected by the Java tooling during classpath setting.

 	 */

-	public static final String BUILDPATH_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".buildpath_problem"/*nonNLS*/;

+	public static final String BUILDPATH_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".buildpath_problem"; //$NON-NLS-1$

 }

diff --git a/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java b/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
index 6297996..27dfaa1 100644
--- a/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
+++ b/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
@@ -227,4 +227,13 @@
 	 * Status constant indicating that a classpath entry was invalid

 	 */

 	public static final int INVALID_CLASSPATH = 964;

+	/**

+	 * Status constant indicating that a value is not a possible value

+	 * for an option.

+	 */

+	public static final int INVALID_OPTION_VALUE = 963;

+	/**

+	 * Status constant indicating that an option is not an existing option.

+	 */

+	public static final int INVALID_OPTION = 962;

 }

diff --git a/model/org/eclipse/jdt/core/IPackageFragment.java b/model/org/eclipse/jdt/core/IPackageFragment.java
index fde463d..a63f609 100644
--- a/model/org/eclipse/jdt/core/IPackageFragment.java
+++ b/model/org/eclipse/jdt/core/IPackageFragment.java
@@ -31,7 +31,7 @@
 	 * string, <code>""</code>).

 	 * </p>

  	*/

-	public static final String DEFAULT_PACKAGE_NAME = ""/*nonNLS*/;

+	public static final String DEFAULT_PACKAGE_NAME = ""; //$NON-NLS-1$

 /**

  * Returns whether this fragment contains at least one Java resource.

  */

diff --git a/model/org/eclipse/jdt/core/IPackageFragmentRoot.java b/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
index ed893af..9de4421 100644
--- a/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
+++ b/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
@@ -40,7 +40,7 @@
 	/**

 	 * Empty root path

 	 */

-	String DEFAULT_PACKAGEROOT_PATH = ""/*nonNLS*/;

+	String DEFAULT_PACKAGEROOT_PATH = ""; //$NON-NLS-1$

 

 /**

  * Attaches the source archive identified by the given absolute path to this

diff --git a/model/org/eclipse/jdt/core/JavaConventions.java b/model/org/eclipse/jdt/core/JavaConventions.java
index 5026726..00aaca0 100644
--- a/model/org/eclipse/jdt/core/JavaConventions.java
+++ b/model/org/eclipse/jdt/core/JavaConventions.java
@@ -29,7 +29,7 @@
  */

 public final class JavaConventions {

 	private final static char fgDot= '.';

-	private final static String fgJAVA= "JAVA"/*nonNLS*/;

+	private final static String fgJAVA= "JAVA"; //$NON-NLS-1$

 /**

  * Not instantiable.

  */

@@ -48,8 +48,8 @@
 	}

 	String extension1 = rootPath1.getFileExtension();

 	String extension2 = rootPath2.getFileExtension();

-	String jarExtension = "JAR"/*nonNLS*/;

-	String zipExtension = "ZIP"/*nonNLS*/;

+	String jarExtension = "JAR"; //$NON-NLS-1$

+	String zipExtension = "ZIP"; //$NON-NLS-1$

 	if (extension1 != null && (extension1.equalsIgnoreCase(jarExtension) || extension1.equalsIgnoreCase(zipExtension))) {

 		return false;

 	} 

@@ -111,14 +111,14 @@
  */

 public static IStatus validateCompilationUnitName(String name) {

 	if (name == null) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.nullName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.nullName"), null); //$NON-NLS-1$

 	}

 	String extension;

 	String identifier;

 	int index;

 	index = name.indexOf('.');

 	if (index == -1) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"), null); //$NON-NLS-1$

 	}

 	identifier = name.substring(0, index);

 	extension = name.substring(index + 1);

@@ -127,9 +127,9 @@
 		return status;

 	}

 	if (!Util.isJavaFileName(name)) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"), null); //$NON-NLS-1$

 	}

-	return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);

+	return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null); //$NON-NLS-1$

 }

 /**

  * Validate the given field name.

@@ -159,9 +159,9 @@
  */

 public static IStatus validateIdentifier(String id) {

 	if (scannedIdentifier(id) != null) {

-		return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);

+		return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null); //$NON-NLS-1$

 	} else {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier"/*nonNLS*/, id), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier", id), null); //$NON-NLS-1$

 	}

 }

 /**

@@ -178,13 +178,13 @@
  */

 public static IStatus validateImportDeclaration(String name) {

 	if (name == null || name.length() == 0) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.nullImport"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.nullImport"), null); //$NON-NLS-1$

 	} 

 	if (name.charAt(name.length() - 1) == '*') {

 		if (name.charAt(name.length() - 2) == '.') {

 			return validatePackageName(name.substring(0, name.length() - 2));

 		} else {

-			return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.unqualifiedImport"/*nonNLS*/), null);

+			return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.unqualifiedImport"), null); //$NON-NLS-1$

 		}

 	}

 	return validatePackageName(name);

@@ -204,11 +204,11 @@
  */

 public static IStatus validateJavaTypeName(String name) {

 	if (name == null) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nullName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nullName"), null); //$NON-NLS-1$

 	}

 	String trimmed = name.trim();

 	if (!name.equals(trimmed)) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nameWithBlanks"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nameWithBlanks"), null); //$NON-NLS-1$

 	}

 	int index = name.lastIndexOf('.');

 	char[] scannedID;

@@ -228,14 +228,14 @@
 

 	if (scannedID != null) {

 		if (CharOperation.contains('$', scannedID)) {

-			return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.dollarName"/*nonNLS*/), null);

+			return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.dollarName"), null); //$NON-NLS-1$

 		}

 		if ((scannedID.length > 0 && Character.isLowerCase(scannedID[0]))) {

-			return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.lowercaseName"/*nonNLS*/), null);

+			return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.lowercaseName"), null); //$NON-NLS-1$

 		}

-		return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);

+		return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null); //$NON-NLS-1$

 	} else {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.invalidName"/*nonNLS*/, name), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.invalidName", name), null); //$NON-NLS-1$

 	}

 }

 /**

@@ -266,22 +266,22 @@
  */

 public static IStatus validatePackageName(String name) {

 	if (name == null) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nullName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nullName"), null); //$NON-NLS-1$

 	}

 	int length;

 	if ((length = name.length()) == 0) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.emptyName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.emptyName"), null); //$NON-NLS-1$

 	}

 	if (name.charAt(0) == fgDot || name.charAt(length-1) == fgDot) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.dotName"/*nonNLS*/), null);

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.dotName"), null); //$NON-NLS-1$

 	}

 	if (Character.isWhitespace(name.charAt(0)) || Character.isWhitespace(name.charAt(name.length() - 1))) {

-		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nameWithBlanks"/*nonNLS*/), null);;

+		return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nameWithBlanks"), null);; //$NON-NLS-1$

 	}

 	int dot = 0;

 	while (dot != -1 && dot < length-1) {

 		if ((dot = name.indexOf(fgDot, dot+1)) != -1 && dot < length-1 && name.charAt(dot+1) == fgDot) {

-			return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.consecutiveDotsName"/*nonNLS*/), null);

+			return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.consecutiveDotsName"), null); //$NON-NLS-1$

 			}

 	}

 	StringTokenizer st = new StringTokenizer(name, new String(new char[] {fgDot}));

@@ -293,7 +293,178 @@
 			return status;

 		}

 	}

-	return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);

+	return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null); //$NON-NLS-1$

 }

 

+/**

+ * Validate the given classpath and output location.

+ * - Source folders cannot be nested inside the binary output, and reciprocally. They can coincidate.

+ * - Source folders cannot be nested in each other.

+ * - Output location must be nested inside project.

+ 

+ * @param classpath a given classpath

+ * @param outputLocation a given output location

+ * @return a status object with code <code>IStatus.OK</code> if

+ *		the given classpath and output location are compatible, otherwise a status 

+ *		object indicating what is wrong with the classpath or output location

+ */

+public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClasspathEntry[] classpath, IPath outputLocation) {

+

+	IProject project = javaProject.getProject();

+	IPath projectPath= project.getFullPath();

+

+	/* validate output location */

+	if (outputLocation == null) {

+		return new JavaModelStatus(IJavaModelStatusConstants.NULL_PATH);

+	}

+	if (outputLocation.isAbsolute()) {

+		if (!projectPath.isPrefixOf(outputLocation)) {

+			return new JavaModelStatus(IJavaModelStatusConstants.PATH_OUTSIDE_PROJECT, javaProject, outputLocation.toString());

+		}

+	} else {

+		return new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, outputLocation);

+	}

+

+		

+		

+	// check if any source entries coincidates with binary output - in which case nesting inside output is legal

+	boolean allowNestingInOutput = false;

+	boolean hasSource = false;

+	for (int i = 0 ; i < classpath.length; i++) {

+		if (classpath[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) hasSource = true;

+		if (classpath[i].getPath().equals(outputLocation)){

+			allowNestingInOutput = true;

+			break;

+		}

+	}

+	if (!hasSource) allowNestingInOutput = true; // if no source, then allowed

+	

+	// check all entries

+	for (int i = 0 ; i < classpath.length; i++) {

+		IClasspathEntry entry = classpath[i];

+		IPath entryPath = entry.getPath();

+

+		// no further check if entry coincidates with project or output location

+		if (entryPath.equals(projectPath)) continue;

+		if (entryPath.equals(outputLocation)) continue;

+		

+		// prevent nesting source entries in each other

+		if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){

+			for (int j = 0; j < classpath.length; j++){

+				IClasspathEntry otherEntry = classpath[j];

+				if (entry != otherEntry && otherEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE){

+					if (entryPath.isPrefixOf(otherEntry.getPath())){

+						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.cannotNestSourceFolderInSource",entryPath.toString(), otherEntry.getPath().toString())); //$NON-NLS-1$

+					}

+				}

+			}

+		}

+		// prevent nesting output location inside entry

+		if (entryPath.isPrefixOf(outputLocation)) {

+			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.cannotNestSourceFolderInOutput",entryPath.toString(), outputLocation.toString())); //$NON-NLS-1$

+		}

+

+		// prevent nesting entry inside output location - when distinct from project or a source folder

+		if (!allowNestingInOutput && outputLocation.isPrefixOf(entryPath)) {

+			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.cannotNestOuputInSourceFolder", outputLocation.toString(), entryPath.toString())); //$NON-NLS-1$

+		}

+	}

+	return JavaModelStatus.VERIFIED_OK;	

+}

+

+	/**

+	 * Returns a message describing the problem related to this classpath entry if any, or null if entry is fine 

+	 * (i.e. if the given classpath entry denotes a valid element to be referenced onto a classpath).

+	 */

+	public static IJavaModelStatus validateClasspathEntry(IJavaProject javaProject, IClasspathEntry entry, boolean checkSourceAttachment){

+		

+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();			

+		IPath path = entry.getPath();

+		

+		switch(entry.getEntryKind()){

+

+			// variable entry check

+			case IClasspathEntry.CPE_VARIABLE :

+				if (path != null && path.segmentCount() >= 1){

+					entry = JavaCore.getResolvedClasspathEntry(entry);

+					if (entry == null){

+						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundVariablePath", path.toString())); //$NON-NLS-1$

+					}

+					return validateClasspathEntry(javaProject, entry, checkSourceAttachment);

+				} else {

+					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalVariablePath", path.toString()));					 //$NON-NLS-1$

+				}

+

+			// library entry check

+			case IClasspathEntry.CPE_LIBRARY :

+				if (path != null && path.isAbsolute() && !path.isEmpty()) {

+					IPath sourceAttachment = entry.getSourceAttachmentPath();

+					Object target = JavaModel.getTarget(workspaceRoot, path, true);

+					if (target instanceof IResource){

+						IResource resolvedResource = (IResource) target;

+						switch(resolvedResource.getType()){

+							case IResource.FILE :

+								String extension = resolvedResource.getFileExtension();

+								if ("jar".equalsIgnoreCase(extension) || "zip".equalsIgnoreCase(extension)){ // internal binary archive //$NON-NLS-2$ //$NON-NLS-1$

+									if (checkSourceAttachment 

+										&& sourceAttachment != null

+										&& !sourceAttachment.isEmpty()

+										&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

+										return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceAttachment", sourceAttachment.toString())); //$NON-NLS-1$

+									}

+								}

+								break;

+							case IResource.FOLDER :	// internal binary folder

+								if (checkSourceAttachment 

+									&& sourceAttachment != null 

+									&& !sourceAttachment.isEmpty()

+									&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

+									return  new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceAttachment", sourceAttachment.toString())); //$NON-NLS-1$

+								}

+						}

+					} else if (target instanceof File){

+						if (checkSourceAttachment 

+							&& sourceAttachment != null 

+							&& !sourceAttachment.isEmpty()

+							&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

+							return  new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceAttachment", sourceAttachment.toString())); //$NON-NLS-1$

+						}

+					} else {

+						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundLibrary", path.toString())); //$NON-NLS-1$

+					}

+				} else {

+					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalLibraryPath", path.toString())); //$NON-NLS-1$

+				}

+				break;

+

+			// project entry check

+			case IClasspathEntry.CPE_PROJECT :

+				if (path != null && path.isAbsolute() && !path.isEmpty()) {

+					IProject project = workspaceRoot.getProject(path.segment(0));

+					try {

+						if (!project.exists() || !project.hasNature(JavaCore.NATURE_ID)){

+							return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundProject", path.segment(0).toString())); //$NON-NLS-1$

+						}

+					} catch (CoreException e){

+						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundProject", path.segment(0).toString())); //$NON-NLS-1$

+					}

+				} else {

+					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalProjectPath", path.segment(0).toString())); //$NON-NLS-1$

+				}

+				break;

+

+			// project source folder

+			case IClasspathEntry.CPE_SOURCE :

+				if (path != null && path.isAbsolute() && !path.isEmpty()) {

+					IPath projectPath= javaProject.getProject().getFullPath();

+					if (!projectPath.isPrefixOf(path) || JavaModel.getTarget(workspaceRoot, path, true) == null){

+						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceFolder", path.toString())); //$NON-NLS-1$

+					}

+				} else {

+					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalSourceFolderPath", path.toString())); //$NON-NLS-1$

+				}

+				break;

+		}

+	return JavaModelStatus.VERIFIED_OK;		

+}

 }

diff --git a/model/org/eclipse/jdt/core/JavaCore.java b/model/org/eclipse/jdt/core/JavaCore.java
index 08955ad..c146e33 100644
--- a/model/org/eclipse/jdt/core/JavaCore.java
+++ b/model/org/eclipse/jdt/core/JavaCore.java
@@ -4,14 +4,18 @@
  * (c) Copyright IBM Corp. 2000, 2001.

  * All Rights Reserved.

  */

- 

+

 import org.eclipse.core.runtime.*;

 import org.eclipse.core.resources.*;

 

 import java.io.*;

+import java.net.URL;

 import java.util.*;

 

+import org.eclipse.jdt.internal.codeassist.impl.CompletionOptions;

 import org.eclipse.jdt.internal.compiler.*;

+import org.eclipse.jdt.internal.compiler.Compiler;

+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;

 import org.eclipse.jdt.internal.compiler.env.*;

 import org.eclipse.jdt.core.*;

 import org.eclipse.jdt.internal.core.builder.*;

@@ -19,6 +23,8 @@
 import org.eclipse.jdt.internal.core.builder.impl.*;

 import org.eclipse.jdt.internal.core.builder.impl.ProblemFactory;

 import org.eclipse.jdt.internal.core.search.indexing.*;

+import org.eclipse.jdt.internal.formatter.CodeFormatter;

+import org.eclipse.jdt.internal.formatter.impl.FormatterOptions;

 

 /**

  * The plug-in runtime class for the Java model plug-in containing the core

@@ -38,25 +44,25 @@
  */

 public final class JavaCore extends Plugin implements IExecutableExtension {

 

-

 	private static Plugin JAVA_CORE_PLUGIN = null;

 	/**

 	 * The plug-in identifier of the Java core support

 	 * (value <code>"org.eclipse.jdt.core"</code>).

 	 */

-	public static final String PLUGIN_ID = "org.eclipse.jdt.core"/*nonNLS*/; // getPlugin().getDescriptor().getUniqueIdentifier();

+	public static final String PLUGIN_ID = "org.eclipse.jdt.core" ; //$NON-NLS-1$

+	// getPlugin().getDescriptor().getUniqueIdentifier();

 

 	/**

 	 * The identifier for the Java builder

 	 * (value <code>"org.eclipse.jdt.core.javabuilder"</code>).

 	 */

-	public static final String BUILDER_ID = PLUGIN_ID + ".javabuilder"/*nonNLS*/;

+	public static final String BUILDER_ID = PLUGIN_ID + ".javabuilder" ; //$NON-NLS-1$

 

 	/**

 	 * The identifier for the Java model

 	 * (value <code>"org.eclipse.jdt.core.javamodel"</code>).

 	 */

-	public static final String MODEL_ID = PLUGIN_ID + ".javamodel"/*nonNLS*/;

+	public static final String MODEL_ID = PLUGIN_ID + ".javamodel" ; //$NON-NLS-1$

 

 	/**

 	 * The identifier for the Java nature

@@ -66,347 +72,353 @@
 	 *

 	 * @see org.eclipse.core.resources.IProject#hasNature

 	 */

-	public static final String NATURE_ID = PLUGIN_ID + ".javanature"/*nonNLS*/;

+	public static final String NATURE_ID = PLUGIN_ID + ".javanature" ; //$NON-NLS-1$

 

 	/**

 	 * Name of the handle id attribute in a Java marker

 	 */

-	private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"/*nonNLS*/;

+	private static final String ATT_HANDLE_ID =

+		"org.eclipse.jdt.internal.core.JavaModelManager.handleId" ; //$NON-NLS-1$

 

-	/**

-	 * Names of recognized configurable options

-	 */

-	public static final String COMPILER_LOCAL_VARIABLE_ATTR = PLUGIN_ID + ".compiler.debug.localVariable"/*nonNLS*/;

-		// possible values are GENERATE or DO_NOT_GENERATE (default is DO_NOT_GENERATE)

-		

-	public static final String COMPILER_LINE_NUMBER_ATTR = PLUGIN_ID + ".compiler.debug.lineNumber"/*nonNLS*/;

-		// possible values are  GENERATE or DO_NOT_GENERATE (default is GENERATE)

-		

-	public static final String COMPILER_SOURCE_FILE_ATTR = PLUGIN_ID + ".compiler.debug.sourceFile"/*nonNLS*/;

-		// possible values are  GENERATE or DO_NOT_GENERATE (default is GENERATE)

-

-	public static final String COMPILER_CODEGEN_UNUSED_LOCAL = PLUGIN_ID + ".compiler.codegen.unusedLocal"/*nonNLS*/;

-		// possible values are PRESERVE or OPTIMIZE_OUT	(default is OPTIMIZE_OUT)

-

-	public static final String COMPILER_CODEGEN_TARGET_PLATFORM = PLUGIN_ID + ".compiler.codegen.targetPlatform"/*nonNLS*/;

-		// possible values are VERSION_1_1 or VERSION_1_2	(default is VERSION_1_1)

-

-	public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID + ".compiler.problem.unreachableCode"/*nonNLS*/;

-		// possible values are ERROR or WARNING	(default is ERROR)

-

-	public static final String COMPILER_PB_INVALID_IMPORT = PLUGIN_ID + ".compiler.problem.invalidImport"/*nonNLS*/;

-		// possible values are ERROR or WARNING	(default is ERROR)

-

-	public static final String COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD = PLUGIN_ID + ".compiler.problem.overridingPackageDefaultMethod"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-		

-	public static final String COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = PLUGIN_ID + ".compiler.problem.methodWithConstructorName"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-

-	public static final String COMPILER_PB_DEPRECATION = PLUGIN_ID + ".compiler.problem.deprecation"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-

-	public static final String COMPILER_PB_HIDDEN_CATCH_BLOCK = PLUGIN_ID + ".compiler.problem.hiddenCatchBlock"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-

-	public static final String COMPILER_PB_UNUSED_LOCAL = PLUGIN_ID + ".compiler.problem.unusedLocal"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-

-	public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is WARNING)

-

-	public static final String COMPILER_PB_SYNTHETIC_ACCESS_EMULATION = PLUGIN_ID + ".compiler.problem.syntheticAccessEmulation"/*nonNLS*/;

-		// possible values are WARNING or IGNORE (default is IGNORE)	

-	

-	public static final String CORE_JAVA_BUILD_ORDER = PLUGIN_ID + ".computeJavaBuildOrder"/*nonNLS*/;

-		// possible values are COMPUTE or IGNORE (default is COMPUTE)

-	/**

-	 * Possible values for configurable options

-	 */

-	public static final String GENERATE = "generate"/*nonNLS*/;

-	public static final String DO_NOT_GENERATE = "do not generate"/*nonNLS*/;

-	public static final String PRESERVE = "preserve"/*nonNLS*/;

-	public static final String OPTIMIZE_OUT = "optimize out"/*nonNLS*/;

-	public static final String VERSION_1_1 = "1.1"/*nonNLS*/;

-	public static final String VERSION_1_2 = "1.2"/*nonNLS*/;

-	public static final String ERROR = "error"/*nonNLS*/;

-	public static final String WARNING = "warning"/*nonNLS*/;

-	public static final String IGNORE = "ignore"/*nonNLS*/;

-	public static final String COMPUTE = "compute"/*nonNLS*/;

-	

-	private static Hashtable ConfigurableOptions;

 	private static Hashtable Variables = new Hashtable(5);

-		// possible values are WARNING or IGNORE (default is IGNORE)

 

-	public static final String COMPILER_PB_NON_EXTERNALIZED_STRING_LITERAL = PLUGIN_ID + ".compiler.problem.nonExternalizedStringLiteral"/*nonNLS*/;

+	/**

+	 * Configurable option names. For further information, refer to the file named Java.ini

+	 */

 

-/**

- * Creates the Java core plug-in.

- */

-public JavaCore(IPluginDescriptor pluginDescriptor) {

-	super(pluginDescriptor);

-	JAVA_CORE_PLUGIN = this;

-}

-/**

- * Adds the given listener for changes to Java elements.

- * Has no effect if an identical listener is already registered.

- *

- * @param listener the listener

- */

-public static void addElementChangedListener(IElementChangedListener listener) {

-	JavaModelManager.getJavaModelManager().addElementChangedListener(listener);

-}

-/**

- * Configures the given marker attribute map for the given Java element.

- * Used for markers which denote a Java element rather than a resource.

- *

- * @param attributes the mutable marker attribute map (key type: <code>String</code>,

- *   value type: <code>String</code>)

- * @param element the Java element for which the marker needs to be configured

- */

-public static void addJavaElementMarkerAttributes(Map attributes, IJavaElement element) {

-	if (element instanceof IMember) 

-		element= ((IMember) element).getClassFile();

-	if (attributes != null && element != null)

-		attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier());

-}

-/**

- * Configures the given marker for the given Java element.

- * Used for markers which denote a Java element rather than a resource.

- *

- * @param marker the marker to be configured

- * @param element the Java element for which the marker needs to be configured

- * @exception CoreException if the <code>IMarker.setAttribute</code> on the marker fails

- */

-public void configureJavaElementMarker(IMarker marker, IJavaElement element) throws CoreException {

-	if (element instanceof IMember)

-		element= ((IMember)element).getClassFile();

-	if (marker != null && element != null)

-		marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier());

-}

-/**

- * Returns the Java model element corresponding to the given handle identifier

- * generated by <code>IJavaElement.getHandleIdentifier()</code>, or

- * <code>null</code> if unable to create the associated element.

- */

-public static IJavaElement create(String handleIdentifier) {

-	if (handleIdentifier == null) {

-		return null;

+	// File containing default settings for configurable options

+	private static final String JAVA_CORE_INIT = "JavaCore.ini"; //$NON-NLS-1$

+	

+	/**

+	 * Compiler options

+	 */

+	public static final String OPTION_LocalVariableAttribute = CompilerOptions.OPTION_LocalVariableAttribute;

+	public static final String OPTION_LineNumberAttribute = CompilerOptions.OPTION_LineNumberAttribute;

+	public static final String OPTION_SourceFileAttribute = CompilerOptions.OPTION_SourceFileAttribute;

+	public static final String OPTION_PreserveUnusedLocal = CompilerOptions.OPTION_PreserveUnusedLocal;

+	public static final String OPTION_ReportUnreachableCode = CompilerOptions.OPTION_ReportUnreachableCode;

+	public static final String OPTION_ReportInvalidImport = CompilerOptions.OPTION_ReportInvalidImport;

+	public static final String OPTION_ReportMethodWithConstructorName = CompilerOptions.OPTION_ReportMethodWithConstructorName;

+	public static final String OPTION_ReportOverridingPackageDefaultMethod = CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod;

+	public static final String OPTION_ReportDeprecation = CompilerOptions.OPTION_ReportDeprecation;

+	public static final String OPTION_ReportHiddenCatchBlock = CompilerOptions.OPTION_ReportHiddenCatchBlock;

+	public static final String OPTION_ReportUnusedLocal = CompilerOptions.OPTION_ReportUnusedLocal;

+	public static final String OPTION_ReportUnusedParameter = CompilerOptions.OPTION_ReportUnusedParameter;

+	public static final String OPTION_TargetPlatform = CompilerOptions.OPTION_TargetPlatform;

+	public static final String OPTION_ReportSyntheticAccessEmulation = CompilerOptions.OPTION_ReportSyntheticAccessEmulation;

+	public static final String OPTION_ReportNonExternalizedStringLiteral = CompilerOptions.OPTION_ReportNonExternalizedStringLiteral;

+	public static final String OPTION_Source = CompilerOptions.OPTION_Source;

+	public static final String OPTION_ReportAssertIdentifier = CompilerOptions.OPTION_ReportAssertIdentifier;

+

+	/**

+	 * Code Formatter options

+	 */

+	public static final String OPTION_InsertNewlineBeforeOpeningBrace = FormatterOptions.OPTION_InsertNewlineBeforeOpeningBrace;

+	public static final String OPTION_InsertNewlineInControlStatement = FormatterOptions.OPTION_InsertNewlineInControlStatement;

+	public static final String OPTION_InsertNewLineBetweenElseAndIf = FormatterOptions.OPTION_InsertNewLineBetweenElseAndIf;

+	public static final String OPTION_InsertNewLineInEmptyBlock = FormatterOptions.OPTION_InsertNewLineInEmptyBlock;

+	public static final String OPTION_ClearAllBlankLines = FormatterOptions.OPTION_ClearAllBlankLines;

+	public static final String OPTION_SplitLineExceedingLength = FormatterOptions.OPTION_SplitLineExceedingLength;

+	public static final String OPTION_CompactAssignment = FormatterOptions.OPTION_CompactAssignment;

+	public static final String OPTION_TabulationChar = FormatterOptions.OPTION_TabulationChar;

+	public static final String OPTION_TabulationSize = FormatterOptions.OPTION_TabulationSize;

+	

+	/**

+	 * Completion Engine options

+	 */

+	public static final String OPTION_VisibilitySensitivity = CompletionOptions.OPTION_PerformVisibilityCheck;

+	public static final String OPTION_EntireWordReplacement = CompletionOptions.OPTION_EntireWordReplacement;

+	

+	/**

+	 * JavaCore options

+	 */

+	public static final String OPTION_ComputeBuildOrder = "org.eclipse.jdt.core.JavaCore.computeJavaBuildOrder"; //$NON-NLS-1$

+	

+	/**

+	 * Code Assist options

+	 */

+	

+	/**

+	 * Creates the Java core plug-in.

+	 */

+	public JavaCore(IPluginDescriptor pluginDescriptor) {

+		super(pluginDescriptor);

+		JAVA_CORE_PLUGIN = this;

 	}

-	try {

-		return JavaModelManager.getJavaModelManager().getHandleFromMemento(handleIdentifier);

-	} catch (JavaModelException e) {

-		return null;

+

+	/**

+	 * Adds the given listener for changes to Java elements.

+	 * Has no effect if an identical listener is already registered.

+	 *

+	 * @param listener the listener

+	 */

+	public static void addElementChangedListener(IElementChangedListener listener) {

+		JavaModelManager.getJavaModelManager().addElementChangedListener(listener);

 	}

-}

-/**

- * Returns the Java element corresponding to the given file, or

- * <code>null</code> if unable to associate the given file

- * with a Java element.

- *

- * <p>The file must be one of:<ul>

- *	<li>a <code>.java</code> file - the element returned is the corresponding <code>ICompilationUnit</code></li>

- *	<li>a <code>.class</code> file - the element returned is the corresponding <code>IClassFile</code></li>

- *	<li>a <code>.jar</code> file - the element returned is the corresponding <code>IPackageFragmentRoot</code></li>

- *	</ul>

- * <p>

- * Creating a Java element has the side effect of creating and opening all of the

- * element's parents if they are not yet open.

- */

-public static IJavaElement create(IFile file) {

-	if (file == null) {

-		return null;

+

+	/**

+	 * Configures the given marker attribute map for the given Java element.

+	 * Used for markers which denote a Java element rather than a resource.

+	 *

+	 * @param attributes the mutable marker attribute map (key type: <code>String</code>,

+	 *   value type: <code>String</code>)

+	 * @param element the Java element for which the marker needs to be configured

+	 */

+	public static void addJavaElementMarkerAttributes(

+		Map attributes,

+		IJavaElement element) {

+		if (element instanceof IMember)

+			element = ((IMember) element).getClassFile();

+		if (attributes != null && element != null)

+			attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier());

 	}

-	String extension= file.getProjectRelativePath().getFileExtension();

-	if (extension != null) {

-		extension= extension.toLowerCase();

-		if (extension.equals("java"/*nonNLS*/)) {

-			return createCompilationUnitFrom(file);

-		} else if (extension.equals("class"/*nonNLS*/)) {

-			return createClassFileFrom(file);

-		} else if (extension.equals("jar"/*nonNLS*/) || extension.equals("zip"/*nonNLS*/)) {

-			return createJarPackageFragmentRootFrom(file);

+	/**

+	 * Configures the given marker for the given Java element.

+	 * Used for markers which denote a Java element rather than a resource.

+	 *

+	 * @param marker the marker to be configured

+	 * @param element the Java element for which the marker needs to be configured

+	 * @exception CoreException if the <code>IMarker.setAttribute</code> on the marker fails

+	 */

+	public void configureJavaElementMarker(IMarker marker, IJavaElement element)

+		throws CoreException {

+		if (element instanceof IMember)

+			element = ((IMember) element).getClassFile();

+		if (marker != null && element != null)

+			marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier());

+	}

+	/**

+	 * Returns the Java model element corresponding to the given handle identifier

+	 * generated by <code>IJavaElement.getHandleIdentifier()</code>, or

+	 * <code>null</code> if unable to create the associated element.

+	 */

+	public static IJavaElement create(String handleIdentifier) {

+		if (handleIdentifier == null) {

+			return null;

 		}

-	}	

-	return null;	

-}

-/**

- * Returns the package fragment or package fragment root corresponding to the given folder, or

- * <code>null</code> if unable to associate the given folder with a Java element.

- * <p>

- * Note that a package fragment root is returned rather than a default package.

- * <p>

- * Creating a Java element has the side effect of creating and opening all of the

- * element's parents if they are not yet open.

- */

-public static IJavaElement create(IFolder folder) {

-	if (folder == null) {

-		return null;

-	}

-	if (folder.getName().indexOf('.') < 0) {

-		JavaProject project = (JavaProject) create(folder.getProject());

-		if (project == null) return null;

-		IJavaElement element = determineIfOnClasspath(folder, project);	

 		try {

-			IPath outputLocation = project.getOutputLocation();

-			if (outputLocation == null) return null;

-			if (outputLocation.isPrefixOf(folder.getFullPath())) {

-				if (project.getClasspathEntryFor(outputLocation) != null) {

-					// if the output location is the same as an input location, return the element

-					return element;

-				} else {

-					// otherwise, do not create elements for folders in the output location

-					return null;

-				}

-			} else {

-				return element;

-			}

+			return JavaModelManager.getJavaModelManager().getHandleFromMemento(

+				handleIdentifier);

 		} catch (JavaModelException e) {

 			return null;

 		}

 	}

-	return null;			

-}

-/**

- * Returns the Java project corresponding to the given project, or

- * <code>null</code> if unable to associate the given project

- * with a Java project.

- * <p>

- * Creating a Java Project has the side effect of creating and opening all of the

- * project's parents if they are not yet open.

- */

-public static IJavaProject create(IProject project) {

-	if (project == null) {

-		return null;

-	}

-	JavaModel javaModel= JavaModelManager.getJavaModel(project.getWorkspace());

-	return javaModel.getJavaProject(project);

-}

-/**

- * Returns the Java element corresponding to the given resource, or

- * <code>null</code> if unable to associate the given resource

- * with a Java element.

- * <p>

- * The resource must be one of:<ul>

- *	<li>a project - the element returned is the corresponding <code>IJavaProject</code></li>

- *	<li>a <code>.java</code> file - the element returned is the corresponding <code>ICompilationUnit</code></li>

- *	<li>a <code>.class</code> file - the element returned is the corresponding <code>IClassFile</code></li>

- *	<li>a <code>.jar</code> file - the element returned is the corresponding <code>IPackageFragmentRoot</code></li>

- *  <li>a folder - the element returned is the corresponding <code>IPackageFragmentRoot</code>

- *			or <code>IPackageFragment</code></li>

- *  <li>the workspace root resource - the element returned is the <code>IJavaModel</code></li>

- *	</ul>

- * <p>

- * Creating a Java element has the side effect of creating and opening all of the

- * element's parents if they are not yet open.

- */

-public static IJavaElement create(IResource resource) {

-	if (resource == null) {

-		return null;

-	}

-	int type= resource.getType();

-	switch (type) {

-		case IResource.PROJECT:

-			return create((IProject)resource);

-		case IResource.FILE:

-			return create((IFile)resource);	

-		case IResource.FOLDER:

-			return create((IFolder)resource);		

-		case IResource.ROOT:

-			return create((IWorkspaceRoot)resource);

-		default:

+	/**

+	 * Returns the Java element corresponding to the given file, or

+	 * <code>null</code> if unable to associate the given file

+	 * with a Java element.

+	 *

+	 * <p>The file must be one of:<ul>

+	 *	<li>a <code>.java</code> file - the element returned is the corresponding <code>ICompilationUnit</code></li>

+	 *	<li>a <code>.class</code> file - the element returned is the corresponding <code>IClassFile</code></li>

+	 *	<li>a <code>.jar</code> file - the element returned is the corresponding <code>IPackageFragmentRoot</code></li>

+	 *	</ul>

+	 * <p>

+	 * Creating a Java element has the side effect of creating and opening all of the

+	 * element's parents if they are not yet open.

+	 */

+	public static IJavaElement create(IFile file) {

+		if (file == null) {

 			return null;

-	}

-}

-/**

- * Returns the Java model.

- */

-public static IJavaModel create(IWorkspaceRoot root) {

-	if (root == null) {

-		return null;

-	}

-	return JavaModelManager.getJavaModel(root.getWorkspace());

-}

-/**

- * Creates and returns a class file element for

- * the given <code>.class</code> file. Returns <code>null</code> if unable

- * to recognize the class file.

- */

-public static IClassFile createClassFileFrom(IFile file) {

-	IJavaProject project = (IJavaProject) create(file.getProject());

-	IPackageFragment pkg = (IPackageFragment) determineIfOnClasspath(file, project);

-	if (pkg == null) {

-		// fix for 1FVS7WE

-		// not on classpath - make the root its folder, and a default package

-		IPackageFragmentRoot root= project.getPackageFragmentRoot(file.getParent());

-		pkg= root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);

-	}

-	return pkg.getClassFile(file.getName());

-}

-/**

- * Creates and returns a compilation unit element for

- * the given <code>.java</code> file. Returns <code>null</code> if unable

- * to recognize the compilation unit.

- */

-public static ICompilationUnit createCompilationUnitFrom(IFile file) {

-	IProject fileProject = file.getProject();

-	IJavaProject project = (IJavaProject) create(fileProject);

-	IPackageFragment pkg= (IPackageFragment)determineIfOnClasspath(file, project);

-	if (pkg == null) {

-		// fix for 1FVS7WE

-		// not on classpath - make the root its folder, and a default package

-		IPackageFragmentRoot root= project.getPackageFragmentRoot(file.getParent());

-		pkg= root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);

-	} 

-	return pkg.getCompilationUnit(file.getName());

-}

-/**

- * Creates and returns a handle for the given JAR file.

- * The Java model associated with the JAR's project may be

- * created as a side effect. 

- * Returns <code>null</code> if unable to create a JAR package fragment root.

- * (for example, if the JAR file represents a non-Java resource)

- */

-public static IPackageFragmentRoot createJarPackageFragmentRootFrom(IFile file) {

-	IJavaProject project= (IJavaProject)create(file.getProject());

-

-	// Create a jar package fragment root only if on the classpath

-	IPath resourcePath = file.getFullPath();

-	try {

-		IClasspathEntry[] entries = project.getResolvedClasspath(true);

-		for (int i = 0, length = entries.length; i < length; i++) {

-			IClasspathEntry entry = entries[i];

-			IPath rootPath = entry.getPath();

-			if (rootPath.equals(resourcePath)) {

-				return project.getPackageFragmentRoot(file);

+		}

+		String extension = file.getProjectRelativePath().getFileExtension();

+		if (extension != null) {

+			extension = extension.toLowerCase();

+			if (extension.equals("java"  //$NON-NLS-1$

+				)) {

+				return createCompilationUnitFrom(file);

+			} else if (extension.equals("class"  //$NON-NLS-1$

+				)) {

+				return createClassFileFrom(file);

+			} else if (extension.equals("jar"  //$NON-NLS-1$

+				) || extension.equals("zip"  //$NON-NLS-1$

+				)) {

+				return createJarPackageFragmentRootFrom(file);

 			}

 		}

-	} catch (JavaModelException e) {

+		return null;

 	}

-	return null;

-}

-/**

- * Returns the package fragment root represented by the resource, or

- * the package fragment the given resource is located in, or <code>null</code>

- * if the given resource is not on the classpath of the given project.

- */

-private static IJavaElement determineIfOnClasspath(IResource resource, IJavaProject project) {

-	IPath resourcePath = resource.getFullPath();

-	try {

-		IClasspathEntry[] entries = project.getResolvedClasspath(true);

-		for (int i = 0; i < entries.length; i++) {

-			IClasspathEntry entry = entries[i];

-			IPath rootPath = entry.getPath();

-			if (rootPath.equals(resourcePath)) {

-				return project.getPackageFragmentRoot(resource);

-			} else

-				if (rootPath.isPrefixOf(resourcePath)) {

-					IPackageFragmentRoot root = ((JavaProject)project).getPackageFragmentRoot(rootPath);

+	/**

+	 * Returns the package fragment or package fragment root corresponding to the given folder, or

+	 * <code>null</code> if unable to associate the given folder with a Java element.

+	 * <p>

+	 * Note that a package fragment root is returned rather than a default package.

+	 * <p>

+	 * Creating a Java element has the side effect of creating and opening all of the

+	 * element's parents if they are not yet open.

+	 */

+	public static IJavaElement create(IFolder folder) {

+		if (folder == null) {

+			return null;

+		}

+		if (folder.getName().indexOf('.') < 0) {

+			JavaProject project = (JavaProject) create(folder.getProject());

+			if (project == null)

+				return null;

+			IJavaElement element = determineIfOnClasspath(folder, project);

+			try {

+				IPath outputLocation = project.getOutputLocation();

+				if (outputLocation == null)

+					return null;

+				if (outputLocation.isPrefixOf(folder.getFullPath())) {

+					if (project.getClasspathEntryFor(outputLocation) != null) {

+						// if the output location is the same as an input location, return the element

+						return element;

+					} else {

+						// otherwise, do not create elements for folders in the output location

+						return null;

+					}

+				} else {

+					return element;

+				}

+			} catch (JavaModelException e) {

+				return null;

+			}

+		}

+		return null;

+	}

+	/**

+	 * Returns the Java project corresponding to the given project, or

+	 * <code>null</code> if unable to associate the given project

+	 * with a Java project.

+	 * <p>

+	 * Creating a Java Project has the side effect of creating and opening all of the

+	 * project's parents if they are not yet open.

+	 */

+	public static IJavaProject create(IProject project) {

+		if (project == null) {

+			return null;

+		}

+		JavaModel javaModel = JavaModelManager.getJavaModel(project.getWorkspace());

+		return javaModel.getJavaProject(project);

+	}

+	/**

+	 * Returns the Java element corresponding to the given resource, or

+	 * <code>null</code> if unable to associate the given resource

+	 * with a Java element.

+	 * <p>

+	 * The resource must be one of:<ul>

+	 *	<li>a project - the element returned is the corresponding <code>IJavaProject</code></li>

+	 *	<li>a <code>.java</code> file - the element returned is the corresponding <code>ICompilationUnit</code></li>

+	 *	<li>a <code>.class</code> file - the element returned is the corresponding <code>IClassFile</code></li>

+	 *	<li>a <code>.jar</code> file - the element returned is the corresponding <code>IPackageFragmentRoot</code></li>

+	 *  <li>a folder - the element returned is the corresponding <code>IPackageFragmentRoot</code>

+	 *			or <code>IPackageFragment</code></li>

+	 *  <li>the workspace root resource - the element returned is the <code>IJavaModel</code></li>

+	 *	</ul>

+	 * <p>

+	 * Creating a Java element has the side effect of creating and opening all of the

+	 * element's parents if they are not yet open.

+	 */

+	public static IJavaElement create(IResource resource) {

+		if (resource == null) {

+			return null;

+		}

+		int type = resource.getType();

+		switch (type) {

+			case IResource.PROJECT :

+				return create((IProject) resource);

+			case IResource.FILE :

+				return create((IFile) resource);

+			case IResource.FOLDER :

+				return create((IFolder) resource);

+			case IResource.ROOT :

+				return create((IWorkspaceRoot) resource);

+			default :

+				return null;

+		}

+	}

+	/**

+	 * Returns the Java model.

+	 */

+	public static IJavaModel create(IWorkspaceRoot root) {

+		if (root == null) {

+			return null;

+		}

+		return JavaModelManager.getJavaModel(root.getWorkspace());

+	}

+	/**

+	 * Creates and returns a class file element for

+	 * the given <code>.class</code> file. Returns <code>null</code> if unable

+	 * to recognize the class file.

+	 */

+	public static IClassFile createClassFileFrom(IFile file) {

+		IJavaProject project = (IJavaProject) create(file.getProject());

+		IPackageFragment pkg = (IPackageFragment) determineIfOnClasspath(file, project);

+		if (pkg == null) {

+			// fix for 1FVS7WE

+			// not on classpath - make the root its folder, and a default package

+			IPackageFragmentRoot root = project.getPackageFragmentRoot(file.getParent());

+			pkg = root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);

+		}

+		return pkg.getClassFile(file.getName());

+	}

+	/**

+	 * Creates and returns a compilation unit element for

+	 * the given <code>.java</code> file. Returns <code>null</code> if unable

+	 * to recognize the compilation unit.

+	 */

+	public static ICompilationUnit createCompilationUnitFrom(IFile file) {

+		IProject fileProject = file.getProject();

+		IJavaProject project = (IJavaProject) create(fileProject);

+		IPackageFragment pkg = (IPackageFragment) determineIfOnClasspath(file, project);

+		if (pkg == null) {

+			// fix for 1FVS7WE

+			// not on classpath - make the root its folder, and a default package

+			IPackageFragmentRoot root = project.getPackageFragmentRoot(file.getParent());

+			pkg = root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);

+		}

+		return pkg.getCompilationUnit(file.getName());

+	}

+	/**

+	 * Creates and returns a handle for the given JAR file.

+	 * The Java model associated with the JAR's project may be

+	 * created as a side effect. 

+	 * Returns <code>null</code> if unable to create a JAR package fragment root.

+	 * (for example, if the JAR file represents a non-Java resource)

+	 */

+	public static IPackageFragmentRoot createJarPackageFragmentRootFrom(IFile file) {

+		IJavaProject project = (IJavaProject) create(file.getProject());

+

+		// Create a jar package fragment root only if on the classpath

+		IPath resourcePath = file.getFullPath();

+		try {

+			IClasspathEntry[] entries = project.getResolvedClasspath(true);

+			for (int i = 0, length = entries.length; i < length; i++) {

+				IClasspathEntry entry = entries[i];

+				IPath rootPath = entry.getPath();

+				if (rootPath.equals(resourcePath)) {

+					return project.getPackageFragmentRoot(file);

+				}

+			}

+		} catch (JavaModelException e) {

+		}

+		return null;

+	}

+	/**

+	 * Returns the package fragment root represented by the resource, or

+	 * the package fragment the given resource is located in, or <code>null</code>

+	 * if the given resource is not on the classpath of the given project.

+	 */

+	private static IJavaElement determineIfOnClasspath(

+		IResource resource,

+		IJavaProject project) {

+		IPath resourcePath = resource.getFullPath();

+		try {

+			IClasspathEntry[] entries = project.getResolvedClasspath(true);

+			for (int i = 0; i < entries.length; i++) {

+				IClasspathEntry entry = entries[i];

+				IPath rootPath = entry.getPath();

+				if (rootPath.equals(resourcePath)) {

+					return project.getPackageFragmentRoot(resource);

+				} else if (rootPath.isPrefixOf(resourcePath)) {

+					IPackageFragmentRoot root =

+						((JavaProject) project).getPackageFragmentRoot(rootPath);

 					IPath pkgPath = resourcePath.removeFirstSegments(rootPath.segmentCount());

 					if (resource.getType() == IResource.FILE) {

 						// if the resource is a file, then remove the last segment which

 						// is the file name in the package

-						pkgPath= pkgPath.removeLastSegments(1);

+						pkgPath = pkgPath.removeLastSegments(1);

 					}

 					StringBuffer pkgName = new StringBuffer(IPackageFragment.DEFAULT_PACKAGE_NAME);

 					for (int j = 0, max = pkgPath.segmentCount(); j < max; j++) {

@@ -416,662 +428,936 @@
 						}

 						pkgName.append(segment);

 						if (j < pkgPath.segmentCount() - 1) {

-							pkgName.append("."/*nonNLS*/);

+							pkgName.append("." ); //$NON-NLS-1$

 						}

 					}

 					return root.getPackageFragment(pkgName.toString());

 				}

+			}

+		} catch (JavaModelException npe) {

+			return null;

 		}

-	} catch (JavaModelException npe) {

 		return null;

 	}

-	return null;

-}

-/**

- * Returns the path held in the given classpath variable.

- * Returns <node>null</code> if unable to bind.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @param variableName the name of the classpath variable

- * @return the path, or <code>null</code> if none 

- * @see #setClasspathVariable

- */

-public static IPath getClasspathVariable(String variableName) {

-	return (IPath)Variables.get(variableName);

-}

-/**

- * Returns the names of all known classpath variables.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @return the list of classpath variable names

- * @see #setClasspathVariable

- */

-public static String[] getClasspathVariableNames() {

-	int length = Variables.size();

-	String[] result = new String[length];

-	Enumeration vars = Variables.keys();

-	int index = 0;

-	while (vars.hasMoreElements()){

-		result[index++] = (String)vars.nextElement();

+	/**

+	 * Returns the path held in the given classpath variable.

+	 * Returns <node>null</code> if unable to bind.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @param variableName the name of the classpath variable

+	 * @return the path, or <code>null</code> if none 

+	 * @see #setClasspathVariable

+	 */

+	public static IPath getClasspathVariable(String variableName) {

+		return (IPath) Variables.get(variableName);

 	}

-	return result;

-}

-/**

- * Answers a set of configurable options with their default values.

- * These options allow to configure the behavior of the underlying components.

- * 

- * Recognized options are listed below, optionName = possibleValue1 / possibleValue2

- * where [] are enclosing the default value of the corresponding option.

- *

- * Note: more options might be added in further releases.

- *

- * RECOGNIZED OPTIONS:

- *

- *	COMPILER_LOCAL_VARIABLE_ATTR = [GENERATE] | DO_NOT_GENERATE

- *  	When generated, this attribute will enable local variable names to be displayed 

- * 		in debugger, only in place where variables are definitely assigned 

- *		(.class file is then bigger)

- *

- *  COMPILER_LINE_NUMBER_ATTR = [GENERATE] | DO_NOT_GENERATE 

- *		When generated, this attribute will enable source code highlighting in debugger 

- *		(.class file is then bigger).

- *		

- *  COMPILER_SOURCE_FILE_ATTR = [GENERATE] | DO_NOT_GENERATE

- *		When generated, this attribute will enable the debugger to present the 

- *		corresponding source code.

- *

- *  COMPILER_CODEGEN_UNUSED_LOCAL = [PRESERVE] | OPTIMIZE_OUT

- *		Unless requested to preserve unused local variables (i.e. never read), the 

- *		compiler will optimize them out, potentially altering debugging

- * 

- *  COMPILER_CODEGEN_TARGET_PLATFORM = [VERSION_1_1] | VERSION_1_2

- * 		Generate .class files either backward compatible with JVM 1.1 or only executable 

- *		on JVM 1.2 and later

- *

- *	COMPILER_PB_UNREACHABLE_CODE = [ERROR] | WARNING

- *		Unreachable code can either be reported as an error or a warning

- *

- *	COMPILER_PB_INVALID_IMPORT = [ERROR] | WARNING

- *		An import statement that cannot be resolved might either be reported 

- *		either as an error or as a warning

- *

- *	COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD = [WARNING] | IGNORE

- *		A package default method is not visible in a different package, and thus 

- *		cannot be overriden. When enabling this option, the compiler will signal 

- *		such scenarii.

- *

- *  COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = [WARNING] | IGNORE

- * 		Naming a method with a constructor name is generally considered poor 

- *		style programming. When enabling this option, the compiler will signal such 

- *		scenarii

- *

- *  COMPILER_PB_DEPRECATION = [WARNING] | IGNORE

- *		When enabled, the compiler will signal use of deprecated API.

- *

- *	COMPILER_PB_HIDDEN_CATCH_BLOCK = [WARNING] | IGNORE

- *		Locally to a try statement, some catch blocks may hide others 

- *		(e.g. 	try {	throw new java.io.CharConversionException();

- *				} catch (java.io.CharConversionException e) {

- *				} catch (java.io.IOException e) {}). 

- *		When enabling this option, the compiler will issue a warning for hidden catch 

- *		blocks corresponding to checked exceptions

- *

- *  COMPILER_PB_UNUSED_LOCAL = WARNING | [IGNORE]

- * 		When enabled, the compiler will issue a warning for unused local variables 

- *		(i.e. variables never read from)

- *

- *	COMPILER_PB_UNUSED_PARAMETER = WARNING | [IGNORE]

- *		When enabled, the compiler will issue a warning for unused method parameters 

- *		(i.e. parameters never read from)

- *

- *	COMPILER_PB_SYNTHETIC_ACCESS_EMULATION = WARNING | [IGNORE]

- *		When enabled, the compiler will issue a warning whenever it emulates access 

- *		to a non-accessible member of an enclosing type

- *

- *	CORE_JAVA_BUILD_ORDER = [COMPUTE] | IGNORE

- *		When enabled, the build order is automatically reflecting the classpath on each

- *		classpath change action. It can still be modified manually afterwards.

- */

- 

-public static Hashtable getDefaultOptions(){

-

-	Hashtable defaultOptions = new Hashtable(10);

-

-	// Compiler settings

-	defaultOptions.put(COMPILER_LOCAL_VARIABLE_ATTR, 					GENERATE);

-	defaultOptions.put(COMPILER_LINE_NUMBER_ATTR, 						GENERATE);

-	defaultOptions.put(COMPILER_SOURCE_FILE_ATTR,						GENERATE);

-	defaultOptions.put(COMPILER_CODEGEN_UNUSED_LOCAL,					PRESERVE);

-	defaultOptions.put(COMPILER_CODEGEN_TARGET_PLATFORM,				VERSION_1_1);

-	defaultOptions.put(COMPILER_PB_UNREACHABLE_CODE,					ERROR);

-	defaultOptions.put(COMPILER_PB_INVALID_IMPORT,						ERROR);

-	defaultOptions.put(COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, 	WARNING);

-	defaultOptions.put(COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME,		WARNING);

-	defaultOptions.put(COMPILER_PB_DEPRECATION,							WARNING);

-	defaultOptions.put(COMPILER_PB_HIDDEN_CATCH_BLOCK,					WARNING);

-	defaultOptions.put(COMPILER_PB_UNUSED_LOCAL,						IGNORE);

-	defaultOptions.put(COMPILER_PB_UNUSED_PARAMETER,					IGNORE);

-	defaultOptions.put(COMPILER_PB_SYNTHETIC_ACCESS_EMULATION,			IGNORE);

-	defaultOptions.put(COMPILER_PB_NON_EXTERNALIZED_STRING_LITERAL,		IGNORE);

-	

-	// JavaCore settings

-	defaultOptions.put(CORE_JAVA_BUILD_ORDER,							IGNORE);

-

-	return defaultOptions;

-}

-/**

- * Returns the single instance of the Java core plug-in runtime class.

- * Equivalent to <code>(JavaCore) getPlugin()</code>.

- */

-public static JavaCore getJavaCore() {

-	return (JavaCore) getPlugin();

-}

-/**

- * Returns the <code>IJavaProject</code> associated with the

- * given <code>IProject</code>, or <code>null</code> if the

- * project does not have a Java nature.

- */

-private IJavaProject getJavaProject(IProject project) {

-	try {

-		if (project.hasNature(NATURE_ID)) {

-			JavaModel model= JavaModelManager.getJavaModel(project.getWorkspace());

-			if (model != null) {

-				return model.getJavaProject(project);

-			}

+	/**

+	 * Returns the names of all known classpath variables.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @return the list of classpath variable names

+	 * @see #setClasspathVariable

+	 */

+	public static String[] getClasspathVariableNames() {

+		int length = Variables.size();

+		String[] result = new String[length];

+		Enumeration vars = Variables.keys();

+		int index = 0;

+		while (vars.hasMoreElements()) {

+			result[index++] = (String) vars.nextElement();

 		}

-	} catch (CoreException e) {

+		return result;

 	}

-	return null;

-}

-/**

- * Answers a copy of the current set of configurable options supported by the Java core.

- * These options allow to configure the behavior of the underlying components.

- *

- * Changes on the set of options are not committed until invoking <code>JavaCore.setOptions</code>

- *

- * For a list of recognized options, refer to <code>JavaCore.getDefaultOptions</code>

- */

-public static Hashtable getOptions(){

 

-	if (ConfigurableOptions == null) return ConfigurableOptions = getDefaultOptions();

-	return (Hashtable)ConfigurableOptions.clone();

-}

-/**

- * Returns the single instance of the Java core plug-in runtime class.

- */

-public static Plugin getPlugin() {

-	return JAVA_CORE_PLUGIN;

-}

-/**

- * This is a helper method which returns the resolved classpath entry denoted 

- * by a given entry (if it is a variable entry). It is obtained by resolving the variable 

- * reference in the first segment. Returns <node>null</code> if unable to resolve using 

- * the following algorithm:

- * <ul>

- * <li> if variable segment cannot be resolved, returns <code>null</code></li>

- * <li> finds a project, JAR or binary folder in the workspace at the resolved path location</li>

- * <li> if none finds an external JAR file or folder outside the workspace at the resolved path location </li>

- * <li> if none returns <code>null</code></li>

- * </ul>

- * <p>

- * Variable source attachment path and root path are also resolved and recorded in the resulting classpath entry.

- * <p>

- * @return the resolved library or project classpath entry, or <code>null</code>

- *   if the given variable entry could not be resolved to a valid classpath entry

- */

-public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry) {

+	private static IPath getInstallLocation() {

+		return new Path(getPlugin().getDescriptor().getInstallURL().getFile());

+	}

 

-	if (entry.getEntryKind() != IClasspathEntry.CPE_VARIABLE) return entry;

+	/**

+	 * Returns the single instance of the Java core plug-in runtime class.

+	 * Equivalent to <code>(JavaCore) getPlugin()</code>.

+	 */

+	public static JavaCore getJavaCore() {

+		return (JavaCore) getPlugin();

+	}

+	/**

+	 * Returns the <code>IJavaProject</code> associated with the

+	 * given <code>IProject</code>, or <code>null</code> if the

+	 * project does not have a Java nature.

+	 */

+	private IJavaProject getJavaProject(IProject project) {

+		try {

+			if (project.hasNature(NATURE_ID)) {

+				JavaModel model = JavaModelManager.getJavaModel(project.getWorkspace());

+				if (model != null) {

+					return model.getJavaProject(project);

+				}

+			}

+		} catch (CoreException e) {

+		}

+		return null;

+	}

+	

+	/**

+	 * Returns the single instance of the Java core plug-in runtime class.

+	 */

+	public static Plugin getPlugin() {

+		return JAVA_CORE_PLUGIN;

+	}

 

-	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

-	IPath resolvedPath = JavaCore.getResolvedVariablePath(entry.getPath());

-	if (resolvedPath == null) return null;

+	/**

+	 * This is a helper method which returns the resolved classpath entry denoted 

+	 * by a given entry (if it is a variable entry). It is obtained by resolving the variable 

+	 * reference in the first segment. Returns <node>null</code> if unable to resolve using 

+	 * the following algorithm:

+	 * <ul>

+	 * <li> if variable segment cannot be resolved, returns <code>null</code></li>

+	 * <li> finds a project, JAR or binary folder in the workspace at the resolved path location</li>

+	 * <li> if none finds an external JAR file or folder outside the workspace at the resolved path location </li>

+	 * <li> if none returns <code>null</code></li>

+	 * </ul>

+	 * <p>

+	 * Variable source attachment path and root path are also resolved and recorded in the resulting classpath entry.

+	 * <p>

+	 * @return the resolved library or project classpath entry, or <code>null</code>

+	 *   if the given variable entry could not be resolved to a valid classpath entry

+	 */

+	public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry) {

 

-	Object target = JavaModel.getTarget(workspaceRoot, resolvedPath, false);

-	if (target == null) return null;

+		if (entry.getEntryKind() != IClasspathEntry.CPE_VARIABLE)

+			return entry;

 

-	// inside the workspace

-	if (target instanceof IResource){	

-		IResource resolvedResource = (IResource) target;

-		if (resolvedResource != null){

-			switch(resolvedResource.getType()){

-				case IResource.PROJECT :

-					return JavaCore.newProjectEntry(resolvedPath); // internal project

-				case IResource.FILE :

-					String extension = resolvedResource.getFileExtension();

-					if ("jar"/*nonNLS*/.equalsIgnoreCase(extension) || "zip"/*nonNLS*/.equalsIgnoreCase(extension)){ // internal binary archive

-						return JavaCore.newLibraryEntry( 

+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+		IPath resolvedPath = JavaCore.getResolvedVariablePath(entry.getPath());

+		if (resolvedPath == null)

+			return null;

+

+		Object target = JavaModel.getTarget(workspaceRoot, resolvedPath, false);

+		if (target == null)

+			return null;

+

+		// inside the workspace

+		if (target instanceof IResource) {

+			IResource resolvedResource = (IResource) target;

+			if (resolvedResource != null) {

+				switch (resolvedResource.getType()) {

+					case IResource.PROJECT :

+						return JavaCore.newProjectEntry(resolvedPath); // internal project

+					case IResource.FILE :

+						String extension = resolvedResource.getFileExtension();

+						if ("jar"  //$NON-NLS-1$

+							.equalsIgnoreCase(extension) || "zip"  //$NON-NLS-1$

+							.equalsIgnoreCase(extension)) { // internal binary archive

+							return JavaCore.newLibraryEntry(

 								resolvedPath,

 								getResolvedVariablePath(entry.getSourceAttachmentPath()),

-								getResolvedVariablePath(entry.getSourceAttachmentRootPath())); 

-					}

-					break;

-				case IResource.FOLDER :	// internal binary folder

-					return JavaCore.newLibraryEntry( 

+								getResolvedVariablePath(entry.getSourceAttachmentRootPath()));

+						}

+						break;

+					case IResource.FOLDER : // internal binary folder

+						return JavaCore.newLibraryEntry(

 							resolvedPath,

 							getResolvedVariablePath(entry.getSourceAttachmentPath()),

-							getResolvedVariablePath(entry.getSourceAttachmentRootPath())); 

+							getResolvedVariablePath(entry.getSourceAttachmentRootPath()));

+				}

 			}

 		}

-	}

-	// outside the workspace

-	if (target instanceof File){

-		File externalFile = (File) target;

-		if (externalFile.isFile()){

-			String fileName = externalFile.getName().toLowerCase();

-			if (fileName.endsWith(".jar"/*nonNLS*/) || fileName.endsWith(".zip"/*nonNLS*/)){ // external binary archive

-				return JavaCore.newLibraryEntry( 

+		// outside the workspace

+		if (target instanceof File) {

+			File externalFile = (File) target;

+			if (externalFile.isFile()) {

+				String fileName = externalFile.getName().toLowerCase();

+				if (fileName.endsWith(".jar"  //$NON-NLS-1$

+					) || fileName.endsWith(".zip"  //$NON-NLS-1$

+					)) { // external binary archive

+					return JavaCore.newLibraryEntry(

 						resolvedPath,

 						getResolvedVariablePath(entry.getSourceAttachmentPath()),

-						getResolvedVariablePath(entry.getSourceAttachmentRootPath())); 

+						getResolvedVariablePath(entry.getSourceAttachmentRootPath()));

+				}

+			} else { // external binary folder

+				return JavaCore.newLibraryEntry(

+					resolvedPath,

+					getResolvedVariablePath(entry.getSourceAttachmentPath()),

+					getResolvedVariablePath(entry.getSourceAttachmentRootPath()));

 			}

-		} else { // external binary folder

-			return JavaCore.newLibraryEntry( 

-						resolvedPath,

-						getResolvedVariablePath(entry.getSourceAttachmentPath()),

-						getResolvedVariablePath(entry.getSourceAttachmentRootPath())); 

 		}

+		return null;

 	}

-	return null;

-}

-/**

- * Resolve a variable path (helper method)

- */

-public static IPath getResolvedVariablePath(IPath variablePath) {

 

-	if (variablePath == null) return null;

-	int count = variablePath.segmentCount();

-	if (count == 0) return null;

+	/**

+	 * Resolve a variable path (helper method)

+	 */

+	public static IPath getResolvedVariablePath(IPath variablePath) {

 

-	// lookup variable	

-	String variableName = variablePath.segment(0);

-	IPath resolvedPath = JavaCore.getClasspathVariable(variableName);

-	if (resolvedPath == null || resolvedPath.isEmpty()) return null;

+		if (variablePath == null)

+			return null;

+		int count = variablePath.segmentCount();

+		if (count == 0)

+			return null;

 

-	// append path suffix

-	if (count > 1){

-		resolvedPath = resolvedPath.append(variablePath.removeFirstSegments(1));

+		// lookup variable	

+		String variableName = variablePath.segment(0);

+		IPath resolvedPath = JavaCore.getClasspathVariable(variableName);

+		if (resolvedPath == null || resolvedPath.isEmpty())

+			return null;

+

+		// append path suffix

+		if (count > 1) {

+			resolvedPath = resolvedPath.append(variablePath.removeFirstSegments(1));

+		}

+		return resolvedPath;

 	}

-	return resolvedPath;

-}

-/**

- * Returns whether the given marker references the given Java element.

- * Used for markers which denote a Java element rather than a resource.

- *

- * @param element the element

- * @param marker the marker

- * @return <code>true</code> if the marker references the element

- * @exception CoreException if the <code>IMarker.getAttribute</code> on the marker fails 	 

- */

- public static boolean isReferencedBy(IJavaElement element, IMarker marker) throws CoreException {

- 	if (element instanceof IMember)

- 		element= ((IMember)element).getClassFile();

- 	return (element != null 

-	 		&& marker != null

-	 		&& element.getHandleIdentifier().equals(marker.getAttribute(ATT_HANDLE_ID)));

-}

-/**

- * Returns whether the given marker delta references the given Java element.

- * Used for markers deltas which denote a Java element rather than a resource.

- *

- * @param element the element

- * @param markerDelta the marker delta

- * @return <code>true</code> if the marker delta references the element

- * @exception CoreException if the  <code>IMarkerDelta.getAttribute</code> on the marker delta fails 	 

- */

-public static boolean isReferencedBy(IJavaElement element, IMarkerDelta markerDelta) throws CoreException {

-	if (element instanceof IMember)	element= ((IMember) element).getClassFile();

-	return element != null 

-			&& markerDelta != null 

+

+	/**

+	 * Returns whether the given marker references the given Java element.

+	 * Used for markers which denote a Java element rather than a resource.

+	 *

+	 * @param element the element

+	 * @param marker the marker

+	 * @return <code>true</code> if the marker references the element

+	 * @exception CoreException if the <code>IMarker.getAttribute</code> on the marker fails 	 

+	 */

+	public static boolean isReferencedBy(IJavaElement element, IMarker marker)

+		throws CoreException {

+		if (element instanceof IMember)

+			element = ((IMember) element).getClassFile();

+		return (

+			element != null

+				&& marker != null

+				&& element.getHandleIdentifier().equals(marker.getAttribute(ATT_HANDLE_ID)));

+	}

+

+	/**

+	 * Returns whether the given marker delta references the given Java element.

+	 * Used for markers deltas which denote a Java element rather than a resource.

+	 *

+	 * @param element the element

+	 * @param markerDelta the marker delta

+	 * @return <code>true</code> if the marker delta references the element

+	 * @exception CoreException if the  <code>IMarkerDelta.getAttribute</code> on the marker delta fails 	 

+	 */

+	public static boolean isReferencedBy(

+		IJavaElement element,

+		IMarkerDelta markerDelta)

+		throws CoreException {

+		if (element instanceof IMember)

+			element = ((IMember) element).getClassFile();

+		return element != null

+			&& markerDelta != null

 			&& element.getHandleIdentifier().equals(markerDelta.getAttribute(ATT_HANDLE_ID));

-}

-/**

- * Creates and returns a new classpath entry of kind <code>CPE_LIBRARY</code> for the JAR or folder

- * identified by the given absolute path. This specifies that all package fragments within the root 

- * will have children of type <code>IClassFile</code>.

- * <p>

- * A library entry is used to denote a prerequisite JAR or root folder containing binaries.

- * The target JAR or folder can either be defined internally to the workspace (absolute path relative

- * to the workspace root) or externally to the workspace (absolute path in the file system).

- *

- * e.g. Here are some examples of binary path usage<ul>

- *	<li><code> "c:/jdk1.2.2/jre/lib/rt.jar" </code> - reference to an external JAR</li>

- *	<li><code> "/Project/someLib.jar" </code> - reference to an internal JAR </li>

- *	<li><code> "c:/classes/" </code> - reference to an external binary folder</li>

- * </ul>

- * Note that this operation does not attempt to validate or access the 

- * resources at the given paths.

- * <p>

- * @param path the absolute path of the binary archive

- * @param sourceAttachmentPath the absolute path of the corresponding source archive, 

- *    or <code>null</code> if none

- * @param sourceAttachmentRootPath the location of the root within the source archive

- *    or <code>null</code> if <code>archivePath</code> is also <code>null</code>

- */ 

+	}

 

-public static IClasspathEntry newLibraryEntry(IPath path, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath) {

-	Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));

-	return new ClasspathEntry(

-			IPackageFragmentRoot.K_BINARY, 

-			IClasspathEntry.CPE_LIBRARY, 

+	/**

+	 * Creates and returns a new classpath entry of kind <code>CPE_LIBRARY</code> for the JAR or folder

+	 * identified by the given absolute path. This specifies that all package fragments within the root 

+	 * will have children of type <code>IClassFile</code>.

+	 * <p>

+	 * A library entry is used to denote a prerequisite JAR or root folder containing binaries.

+	 * The target JAR or folder can either be defined internally to the workspace (absolute path relative

+	 * to the workspace root) or externally to the workspace (absolute path in the file system).

+	 *

+	 * e.g. Here are some examples of binary path usage<ul>

+	 *	<li><code> "c:/jdk1.2.2/jre/lib/rt.jar" </code> - reference to an external JAR</li>

+	 *	<li><code> "/Project/someLib.jar" </code> - reference to an internal JAR </li>

+	 *	<li><code> "c:/classes/" </code> - reference to an external binary folder</li>

+	 * </ul>

+	 * Note that this operation does not attempt to validate or access the 

+	 * resources at the given paths.

+	 * <p>

+	 * @param path the absolute path of the binary archive

+	 * @param sourceAttachmentPath the absolute path of the corresponding source archive, 

+	 *    or <code>null</code> if none

+	 * @param sourceAttachmentRootPath the location of the root within the source archive

+	 *    or <code>null</code> if <code>archivePath</code> is also <code>null</code>

+	 */

+	public static IClasspathEntry newLibraryEntry(

+		IPath path,

+		IPath sourceAttachmentPath,

+		IPath sourceAttachmentRootPath) {

+		Assert.isTrue(

+			path.isAbsolute(),

+			Util.bind("classpath.needAbsolutePath" )); //$NON-NLS-1$

+		return new ClasspathEntry(

+			IPackageFragmentRoot.K_BINARY,

+			IClasspathEntry.CPE_LIBRARY,

 			JavaProject.canonicalizedPath(path),

 			sourceAttachmentPath,

 			sourceAttachmentRootPath);

-}

-/**

- * Creates and returns a new classpath entry of kind <code>CPE_PROJECT</code>

- * for the project identified by the given absolute path.

- * <p>

- * A project entry is used to denote a prerequisite project on a classpath.

- * The referenced project will be contributed as a whole, either as sources (in the Java Model, it

- * contributes all its package fragment roots) or as binaries (when building, it contributes its 

- * whole output location).

- * <p>

- * A project reference allows to indirect through another project, independently from its internal layout. 

- * <p>

- * The prerequisite project is referred to using an absolute path relative to the workspace root.

- */

-public static IClasspathEntry newProjectEntry(IPath path){

-	Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));

-	return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE, IClasspathEntry.CPE_PROJECT, path, null, null);

-}

-/**

- * Returns a new empty region.

- */

-public static IRegion newRegion() {

-	return new Region();

-}

-/**

- * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code> for the project's source folder 

- * identified by the given absolute path. This specifies that all package fragments within the root will 

- * have children of type <code>ICompilationUnit</code>.

- * <p>

- * The source folder is referred to using an absolute path relative to the workspace root, e.g. <code>"/Project/src"</code>.

- * <p>

- * A source entry is used to setup the internal source layout of a project, and cannot be used out of the

- * context of the containing project (a source entry "Proj1/src" cannot be used on the classpath of Proj2).

- */ 

-public static IClasspathEntry newSourceEntry(IPath path){

-	Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));

-	return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE, IClasspathEntry.CPE_SOURCE, path, null, null);

-}

-/**

- * Creates and returns a new classpath entry of kind <code>CPE_VARIABLE</code>

- * for the given path. The first segment of the the path is the name of a classpath variable.

- * The trailing segments of the path will be appended to resolved variable path.

- * <p>

- * A variable entry allows to express indirect references on a classpath to other projects or libraries,

- * depending on what the classpath variable is referring.

- * <p>

- * e.g. Here are some examples of variable path usage<ul>

- * <li><"JDTCORE" where variable <code>JDTCORE</code> is 

- *		bound to "c:/jars/jdtcore.jar". The resoved classpath entry is denoting the library "c:\jars\jdtcore.jar"</li>

- * <li> "JDTCORE" where variable <code>JDTCORE</code> is 

- *		bound to "/Project_JDTCORE". The resoved classpath entry is denoting the project "/Project_JDTCORE"</li>

- * <li> "PLUGINS/com.example/example.jar" where variable <code>PLUGINS</code>

- *      is bound to "c:/eclipse/plugins". The resolved classpath entry is denoting the library "c:/eclipse/plugins/com.example/example.jar"</li>

- * </ul>

- * <p>

- * Note that this operation does not attempt to validate classpath variables

- * or access the resources at the given paths.

- * <p>

- * @param variablePath the path of the binary archive; first segment is the

- *   name of a classpath variable

- * @param variableSourceAttachmentPath the path of the corresponding source archive, 

- *    or <code>null</code> if none; if present, the first segment is the

- *    name of a classpath variable (not necessarily the same variable

- *    as the one that begins <code>variablePath</code>)

- * @param sourceAttachmentRootPath the location of the root within the source archive

- *    or <code>null</code> if <code>archivePath</code> is also <code>null</code>

- */

-public static IClasspathEntry newVariableEntry(IPath variablePath, IPath variableSourceAttachmentPath, IPath sourceAttachmentRootPath){

-	Assert.isTrue(variablePath != null && variablePath.segmentCount() >= 1, Util.bind("classpath.illegalVariablePath"/*nonNLS*/));

-	return new ClasspathEntry(

-					IPackageFragmentRoot.K_SOURCE, 

-					IClasspathEntry.CPE_VARIABLE, 

-					variablePath,

-					variableSourceAttachmentPath,

-					sourceAttachmentRootPath);

-}

-/**

- * Removed the given classpath variable. Does nothing if no value was

- * set for this classpath variable.

- * <p>

- * This functionality cannot be used while the resource tree is locked.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @param variableName the name of the classpath variable

- * @see #setClasspathVariable

- *

- * @deprecated - use version with extra IProgressMonitor

- */

-public static void removeClasspathVariable(String variableName) {

-

-	removeClasspathVariable(variableName, null);

-}

-/**

- * Removed the given classpath variable. Does nothing if no value was

- * set for this classpath variable.

- * <p>

- * This functionality cannot be used while the resource tree is locked.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @param variableName the name of the classpath variable

- * @param monitor the progress monitor to report progress

- * @see #setClasspathVariable

- */

-public static void removeClasspathVariable(String variableName, IProgressMonitor monitor) {

-

-	try {

-		updateVariableValue(variableName, null, monitor);

-	} catch(JavaModelException e){

 	}

-}

-/**

- * Removes the given element changed listener.

- * Has no affect if an identical listener is not registered.

- *

- * @param listener the listener

- */

-public static void removeElementChangedListener(IElementChangedListener listener) {

-	JavaModelManager.getJavaModelManager().removeElementChangedListener(listener);

-}

-/**

- * Sets the value of the given classpath variable.

- * The path must have at least one segment.

- * <p>

- * This functionality cannot be used while the resource tree is locked.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @param variableName the name of the classpath variable

- * @param path the path

- * @see #getClasspathVariable

- *

- * @deprecated - use API with IProgressMonitor

- */

-public static void setClasspathVariable(String variableName, IPath path) throws JavaModelException {

 

-	setClasspathVariable(variableName, path, null);

-}

-/**

- * Sets the value of the given classpath variable.

- * The path must have at least one segment.

- * <p>

- * This functionality cannot be used while the resource tree is locked.

- * <p>

- * Classpath variable values are persisted locally to the workspace, and 

- * are preserved from session to session.

- * <p>

- *

- * @param variableName the name of the classpath variable

- * @param path the path

- * @param monitor a monitor to report progress

- * @see #getClasspathVariable

- */

-public static void setClasspathVariable(String variableName, IPath path, IProgressMonitor monitor) throws JavaModelException {

+	/**

+	 * Creates and returns a new classpath entry of kind <code>CPE_PROJECT</code>

+	 * for the project identified by the given absolute path.

+	 * <p>

+	 * A project entry is used to denote a prerequisite project on a classpath.

+	 * The referenced project will be contributed as a whole, either as sources (in the Java Model, it

+	 * contributes all its package fragment roots) or as binaries (when building, it contributes its 

+	 * whole output location).

+	 * <p>

+	 * A project reference allows to indirect through another project, independently from its internal layout. 

+	 * <p>

+	 * The prerequisite project is referred to using an absolute path relative to the workspace root.

+	 */

+	public static IClasspathEntry newProjectEntry(IPath path) {

+		Assert.isTrue(

+			path.isAbsolute(),

+			Util.bind("classpath.needAbsolutePath" )); //$NON-NLS-1$

+		return new ClasspathEntry(

+			IPackageFragmentRoot.K_SOURCE,

+			IClasspathEntry.CPE_PROJECT,

+			path,

+			null,

+			null);

+	}

 

-	Assert.isTrue(path != null, Util.bind("classpath.nullVariablePath"/*nonNLS*/));

-	updateVariableValue(variableName, path, monitor);

-}

-/* (non-Javadoc)

- * Method declared on IExecutableExtension.

- * Record any necessary initialization data from the plugin.

- */

-public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) throws CoreException {}

-/**

- * Set current set of configurable options supported by the Java core.

- * These options allow to configure the behavior of the underlying components.

- * 

- * For a list of recognized options, refer to <code>JavaCore.getDefaultOptions</code>

- */

-public static void setOptions(Hashtable configurableOptions){

-	ConfigurableOptions = (Hashtable) configurableOptions.clone();

-}

-/**

- * Shutdown the JavaCore plugin

- * <p>

- * De-registers the JavaModelManager as a resource changed listener and save participant.

- * <p>

- * @see Plugin#shutdown

- */

-public void shutdown() {

+	/**

+	 * Returns a new empty region.

+	 */

+	public static IRegion newRegion() {

+		return new Region();

+	}

 

-	IWorkspace workspace = ResourcesPlugin.getWorkspace();

-	workspace.removeResourceChangeListener(JavaModelManager.getJavaModelManager());

-	workspace.removeSaveParticipant(this);

+	/**

+	 * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code> for the project's source folder 

+	 * identified by the given absolute path. This specifies that all package fragments within the root will 

+	 * have children of type <code>ICompilationUnit</code>.

+	 * <p>

+	 * The source folder is referred to using an absolute path relative to the workspace root, e.g. <code>"/Project/src"</code>.

+	 * <p>

+	 * A source entry is used to setup the internal source layout of a project, and cannot be used out of the

+	 * context of the containing project (a source entry "Proj1/src" cannot be used on the classpath of Proj2).

+	 */

+	public static IClasspathEntry newSourceEntry(IPath path) {

+		Assert.isTrue(

+			path.isAbsolute(),

+			Util.bind("classpath.needAbsolutePath" )); //$NON-NLS-1$

+		return new ClasspathEntry(

+			IPackageFragmentRoot.K_SOURCE,

+			IClasspathEntry.CPE_SOURCE,

+			path,

+			null,

+			null);

+	}

 

-	((JavaModelManager) JavaModelManager.getJavaModelManager()).shutdown();

-}

-/**

- * Initiate the background indexing process.

- * This should be deferred after the plugin activation.

- */

-private void startIndexing() {

+	/**

+	 * Creates and returns a new classpath entry of kind <code>CPE_VARIABLE</code>

+	 * for the given path. The first segment of the the path is the name of a classpath variable.

+	 * The trailing segments of the path will be appended to resolved variable path.

+	 * <p>

+	 * A variable entry allows to express indirect references on a classpath to other projects or libraries,

+	 * depending on what the classpath variable is referring.

+	 * <p>

+	 * e.g. Here are some examples of variable path usage<ul>

+	 * <li><"JDTCORE" where variable <code>JDTCORE</code> is 

+	 *		bound to "c:/jars/jdtcore.jar". The resoved classpath entry is denoting the library "c:\jars\jdtcore.jar"</li>

+	 * <li> "JDTCORE" where variable <code>JDTCORE</code> is 

+	 *		bound to "/Project_JDTCORE". The resoved classpath entry is denoting the project "/Project_JDTCORE"</li>

+	 * <li> "PLUGINS/com.example/example.jar" where variable <code>PLUGINS</code>

+	 *      is bound to "c:/eclipse/plugins". The resolved classpath entry is denoting the library "c:/eclipse/plugins/com.example/example.jar"</li>

+	 * </ul>

+	 * <p>

+	 * Note that this operation does not attempt to validate classpath variables

+	 * or access the resources at the given paths.

+	 * <p>

+	 * @param variablePath the path of the binary archive; first segment is the

+	 *   name of a classpath variable

+	 * @param variableSourceAttachmentPath the path of the corresponding source archive, 

+	 *    or <code>null</code> if none; if present, the first segment is the

+	 *    name of a classpath variable (not necessarily the same variable

+	 *    as the one that begins <code>variablePath</code>)

+	 * @param sourceAttachmentRootPath the location of the root within the source archive

+	 *    or <code>null</code> if <code>archivePath</code> is also <code>null</code>

+	 */

+	public static IClasspathEntry newVariableEntry(

+		IPath variablePath,

+		IPath variableSourceAttachmentPath,

+		IPath sourceAttachmentRootPath) {

+		Assert.isTrue(

+			variablePath != null && variablePath.segmentCount() >= 1,

+			Util.bind("classpath.illegalVariablePath" )); //$NON-NLS-1$

+		return new ClasspathEntry(

+			IPackageFragmentRoot.K_SOURCE,

+			IClasspathEntry.CPE_VARIABLE,

+			variablePath,

+			variableSourceAttachmentPath,

+			sourceAttachmentRootPath);

+	}

 

-	JavaModelManager manager = (JavaModelManager) JavaModelManager.getJavaModelManager();

-	IndexManager indexManager = manager.getIndexManager(); 

-	if (indexManager != null) indexManager.reset();

-	/*	

-		// if there is a desktop defer the start of the indexing by posting a runnable

-		if (getDesktopPlugin() != null) {

-			IDesktop desktop= getDesktop();

-			ApplicationWindow window= (ApplicationWindow) desktop.getActiveDesktopWindow();

-			Display display= null;

-			if (window != null)

-				display= window.getDisplay();

-			if (display != null) {

-				display.asyncExec(start);

-				return;

-			}

+	/**

+	 * Removed the given classpath variable. Does nothing if no value was

+	 * set for this classpath variable.

+	 * <p>

+	 * This functionality cannot be used while the resource tree is locked.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @param variableName the name of the classpath variable

+	 * @see #setClasspathVariable

+	 *

+	 * @deprecated - use version with extra IProgressMonitor

+	 */

+	public static void removeClasspathVariable(String variableName) {

+		removeClasspathVariable(variableName, null);

+	}

+

+	/**

+	 * Removed the given classpath variable. Does nothing if no value was

+	 * set for this classpath variable.

+	 * <p>

+	 * This functionality cannot be used while the resource tree is locked.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @param variableName the name of the classpath variable

+	 * @param monitor the progress monitor to report progress

+	 * @see #setClasspathVariable

+	 */

+	public static void removeClasspathVariable(

+		String variableName,

+		IProgressMonitor monitor) {

+

+		try {

+			updateVariableValue(variableName, null, monitor);

+		} catch (JavaModelException e) {

 		}

-	*/		

-}

-/**

- * Startup of the JavaCore plugin

- * <p>

- * Registers the JavaModelManager as a resource changed listener and save participant.

- * Starts the background indexing, and restore saved classpath variable values.

- * <p>

- * @see Plugin#startup

- */

-public void startup() {

-		JavaModelManager manager = JavaModelManager.getJavaModelManager();

-	try {

+	}

+

+	/**

+	 * Removes the given element changed listener.

+	 * Has no affect if an identical listener is not registered.

+	 *

+	 * @param listener the listener

+	 */

+	public static void removeElementChangedListener(IElementChangedListener listener) {

+		JavaModelManager.getJavaModelManager().removeElementChangedListener(listener);

+	}

+

+	/**

+	 * Sets the value of the given classpath variable.

+	 * The path must have at least one segment.

+	 * <p>

+	 * This functionality cannot be used while the resource tree is locked.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @param variableName the name of the classpath variable

+	 * @param path the path

+	 * @see #getClasspathVariable

+	 *

+	 * @deprecated - use API with IProgressMonitor

+	 */

+	public static void setClasspathVariable(String variableName, IPath path)

+		throws JavaModelException {

+

+		setClasspathVariable(variableName, path, null);

+	}

+

+	/**

+	 * Sets the value of the given classpath variable.

+	 * The path must have at least one segment.

+	 * <p>

+	 * This functionality cannot be used while the resource tree is locked.

+	 * <p>

+	 * Classpath variable values are persisted locally to the workspace, and 

+	 * are preserved from session to session.

+	 * <p>

+	 *

+	 * @param variableName the name of the classpath variable

+	 * @param path the path

+	 * @param monitor a monitor to report progress

+	 * @see #getClasspathVariable

+	 */

+	public static void setClasspathVariable(

+		String variableName,

+		IPath path,

+		IProgressMonitor monitor)

+		throws JavaModelException {

+

+		Assert.isTrue(path != null, Util.bind("classpath.nullVariablePath" )); //$NON-NLS-1$

+		updateVariableValue(variableName, path, monitor);

+	}

+

+	/* (non-Javadoc)

+	 * Method declared on IExecutableExtension.

+	 * Record any necessary initialization data from the plugin.

+	 */

+	public void setInitializationData(

+		IConfigurationElement cfig,

+		String propertyName,

+		Object data)

+		throws CoreException {

+	}

+

+	/**

+	 * Shutdown the JavaCore plugin

+	 * <p>

+	 * De-registers the JavaModelManager as a resource changed listener and save participant.

+	 * <p>

+	 * @see Plugin#shutdown

+	 */

+	public void shutdown() {

+

 		IWorkspace workspace = ResourcesPlugin.getWorkspace();

-		IndexManager indexManager = manager.getIndexManager();

-		if (indexManager != null) {

-			// need to initialize workbench now since a query may be done before indexing starts

-			indexManager.workspace = workspace;

-		}

-		workspace.addResourceChangeListener(

-			manager, 

-			IResourceChangeEvent.PRE_AUTO_BUILD | IResourceChangeEvent.POST_CHANGE 

-				| IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE);

-		

-		startIndexing();

+		workspace.removeResourceChangeListener(JavaModelManager.getJavaModelManager());

+		workspace.removeSaveParticipant(this);

 

-		workspace.addSaveParticipant(this, manager);

-		manager.loadVariables();

-	} catch(CoreException e) {

-	} catch(RuntimeException e){

-		manager.shutdown();

-		throw e;

+		((JavaModelManager) JavaModelManager.getJavaModelManager()).shutdown();

 	}

-}

-/**

- * Internal updating of a variable value (null path meaning removal).

- */

-private static void updateVariableValue(String variableName, IPath path, IProgressMonitor monitor) throws JavaModelException {

 

-	// gather classpath information for updating

-	Hashtable affectedProjects = new Hashtable(5);

-	JavaModelManager manager = JavaModelManager.getJavaModelManager();

-	try {

-		IJavaModel model = manager.getJavaModel();

-		if (model != null){

-			IJavaProject[] projects = model.getJavaProjects();

-			nextProject: for (int i = 0, max = projects.length; i < max; i++){

-				IClasspathEntry[] entries = projects[i].getRawClasspath();

-				for (int j = 0, cplength = entries.length; j < cplength; j++){

-					IClasspathEntry oldEntry = entries[j];

-					if (oldEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE){

-						IPath sourcePath, sourceRootPath;

-						if (oldEntry.getPath().segment(0).equals(variableName) 

-								|| ((sourcePath = oldEntry.getSourceAttachmentPath()) != null && sourcePath.segment(0).equals(variableName))

-								|| ((sourceRootPath = oldEntry.getSourceAttachmentRootPath()) != null && sourceRootPath.segment(0).equals(variableName))) {

-							affectedProjects.put(projects[i], projects[i].getResolvedClasspath(true));

-							continue nextProject;

+	/**

+	 * Initiate the background indexing process.

+	 * This should be deferred after the plugin activation.

+	 */

+	private void startIndexing() {

+

+		JavaModelManager manager =

+			(JavaModelManager) JavaModelManager.getJavaModelManager();

+		IndexManager indexManager = manager.getIndexManager();

+		if (indexManager != null)

+			indexManager.reset();

+	}

+

+	/**

+	 * Startup of the JavaCore plugin

+	 * <p>

+	 * Registers the JavaModelManager as a resource changed listener and save participant.

+	 * Starts the background indexing, and restore saved classpath variable values.

+	 * <p>

+	 * @see Plugin#startup

+	 */

+	public void startup() {

+		JavaModelManager manager = JavaModelManager.getJavaModelManager();

+		try {

+			IWorkspace workspace = ResourcesPlugin.getWorkspace();

+			IndexManager indexManager = manager.getIndexManager();

+			if (indexManager != null) {

+				// need to initialize workbench now since a query may be done before indexing starts

+				indexManager.workspace = workspace;

+			}

+			workspace.addResourceChangeListener(

+				manager,

+				IResourceChangeEvent.PRE_AUTO_BUILD

+					| IResourceChangeEvent.POST_CHANGE

+					| IResourceChangeEvent.PRE_DELETE

+					| IResourceChangeEvent.PRE_CLOSE);

+

+			startIndexing();

+

+			workspace.addSaveParticipant(this, manager);

+			manager.loadVariables();

+			manager.loadOptions();

+		} catch (CoreException e) {

+		} catch (RuntimeException e) {

+			manager.shutdown();

+			throw e;

+		}

+	}

+

+	/**

+	 * Internal updating of a variable value (null path meaning removal).

+	 */

+	private static void updateVariableValue(

+		String variableName,

+		IPath path,

+		IProgressMonitor monitor)

+		throws JavaModelException {

+

+		// gather classpath information for updating

+		Hashtable affectedProjects = new Hashtable(5);

+		JavaModelManager manager = JavaModelManager.getJavaModelManager();

+		try {

+			IJavaModel model = manager.getJavaModel();

+			if (model != null) {

+				IJavaProject[] projects = model.getJavaProjects();

+				nextProject : for (int i = 0, max = projects.length; i < max; i++) {

+					IClasspathEntry[] entries = projects[i].getRawClasspath();

+					for (int j = 0, cplength = entries.length; j < cplength; j++) {

+						IClasspathEntry oldEntry = entries[j];

+						if (oldEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {

+							IPath sourcePath, sourceRootPath;

+							if (oldEntry.getPath().segment(0).equals(variableName)

+								|| ((sourcePath = oldEntry.getSourceAttachmentPath()) != null

+									&& sourcePath.segment(0).equals(variableName))

+								|| ((sourceRootPath = oldEntry.getSourceAttachmentRootPath()) != null

+									&& sourceRootPath.segment(0).equals(variableName))) {

+								affectedProjects.put(projects[i], projects[i].getResolvedClasspath(true));

+								continue nextProject;

+							}

 						}

 					}

 				}

 			}

+		} catch (JavaModelException e) {

 		}

-	} catch(JavaModelException e){

+		if (path == null) {

+			Variables.remove(variableName);

+		} else {

+			// new variable value is assigned

+			Variables.put(variableName, path);

+		}

+		if (!affectedProjects.isEmpty()) {

+			boolean wasFiring = manager.isFiring();

+			try {

+				if (wasFiring)

+					manager.stopDeltas();

+				// propagate classpath change

+				Enumeration projectsToUpdate = affectedProjects.keys();

+				while (projectsToUpdate.hasMoreElements()) {

+					JavaProject project = (JavaProject) projectsToUpdate.nextElement();

+					project

+						.setRawClasspath(

+							project.getRawClasspath(),

+							monitor,

+							project.getWorkspace().isAutoBuilding(),

+					// force build if in auto build mode

+					 (IClasspathEntry[]) affectedProjects.get(project));

+				}

+			} finally {

+				manager.mergeDeltas();

+				if (wasFiring) {

+					manager.startDeltas();

+					manager.fire();

+				}

+			}

+		}

 	}

 

-	if (path == null){

-		Variables.remove(variableName);

-	} else {

-		// new variable value is assigned

-		Variables.put(variableName, path);

+	/**

+	* Set the value of the current setting for an option.

+	*

+	* @return IJavaModelStatusConstants.INVALID_OPTION_VALUE if option value

+	* are not correct and IJavaModelStatusConstants.INVALID_OPTION if option

+	* doesn't exist.

+	*/

+	public static IJavaModelStatus setOptionValue(String id, String value) {

+		IJavaModelStatus status = validateOptionValue(id, value);

+		if (status.getCode() == IJavaModelStatus.OK) {

+			ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+			if (option != null)

+				option.setValue(value);

+		}

+		return status;

 	}

 

-	if (!affectedProjects.isEmpty()){

-		boolean wasFiring = manager.isFiring();

+	/**

+	* Answer the value of the current setting for an option.

+	*

+	* @return String

+	*/

+	public static String getOptionValue(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getValue();

+

+		return null;

+	}

+

+	/**

+	* Set the value of the default setting for an option.

+	*

+	* @return IJavaModelStatusConstants.INVALID_OPTION_VALUE if option value

+	* are not correct and IJavaModelStatusConstants.INVALID_OPTION if option

+	* doesn't exist.

+	*/

+	private static IJavaModelStatus setOptionDefaultValue(

+		String id,

+		String value) {

+		IJavaModelStatus status = validateOptionValue(id, value);

+		if (status.getCode() == IJavaModelStatus.OK) {

+			ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+			if (option != null)

+				option.setDefaultValue(value);

+		}

+		return status;

+	}

+

+	/**

+	* Answer the value of the default setting for an option.

+	*

+	* @return String

+	*/

+	public static String getOptionDefaultValue(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getDefaultValue();

+

+		return null;

+	}

+

+	/**

+	* Return an String that represents the localized description of an option.

+	*

+	* @return java.lang.String

+	*/

+	public static String getOptionDescription(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getDescription();

+

+		return null;

+	}

+	/**

+	* Return a String that represents the localized name of an option.

+	* @return java.lang.String

+	*/

+	public static String getOptionName(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getName();

+

+		return null;

+	}

+

+	/**

+	* Return a String that identifies the component owner of an option

+	* (typically the qualified type name of the class which it corresponds to).

+	*

+	* e.g. "org.eclipse.jdt.internal.compiler.api.Compiler"

+	*

+	* @return java.lang.String

+	*/

+	public static String getOptionComponentName(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getComponentName();

+

+		return null;

+	}

+

+	/**

+	 * Return a String that represents the localized category of an option.

+	 * @return java.lang.String

+	 */

+	public static String getOptionCategory(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getCategory();

+

+		return null;

+	}

+

+	/**

+	* Return an array of String that represents the localized possible values of an option.

+	*

+	* @return java.lang.String[]

+	*/

+	public static String[] getOptionPossibleValues(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getPossibleValues();

+

+		return null;

+	}

+

+	/**

+	 * Return the type of option. Type is a String with possible value :

+	 * <code>discrete</code>,<code>string</code>,<code>int</code> and

+	 * <code>float</code>.

+	 */

+	public static String getOptionType(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getType();

+

+		return null;

+	}

+

+	/**

+	 * Return the maximum value of option if option's type is <code>int</code>

+	 *  or <code>float</code>.Otherwise return null.

+	 */

+	public static Number getOptionMax(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null) {

+			return option.getMax();

+		}

+

+		return null;

+	}

+

+	/**

+	 * Return the minimum value of option if option's type is <code>int</code>

+	 *  or <code>float</code>.Otherwise return null.

+	 */

+	public static Number getOptionMin(String id) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null)

+			return option.getMin();

+

+		return null;

+	}

+

+	/**

+	 * Answers a set of option'IDs which are in option set of JavaCore

+	 */

+	public static String[] getOptionIDs() {

+		return JavaModelManager.getOptionIDs();

+	}

+

+	/**

+	 * Answers a set of option'IDs which are in option set of JavaCore

+	 * and associated with a component.

+	 */

+	public static String[] getOptionIDs(String componentName) {

+		String[] ids = getOptionIDs();

+

+		String[] result = new String[ids.length];

+		int resultCount = 0;

+		for (int i = 0; i < ids.length; i++) {

+			if (ids[i].startsWith(componentName))

+				result[resultCount++] = ids[i];

+		}

+

+		System.arraycopy(result, 0, result = new String[resultCount], 0, resultCount);

+

+		return result;

+	}

+

+	/**

+	 * Answers if a value is valide for an option

+	 * 

+	 * @return IJavaModelStatusConstants.INVALID_OPTION_VALUE if option value

+	 * are not correct and IJavaModelStatusConstants.INVALID_OPTION if option

+	 * doesn't exist.

+	 */

+	public static IJavaModelStatus validateOptionValue(String id, String value) {

+		ConfigurableOption option = (ConfigurableOption) getOptions().get(id);

+

+		if (option != null) {

+			String[] values = option.getPossibleValues();

+			if (values == ConfigurableOption.NoDiscreteValue) {

+				try {

+					if (option.getType().equals(ConfigurableOption.INT)) {

+						int max = option.getMax().intValue();

+						int min = option.getMin().intValue();

+						int val = Integer.parseInt(value);

+						if (val > max || val < min)

+							return new JavaModelStatus(IJavaModelStatusConstants.INVALID_OPTION_VALUE);

+					} else if (option.getType().equals(ConfigurableOption.FLOAT)) {

+						float max = option.getMax().floatValue();

+						float min = option.getMin().floatValue();

+						float val = Float.parseFloat(value);

+						if (val > max || val < min)

+							return new JavaModelStatus(IJavaModelStatusConstants.INVALID_OPTION_VALUE);

+					}

+				} catch (NumberFormatException e) {

+					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_OPTION_VALUE);

+				}

+				return JavaModelStatus.VERIFIED_OK;

+			} else {

+				for (int i = 0; i < values.length; i++) {

+					if (values[i].equals(value))

+						return JavaModelStatus.VERIFIED_OK;

+				}

+				return new JavaModelStatus(IJavaModelStatusConstants.INVALID_OPTION_VALUE);

+			}

+		}

+		return new JavaModelStatus(IJavaModelStatusConstants.INVALID_OPTION);

+	}

+

+	/**

+	 * Reset JavaCore option values to defaults.

+	 */

+	public static void resetOptions() {

+		Locale locale = Locale.getDefault();

+

+		if (JavaModelManager.fOptions == null) {

+			JavaModelManager.initializeOptions();

+			// Set options to JavaCore default value

+			setJavaCoreDefaultOptionsValue(locale);

+

+		} else {

+			ConfigurableOption[] options =

+				(ConfigurableOption[]) JavaModelManager.fOptions.values().toArray(

+					new ConfigurableOption[0]);

+			for (int i = 0; i < options.length; i++)

+				options[i].setToDefault();

+		}

+	}

+

+	private static void setJavaCoreDefaultOptionsValue(Locale locale) {

+		BufferedReader reader = null;

 		try {

-			if (wasFiring) manager.stopDeltas();

-			// propagate classpath change

-			Enumeration projectsToUpdate = affectedProjects.keys();

-			while (projectsToUpdate.hasMoreElements()){

-				JavaProject project = (JavaProject)projectsToUpdate.nextElement();

-				project.setRawClasspath(

-					project.getRawClasspath(), 

-					monitor, 

-					project.getWorkspace().isAutoBuilding(), // force build if in auto build mode

-					(IClasspathEntry[])affectedProjects.get(project));

+			reader =

+				new BufferedReader(

+					new InputStreamReader(JavaCore.class.getResourceAsStream(JAVA_CORE_INIT)));

+			String line = reader.readLine();

+			while (line != null) {

+				int equalIndex = line.indexOf("=" ); //$NON-NLS-1$

+				if (!line.startsWith("#" ) && equalIndex != -1) { //$NON-NLS-1$

+					String id = line.substring(0, equalIndex).trim();

+

+					ConfigurableOption option = new ConfigurableOption(id, locale);

+					if (option.getPossibleValues() != ConfigurableOption.NoDiscreteValue) {

+						try {

+							int index = Integer.parseInt(line.substring(equalIndex + 1).trim());

+							option.setDefaultValueIndex(index);

+						} catch (NumberFormatException e) {

+							// value is default default value

+						}

+					} else {

+						String value = line.substring(equalIndex + 1).trim();

+						option.setDefaultValue(value);

+					}

+					JavaModelManager.addOption(option);

+				}

+				line = reader.readLine();

 			}

+		} catch (FileNotFoundException e) {

+		} catch (IOException e) {

 		} finally {

-			manager.mergeDeltas();

-			if (wasFiring){

-				manager.startDeltas();

-				manager.fire();

+			if (reader != null) {

+				try {

+					reader.close();

+				} catch(IOException e){

+				}

 			}

 		}

 	}

-}

-}

+

+	private static Hashtable getOptions() {

+		if (JavaModelManager.fOptions == null)

+			resetOptions();

+

+		return JavaModelManager.fOptions;

+	}

+

+	/**

+	 * Returns all the options of Java Core to be shown by the UI

+	 *

+	 * @param locale java.util.Locale

+	 * @return org.eclipse.jdt.internal.compiler.ConfigurableOption[]

+	 */

+	private static ConfigurableOption[] getDefaultOptions(Locale locale) {

+		String[] ids = ConfigurableOption.getIDs(JavaCore.class.getName(), locale);

+

+		ConfigurableOption[] result = new ConfigurableOption[ids.length];

+		for (int i = 0; i < ids.length; i++) {

+			result[i] = new ConfigurableOption(ids[i], locale);

+		}

+		return result;

+	}

+}
\ No newline at end of file
diff --git a/model/org/eclipse/jdt/core/JavaModelException.java b/model/org/eclipse/jdt/core/JavaModelException.java
index e7017e5..0a6ba96 100644
--- a/model/org/eclipse/jdt/core/JavaModelException.java
+++ b/model/org/eclipse/jdt/core/JavaModelException.java
@@ -98,13 +98,13 @@
  */

 public String toString() {

 	StringBuffer buffer= new StringBuffer();

-	buffer.append("Java Model Exception: "/*nonNLS*/);

+	buffer.append("Java Model Exception: "); //$NON-NLS-1$

 	if (getException() != null) {

 		if (getException() instanceof CoreException) {

 			CoreException c= (CoreException)getException();

-			buffer.append("Core Exception [code "/*nonNLS*/);

+			buffer.append("Core Exception [code "); //$NON-NLS-1$

 			buffer.append(c.getStatus().getCode());

-			buffer.append("] "/*nonNLS*/);

+			buffer.append("] "); //$NON-NLS-1$

 			buffer.append(c.getStatus().getMessage());

 		} else {

 			buffer.append(getException().toString());

diff --git a/model/org/eclipse/jdt/core/Signature.java b/model/org/eclipse/jdt/core/Signature.java
index 7a870dd..0afa1ac 100644
--- a/model/org/eclipse/jdt/core/Signature.java
+++ b/model/org/eclipse/jdt/core/Signature.java
@@ -173,54 +173,54 @@
 	 * String constant for the signature of the primitive type boolean.

 	 * Value is <code>"Z"</code>.

 	 */

-	public static final String SIG_BOOLEAN 		= "Z"/*nonNLS*/;

+	public static final String SIG_BOOLEAN 		= "Z"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type byte. 

 	 * Value is <code>"B"</code>.

 	 */

-	public static final String SIG_BYTE 		= "B"/*nonNLS*/;

+	public static final String SIG_BYTE 		= "B"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type char.

 	 * Value is <code>"C"</code>.

 	 */

-	public static final String SIG_CHAR 		= "C"/*nonNLS*/;

+	public static final String SIG_CHAR 		= "C"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type double.

 	 * Value is <code>"D"</code>.

 	 */

-	public static final String SIG_DOUBLE 		= "D"/*nonNLS*/;

+	public static final String SIG_DOUBLE 		= "D"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type float.

 	 * Value is <code>"F"</code>.

 	 */

-	public static final String SIG_FLOAT 		= "F"/*nonNLS*/;

+	public static final String SIG_FLOAT 		= "F"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type int.

 	 * Value is <code>"I"</code>.

 	 */

-	public static final String SIG_INT 			= "I"/*nonNLS*/;

+	public static final String SIG_INT 			= "I"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type long.

 	 * Value is <code>"J"</code>.

 	 */

-	public static final String SIG_LONG			= "J"/*nonNLS*/;

+	public static final String SIG_LONG			= "J"; //$NON-NLS-1$

 

 	/**

 	 * String constant for the signature of the primitive type short.

 	 * Value is <code>"S"</code>.

 	 */

-	public static final String SIG_SHORT		= "S"/*nonNLS*/;

+	public static final String SIG_SHORT		= "S"; //$NON-NLS-1$

 

 	/** String constant for the signature of result type void.

 	 * Value is <code>"V"</code>.

 	 */

-	public static final String SIG_VOID			= "V"/*nonNLS*/;

+	public static final String SIG_VOID			= "V"; //$NON-NLS-1$

 	

 /**

  * Not instantiable.

@@ -236,7 +236,7 @@
 	StringBuffer sb = new StringBuffer(typeName.length() + arrayCount * 2);

 	sb.append(typeName);

 	for (int i = 0; i < arrayCount; ++i) {

-		sb.append("[]"/*nonNLS*/);

+		sb.append("[]"); //$NON-NLS-1$

 	}

 	return sb.toString();

 }

@@ -302,7 +302,7 @@
 					return SIG_VOID;

 			case 6 :

 				if (typeName[0] == 'S' && typeName[1] == 't' && typeName[2] == 'r' && typeName[3] == 'i' && typeName[4] == 'n' && typeName[5] == 'g')

-					if (!isResolved) return "QString;"/*nonNLS*/;

+					if (!isResolved) return "QString;"; //$NON-NLS-1$

 					break;

 			case 7 :

 				if (typeName[0] == 'b' && typeName[1] == 'o' && typeName[2] == 'o' && typeName[3] == 'l' && typeName[4] == 'e' && typeName[5] == 'a' && typeName[6] == 'n')

@@ -617,7 +617,7 @@
 public static String getQualifier(String name) {

 	int lastDot = name.lastIndexOf(C_DOT);

 	if (lastDot == -1) {

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	}

 	return name.substring(0, lastDot);

 }

@@ -715,7 +715,7 @@
  */

 public static String toQualifiedName(String[] segments) {

 	if (segments.length == 0) {

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	}

 	if (segments.length == 1) {

 		return segments[0];

@@ -755,28 +755,28 @@
 public static String toString(String signature) throws IllegalArgumentException {

 	try {

 		if (signature.charAt(0) == C_PARAM_START) {

-			return toString(signature, ""/*nonNLS*/, null, true, true);

+			return toString(signature, "", null, true, true); //$NON-NLS-1$

 		}

 		int arrayCount = getArrayCount(signature);

 		switch (signature.charAt(arrayCount)) {

 			case C_BOOLEAN :

-				return arrayIfy("boolean"/*nonNLS*/, arrayCount);

+				return arrayIfy("boolean", arrayCount); //$NON-NLS-1$

 			case C_BYTE :

-				return arrayIfy("byte"/*nonNLS*/, arrayCount);

+				return arrayIfy("byte", arrayCount); //$NON-NLS-1$

 			case C_CHAR :

-				return arrayIfy("char"/*nonNLS*/, arrayCount);

+				return arrayIfy("char", arrayCount); //$NON-NLS-1$

 			case C_DOUBLE :

-				return arrayIfy("double"/*nonNLS*/, arrayCount);

+				return arrayIfy("double", arrayCount); //$NON-NLS-1$

 			case C_FLOAT :

-				return arrayIfy("float"/*nonNLS*/, arrayCount);

+				return arrayIfy("float", arrayCount); //$NON-NLS-1$

 			case C_INT :

-				return arrayIfy("int"/*nonNLS*/, arrayCount);

+				return arrayIfy("int", arrayCount); //$NON-NLS-1$

 			case C_LONG :

-				return arrayIfy("long"/*nonNLS*/, arrayCount);

+				return arrayIfy("long", arrayCount); //$NON-NLS-1$

 			case C_SHORT :

-				return arrayIfy("short"/*nonNLS*/, arrayCount);

+				return arrayIfy("short", arrayCount); //$NON-NLS-1$

 			case C_VOID :

-				return arrayIfy("void"/*nonNLS*/, arrayCount);

+				return arrayIfy("void", arrayCount); //$NON-NLS-1$

 			case C_RESOLVED :

 			case C_UNRESOLVED :

 				int semi = signature.indexOf(C_SEMICOLON, arrayCount + 1);

@@ -838,7 +838,7 @@
 	sb.append(C_PARAM_START);

 	for (int i = 0; i < paramTypes.length; ++i) {

 		if (i != 0)

-			sb.append(", "/*nonNLS*/);

+			sb.append(", "); //$NON-NLS-1$

 		String readableParamType = toString(paramTypes[i]);

 		if (!fullyQualifyTypeNames) {

 			int lastDot = readableParamType.lastIndexOf(C_DOT);

diff --git a/model/org/eclipse/jdt/core/jdom/DOMFactory.java b/model/org/eclipse/jdt/core/jdom/DOMFactory.java
index bb56111..83758ed 100644
--- a/model/org/eclipse/jdt/core/jdom/DOMFactory.java
+++ b/model/org/eclipse/jdt/core/jdom/DOMFactory.java
@@ -47,7 +47,7 @@
  * Method declared on IDOMFactory.

  */

 public IDOMField createField() {

-	return createField("Object aField;"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);

+	return createField("Object aField;"+ JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 }

 /* (non-Javadoc)

  * Method declared on IDOMFactory.

@@ -77,7 +77,7 @@
  * Method declared on IDOMFactory.

  */

 public IDOMInitializer createInitializer() {

-	return createInitializer("static {}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);

+	return createInitializer("static {}"+ JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 }

 /* (non-Javadoc)

  * Method declared on IDOMFactory.

@@ -92,7 +92,7 @@
  * Method declared on IDOMFactory.

  */

 public IDOMMethod createMethod() {

-	return createMethod("public void newMethod() {"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR+"}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);

+	return createMethod("public void newMethod() {"+ JavaModelManager.LINE_SEPARATOR+"}"+ JavaModelManager.LINE_SEPARATOR); //$NON-NLS-2$ //$NON-NLS-1$

 }

 /* (non-Javadoc)

  * Method declared on IDOMFactory.

@@ -122,7 +122,7 @@
  * Method declared on IDOMFactory.

  */

 public IDOMType createType() {

-	return createType("public class AClass {"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR +"}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);

+	return createType("public class AClass {"+ JavaModelManager.LINE_SEPARATOR +"}"+ JavaModelManager.LINE_SEPARATOR); //$NON-NLS-2$ //$NON-NLS-1$

 }

 /* (non-Javadoc)

  * Method declared on IDOMFactory.

diff --git a/model/org/eclipse/jdt/internal/core/Assert.java b/model/org/eclipse/jdt/internal/core/Assert.java
index 707494c..8ad8792 100644
--- a/model/org/eclipse/jdt/internal/core/Assert.java
+++ b/model/org/eclipse/jdt/internal/core/Assert.java
@@ -19,7 +19,7 @@
  * @exception IllegalArgumentException if the legality test failed

  */

 public static boolean isLegal(boolean expression) {

-	return isLegal(expression, ""/*nonNLS*/);

+	return isLegal(expression, ""); //$NON-NLS-1$

 }

 /** Asserts that an argument is legal. If the given boolean is

  * not <code>true</code>, an <code>IllegalArgumentException</code>

@@ -44,7 +44,7 @@
  * @exception IllegalArgumentException if the object is <code>null</code>

  */

 public static void isNotNull(Object object) {

-	isNotNull(object, ""/*nonNLS*/);

+	isNotNull(object, ""); //$NON-NLS-1$

 }

 /** Asserts that the given object is not <code>null</code>. If this

  * is not the case, some kind of unchecked exception is thrown.

@@ -56,7 +56,7 @@
  */

 public static void isNotNull(Object object, String message) {

 	if (object == null)

-		throw new AssertionFailedException(Util.bind("assert.nullArgument"/*nonNLS*/,message));

+		throw new AssertionFailedException(Util.bind("assert.nullArgument",message)); //$NON-NLS-1$

 }

 /** Asserts that the given boolean is <code>true</code>. If this

  * is not the case, some kind of unchecked exception is thrown.

@@ -66,7 +66,7 @@
  *    if the check fails)

  */

 public static boolean isTrue(boolean expression) {

-	return isTrue(expression, ""/*nonNLS*/);

+	return isTrue(expression, ""); //$NON-NLS-1$

 }

 /** Asserts that the given boolean is <code>true</code>. If this

  * is not the case, some kind of unchecked exception is thrown.

@@ -79,7 +79,7 @@
  */

 public static boolean isTrue(boolean expression, String message) {

 	if (!expression)

-		throw new AssertionFailedException(Util.bind("assert.failed"/*nonNLS*/, message));

+		throw new AssertionFailedException(Util.bind("assert.failed", message)); //$NON-NLS-1$

 	return expression;

 }

 

diff --git a/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java b/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
index 7f9ec67..c1972e9 100644
--- a/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
+++ b/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
@@ -21,11 +21,11 @@
 	this.contents = contents;

 	this.fileName = fileName.toCharArray();

 

-	int start = fileName.lastIndexOf("/"/*nonNLS*/) + 1;

-	if (start == 0 || start < fileName.lastIndexOf("\\"/*nonNLS*/))

-		start = fileName.lastIndexOf("\\"/*nonNLS*/) + 1;

+	int start = fileName.lastIndexOf("/") + 1; //$NON-NLS-1$

+	if (start == 0 || start < fileName.lastIndexOf("\\")) //$NON-NLS-1$

+		start = fileName.lastIndexOf("\\") + 1; //$NON-NLS-1$

 

-	int end = fileName.lastIndexOf("."/*nonNLS*/);

+	int end = fileName.lastIndexOf("."); //$NON-NLS-1$

 	if (end == -1)

 		end = fileName.length();

 

@@ -75,6 +75,6 @@
 	return mainTypeName;

 }

 public String toString(){

-	return "CompilationUnit: "/*nonNLS*/+new String(fileName);

+	return "CompilationUnit: "+new String(fileName); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/model/org/eclipse/jdt/internal/core/BinaryMethod.java
index 0616e24..2bf473b 100644
--- a/model/org/eclipse/jdt/internal/core/BinaryMethod.java
+++ b/model/org/eclipse/jdt/internal/core/BinaryMethod.java
@@ -110,7 +110,7 @@
 		int paramCount = Signature.getParameterCount(new String(info.getMethodDescriptor()));

 		fParameterNames = new String[paramCount];

 		for (int i = 0; i < paramCount; i++) {

-			fParameterNames[i] = "arg"/*nonNLS*/ + i;

+			fParameterNames[i] = "arg" + i; //$NON-NLS-1$

 		}

 	}

 	return fParameterNames;

@@ -151,18 +151,18 @@
 public String readableName() {

 

 	StringBuffer buffer = new StringBuffer(super.readableName());

-	buffer.append("("/*nonNLS*/);

+	buffer.append("("); //$NON-NLS-1$

 	String[] parameterTypes = this.getParameterTypes();

 	int length;

 	if (parameterTypes != null && (length = parameterTypes.length) > 0) {

 		for (int i = 0; i < length; i++) {

 			buffer.append(Signature.toString(parameterTypes[i]));

 			if (i < length - 1) {

-				buffer.append(", "/*nonNLS*/);

+				buffer.append(", "); //$NON-NLS-1$

 			}

 		}

 	}

-	buffer.append(")"/*nonNLS*/);

+	buffer.append(")"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/BinaryType.java b/model/org/eclipse/jdt/internal/core/BinaryType.java
index 49dbcaf..d71ce8e 100644
--- a/model/org/eclipse/jdt/internal/core/BinaryType.java
+++ b/model/org/eclipse/jdt/internal/core/BinaryType.java
@@ -109,7 +109,7 @@
 			return null;

 		}

 		enclosingTypeName = ClassFile.unqualifiedName(enclosingTypeName);

-		return getPackageFragment().getClassFile(new String(enclosingTypeName) + ".class"/*nonNLS*/).getType();

+		return getPackageFragment().getClassFile(new String(enclosingTypeName) + ".class").getType(); //$NON-NLS-1$

 	} catch (JavaModelException npe) {

 		return null;

 	}

@@ -231,7 +231,7 @@
  * @see IType#getType

  */

 public IType getType(String name) {

-	IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$"/*nonNLS*/ + name + ".class"/*nonNLS*/);

+	IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$" + name + ".class"); //$NON-NLS-2$ //$NON-NLS-1$

 	return new BinaryType(classFile, name);

 }

 /**

@@ -302,7 +302,7 @@
  */

 public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {

 	if (project == null) {

-		throw new IllegalArgumentException(Util.bind("hierarchy.nullProject"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("hierarchy.nullProject")); //$NON-NLS-1$

 	}

 	CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(

 		this, 

diff --git a/model/org/eclipse/jdt/internal/core/Buffer.java b/model/org/eclipse/jdt/internal/core/Buffer.java
index 150909f..2f6866a 100644
--- a/model/org/eclipse/jdt/internal/core/Buffer.java
+++ b/model/org/eclipse/jdt/internal/core/Buffer.java
@@ -166,8 +166,8 @@
 			char currentChar = nextChar;

 			nextChar = i < length-1 ? text[i+1] : ' ';

 			switch (currentChar) {

-				case '\n': return "\n"/*nonNLS*/;

-				case '\r': return nextChar == '\n' ? "\r\n"/*nonNLS*/ : "\r"/*nonNLS*/;

+				case '\n': return "\n"; //$NON-NLS-1$

+				case '\r': return nextChar == '\n' ? "\r\n" : "\r"; //$NON-NLS-1$ //$NON-NLS-2$

 			}

 		}

 	}

@@ -208,7 +208,7 @@
  */

 public String getContents() {

 	if (fContents == null)

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	synchronized (fLock) {

 		if (fGapStart < 0) {

 			return new String(fContents);

@@ -261,7 +261,7 @@
  */

 public String getText(int offset, int length) {

 	if (fContents == null)

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	synchronized (fLock) {

 		if (offset + length < fGapStart)

 			return new String(fContents, offset, length);

@@ -373,9 +373,8 @@
 				buffer.append(lineSeparator);

 				if (nextChar == '\n') {

 					nextChar = ' ';

-					i++;

 				}

-				lineStart = i+1;

+				lineStart = i+2;

 				break;

 		}

 	}

@@ -616,19 +615,19 @@
 	char[] contents = this.getCharacters();

 	int length = contents.length;

 	StringBuffer buffer = new StringBuffer(length);

-	buffer.append("Buffer:\n"/*nonNLS*/);

+	buffer.append("Buffer:\n"); //$NON-NLS-1$

 	for (int i = 0; i < length; i++) {

 		char car = contents[i];

 		switch (car) {

 			case '\n': 

-				buffer.append("\\n\n"/*nonNLS*/);

+				buffer.append("\\n\n"); //$NON-NLS-1$

 				break;

 			case '\r':

 				if (i < length-1 && contents[i+1] == '\n') {

-					buffer.append("\\r\\n\n"/*nonNLS*/);

+					buffer.append("\\r\\n\n"); //$NON-NLS-1$

 					i++;

 				} else {

-					buffer.append("\\r\n"/*nonNLS*/);

+					buffer.append("\\r\n"); //$NON-NLS-1$

 				}

 				break;

 			default:

diff --git a/model/org/eclipse/jdt/internal/core/ClassFile.java b/model/org/eclipse/jdt/internal/core/ClassFile.java
index a956b0d..d4c5da5 100644
--- a/model/org/eclipse/jdt/internal/core/ClassFile.java
+++ b/model/org/eclipse/jdt/internal/core/ClassFile.java
@@ -33,7 +33,7 @@
 protected ClassFile(IPackageFragment parent, String name) {

 	super(CLASS_FILE, parent, name);

 	if (!Util.isClassFileName(name)) {

-		throw new IllegalArgumentException(Util.bind("element.invalidClassFileName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.invalidClassFileName")); //$NON-NLS-1$

 	}

 }

 /**

@@ -42,7 +42,7 @@
 public void codeComplete(int offset, ICodeCompletionRequestor requestor) throws JavaModelException {

 	String source = getSource();

 	if (source != null) {

-		BasicCompilationUnit cu = new BasicCompilationUnit(getSource().toCharArray(), getElementName() + ".java"/*nonNLS*/);

+		BasicCompilationUnit cu = new BasicCompilationUnit(getSource().toCharArray(), getElementName() + ".java"); //$NON-NLS-1$

 		codeComplete(cu, cu, offset, requestor);

 	}

 }

@@ -56,7 +56,7 @@
 		contents = buffer.getCharacters();

 		String name = getElementName();

 		name = name.substring(0, name.length() - 6); // remove ".class"

-		name = name + ".java"/*nonNLS*/;

+		name = name + ".java"; //$NON-NLS-1$

 		BasicCompilationUnit cu = new BasicCompilationUnit(contents, name);

 		return super.codeSelect(cu, offset, length);

 	} else {

@@ -141,7 +141,7 @@
 				zip = root.getJar();

 				String entryName = getParent().getElementName();

 				entryName = entryName.replace('.', '/');

-				if (entryName.equals(""/*nonNLS*/)) {

+				if (entryName.equals("")) { //$NON-NLS-1$

 					entryName += getElementName();

 				} else {

 					entryName += '/' + getElementName();

@@ -278,7 +278,7 @@
 public WorkingCopy getWorkingCopy() {

 	String name = getElementName();

 	name = name.substring(0, name.length() - 6); // remove ".class"

-	name = name + ".java"/*nonNLS*/;

+	name = name + ".java"; //$NON-NLS-1$

 	return new WorkingCopy((IPackageFragment) getParent(), name);

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/ClassFileInfo.java b/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
index 2db5ba7..35ca099 100644
--- a/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
+++ b/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
@@ -73,7 +73,7 @@
 		for (int i = 0, typeCount = innerTypes.length; i < typeCount; i++) {

 			IBinaryNestedType binaryType = innerTypes[i];

 			String innerQualifiedName = new String(binaryType.getName());

-			IClassFile classFile= ((IPackageFragment)fClassFile.getParent()).getClassFile(new String(ClassFile.unqualifiedName(binaryType.getName())) + ".class"/*nonNLS*/);

+			IClassFile classFile= ((IPackageFragment)fClassFile.getParent()).getClassFile(new String(ClassFile.unqualifiedName(binaryType.getName())) + ".class"); //$NON-NLS-1$

 			IType innerType = new BinaryType(classFile, new String(ClassFile.simpleName(binaryType.getName())));

 			children.addElement(innerType);

 		}

diff --git a/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index 8ec95ad..d0a65fd 100644
--- a/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -170,38 +170,38 @@
 	buffer.append('[');

 	switch (getEntryKind()) {

 		case IClasspathEntry.CPE_LIBRARY:

-			buffer.append("CPE_LIBRARY"/*nonNLS*/);

+			buffer.append("CPE_LIBRARY"); //$NON-NLS-1$

 			break;

 		case IClasspathEntry.CPE_PROJECT:

-			buffer.append("CPE_PROJECT"/*nonNLS*/);

+			buffer.append("CPE_PROJECT"); //$NON-NLS-1$

 			break;

 		case IClasspathEntry.CPE_SOURCE:

-			buffer.append("CPE_SOURCE"/*nonNLS*/);

+			buffer.append("CPE_SOURCE"); //$NON-NLS-1$

 			break;

 		case IClasspathEntry.CPE_VARIABLE:

-			buffer.append("CPE_VARIABLE"/*nonNLS*/);

+			buffer.append("CPE_VARIABLE"); //$NON-NLS-1$

 			break;

 	}

-	buffer.append("]["/*nonNLS*/);

+	buffer.append("]["); //$NON-NLS-1$

 	switch (getContentKind()) {

 		case IPackageFragmentRoot.K_BINARY:

-			buffer.append("K_BINARY"/*nonNLS*/);

+			buffer.append("K_BINARY"); //$NON-NLS-1$

 			break;

 		case IPackageFragmentRoot.K_SOURCE:

-			buffer.append("K_SOURCE"/*nonNLS*/);

+			buffer.append("K_SOURCE"); //$NON-NLS-1$

 			break;

 		case ClasspathEntry.K_OUTPUT:

-			buffer.append("K_OUTPUT"/*nonNLS*/);

+			buffer.append("K_OUTPUT"); //$NON-NLS-1$

 			break;

 	}

 	buffer.append(']');

 	if (getSourceAttachmentPath() != null){

-		buffer.append("[sourcePath:"/*nonNLS*/);

+		buffer.append("[sourcePath:"); //$NON-NLS-1$

 		buffer.append(getSourceAttachmentPath());

 		buffer.append(']');

 	}

 	if (getSourceAttachmentRootPath() != null){

-		buffer.append("[rootPath:"/*nonNLS*/);

+		buffer.append("[rootPath:"); //$NON-NLS-1$

 		buffer.append(getSourceAttachmentRootPath());

 		buffer.append(']');

 	}

diff --git a/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java b/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
index 28d5127..b42b95f 100644
--- a/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
@@ -86,7 +86,7 @@
  * 	of the original compilation unit fails

  */

 protected void executeOperation() throws JavaModelException {

-	beginTask(Util.bind("workingCopy.commit"/*nonNLS*/), 2);

+	beginTask(Util.bind("workingCopy.commit"), 2); //$NON-NLS-1$

 	ICompilationUnit copy = getCompilationUnit();

 	ICompilationUnit original = (ICompilationUnit) copy.getOriginalElement();

 

diff --git a/model/org/eclipse/jdt/internal/core/CompilationUnit.java b/model/org/eclipse/jdt/internal/core/CompilationUnit.java
index 8372504..face277 100644
--- a/model/org/eclipse/jdt/internal/core/CompilationUnit.java
+++ b/model/org/eclipse/jdt/internal/core/CompilationUnit.java
@@ -34,7 +34,7 @@
 protected CompilationUnit(IPackageFragment parent, String name) {

 	super(COMPILATION_UNIT, parent, name);

 	if (!Util.isJavaFileName(name)) {

-		throw new IllegalArgumentException(Util.bind("convention.unit.notJavaName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("convention.unit.notJavaName")); //$NON-NLS-1$

 	}

 }

 /**

@@ -77,7 +77,7 @@
  */

 public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements = new IJavaElement[] {this};

 	IJavaElement[] containers = new IJavaElement[] {container};

@@ -120,10 +120,10 @@
 	if (!exists()) {

 		//autogenerate this compilation unit

 		IPackageFragment pkg = (IPackageFragment) getParent();

-		String source = ""/*nonNLS*/;

+		String source = ""; //$NON-NLS-1$

 		if (pkg.getElementName().length() > 0) {

 			//not the default package...add the package declaration

-			source = "package "/*nonNLS*/ + pkg.getElementName() + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR;

+			source = "package " + pkg.getElementName() + ";"  + JavaModelManager.LINE_SEPARATOR + JavaModelManager.LINE_SEPARATOR; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 		CreateCompilationUnitOperation op = new CreateCompilationUnitOperation(pkg, fName, source, force);

 		runOperation(op, monitor);

@@ -173,7 +173,7 @@
 		} else {

 			// iterate through all the types inside the receiver and see if one of them can fit

 			IType[] types = getTypes();

-			String typeNodeName = nodeName.substring(0, nodeName.indexOf(".java"/*nonNLS*/));

+			String typeNodeName = nodeName.substring(0, nodeName.indexOf(".java")); //$NON-NLS-1$

 			for (int i = 0, max = types.length; i < max; i++) {

 				if (types[i].getElementName().equals(typeNodeName)) {

 					return true;

@@ -378,7 +378,7 @@
  */

 public String getSource() throws JavaModelException {

 	IBuffer buffer = getBuffer();

-	if (buffer == null) return ""/*nonNLS*/;

+	if (buffer == null) return ""; //$NON-NLS-1$

 	return buffer.getContents();

 }

 /**

@@ -470,7 +470,7 @@
  */

 public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] containers= new IJavaElement[] {container};

@@ -540,7 +540,7 @@
  */

 public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullName")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] dests= new IJavaElement[] {this.getParent()};

diff --git a/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java b/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
index acecc72..db6f629 100644
--- a/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
+++ b/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
@@ -148,7 +148,7 @@
 		addReference(ReferenceInfo.REFTYPE_call, name);

 	}

 	else {

-		String name = "<"/*nonNLS*/ + new String(typeName) + ">/"/*nonNLS*/ + argCount;  

+		String name = "<" + new String(typeName) + ">/" + argCount;   //$NON-NLS-2$ //$NON-NLS-1$

 		addReference(ReferenceInfo.REFTYPE_call, name.toCharArray());

 	}

 }

@@ -178,7 +178,7 @@
 	// tack on the '.*' if it is onDemand

 	String importName;

 	if (onDemand) {

-		importName= new String(name) + ".*"/*nonNLS*/;

+		importName= new String(name) + ".*"; //$NON-NLS-1$

 	} else {

 		importName= new String(name);

 	}

@@ -239,7 +239,7 @@
 		addReference(ReferenceInfo.REFTYPE_call, name);

 	}

 	else {

-		String name = new String(methodName) + "/"/*nonNLS*/ + argCount;  

+		String name = new String(methodName) + "/" + argCount;   //$NON-NLS-1$

 		addReference(ReferenceInfo.REFTYPE_call, name.toCharArray());

 	}

 }

@@ -559,13 +559,13 @@
 		if (fPackageName == null) {

 			qualifiedName= nameString.toCharArray();

 		} else {

-			qualifiedName= (new String(fPackageName) + "."/*nonNLS*/ + nameString).toCharArray();

+			qualifiedName= (new String(fPackageName) + "." + nameString).toCharArray(); //$NON-NLS-1$

 		}

 	}

 	else if (parentHandle.getElementType() == IJavaElement.TYPE) {

 		handle = ((IType) parentHandle).getType(nameString);

 		enclosingTypeName= ((SourceTypeElementInfo)parentInfo).getName();

-		qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "."/*nonNLS*/ + nameString).toCharArray();

+		qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "." + nameString).toCharArray(); //$NON-NLS-1$

 	}

 	else {

 		Assert.isTrue(false); // Should not happen

diff --git a/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java b/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
index 8a3b8ec..27c5507 100644
--- a/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
+++ b/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
@@ -19,138 +19,164 @@
 import java.util.*;

 

 public class CompilationUnitVisitor extends Compiler {

-/**

- * Answer a new CompilationUnitVisitor using the given name environment and compiler options.

- * The environment and options will be in effect for the lifetime of the compiler.

- * When the compiler is run, compilation results are sent to the given requestor.

- *

- *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment

- *      Environment used by the compiler in order to resolve type and package

- *      names. The name environment implements the actual connection of the compiler

- *      to the outside world (e.g. in batch mode the name environment is performing

- *      pure file accesses, reuse previous build state or connection to repositories).

- *      Note: the name environment is responsible for implementing the actual classpath

- *            rules.

- *

- *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy

- *      Configurable part for problem handling, allowing the compiler client to

- *      specify the rules for handling problems (stop on first error or accumulate

- *      them all) and at the same time perform some actions such as opening a dialog

- *      in UI when compiling interactively.

- *      @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies

- *      

- *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor

- *      Component which will receive and persist all compilation results and is intended

- *      to consume them as they are produced. Typically, in a batch compiler, it is 

- *      responsible for writing out the actual .class files to the file system.

- *      @see org.eclipse.jdt.internal.compiler.api.CompilationResult

- *

- *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory

- *      Factory used inside the compiler to create problem descriptors. It allows the

- *      compiler client to supply its own representation of compilation problems in

- *      order to avoid object conversions. Note that the factory is not supposed

- *      to accumulate the created problems, the compiler will gather them all and hand

- *      them back as part of the compilation unit result.

- */

-public CompilationUnitVisitor(

-	INameEnvironment environment, 

-	IErrorHandlingPolicy policy, 

-	ConfigurableOption[] settings, 

-	ICompilerRequestor requestor, 

-	IProblemFactory problemFactory) {

-		

-	super(environment, policy, settings, requestor, problemFactory);

-}

-/**

- * Add an additional source type

- */

-public void accept(ISourceType sourceType, PackageBinding packageBinding) {

-	CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1); // need to hold onto this

-	CompilationUnitDeclaration unit =

-		SourceTypeConverter.buildCompilationUnit(sourceType, true, true, lookupEnvironment.problemReporter, result);

+	

+	/**

+	 * Answer a new CompilationUnitVisitor using the given name environment and compiler options.

+	 * The environment and options will be in effect for the lifetime of the compiler.

+	 * When the compiler is run, compilation results are sent to the given requestor.

+	 *

+	 *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment

+	 *      Environment used by the compiler in order to resolve type and package

+	 *      names. The name environment implements the actual connection of the compiler

+	 *      to the outside world (e.g. in batch mode the name environment is performing

+	 *      pure file accesses, reuse previous build state or connection to repositories).

+	 *      Note: the name environment is responsible for implementing the actual classpath

+	 *            rules.

+	 *

+	 *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy

+	 *      Configurable part for problem handling, allowing the compiler client to

+	 *      specify the rules for handling problems (stop on first error or accumulate

+	 *      them all) and at the same time perform some actions such as opening a dialog

+	 *      in UI when compiling interactively.

+	 *      @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies

+	 *      

+	 *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor

+	 *      Component which will receive and persist all compilation results and is intended

+	 *      to consume them as they are produced. Typically, in a batch compiler, it is 

+	 *      responsible for writing out the actual .class files to the file system.

+	 *      @see org.eclipse.jdt.internal.compiler.api.CompilationResult

+	 *

+	 *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory

+	 *      Factory used inside the compiler to create problem descriptors. It allows the

+	 *      compiler client to supply its own representation of compilation problems in

+	 *      order to avoid object conversions. Note that the factory is not supposed

+	 *      to accumulate the created problems, the compiler will gather them all and hand

+	 *      them back as part of the compilation unit result.

+	 */

+	public CompilationUnitVisitor(

+		INameEnvironment environment,

+		IErrorHandlingPolicy policy,

+		ConfigurableOption[] settings,

+		ICompilerRequestor requestor,

+		IProblemFactory problemFactory) {

 

-	if (unit != null) {

-		this.lookupEnvironment.buildTypeBindings(unit);

-		this.lookupEnvironment.completeTypeBindings(unit, true);

+		super(environment, policy, settings, requestor, problemFactory);

 	}

-}

-/*

- *  Low-level API performing the actual compilation

- */

-protected static IErrorHandlingPolicy getHandlingPolicy() {

 

-	// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)	

-	return new IErrorHandlingPolicy() {

-		public boolean stopOnFirstError() {

-			return false;

-		}

-		public boolean proceedOnErrors() {

-			return false; // stop if there are some errors 

-		}

-	};

-}

-protected static INameEnvironment getNameEnvironment(ICompilationUnit sourceUnit) throws JavaModelException {

-	return (SearchableEnvironment) ((JavaProject) sourceUnit.getJavaProject())

-				.getSearchableNameEnvironment();

-}

-/*

- *  Low-level API performing the actual compilation

- */

-protected static ConfigurableOption[] getOptions() {

-	CompilerOptions options = new CompilerOptions();

-	return options.getConfigurableOptions(Locale.getDefault());

-}

-/*

- * Answer the component to which will be handed back compilation results from the compiler

- */

-protected static ICompilerRequestor getRequestor() {

-	return new ICompilerRequestor() {

-		public void acceptResult(CompilationResult compilationResult) {

-		}

-	};

-}

-public static void visit(ICompilationUnit unitElement, IAbstractSyntaxTreeVisitor visitor) throws JavaModelException {

-	

-	CompilationUnitVisitor compilationUnitVisitor = new CompilationUnitVisitor(

-		getNameEnvironment(unitElement),

-		getHandlingPolicy(),

-		getOptions(),

-		getRequestor(),

-		getProblemFactory(visitor));

+	/**

+	 * Add additional source types

+	 */

+	public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {

+		CompilationResult result =

+			new CompilationResult(sourceTypes[0].getFileName(), 1, 1);

+		// need to hold onto this

+		CompilationUnitDeclaration unit =

+			SourceTypeConverter.buildCompilationUnit(

+				sourceTypes,

+				true,

+				true,

+				lookupEnvironment.problemReporter,

+				result);

 

-	

-	CompilationUnitDeclaration unit = null;

-	try {

-		unit = compilationUnitVisitor.resolve(

-				new BasicCompilationUnit(

-					unitElement.getSource().toCharArray(), 

-					unitElement.getElementName()));

 		if (unit != null) {

-			unit.traverse(visitor, unit.scope);

-		}		

-	} finally {

-		if (unit != null) {

-			unit.cleanUp();

+			this.lookupEnvironment.buildTypeBindings(unit);

+			this.lookupEnvironment.completeTypeBindings(unit, true);

 		}

 	}

-}

 

-protected static IProblemFactory getProblemFactory(final IAbstractSyntaxTreeVisitor visitor) {

+	/*

+	 *  Low-level API performing the actual compilation

+	 */

+	protected static IErrorHandlingPolicy getHandlingPolicy() {

 

-	return new DefaultProblemFactory(Locale.getDefault()){

-		public IProblem createProblem(char[] originatingFileName, int problemId, String[] arguments, int severity, int startPosition, int endPosition, int lineNumber) {

+		// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)	

+		return new IErrorHandlingPolicy() {

+			public boolean stopOnFirstError() {

+				return false;

+			}

+			public boolean proceedOnErrors() {

+				return false; // stop if there are some errors 

+			}

+		};

+	}

 

-			IProblem problem = super.createProblem(

-				originatingFileName,

-				problemId,

-				arguments,

-				severity,

-				startPosition,

-				endPosition,

-				lineNumber);

-			visitor.acceptProblem(problem);

-			return problem;

+	protected static INameEnvironment getNameEnvironment(ICompilationUnit sourceUnit)

+		throws JavaModelException {

+		return (SearchableEnvironment) ((JavaProject) sourceUnit.getJavaProject())

+			.getSearchableNameEnvironment();

+	}

+

+	/*

+	 *  Low-level API performing the actual compilation

+	 */

+	protected static ConfigurableOption[] getOptions() {

+		return JavaModelManager.getOptions();

+	}

+

+	/*

+	 * Answer the component to which will be handed back compilation results from the compiler

+	 */

+	protected static ICompilerRequestor getRequestor() {

+		return new ICompilerRequestor() {

+			public void acceptResult(CompilationResult compilationResult) {

+			}

+		};

+	}

+

+	public static void visit(

+		ICompilationUnit unitElement,

+		IAbstractSyntaxTreeVisitor visitor)

+		throws JavaModelException {

+

+		CompilationUnitVisitor compilationUnitVisitor =

+			new CompilationUnitVisitor(

+				getNameEnvironment(unitElement),

+				getHandlingPolicy(),

+				getOptions(),

+				getRequestor(),

+				getProblemFactory(visitor));

+

+		CompilationUnitDeclaration unit = null;

+		try {

+			unit =

+				compilationUnitVisitor.resolve(

+					new BasicCompilationUnit(

+						unitElement.getSource().toCharArray(),

+						unitElement.getElementName()));

+			if (unit != null) {

+				unit.traverse(visitor, unit.scope);

+			}

+		} finally {

+			if (unit != null) {

+				unit.cleanUp();

+			}

 		}

-	};

-}

-}

+	}

+

+	protected static IProblemFactory getProblemFactory(final IAbstractSyntaxTreeVisitor visitor) {

+

+		return new DefaultProblemFactory(Locale.getDefault()) {

+			public IProblem createProblem(

+				char[] originatingFileName,

+				int problemId,

+				String[] arguments,

+				int severity,

+				int startPosition,

+				int endPosition,

+				int lineNumber) {

+

+				IProblem problem =

+					super.createProblem(

+						originatingFileName,

+						problemId,

+						arguments,

+						severity,

+						startPosition,

+						endPosition,

+						lineNumber);

+				visitor.acceptProblem(problem);

+				return problem;

+			}

+		};

+	}

+}
\ No newline at end of file
diff --git a/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java b/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
index 4858baf..724206e 100644
--- a/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
@@ -68,7 +68,7 @@
  * for progress monitoring.

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.copyElementProgress"/*nonNLS*/);

+	return Util.bind("operation.copyElementProgress"); //$NON-NLS-1$

 }

 /**

  * Returns the nested operation to use for processing this element

@@ -83,7 +83,7 @@
 				return new CreateImportOperation(element.getElementName(), (ICompilationUnit) dest);

 			case IJavaElement.TYPE :

 				if (isRenamingMainType(element, dest)) {

-					return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + ".java"/*nonNLS*/}, fForce);

+					return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + ".java"}, fForce); //$NON-NLS-1$

 				} else {

 					return new CreateTypeOperation(dest, getSourceFor(element) + JavaModelManager.LINE_SEPARATOR, fForce);

 				}

diff --git a/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java b/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
index 3fe95cd..4c4ae12 100644
--- a/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
@@ -159,7 +159,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.copyResourceProgress"/*nonNLS*/);

+	return Util.bind("operation.copyResourceProgress"); //$NON-NLS-1$

 }

 /**

  * Sets the deltas to register the changes resulting from this operation

@@ -342,7 +342,7 @@
 			}

 			if (!newFrag.getElementName().equals(source.getElementName())) { // if package has been renamed, update the compilation units

 				for (int i = 0; i < resources.length; i++) {

-					if (resources[i].getName().endsWith(".java"/*nonNLS*/)) {

+					if (resources[i].getName().endsWith(".java")) { //$NON-NLS-1$

 						// we only consider potential compilation units

 						ICompilationUnit cu = newFrag.getCompilationUnit(resources[i].getName());

 						IDOMCompilationUnit domCU = fFactory.createCompilationUnit(cu.getSource(), cu.getElementName());

@@ -428,7 +428,7 @@
 	if (!seenPackageNode && !defaultPackage) {

 		//the cu was in a default package...no package declaration

 		//create the new package declaration as the first child of the cu

-		IDOMPackage pkg = fFactory.createPackage("package "/*nonNLS*/ + pkgName + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);

+		IDOMPackage pkg = fFactory.createPackage("package " + pkgName + ";" + JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$ //$NON-NLS-2$

 		domCU.getFirstChild().insertSibling(pkg);

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java b/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
index 2a8ce5f..8cf623a 100644
--- a/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
@@ -54,7 +54,7 @@
  * @exception JavaModelException if unable to create the compilation unit.

  */

 protected void executeOperation() throws JavaModelException {

-	beginTask(Util.bind("operation.createUnitProgress"/*nonNLS*/), 2);

+	beginTask(Util.bind("operation.createUnitProgress"), 2); //$NON-NLS-1$

 	JavaElementDelta delta = newJavaElementDelta();

 	ICompilationUnit unit = getCompilationUnit();

 	IPackageFragment pkg = (IPackageFragment) getParentElement();

diff --git a/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java b/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
index 79ab766..ff09cc8 100644
--- a/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
@@ -55,7 +55,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createFieldProgress"/*nonNLS*/);

+	return Util.bind("operation.createFieldProgress"); //$NON-NLS-1$

 }

 /**

  * By default the new field is positioned after the last existing field

diff --git a/model/org/eclipse/jdt/internal/core/CreateImportOperation.java b/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
index f40b1fb..9111d8d 100644
--- a/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
@@ -72,7 +72,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createImportsProgress"/*nonNLS*/);

+	return Util.bind("operation.createImportsProgress"); //$NON-NLS-1$

 }

 /**

  * Sets the correct position for the new import:<ul>

diff --git a/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java b/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
index 436ee5a..b16e479 100644
--- a/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
@@ -78,7 +78,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createInitializerProgress"/*nonNLS*/);

+	return Util.bind("operation.createInitializerProgress"); //$NON-NLS-1$

 }

 /**

  * By default the new initializer is positioned after the last existing initializer

diff --git a/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java b/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
index d99a852..9ce66ac 100644
--- a/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
@@ -79,7 +79,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createMethodProgress"/*nonNLS*/);

+	return Util.bind("operation.createMethodProgress"); //$NON-NLS-1$

 }

 /**

  * @see CreateTypeMemberOperation#verifyNameCollision

diff --git a/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java b/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
index 14fd966..4d90298 100644
--- a/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
@@ -72,7 +72,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createPackageProgress"/*nonNLS*/);

+	return Util.bind("operation.createPackageProgress"); //$NON-NLS-1$

 }

 /**

  * Sets the correct position for new package declaration:<ul>

diff --git a/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java b/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
index 8e9c69e..3be9920 100644
--- a/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
@@ -54,9 +54,9 @@
 	JavaElementDelta delta = newJavaElementDelta();

 	IPackageFragmentRoot root = (IPackageFragmentRoot) getParentElement();

 	String[] names = Signature.getSimpleNames(fName);

-	beginTask(Util.bind("operation.createPackageFragmentProgress"/*nonNLS*/), names.length);

+	beginTask(Util.bind("operation.createPackageFragmentProgress"), names.length); //$NON-NLS-1$

 	IContainer parentFolder = (IContainer) root.getUnderlyingResource();

-	String sideEffectPackageName = ""/*nonNLS*/;

+	String sideEffectPackageName = ""; //$NON-NLS-1$

 	Vector resultElements = new Vector(names.length);

 	int i;

 	for (i = 0; i < names.length; i++) {

diff --git a/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java b/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
index 58e4d3c..a0b02ce 100644
--- a/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
@@ -64,11 +64,11 @@
 protected IDOMNode generateSyntaxIncorrectDOM() throws JavaModelException {

 	//create some dummy source to generate a dom node

 	StringBuffer buff = new StringBuffer();

-	buff.append(JavaModelManager.LINE_SEPARATOR + " public class A {"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);

+	buff.append(JavaModelManager.LINE_SEPARATOR + " public class A {" + JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	buff.append(fSource);

 	buff.append(JavaModelManager.LINE_SEPARATOR).append('}');

-	IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java"/*nonNLS*/);

-	IDOMNode node = (IDOMNode) domCU.getChild("A"/*nonNLS*/).getChildren().nextElement();

+	IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java"); //$NON-NLS-1$

+	IDOMNode node = (IDOMNode) domCU.getChild("A").getChildren().nextElement(); //$NON-NLS-1$

 	if (node != null) {

 		node.remove();

 	}

diff --git a/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java b/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
index 9a1a08d..d3ac4f5 100644
--- a/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
+++ b/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
@@ -58,7 +58,7 @@
  * @see CreateElementInCUOperation#getMainTaskName

  */

 public String getMainTaskName(){

-	return Util.bind("operation.createTypeProgress"/*nonNLS*/);

+	return Util.bind("operation.createTypeProgress"); //$NON-NLS-1$

 }

 /**

  * Returns the <code>IType</code> the member is to be created in.

diff --git a/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java b/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
index 1f1a2e7..9b8474e 100644
--- a/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
@@ -60,7 +60,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.deleteElementProgress"/*nonNLS*/);

+	return Util.bind("operation.deleteElementProgress"); //$NON-NLS-1$

 }

 /**

  * Groups the elements to be processed by their compilation unit.

@@ -112,7 +112,7 @@
 		if (e.exists()) {

 			IDOMNode node = ((JavaElement) e).findNode(cuDOM);

 			// TBD

-			Assert.isTrue(node != null, Util.bind("element.cannotLocate"/*nonNLS*/, e.getElementName(), cuDOM.getName()));

+			Assert.isTrue(node != null, Util.bind("element.cannotLocate", e.getElementName(), cuDOM.getName())); //$NON-NLS-1$

 			node.remove();

 			delta.removed(e);

 			if (e.getElementType() == IJavaElement.IMPORT_DECLARATION) {

diff --git a/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java b/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
index 01cf6db..3bff201 100644
--- a/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
@@ -87,7 +87,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.deleteResourceProgress"/*nonNLS*/);

+	return Util.bind("operation.deleteResourceProgress"); //$NON-NLS-1$

 }

 /**

  * @see MultiOperation. This method delegate to <code>deleteResource</code> or

diff --git a/model/org/eclipse/jdt/internal/core/DeltaProcessor.java b/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
index 5b36f6f..1e25eb5 100644
--- a/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
+++ b/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
@@ -314,7 +314,7 @@
 	if (resource == null) return null;

 	String extension = resource.getFileExtension();

 	extension = extension == null ? null : extension.toLowerCase();

-	if ("jar"/*nonNLS*/.equals(extension) || "zip"/*nonNLS*/.equals(extension)) {

+	if ("jar".equals(extension) || "zip".equals(extension)) { //$NON-NLS-2$ //$NON-NLS-1$

 		IJavaProject[] projects = null;

 		try {

 			projects = JavaModelManager.getJavaModel(resource.getWorkspace()).getJavaProjects();

diff --git a/model/org/eclipse/jdt/internal/core/ImportContainer.java b/model/org/eclipse/jdt/internal/core/ImportContainer.java
index 99db352..c78edf9 100644
--- a/model/org/eclipse/jdt/internal/core/ImportContainer.java
+++ b/model/org/eclipse/jdt/internal/core/ImportContainer.java
@@ -13,7 +13,7 @@
  */

 public class ImportContainer extends SourceRefElement implements IImportContainer {

 protected ImportContainer(ICompilationUnit parent) {

-	super(IMPORT_CONTAINER, parent, ""/*nonNLS*/);

+	super(IMPORT_CONTAINER, parent, ""); //$NON-NLS-1$

 }

 /**

  * @see JavaElement#getHandleMemento()

@@ -25,7 +25,7 @@
  * @see JavaElement#getHandleMemento()

  */

 protected char getHandleMementoDelimiter() {

-	Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));

+	Assert.isTrue(false, Util.bind("assert.shouldNotImplement")); //$NON-NLS-1$

 	return 0;

 }

 /**

@@ -65,7 +65,7 @@
 	if (info == null || !(info instanceof JavaElementInfo)) return;

 	IJavaElement[] children = ((JavaElementInfo)info).getChildren();

 	for (int i = 0; i < children.length; i++) {

-		if (i > 0) buffer.append("\n"/*nonNLS*/);

+		if (i > 0) buffer.append("\n"); //$NON-NLS-1$

 		((JavaElement)children[i]).toString(tab, buffer);

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/ImportDeclaration.java b/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
index bd6f120..bf4d453 100644
--- a/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
+++ b/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
@@ -39,7 +39,7 @@
  * Returns true if the import is on-demand (ends with ".*")

  */

 public boolean isOnDemand() {

-	return fName.endsWith(".*"/*nonNLS*/);

+	return fName.endsWith(".*"); //$NON-NLS-1$

 }

 /**

  */

@@ -51,10 +51,10 @@
  * @private Debugging purposes

  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

-	buffer.append("import "/*nonNLS*/);

+	buffer.append("import "); //$NON-NLS-1$

 	buffer.append(getElementName());

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/Initializer.java b/model/org/eclipse/jdt/internal/core/Initializer.java
index 9bcbca5..9ac3a7d 100644
--- a/model/org/eclipse/jdt/internal/core/Initializer.java
+++ b/model/org/eclipse/jdt/internal/core/Initializer.java
@@ -18,7 +18,7 @@
 /* package */ class Initializer extends Member implements IInitializer {

 

 protected Initializer(IType parent, int occurrenceCount) {

-	super(INITIALIZER, parent, ""/*nonNLS*/);

+	super(INITIALIZER, parent, ""); //$NON-NLS-1$

 	// 0 is not valid: this first occurrence is occurrence 1.

 	if (occurrenceCount <= 0)

 		throw new IllegalArgumentException();

@@ -70,16 +70,16 @@
  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (info == null) {

-		buffer.append("<initializer>"/*nonNLS*/);

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append("<initializer>"); //$NON-NLS-1$

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	} else {

 		try {

 			if (Flags.isStatic(this.getFlags())) {

-				buffer.append("static "/*nonNLS*/);

+				buffer.append("static "); //$NON-NLS-1$

 			}

-			buffer.append("initializer"/*nonNLS*/);

+			buffer.append("initializer"); //$NON-NLS-1$

 		} catch (JavaModelException e) {

-			buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());

+			buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$

 		}

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/JarEntryFile.java b/model/org/eclipse/jdt/internal/core/JarEntryFile.java
index 72d0914..147314e 100644
--- a/model/org/eclipse/jdt/internal/core/JarEntryFile.java
+++ b/model/org/eclipse/jdt/internal/core/JarEntryFile.java
@@ -62,6 +62,6 @@
  * @see IStorage#isReadOnly()

  */

 public String toString() {

-	return "JarEntryFile["/*nonNLS*/+this.zipName+"::"/*nonNLS*/+this.entryName+"]"/*nonNLS*/;

+	return "JarEntryFile["+this.zipName+"::"+this.entryName+"]"; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java b/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
index 945ac02..00a545d 100644
--- a/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
+++ b/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
@@ -65,7 +65,7 @@
 		try {

 			verifyAttachSource(zipPath);

 			if (monitor != null) {

-				monitor.beginTask(Util.bind("element.attachingSource"/*nonNLS*/), 2);

+				monitor.beginTask(Util.bind("element.attachingSource"), 2); //$NON-NLS-1$

 			}

 			SourceMapper mapper= null;

 			SourceMapper oldMapper= getSourceMapper();

@@ -377,14 +377,14 @@
 				Object target = JavaModel.getTarget(workspaceRoot, entry.getSourceAttachmentPath(), true);

 				if (target instanceof IFile){

 					IFile file = (IFile) target;

-					if ("jar"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension()) || "zip"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension())){

+					if ("jar".equalsIgnoreCase(file.getFileExtension()) || "zip".equalsIgnoreCase(file.getFileExtension())){ //$NON-NLS-2$ //$NON-NLS-1$

 						return entry;

 					}

 				}

 				if (target instanceof java.io.File){

 					java.io.File file = (java.io.File) target;

 					String name = file.getName();

-					if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){

+					if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$

 						return entry;

 					}

 				}

@@ -405,14 +405,14 @@
 					if (target instanceof IFile){

 						IFile file = (IFile) target;

 						String name = file.getName();

-						if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){

+						if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$

 							return entry;

 						}

 					}

 					if (target instanceof java.io.File){

 						java.io.File file = (java.io.File) target;

 						String name = file.getName();

-						if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){

+						if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$

 							return entry;

 						}

 					}

@@ -503,7 +503,7 @@
 				if (recommendation != null){

 					propertyString = recommendation.getSourceAttachmentPath().toString() 

 										+ ATTACHMENT_PROPERTY_DELIMITER 

-										+ (recommendation.getSourceAttachmentRootPath() == null ? ""/*nonNLS*/ : recommendation.getSourceAttachmentRootPath().toString());

+										+ (recommendation.getSourceAttachmentRootPath() == null ? "" : recommendation.getSourceAttachmentRootPath().toString()); //$NON-NLS-1$

 					getWorkspace().getRoot().setPersistentProperty(qName, propertyString);

 				}

 			}

@@ -520,7 +520,7 @@
 		ZipFile jarFile = null;

 		try {

 			jarFile = getJar();

-			return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: "/*nonNLS*/ + jarFile.getName());

+			return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: " + jarFile.getName()); //$NON-NLS-1$

 		} catch (CoreException e) {

 			throw new JavaModelException(e);

 		} finally {

diff --git a/model/org/eclipse/jdt/internal/core/JavaElement.java b/model/org/eclipse/jdt/internal/core/JavaElement.java
index 286bcd3..bc883d4 100644
--- a/model/org/eclipse/jdt/internal/core/JavaElement.java
+++ b/model/org/eclipse/jdt/internal/core/JavaElement.java
@@ -77,7 +77,7 @@
  */

 protected JavaElement(int type, IJavaElement parent, String name) throws IllegalArgumentException {

 	if (type < JAVA_MODEL || type > IMPORT_DECLARATION) {

-		throw new IllegalArgumentException(Util.bind("element.invalidType"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.invalidType")); //$NON-NLS-1$

 	}

 	fLEType= type;

 	fParent= parent;

@@ -254,7 +254,7 @@
  *

  * @exception JavaModelException if the element is not present or not accessible

  */

-protected JavaElementInfo getElementInfo() throws JavaModelException {

+public JavaElementInfo getElementInfo() throws JavaModelException {

 	synchronized(fgJavaModelManager){

 		Object info = fgJavaModelManager.getInfo(this);

 		if (info == null) {

@@ -516,7 +516,7 @@
 protected String tabString(int tab) {

 	StringBuffer buffer = new StringBuffer();

 	for (int i = tab; i > 0; i--)

-		buffer.append("  "/*nonNLS*/);

+		buffer.append("  "); //$NON-NLS-1$

 	return buffer.toString();

 }

 /**

@@ -554,11 +554,11 @@
 protected void toStringAncestors(StringBuffer buffer) {

 	JavaElement parent = (JavaElement)this.getParent();

 	if (parent != null) {

-		buffer.append(" [in "/*nonNLS*/);

+		buffer.append(" [in "); //$NON-NLS-1$

 		Object parentInfo = fgJavaModelManager.getInfo(parent);

 		parent.toStringInfo(0, buffer, parentInfo);

 		parent.toStringAncestors(buffer);

-		buffer.append("]"/*nonNLS*/);

+		buffer.append("]"); //$NON-NLS-1$

 	}

 }

 /**

@@ -568,7 +568,7 @@
 	if (info == null || !(info instanceof JavaElementInfo)) return;

 	IJavaElement[] children = ((JavaElementInfo)info).getChildren();

 	for (int i = 0; i < children.length; i++) {

-		buffer.append("\n"/*nonNLS*/);

+		buffer.append("\n"); //$NON-NLS-1$

 		((JavaElement)children[i]).toString(tab + 1, buffer);

 	}

 }

@@ -578,7 +578,7 @@
 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	buffer.append(getElementName());

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	}

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/JavaElementDelta.java b/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
index 35fd0e0..4722567 100644
--- a/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
+++ b/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
@@ -477,7 +477,7 @@
 		buffer.append('\t');

 	}

 	buffer.append(((JavaElement)getElement()).toDebugString());

-	buffer.append("["/*nonNLS*/);

+	buffer.append("["); //$NON-NLS-1$

 	switch (getKind()) {

 		case IJavaElementDelta.ADDED :

 			buffer.append('+');

@@ -492,68 +492,68 @@
 			buffer.append('?');

 			break;

 	}

-	buffer.append("]: {"/*nonNLS*/);

+	buffer.append("]: {"); //$NON-NLS-1$

 	int changeFlags = getFlags();

 	boolean prev = false;

 	if ((changeFlags & IJavaElementDelta.F_CHILDREN) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("CHILDREN"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("CHILDREN"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_CONTENT) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("CONTENT"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("CONTENT"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_MOVED_FROM) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("MOVED_FROM("/*nonNLS*/ + ((JavaElement)getMovedFromElement()).toDebugString() + ")"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("MOVED_FROM(" + ((JavaElement)getMovedFromElement()).toDebugString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_MOVED_TO) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("MOVED_TO("/*nonNLS*/ + ((JavaElement)getMovedToElement()).toDebugString() + ")"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("MOVED_TO(" + ((JavaElement)getMovedToElement()).toDebugString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("ADDED TO CLASSPATH"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("ADDED TO CLASSPATH"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("REMOVED FROM CLASSPATH"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("REMOVED FROM CLASSPATH"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_CLASSPATH_REORDER) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("REORDERED IN CLASSPATH"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("REORDERED IN CLASSPATH"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_MODIFIERS) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("MODIFIERS CHANGED"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("MODIFIERS CHANGED"); //$NON-NLS-1$

 		prev = true;

 	}

 	if ((changeFlags & IJavaElementDelta.F_SUPER_TYPES) != 0) {

 		if (prev)

-			buffer.append(" | "/*nonNLS*/);

-		buffer.append("SUPER TYPES CHANGED"/*nonNLS*/);

+			buffer.append(" | "); //$NON-NLS-1$

+		buffer.append("SUPER TYPES CHANGED"); //$NON-NLS-1$

 		prev = true;

 	}

-	buffer.append("}"/*nonNLS*/);

+	buffer.append("}"); //$NON-NLS-1$

 	IJavaElementDelta[] children = getAffectedChildren();

 	if (children != null) {

 		for (int i = 0; i < children.length; ++i) {

-			buffer.append("\n"/*nonNLS*/);

+			buffer.append("\n"); //$NON-NLS-1$

 			buffer.append(((JavaElementDelta) children[i]).toDebugString(depth + 1));

 		}

 	}

diff --git a/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java b/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
index 3a9be1d..d9621d5 100644
--- a/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
@@ -422,7 +422,7 @@
 }

 public String toString() {

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("Built delta:\n"/*nonNLS*/);

+	buffer.append("Built delta:\n"); //$NON-NLS-1$

 	buffer.append(this.delta.toString());

 	return buffer.toString();

 }

diff --git a/model/org/eclipse/jdt/internal/core/JavaModel.java b/model/org/eclipse/jdt/internal/core/JavaModel.java
index a359be8..37685b6 100644
--- a/model/org/eclipse/jdt/internal/core/JavaModel.java
+++ b/model/org/eclipse/jdt/internal/core/JavaModel.java
@@ -35,7 +35,7 @@
  * @exception Error if called more than once

  */

 protected JavaModel(IWorkspace workspace) throws Error {

-	super(JAVA_MODEL, null, ""/*nonNLS*/ /*workspace has empty name*/);

+	super(JAVA_MODEL, null, "" /*workspace has empty name*/); //$NON-NLS-1$

 	this.workspace = workspace;

 }

 private void cleanupCycleMarkers() {

@@ -102,10 +102,9 @@
 			if (generateMarkerOnError) {

 				try {

 					IMarker marker = this.workspace.getRoot().getProject(dependentProjectName).createMarker(IJavaModelMarker.TRANSIENT_PROBLEM);

-					marker.setAttribute(IMarker.MESSAGE, Util.bind("classpath.cycle"/*nonNLS*/));

-					marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);

-					marker.setAttribute(IMarker.LOCATION, dependentProjectName);

-					marker.setAttribute(IJavaModelMarker.CYCLE_DETECTED, dependentProjectName);

+					marker.setAttributes(

+						new String[]{ IMarker.MESSAGE, IMarker.PRIORITY, IMarker.LOCATION, IJavaModelMarker.CYCLE_DETECTED},

+						new Object[]{ Util.bind("classpath.cycle"), new Integer(IMarker.PRIORITY_HIGH), dependentProjectName, dependentProjectName}); //$NON-NLS-1$

 				} catch (CoreException e) {

 					e.printStackTrace();

 				}

@@ -374,7 +373,7 @@
  * contribution to a memento.

  */

 protected char getHandleMementoDelimiter(){

-	Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));

+	Assert.isTrue(false, Util.bind("assert.shouldNotImplement")); //$NON-NLS-1$

 	return 0;

 }

 /**

@@ -411,7 +410,7 @@
 	} else if (resource.getType() == IResource.PROJECT) {

 		return new JavaProject((IProject)resource, this);

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.invalidResourceForProject"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.invalidResourceForProject")); //$NON-NLS-1$

 	}

 }

 /**

@@ -481,9 +480,9 @@
  * @private Debugging purposes

  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

-	buffer.append("Java Model"/*nonNLS*/);

+	buffer.append("Java Model"); //$NON-NLS-1$

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	}

 }

 

diff --git a/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index 7a88eb0..480efcb 100644
--- a/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -39,6 +39,15 @@
  * the static method <code>JavaModelManager.getJavaModelManager()</code>.

  */

 public class JavaModelManager implements IResourceChangeListener, ISaveParticipant { 	

+	/**

+	 * JavaCore options (don't use this field to add an new option,

+	 * use JavaModelManager#addOption method.

+	 */

+	public static Hashtable fOptions;

+	/**

+	 * JavaCore options IDs

+	 */

+	private static ArrayList fOptionIDs;

 

 	/**

 	 * The singleton manager

@@ -93,12 +102,12 @@
 	/**

 	 * Local Java workspace properties file name (generated inside JavaCore plugin state location)

 	 */

-	private static final String WKS_PROP_FILENAME= "workspace.properties"/*nonNLS*/;

+	private static final String WKS_PROP_FILENAME= "workspace.properties"; //$NON-NLS-1$

 

 	/**

 	 * Name of the handle id attribute in a Java marker

 	 */

-	private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"/*nonNLS*/;

+	private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"; //$NON-NLS-1$

 

 	/**

 	 * Table from IProject to PerProjectInfo.

@@ -129,7 +138,7 @@
 	/**

 	 * Line separator to use throughout the JavaModel for any source edit operation

 	 */

-	public static String LINE_SEPARATOR = System.getProperty("line.separator"/*nonNLS*/);

+	public static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$

 	/**

 	 * Constructs a new JavaModelManager

 	 */

@@ -168,212 +177,7 @@
 public void closeAffectedElements(IResourceDelta delta) {

 	fDeltaProcessor.closeAffectedElements(delta);

 }

-/**

- * Convert options Map into ConfigurableOption understood by the infrastructure

- *

- * Should be revisited

- */

-public static ConfigurableOption[] convertConfigurableOptions(Hashtable optionMap) {

 

-	Enumeration optionNames = optionMap.keys();

-	CompilerOptions compilerOptions = new CompilerOptions();

-	int index = 0;

-	

-	while (optionNames.hasMoreElements()){

-		

-		String optionName = (String)optionNames.nextElement();

-		String optionValue = (String)optionMap.get(optionName);

-		

-		if (optionName.equals(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR)){

-

-			if (optionValue.equals(JavaCore.GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() | CompilerOptions.Vars);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Vars);

-				continue;

-			}

-			continue;

-		} 

-		if (optionName.equals(JavaCore.COMPILER_LINE_NUMBER_ATTR)){

-

-			if (optionValue.equals(JavaCore.GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() | CompilerOptions.Lines);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Lines);

-				continue;

-			}

-			continue;

-		} 

-		if (optionName.equals(JavaCore.COMPILER_SOURCE_FILE_ATTR)){

-

-			if (optionValue.equals(JavaCore.GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() | CompilerOptions.Source);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){

-				compilerOptions.produceDebugAttributes(

-					compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Source);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL)){

-

-			if (optionValue.equals(JavaCore.PRESERVE)){

-				compilerOptions.preserveAllLocalVariables(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.OPTIMIZE_OUT)){

-				compilerOptions.preserveAllLocalVariables(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM)){

-

-			if (optionValue.equals(JavaCore.VERSION_1_1)){

-				compilerOptions.setTargetJDK(CompilerOptions.JDK1_1);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.VERSION_1_2)){

-				compilerOptions.setTargetJDK(CompilerOptions.JDK1_2);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_UNREACHABLE_CODE)){

-

-			if (optionValue.equals(JavaCore.ERROR)){

-				compilerOptions.handleUnreachableCodeAsError(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleUnreachableCodeAsError(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_INVALID_IMPORT)){

-

-			if (optionValue.equals(JavaCore.ERROR)){

-				compilerOptions.handleImportProblemAsError(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleImportProblemAsError(false);

-				continue;

-			}

-			continue;

-		}

-		

-		if (optionName.equals(JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleOverriddenPackageDefaultMethodAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleOverriddenPackageDefaultMethodAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleMethodWithConstructorNameAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleMethodWithConstructorNameAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_DEPRECATION)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleDeprecationUseAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleDeprecationUseAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleMaskedCatchBlockAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleMaskedCatchBlockAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_UNUSED_LOCAL)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleUnusedLocalVariableAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleUnusedLocalVariableAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_UNUSED_PARAMETER)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleUnusedArgumentAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleUnusedArgumentAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleAccessEmulationAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleAccessEmulationAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-		if (optionName.equals(JavaCore.COMPILER_PB_NON_EXTERNALIZED_STRING_LITERAL)){

-

-			if (optionValue.equals(JavaCore.WARNING)){

-				compilerOptions.handleNonExternalizedStringLiteralAsWarning(true);

-				continue;

-			}

-			if (optionValue.equals(JavaCore.IGNORE)){

-				compilerOptions.handleNonExternalizedStringLiteralAsWarning(false);

-				continue;

-			}

-			continue;

-		}

-	}

-	return compilerOptions.getConfigurableOptions(Locale.getDefault());

-}

 	/**

 	 * Note that the project is now deleted.

 	 *

@@ -483,7 +287,7 @@
 			return null;

 		}

 		JavaModel model= (JavaModel) getJavaModel(workspace);

-		if (memento.equals(""/*nonNLS*/)){ // workspace memento

+		if (memento.equals("")){ // workspace memento //$NON-NLS-1$

 			return model;

 		}

 		int modelEnd= memento.indexOf(JavaElement.JEM_JAVAPROJECT);

@@ -584,7 +388,7 @@
 				try {

 					modelInfo.fJavaModel.close();

 				} catch (JavaModelException e) {

-					Assert.isTrue(false, Util.bind("element.onlyOneJavaModel"/*nonNLS*/));

+					Assert.isTrue(false, Util.bind("element.onlyOneJavaModel")); //$NON-NLS-1$

 					return null;

 				}

 			}

@@ -592,7 +396,7 @@
 		if (modelInfo == null || modelInfo.workspace.equals(workspace)) {

 			return new JavaModel(workspace);

 		} else {

-			Assert.isTrue(false, Util.bind("element.onlyOneJavaModel"/*nonNLS*/));

+			Assert.isTrue(false, Util.bind("element.onlyOneJavaModel")); //$NON-NLS-1$

 			return null;

 		}

 

@@ -618,7 +422,7 @@
 		if (state == null && JavaBuilder.SAVE_ENABLED && !info.triedRead) {

 			info.triedRead= true;

 			try {

-				if (monitor != null) monitor.subTask(Util.bind("build.readStateProgress"/*nonNLS*/, project.getName()));

+				if (monitor != null) monitor.subTask(Util.bind("build.readStateProgress", project.getName())); //$NON-NLS-1$

 				state= readState(info);

 				info.setLastBuiltState(state);

 			} catch (CoreException e) {

@@ -663,12 +467,12 @@
 		if (!project.exists()) return null;

 		IPluginDescriptor descr= JavaCore.getJavaCore().getDescriptor();

 		IPath workingLocation= project.getPluginWorkingLocation(descr);

-		return workingLocation.append("state.dat"/*nonNLS*/).toFile();

+		return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$

 	}

 	public String getVariablesAsXMLString() throws CoreException {

 

 		Document document = new DocumentImpl();

-		Element rootElement = document.createElement("variables"/*nonNLS*/);

+		Element rootElement = document.createElement("variables"); //$NON-NLS-1$

 		document.appendChild(rootElement);

 

 		String[] variables = JavaCore.getClasspathVariableNames();

@@ -676,9 +480,9 @@
 		for (int i= 0; i < variables.length; ++i) {

 			String var = variables[i];

 			IPath varPath = JavaCore.getClasspathVariable(var);

-			Element varElement= document.createElement("variable"/*nonNLS*/);

-			varElement.setAttribute("name"/*nonNLS*/, var);

-			varElement.setAttribute("path"/*nonNLS*/, varPath.toString());			

+			Element varElement= document.createElement("variable"); //$NON-NLS-1$

+			varElement.setAttribute("name", var); //$NON-NLS-1$

+			varElement.setAttribute("path", varPath.toString());			 //$NON-NLS-1$

 			rootElement.appendChild(varElement);

 		}

 

@@ -695,6 +499,42 @@
 		return writer.toString();	

 			

 	}

+	

+	public String getOptionsAsXMLString() throws CoreException {

+

+		Document document = new DocumentImpl();

+		Element rootElement = document.createElement("options"); //$NON-NLS-1$

+		document.appendChild(rootElement);

+

+		String[] ids = JavaCore.getOptionIDs();

+		

+		for (int i= 0; i < ids.length; ++i) {

+			ConfigurableOption option = (ConfigurableOption)fOptions.get(ids[i]);

+			

+			Element optionElement= document.createElement("option"); //$NON-NLS-1$

+			optionElement.setAttribute("id", ids[i]); //$NON-NLS-1$

+			if(option.getPossibleValues() == ConfigurableOption.NoDiscreteValue){

+				optionElement.setAttribute("value", option.getValue());	 //$NON-NLS-1$

+			}

+			else{

+				optionElement.setAttribute("index", String.valueOf(option.getValueIndex()));	 //$NON-NLS-1$

+			}

+			rootElement.appendChild(optionElement);

+		}

+

+		// produce a String output

+		StringWriter writer = new StringWriter();

+		try {

+			OutputFormat format = new OutputFormat();

+			format.setIndenting(true);

+			Serializer serializer = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(writer, format);

+			serializer.asDOMSerializer().serialize(document);

+		} catch (IOException e) {

+			throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);

+		}

+		return writer.toString();	

+			

+	}

 /**

 	 * Returns the open ZipFile at the given location. If the ZipFile

 	 * does not yet exist, it is created, opened, and added to the cache

@@ -720,7 +560,7 @@
 		} else if (!path.isAbsolute()) {

 			file= root.getFile(path);

 			if (file == null || file.getType() != IResource.FILE) {

-				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("file.notFound"/*nonNLS*/), null));

+				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("file.notFound"), null)); //$NON-NLS-1$

 			}

 			ensureLocal(file);

 			fileSystemPath= file.getLocation().toOSString();

@@ -731,7 +571,7 @@
 		try {

 			return new ZipFile(fileSystemPath);

 		} catch (IOException e) {

-			throw new CoreException(new Status(Status.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("status.IOException"/*nonNLS*/), e));

+			throw new CoreException(new Status(Status.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("status.IOException"), e)); //$NON-NLS-1$

 		}

 	}

 	/**

@@ -751,13 +591,23 @@
 	public void loadVariables() throws CoreException {

 		

 		String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(

-								new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/));

+								new QualifiedName(JavaCore.PLUGIN_ID, "variables")); //$NON-NLS-1$

 		try {

 			if (xmlString != null) readVariables(xmlString);

 		} catch(IOException e){

 			return;

 		}

 	}

+	

+	public void loadOptions() throws CoreException {	

+		String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(

+								new QualifiedName(JavaCore.PLUGIN_ID, "options")); //$NON-NLS-1$

+		try {

+			if (xmlString != null) readOptions(xmlString);

+		} catch(IOException e){

+			return;

+		}

+	}

 /**

  * Merged all awaiting deltas.

  */

@@ -846,13 +696,13 @@
 			try {

 				String pluginID= in.readUTF();

 				if (!pluginID.equals(JavaCore.PLUGIN_ID))

-					throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));

+					throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$

 				String kind= in.readUTF();

-				if (!kind.equals("STATE"/*nonNLS*/))

-					throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));

+				if (!kind.equals("STATE")) //$NON-NLS-1$

+					throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$

 				int version= in.readInt();

 				if (version != 0x0001)

-					throw new IOException(Util.bind("build.unhandledVersionFormat"/*nonNLS*/));

+					throw new IOException(Util.bind("build.unhandledVersionFormat")); //$NON-NLS-1$

 				boolean hasState= in.readBoolean();

 				IState state= null;

 				if (hasState) {

@@ -876,15 +726,15 @@
 			DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();

 			cpElement = parser.parse(new InputSource(reader)).getDocumentElement();

 		} catch(SAXException e) {

-			throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));

+			return;

 		} catch(ParserConfigurationException e){

-			reader.close();

-			throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));

+			return;

 		} finally {

 			reader.close();

 		}

-		if (!cpElement.getNodeName().equalsIgnoreCase("variables"/*nonNLS*/)) {

-			throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));

+		if (cpElement == null) return;

+		if (!cpElement.getNodeName().equalsIgnoreCase("variables")) { //$NON-NLS-1$

+			return;

 		}

 		NodeList list= cpElement.getChildNodes();

 		Vector variables = new Vector();

@@ -894,9 +744,9 @@
 			short type= node.getNodeType();

 			if (type == Node.ELEMENT_NODE) {

 				Element element= (Element) node;

-				if (element.getNodeName().equalsIgnoreCase("variable"/*nonNLS*/)) {

-					String varName = element.getAttribute("name"/*nonNLS*/);

-					String varPath = element.getAttribute("path"/*nonNLS*/);

+				if (element.getNodeName().equalsIgnoreCase("variable")) { //$NON-NLS-1$

+					String varName = element.getAttribute("name"); //$NON-NLS-1$

+					String varPath = element.getAttribute("path"); //$NON-NLS-1$

 					try {

 						JavaCore.setClasspathVariable(varName, new Path(varPath), null);

 					} catch(JavaModelException e){

@@ -906,7 +756,57 @@
 

 			}

 		}

-	}	

+	}

+	

+	public void readOptions(String xmlString) throws IOException {

+		if(fOptions == null)

+			JavaCore.resetOptions();

+		

+		StringReader reader = new StringReader(xmlString);

+		Element cpElement;

+		try {

+			DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();

+			cpElement = parser.parse(new InputSource(reader)).getDocumentElement();

+		} catch(SAXException e) {

+			return;

+		} catch(ParserConfigurationException e){

+			return;

+		} finally {

+			reader.close();

+		}

+		if (cpElement == null) return;

+		if (!cpElement.getNodeName().equalsIgnoreCase("options")) { //$NON-NLS-1$

+			return;

+		}

+		NodeList list= cpElement.getChildNodes();

+		int length= list.getLength();

+		for (int i= 0; i < length; ++i) {

+			Node node= list.item(i);

+			short type= node.getNodeType();

+			if (type == Node.ELEMENT_NODE) {

+				Element element= (Element) node;

+				if (element.getNodeName().equalsIgnoreCase("option")) { //$NON-NLS-1$

+					String id = element.getAttribute("id"); //$NON-NLS-1$

+					ConfigurableOption option = (ConfigurableOption) fOptions.get(id);

+					

+					String[] possible = option.getPossibleValues();

+					if(possible == ConfigurableOption.NoDiscreteValue){

+						String value = element.getAttribute("value"); //$NON-NLS-1$

+						option.setValue(value);

+					}

+					else {

+						try {

+							int valueIndex = Integer.parseInt(element.getAttribute("index")); //$NON-NLS-1$

+							option.setValueIndex(valueIndex);

+						} catch(NumberFormatException e){

+						}

+					}

+					

+				}

+

+			}

+		}

+	}

 	/**

 	 * Registers the given delta with this manager. This API is to be

 	 * used to registerd deltas that are created explicitly by the Java

@@ -1057,7 +957,7 @@
 		if (vStats != null) {

 			IStatus[] stats= new IStatus[vStats.size()];

 			vStats.copyInto(stats);

-			throw new CoreException(new MultiStatus(JavaCore.PLUGIN_ID, IStatus.ERROR, stats, Util.bind("build.cannotSaveStates"/*nonNLS*/), null));

+			throw new CoreException(new MultiStatus(JavaCore.PLUGIN_ID, IStatus.ERROR, stats, Util.bind("build.cannotSaveStates"), null)); //$NON-NLS-1$

 		}

 	}

 	/**

@@ -1065,7 +965,7 @@
 	 */

 	private void saveState(PerProjectInfo info) throws CoreException {

 

-		if (VERBOSE) System.out.println(Util.bind("build.saveStateProgress"/*nonNLS*/, info.project.getName()));

+		if (VERBOSE) System.out.println(Util.bind("build.saveStateProgress", info.project.getName())); //$NON-NLS-1$

 		long t= System.currentTimeMillis();

 		File file= getSerializationFile(info.project);

 		if (file == null) return;

@@ -1073,7 +973,7 @@
 			DataOutputStream out= new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));

 			try {

 				out.writeUTF(JavaCore.PLUGIN_ID);

-				out.writeUTF("STATE"/*nonNLS*/);

+				out.writeUTF("STATE"); //$NON-NLS-1$

 				out.writeInt(0x0001);

 				IState state= info.getLastBuiltState();

 				if (state == null) {

@@ -1090,16 +990,16 @@
 				file.delete();

 			} catch(SecurityException se){

 			}

-			throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState"/*nonNLS*/, info.project.getName()), e));

+			throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState", info.project.getName()), e)); //$NON-NLS-1$

 		} catch (IOException e) {

 			try {

 				file.delete();

 			} catch(SecurityException se){

 			}

-			throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState"/*nonNLS*/, info.project.getName()), e));

+			throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState", info.project.getName()), e)); //$NON-NLS-1$

 		}

 		t= System.currentTimeMillis() - t;

-		if (VERBOSE) System.out.println(Util.bind("build.saveStateComplete"/*nonNLS*/, String.valueOf(t)));

+		if (VERBOSE) System.out.println(Util.bind("build.saveStateComplete", String.valueOf(t))); //$NON-NLS-1$

 	}

 	/**

 	 * Saves the built state for the project if it has been changed since last save.

@@ -1119,15 +1019,22 @@
 	}

 	public void saveVariables() throws CoreException {

 		ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(

-			new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/), 

+			new QualifiedName(JavaCore.PLUGIN_ID, "variables"),  //$NON-NLS-1$

 			getVariablesAsXMLString());

 	}

+	

+	public void saveOptions() throws CoreException {

+		ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(

+			new QualifiedName(JavaCore.PLUGIN_ID, "options"),  //$NON-NLS-1$

+			getOptionsAsXMLString());

+	}

 /**

  * @see ISaveParticipant

  */

 public void saving(ISaveContext context) throws CoreException {

 

 	this.saveVariables();

+	this.saveOptions();

 	

 	if (context.getKind() == ISaveContext.FULL_SAVE){

 		this.saveBuildState();	// build state

@@ -1140,8 +1047,9 @@
 	protected void setBuildOrder(String[] javaBuildOrder) throws JavaModelException {

 

 		// optional behaviour

-		if (!JavaCore.COMPUTE.equals(JavaCore.getOptions().get(JavaCore.CORE_JAVA_BUILD_ORDER))) return;

-			

+		// possible value of index 0 is Compute

+		if (!JavaCore.getOptionPossibleValues(JavaCore.OPTION_ComputeBuildOrder)[0].equals(JavaCore.getOptionValue(JavaCore.OPTION_ComputeBuildOrder))) return;

+		

 		if (javaBuildOrder == null || javaBuildOrder.length <= 1) return;

 		

 		IWorkspace workspace = ResourcesPlugin.getWorkspace();

@@ -1221,4 +1129,38 @@
 	public void stopDeltas() {

 		fFire= false;

 	}

+	

+	/**

+ 	* Answers a copy of the current set of options supported by the Java core.

+ 	* These options allow to configure the behavior of the underlying components.

+ 	*

+ 	* Changes on the set of options are not committed until invoking <code>JavaCore.setOptionValue</code>

+ 	*/

+	public static ConfigurableOption[] getOptions(){

+		if(fOptions == null)

+			JavaCore.resetOptions();

+		

+		return (ConfigurableOption[])fOptions.values().toArray(new ConfigurableOption[0]);

+	}

+	

+	/**

+	 * Answers a set of option'IDs which are in option set of JavaCore

+	 */

+	public static String[] getOptionIDs(){

+		if(fOptionIDs == null)

+			JavaCore.resetOptions();

+			

+		return (String [])fOptionIDs.toArray(new String[0]);

+	}

+	

+	public static void initializeOptions(){

+		fOptions = new Hashtable(10);

+		fOptionIDs = new ArrayList(10);

+	}

+	

+	public static void addOption(ConfigurableOption option){

+		String id = option.getID();

+		fOptions.put(id,option);

+		fOptionIDs.add(id);

+	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/JavaModelOperation.java b/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
index 822686b..ea18ad6 100644
--- a/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
+++ b/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
@@ -135,7 +135,7 @@
  */

 protected void checkCanceled() {

 	if (isCanceled()) {

-		throw new OperationCanceledException(Util.bind("operation.cancelled"/*nonNLS*/));

+		throw new OperationCanceledException(Util.bind("operation.cancelled")); //$NON-NLS-1$

 	}

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/JavaModelStatus.java b/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
index c868e21..b63aa41 100644
--- a/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
+++ b/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
@@ -52,13 +52,13 @@
  */

 public JavaModelStatus() {

 	// no code for an multi-status

-	super(ERROR, JavaCore.PLUGIN_ID, 0, "JavaModelStatus"/*nonNLS*/, null);

+	super(ERROR, JavaCore.PLUGIN_ID, 0, "JavaModelStatus", null); //$NON-NLS-1$

 }

 /**

  * Constructs an Java model status with no corresponding elements.

  */

 public JavaModelStatus(int code) {

-	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);

+	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$

 	fElements= JavaElementInfo.fgEmptyChildren;

 }

 /**

@@ -66,7 +66,7 @@
  * elements.

  */

 public JavaModelStatus(int code, IJavaElement[] elements) {

-	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);

+	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$

 	fElements= elements;

 	fPath= null;

 }

@@ -74,7 +74,7 @@
  * Constructs an Java model status with no corresponding elements.

  */

 public JavaModelStatus(int code, String string) {

-	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);

+	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$

 	fElements= JavaElementInfo.fgEmptyChildren;

 	fPath= null;

 	fString = string;

@@ -83,14 +83,14 @@
  * Constructs an Java model status with no corresponding elements.

  */

 public JavaModelStatus(int code, Throwable throwable) {

-	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, throwable);

+	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", throwable); //$NON-NLS-1$

 	fElements= JavaElementInfo.fgEmptyChildren;

 }

 /**

  * Constructs an Java model status with no corresponding elements.

  */

 public JavaModelStatus(int code, IPath path) {

-	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);

+	super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$

 	fElements= JavaElementInfo.fgEmptyChildren;

 	fPath= path;

 }

@@ -113,7 +113,7 @@
  * Constructs an Java model status with no corresponding elements.

  */

 public JavaModelStatus(CoreException coreException) {

-	super(ERROR, JavaCore.PLUGIN_ID, CORE_EXCEPTION, "JavaModelStatus"/*nonNLS*/, coreException);

+	super(ERROR, JavaCore.PLUGIN_ID, CORE_EXCEPTION, "JavaModelStatus", coreException); //$NON-NLS-1$

 	fElements= JavaElementInfo.fgEmptyChildren;

 }

 protected int getBits() {

@@ -140,89 +140,89 @@
 	if (getException() == null) {

 		switch (getCode()) {

 			case CORE_EXCEPTION :

-				return Util.bind("status.coreException"/*nonNLS*/);

+				return Util.bind("status.coreException"); //$NON-NLS-1$

 			case BUILDER_INITIALIZATION_ERROR:

-				return Util.bind("build.initializationError"/*nonNLS*/);

+				return Util.bind("build.initializationError"); //$NON-NLS-1$

 			case BUILDER_SERIALIZATION_ERROR:

-				return Util.bind("build.serializationError"/*nonNLS*/);

+				return Util.bind("build.serializationError"); //$NON-NLS-1$

 			case DEVICE_PATH:

-				return Util.bind("status.cannotUseDeviceOnPath"/*nonNLS*/, getPath().toString());

+				return Util.bind("status.cannotUseDeviceOnPath", getPath().toString()); //$NON-NLS-1$

 			case DOM_EXCEPTION:

-				return Util.bind("status.JDOMError"/*nonNLS*/);

+				return Util.bind("status.JDOMError"); //$NON-NLS-1$

 			case ELEMENT_DOES_NOT_EXIST:

-				return Util.bind("element.doesNotExist"/*nonNLS*/,fElements[0].getElementName());

+				return Util.bind("element.doesNotExist",fElements[0].getElementName()); //$NON-NLS-1$

 			case EVALUATION_ERROR:

-				return Util.bind("status.evaluationError"/*nonNLS*/, getString());

+				return Util.bind("status.evaluationError", getString()); //$NON-NLS-1$

 			case INDEX_OUT_OF_BOUNDS:

-				return Util.bind("status.indexOutOfBounds"/*nonNLS*/);

+				return Util.bind("status.indexOutOfBounds"); //$NON-NLS-1$

 			case INVALID_CONTENTS:

-				return Util.bind("status.invalidContents"/*nonNLS*/);

+				return Util.bind("status.invalidContents"); //$NON-NLS-1$

 			case INVALID_DESTINATION:

-				return Util.bind("status.invalidDestination"/*nonNLS*/, fElements[0].getElementName());

+				return Util.bind("status.invalidDestination", fElements[0].getElementName()); //$NON-NLS-1$

 			case INVALID_ELEMENT_TYPES:

-				StringBuffer buff= new StringBuffer(Util.bind("operation.notSupported"/*nonNLS*/));

+				StringBuffer buff= new StringBuffer(Util.bind("operation.notSupported")); //$NON-NLS-1$

 				for (int i= 0; i < fElements.length; i++) {

 					if (i > 0) {

-						buff.append(", "/*nonNLS*/);

+						buff.append(", "); //$NON-NLS-1$

 					}

 					buff.append(fElements[0].getElementName());

 				}

 				return buff.toString();

 			case INVALID_NAME:

-				return Util.bind("status.invalidName"/*nonNLS*/, getString());

+				return Util.bind("status.invalidName", getString()); //$NON-NLS-1$

 			case INVALID_PACKAGE:

-				return Util.bind("status.invalidPackage"/*nonNLS*/, getString());

+				return Util.bind("status.invalidPackage", getString()); //$NON-NLS-1$

 			case INVALID_PATH:

-				return Util.bind("status.invalidPath"/*nonNLS*/, getPath() == null ? "null"/*nonNLS*/ : getPath().toString());

+				return Util.bind("status.invalidPath", getPath() == null ? "null" : getPath().toString()); //$NON-NLS-1$ //$NON-NLS-2$

 			case INVALID_PROJECT:

-				return Util.bind("status.invalidProject"/*nonNLS*/, getString());

+				return Util.bind("status.invalidProject", getString()); //$NON-NLS-1$

 			case INVALID_RESOURCE:

-				return Util.bind("status.invalidResource"/*nonNLS*/, getString());

+				return Util.bind("status.invalidResource", getString()); //$NON-NLS-1$

 			case INVALID_RESOURCE_TYPE:

-				return Util.bind("status.invalidResourceType"/*nonNLS*/, getString());

+				return Util.bind("status.invalidResourceType", getString()); //$NON-NLS-1$

 			case INVALID_SIBLING:

-				return Util.bind("status.invalidSibling"/*nonNLS*/, fElements[0].getElementName());

+				return Util.bind("status.invalidSibling", fElements[0].getElementName()); //$NON-NLS-1$

 			case IO_EXCEPTION:

-				return Util.bind("status.IOException"/*nonNLS*/);

+				return Util.bind("status.IOException"); //$NON-NLS-1$

 			case NAME_COLLISION:

 				if (fElements != null && fElements.length > 0) {

 					IJavaElement element = fElements[0];

 					String name = element.getElementName();

 					if (element instanceof IPackageFragment && name.equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {

-						return Util.bind("operation.cannotRenameDefaultPackage"/*nonNLS*/);

+						return Util.bind("operation.cannotRenameDefaultPackage"); //$NON-NLS-1$

 					}

 				}

-				return Util.bind("status.nameCollision"/*nonNLS*/);

+				return Util.bind("status.nameCollision"); //$NON-NLS-1$

 			case NO_ELEMENTS_TO_PROCESS:

-				return Util.bind("operation.needElements"/*nonNLS*/);

+				return Util.bind("operation.needElements"); //$NON-NLS-1$

 			case NULL_NAME:

-				return Util.bind("operation.needName"/*nonNLS*/);

+				return Util.bind("operation.needName"); //$NON-NLS-1$

 			case NULL_PATH:

-				return Util.bind("operation.needPath"/*nonNLS*/);

+				return Util.bind("operation.needPath"); //$NON-NLS-1$

 			case NULL_STRING:

-				return Util.bind("operation.needString"/*nonNLS*/);

+				return Util.bind("operation.needString"); //$NON-NLS-1$

 			case PATH_OUTSIDE_PROJECT:

-				return Util.bind("operation.pathOutsideProject"/*nonNLS*/, getString(), fElements[0].getElementName());

+				return Util.bind("operation.pathOutsideProject", getString(), fElements[0].getElementName()); //$NON-NLS-1$

 			case READ_ONLY:

 				IJavaElement element = fElements[0];

 				String name = element.getElementName();

 				if (element instanceof IPackageFragment && name.equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {

-					return Util.bind("status.defaultPackageReadOnly"/*nonNLS*/);

+					return Util.bind("status.defaultPackageReadOnly"); //$NON-NLS-1$

 				}

-				return  Util.bind("status.readOnly"/*nonNLS*/, name);

+				return  Util.bind("status.readOnly", name); //$NON-NLS-1$

 			case RELATIVE_PATH:

-				return Util.bind("operation.needAbsolutePath"/*nonNLS*/, getPath().toString());

+				return Util.bind("operation.needAbsolutePath", getPath().toString()); //$NON-NLS-1$

 			case TARGET_EXCEPTION:

-				return Util.bind("status.targetException"/*nonNLS*/);

+				return Util.bind("status.targetException"); //$NON-NLS-1$

 			case UPDATE_CONFLICT:

-				return Util.bind("status.updateConflict"/*nonNLS*/);

+				return Util.bind("status.updateConflict"); //$NON-NLS-1$

 			case NO_LOCAL_CONTENTS :

-				return Util.bind("status.noLocalContents"/*nonNLS*/, getPath().toString());

+				return Util.bind("status.noLocalContents", getPath().toString()); //$NON-NLS-1$

 		}

 		return getString();

 	} else {

 		if (getCode() == CORE_EXCEPTION){

-			return Util.bind("status.coreExceptionWithArg"/*nonNLS*/, getException().getMessage());

+			return Util.bind("status.coreExceptionWithArg", getException().getMessage()); //$NON-NLS-1$

 		}

 		return getException().getMessage();

 	}

@@ -311,9 +311,9 @@
  */

 public String toString() {

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("Java Model Status ["/*nonNLS*/);

+	buffer.append("Java Model Status ["); //$NON-NLS-1$

 	buffer.append(getMessage());

-	buffer.append("]"/*nonNLS*/);

+	buffer.append("]"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/JavaProject.java b/model/org/eclipse/jdt/internal/core/JavaProject.java
index 0dda925..c3b8902 100644
--- a/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -202,7 +202,7 @@
 	 * This is the project bin folder

 	 */

 	protected IPath defaultOutputLocation() throws JavaModelException {

-		return getProject().getFullPath().append("bin"/*nonNLS*/);

+		return getProject().getFullPath().append("bin"); //$NON-NLS-1$

 	}

 	/**

 	 * Returns true if this handle represents the same Java project

@@ -245,14 +245,14 @@
 					// default to the first one

 					return pkgFragments[0];

 				}

-			} else if (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {

+			} else if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) { //$NON-NLS-1$ //$NON-NLS-2$

 				IPath packagePath= path.removeLastSegments(1);

 				String packageName= packagePath.toString().replace(IPath.SEPARATOR, '.');

 				String typeName= path.lastSegment();

 				typeName= typeName.substring(0, typeName.length() - extension.length() - 1);

 				String qualifiedName= null;

 				if (packageName.length() > 0) {

-					qualifiedName= packageName + "."/*nonNLS*/ + typeName;

+					qualifiedName= packageName + "." + typeName; //$NON-NLS-1$

 				} else {

 					qualifiedName= typeName;

 				}

@@ -437,18 +437,11 @@
 		return getPackageFragmentRoots();

 	}

 	/**

-	 * @see IJavaProject

-	 * @deprecated

-	 */

-	public IClasspathEntry[] getClasspath() throws JavaModelException {

-		return getRawClasspath();

-	}

-	/**

 	 * Returns the XML String encoding of the class path.

 	 */

 	protected String getClasspathAsXMLString(IClasspathEntry[] classpath, IPath outputLocation) throws JavaModelException {

 		Document doc= new DocumentImpl();

-		Element cpElement= doc.createElement("classpath"/*nonNLS*/);

+		Element cpElement= doc.createElement("classpath"); //$NON-NLS-1$

 		doc.appendChild(cpElement);

 

 		for (int i= 0; i < classpath.length; ++i) {

@@ -459,9 +452,9 @@
 		if (outputLocation != null) {

 			outputLocation= outputLocation.removeFirstSegments(1);

 			outputLocation= outputLocation.makeRelative();

-			Element oElement= doc.createElement("classpathentry"/*nonNLS*/);

-			oElement.setAttribute("kind"/*nonNLS*/, kindToString(ClasspathEntry.K_OUTPUT));

-			oElement.setAttribute("path"/*nonNLS*/, outputLocation.toOSString());

+			Element oElement= doc.createElement("classpathentry"); //$NON-NLS-1$

+			oElement.setAttribute("kind", kindToString(ClasspathEntry.K_OUTPUT)); //$NON-NLS-1$

+			oElement.setAttribute("path", outputLocation.toOSString()); //$NON-NLS-1$

 			cpElement.appendChild(oElement);

 		}

 

@@ -495,15 +488,15 @@
 	 * of this project

 	 */

 	public QualifiedName getClasspathPropertyName() {

-		return new QualifiedName(JavaCore.PLUGIN_ID, "classpath"/*nonNLS*/);

+		return new QualifiedName(JavaCore.PLUGIN_ID, "classpath"); //$NON-NLS-1$

 	}

 	/**

 	 * Returns the XML String encoding of the class path.

 	 */

 	protected static Element getEntryAsXMLElement(Document document, IClasspathEntry entry, IPath prefixPath) throws JavaModelException {

 		

-		Element element= document.createElement("classpathentry"/*nonNLS*/);

-		element.setAttribute("kind"/*nonNLS*/, kindToString(entry.getEntryKind()));

+		Element element= document.createElement("classpathentry"); //$NON-NLS-1$

+		element.setAttribute("kind", kindToString(entry.getEntryKind())); //$NON-NLS-1$

 		IPath path= entry.getPath();

 		if (entry.getEntryKind() != IClasspathEntry.CPE_VARIABLE){

 			// translate to project relative from absolute (unless a device path)

@@ -518,12 +511,12 @@
 				}

 			}

 		}

-		element.setAttribute("path"/*nonNLS*/, path.toString());

+		element.setAttribute("path", path.toString()); //$NON-NLS-1$

 		if (entry.getSourceAttachmentPath() != null){

-			element.setAttribute("sourcepath"/*nonNLS*/, entry.getSourceAttachmentPath().toString());

+			element.setAttribute("sourcepath", entry.getSourceAttachmentPath().toString()); //$NON-NLS-1$

 		}

 		if (entry.getSourceAttachmentRootPath() != null){

-			element.setAttribute("rootpath"/*nonNLS*/, entry.getSourceAttachmentRootPath().toString());

+			element.setAttribute("rootpath", entry.getSourceAttachmentRootPath().toString()); //$NON-NLS-1$

 		}

 		return element;

 	}

@@ -597,7 +590,7 @@
 	 */

 	public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) {

 		String name= resource.getName();

-		if (Util.endsWithIgnoreCase(name,".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name,".zip"/*nonNLS*/)) {

+		if (Util.endsWithIgnoreCase(name,".jar") || Util.endsWithIgnoreCase(name,".zip")) { //$NON-NLS-2$ //$NON-NLS-1$

 			return new JarPackageFragmentRoot(resource, this);

 		} else {

 			return new PackageFragmentRoot(resource, this);

@@ -683,7 +676,7 @@
 		if (entry.getContentKind() == IPackageFragmentRoot.K_BINARY) {

 			String ext= path.getFileExtension();

 			IPackageFragmentRoot root= null;

-			if (ext != null && (ext.equalsIgnoreCase("zip"/*nonNLS*/) || ext.equalsIgnoreCase("jar"/*nonNLS*/))) {

+			if (ext != null && (ext.equalsIgnoreCase("zip") || ext.equalsIgnoreCase("jar"))) { //$NON-NLS-1$ //$NON-NLS-2$

 				// jar

 				// removeFirstSegment removes the part relative to the project which is retrieve 

 				// through workspace.getDefaultContentLocation

@@ -938,15 +931,15 @@
 	 * Returns the kind of a <code>PackageFragmentRoot</code> from its <code>String</code> form.

 	 */

 	static int kindFromString(String kindStr) {

-		if (kindStr.equalsIgnoreCase("prj"/*nonNLS*/))

+		if (kindStr.equalsIgnoreCase("prj")) //$NON-NLS-1$

 			return IClasspathEntry.CPE_PROJECT;

-		if (kindStr.equalsIgnoreCase("var"/*nonNLS*/))

+		if (kindStr.equalsIgnoreCase("var")) //$NON-NLS-1$

 			return IClasspathEntry.CPE_VARIABLE;

-		if (kindStr.equalsIgnoreCase("src"/*nonNLS*/))

+		if (kindStr.equalsIgnoreCase("src")) //$NON-NLS-1$

 			return IClasspathEntry.CPE_SOURCE;

-		if (kindStr.equalsIgnoreCase("lib"/*nonNLS*/))

+		if (kindStr.equalsIgnoreCase("lib")) //$NON-NLS-1$

 			return IClasspathEntry.CPE_LIBRARY;

-		if (kindStr.equalsIgnoreCase("output"/*nonNLS*/))

+		if (kindStr.equalsIgnoreCase("output")) //$NON-NLS-1$

 			return ClasspathEntry.K_OUTPUT;

 		return -1;

 	}

@@ -958,17 +951,17 @@
 	static String kindToString(int kind) {

 		switch (kind) {

 			case IClasspathEntry.CPE_PROJECT :

-				return "src"/*nonNLS*/; // backward compatibility

+				return "src"; // backward compatibility //$NON-NLS-1$

 			case IClasspathEntry.CPE_SOURCE :

-				return "src"/*nonNLS*/;

+				return "src"; //$NON-NLS-1$

 			case IClasspathEntry.CPE_LIBRARY :

-				return "lib"/*nonNLS*/;

+				return "lib"; //$NON-NLS-1$

 			case IClasspathEntry.CPE_VARIABLE :

-				return "var"/*nonNLS*/;

+				return "var"; //$NON-NLS-1$

 			case ClasspathEntry.K_OUTPUT :

-				return "output"/*nonNLS*/;

+				return "output"; //$NON-NLS-1$

 			default :

-				return "unknown"/*nonNLS*/;

+				return "unknown"; //$NON-NLS-1$

 		}

 	}

 	/**

@@ -990,31 +983,10 @@
 	}

 	/**

 	 * @see IJavaProject

-	 * @deprecated

-	 */

-	public IClasspathEntry newLibraryEntry(IPath path) {

-		return JavaCore.newLibraryEntry(path, null, null);

-	}

-	/**

-	 * @see IJavaProject

- 	 * @deprecated

-	 */

-	public IClasspathEntry newProjectEntry(IPath path) {

-		return JavaCore.newProjectEntry(path);

-	}

-	/**

-	 * @see IJavaProject

-	 * @deprecated	 

-	 */

-	public IClasspathEntry newSourceEntry(IPath path) {

-		return JavaCore.newSourceEntry(path);

-	}

-	/**

-	 * @see IJavaProject

 	 */

 	public ITypeHierarchy newTypeHierarchy(IRegion region, IProgressMonitor monitor) throws JavaModelException {

 		if (region == null) {

-			throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion")); //$NON-NLS-1$

 		}

 		CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(null, region, this, true);

 		runOperation(op, monitor);

@@ -1025,10 +997,10 @@
 	 */

 	public ITypeHierarchy newTypeHierarchy(IType type, IRegion region, IProgressMonitor monitor) throws JavaModelException {

 		if (type == null) {

-			throw new IllegalArgumentException(Util.bind("hierarchy.nullFocusType"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("hierarchy.nullFocusType")); //$NON-NLS-1$

 		}

 		if (region == null) {

-			throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion")); //$NON-NLS-1$

 		}

 		CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(type, region, this, true);

 		runOperation(op, monitor);

@@ -1095,15 +1067,15 @@
 			DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();

 			cpElement = parser.parse(new InputSource(reader)).getDocumentElement();

 		} catch(SAXException e) {

-			throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));

+			throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$

 		} catch(ParserConfigurationException e){

 			reader.close();

-			throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));

+			throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$

 		} finally {

 			reader.close();

 		}

-		if (!cpElement.getNodeName().equalsIgnoreCase("classpath"/*nonNLS*/)) {

-			throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));

+		if (!cpElement.getNodeName().equalsIgnoreCase("classpath")) { //$NON-NLS-1$

+			throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$

 		}

 		NodeList list= cpElement.getChildNodes();

 		Vector paths= new Vector();

@@ -1113,9 +1085,9 @@
 			short type= node.getNodeType();

 			if (type == Node.ELEMENT_NODE) {

 				Element cpeElement= (Element) node;

-				if (cpeElement.getNodeName().equalsIgnoreCase("classpathentry"/*nonNLS*/)) {

-					String cpeElementKind = cpeElement.getAttribute("kind"/*nonNLS*/);

-					String pathStr = cpeElement.getAttribute("path"/*nonNLS*/);

+				if (cpeElement.getNodeName().equalsIgnoreCase("classpathentry")) { //$NON-NLS-1$

+					String cpeElementKind = cpeElement.getAttribute("kind"); //$NON-NLS-1$

+					String pathStr = cpeElement.getAttribute("path"); //$NON-NLS-1$

 					// ensure path is absolute

 					IPath path= new Path(pathStr);

 					int kind= kindFromString(cpeElementKind);

@@ -1123,10 +1095,10 @@
 						path= projectPath.append(path);

 					}

 					// source attachment info (optional)

-					String sourceAttachmentPathStr = cpeElement.getAttribute("sourcepath"/*nonNLS*/);

-					IPath sourceAttachmentPath = sourceAttachmentPathStr.equals(""/*nonNLS*/) ? null : new Path(sourceAttachmentPathStr);

-					String sourceAttachmentRootPathStr = cpeElement.getAttribute("rootpath"/*nonNLS*/);

-					IPath sourceAttachmentRootPath = sourceAttachmentRootPathStr.equals(""/*nonNLS*/) ? null : new Path(sourceAttachmentRootPathStr);

+					String sourceAttachmentPathStr = cpeElement.getAttribute("sourcepath"); //$NON-NLS-1$

+					IPath sourceAttachmentPath = sourceAttachmentPathStr.equals("") ? null : new Path(sourceAttachmentPathStr); //$NON-NLS-1$

+					String sourceAttachmentRootPathStr = cpeElement.getAttribute("rootpath"); //$NON-NLS-1$

+					IPath sourceAttachmentRootPath = sourceAttachmentRootPathStr.equals("") ? null : new Path(sourceAttachmentRootPathStr); //$NON-NLS-1$

 					

 					IClasspathEntry entry= createClasspathEntry(path, kind, sourceAttachmentPath, sourceAttachmentRootPath);

 					if (entry == null) return null;

@@ -1251,13 +1223,6 @@
 		}

 	}

 	/**

-	 * @see IJavaProject

-	 * @deprecated

-	 */

-	public void setClasspath(IClasspathEntry[] entries, IProgressMonitor monitor) throws JavaModelException {

-		setRawClasspath(entries, monitor, true);

-	}

-	/**

 	 * Update the Java command in the build spec (replace existing one if present,

 	 * add one first if none).

 	 */

@@ -1292,7 +1257,7 @@
 	 */

 	public void setOutputLocation(IPath outputLocation, IProgressMonitor monitor) throws JavaModelException {

 		if (outputLocation == null) {

-			throw new IllegalArgumentException(Util.bind("path.nullpath"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("path.nullpath")); //$NON-NLS-1$

 		}

 		if (outputLocation.equals(getOutputLocation())) {

 			return;

@@ -1461,9 +1426,9 @@
 	private void createClasspathProblemMarker(IClasspathEntry entry, String message){

 		try {

 			IMarker marker = getProject().createMarker(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER);

-			marker.setAttribute(IMarker.MESSAGE, message);

-			marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);

-			marker.setAttribute(IMarker.LOCATION, Util.bind("classpath.buildPath"/*nonNLS*/));

+			marker.setAttributes(

+				new String[]{ IMarker.MESSAGE, IMarker.SEVERITY, IMarker.LOCATION},

+				new Object[]{message, new Integer(IMarker.SEVERITY_WARNING), Util.bind("classpath.buildPath")}); //$NON-NLS-1$

 		} catch (CoreException e) {

 		}		

 	}

@@ -1482,98 +1447,6 @@
 	}

 

 	/**

-	 * Returns a message describing the problem related to this classpath entry if any, or null if entry is fine 

-	 * (i.e. if the given classpath entry denotes a valid element to be referenced onto a classpath).

-	 */

-	private String getClasspathEntryErrorMessage(IClasspathEntry entry, boolean checkSourceAttachment){

-		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();			

-		IPath path = entry.getPath();

-		

-		switch(entry.getEntryKind()){

-

-			// variable entry check

-			case IClasspathEntry.CPE_VARIABLE :

-				entry = JavaCore.getResolvedClasspathEntry(entry);

-				if (entry == null){

-					return Util.bind("classpath.unboundVariablePath"/*nonNLS*/, path.toString());

-				}

-				return getClasspathEntryErrorMessage(entry, checkSourceAttachment);

-

-

-			// library entry check

-			case IClasspathEntry.CPE_LIBRARY :

-				if (path != null && path.isAbsolute() && !path.isEmpty()) {

-					IPath sourceAttachment = entry.getSourceAttachmentPath();

-					Object target = JavaModel.getTarget(workspaceRoot, path, true);

-					if (target instanceof IResource){

-						IResource resolvedResource = (IResource) target;

-						switch(resolvedResource.getType()){

-							case IResource.FILE :

-								String extension = resolvedResource.getFileExtension();

-								if ("jar"/*nonNLS*/.equalsIgnoreCase(extension) || "zip"/*nonNLS*/.equalsIgnoreCase(extension)){ // internal binary archive

-									if (checkSourceAttachment 

-										&& sourceAttachment != null

-										&& !sourceAttachment.isEmpty()

-										&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

-										return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());

-									}

-								}

-								break;

-							case IResource.FOLDER :	// internal binary folder

-								if (checkSourceAttachment 

-									&& sourceAttachment != null 

-									&& !sourceAttachment.isEmpty()

-									&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

-									return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());

-								}

-						}

-					} else if (target instanceof File){

-						if (checkSourceAttachment 

-							&& sourceAttachment != null 

-							&& !sourceAttachment.isEmpty()

-							&& JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){

-							return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());

-						}

-					} else {

-						return Util.bind("classpath.unboundLibrary"/*nonNLS*/, path.toString());

-					}

-				} else {

-					return Util.bind("classpath.illegalLibraryPath"/*nonNLS*/, path.toString());

-				}

-				break;

-

-			// project entry check

-			case IClasspathEntry.CPE_PROJECT :

-				if (path != null && path.isAbsolute() && !path.isEmpty()) {

-					IProject project = workspaceRoot.getProject(path.segment(0));

-					try {

-						if (!project.exists() || !project.hasNature(JavaCore.NATURE_ID)){

-							return Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString());

-						}

-					} catch (CoreException e){

-						return Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString());

-					}

-				} else {

-					return Util.bind("classpath.illegalProjectPath"/*nonNLS*/, path.segment(0).toString());

-				}

-				break;

-

-			// project source folder

-			case IClasspathEntry.CPE_SOURCE :

-				if (path != null && path.isAbsolute() && !path.isEmpty()) {

-					IPath projectPath= getProject().getFullPath();

-					if (!projectPath.isPrefixOf(path) || JavaModel.getTarget(workspaceRoot, path, true) == null){

-						return Util.bind("classpath.unboundSourceFolder"/*nonNLS*/, path.toString());

-					}

-				} else {

-					return Util.bind("classpath.illegalSourceFolderPath"/*nonNLS*/, path.toString());

-				}

-				break;

-		}

-		return null;

-	}

-

-	/**

 	 * Internal variant which can create marker on project for invalid entries

 	 */

 	public IClasspathEntry[] getResolvedClasspath(boolean ignoreUnresolvedVariable, boolean generateMarkerOnError) throws JavaModelException {

@@ -1587,6 +1460,12 @@
 			

 			IClasspathEntry entry = classpath[i];

 

+			/* validation if needed */

+			if (generateMarkerOnError){

+				IJavaModelStatus status = JavaConventions.validateClasspathEntry(this, entry, false);

+				if (!status.isOK()) createClasspathProblemMarker(entry, status.getMessage());

+			}

+

 			/* resolve variables if any, unresolved ones are ignored */

 			if (entry.getEntryKind() == IClasspathEntry.CPE_VARIABLE){

 

@@ -1598,15 +1477,12 @@
 				IPath variablePath = entry.getPath(); // for error reporting

 				entry = JavaCore.getResolvedClasspathEntry(entry);

 				if (entry == null){

-					if (generateMarkerOnError) createClasspathProblemMarker(classpath[i], Util.bind("classpath.unboundVariablePath"/*nonNLS*/, variablePath.toString()));

 					if (!ignoreUnresolvedVariable){

 						throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND, variablePath.toString()));

 					}

 				}

 			}

 			if (entry != null){

-				String msg;

-				if (generateMarkerOnError && (msg = getClasspathEntryErrorMessage(entry, false)) != null) createClasspathProblemMarker(classpath[i], msg);

 				resolvedPath[index++] = entry;

 			}

 		}

diff --git a/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java b/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
index e9cbfbf..c405379 100644
--- a/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
@@ -28,7 +28,7 @@
  * for progress monitoring.

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.moveElementProgress"/*nonNLS*/);

+	return Util.bind("operation.moveElementProgress"); //$NON-NLS-1$

 }

 /**

  * @see CopyElementsOperation#isMove()

diff --git a/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java b/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
index 895def8..cfbf9ae 100644
--- a/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
@@ -27,7 +27,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.moveResourceProgress"/*nonNLS*/);

+	return Util.bind("operation.moveResourceProgress"); //$NON-NLS-1$

 }

 /**

  * @see CopyResourceElementsOperation#isMove()

diff --git a/model/org/eclipse/jdt/internal/core/NameLookup.java b/model/org/eclipse/jdt/internal/core/NameLookup.java
index 8ebdbe1..9b0c5b6 100644
--- a/model/org/eclipse/jdt/internal/core/NameLookup.java
+++ b/model/org/eclipse/jdt/internal/core/NameLookup.java
@@ -152,7 +152,7 @@
 		if (index != -1) {

 			cuName= cuName.substring(0, index);

 		}

-		cuName += ".java"/*nonNLS*/;

+		cuName += ".java"; //$NON-NLS-1$

 

 		IPackageFragment[] frags= (IPackageFragment[]) fPackageFragments.get(pkgName);

 		if (frags != null) {

@@ -173,7 +173,7 @@
  */

 public IPackageFragment findPackageFragment(IPath path) {

 	if (!path.isAbsolute()) {

-		throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$

 	}

 	IResource possibleFragment = workspace.getRoot().findMember(path);

 	if (possibleFragment == null) {

@@ -244,7 +244,7 @@
 	 */

 	public IPackageFragmentRoot findPackageFragmentRoot(IPath path) {

 		if (!path.isAbsolute()) {

-			throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$

 		}

 		for (int i= 0; i < fPackageFragmentRoots.length; i++) {

 			IPackageFragmentRoot classpathRoot= fPackageFragmentRoots[i];

@@ -532,7 +532,7 @@
 		 * the compilationUnits always will. So add it if we're looking for 

 		 * an exact match.

 		 */

-		String unitName= partialMatch ? matchName.toLowerCase() : matchName + ".java"/*nonNLS*/;

+		String unitName= partialMatch ? matchName.toLowerCase() : matchName + ".java"; //$NON-NLS-1$

 

 		for (int i= 0; i < length; i++) {

 			if (requestor.isCanceled())

diff --git a/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java b/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
index e79947f..ea97f45 100644
--- a/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
+++ b/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
@@ -25,7 +25,7 @@
 }

 public void acceptMethod(IMethod method) {

 	try {

-		if (!Signature.getReturnType(method.getSignature()).equals("V"/*nonNLS*/)) {

+		if (!Signature.getReturnType(method.getSignature()).equals("V")) { //$NON-NLS-1$

 			super.acceptMethod(method);

 		}

 	} catch (JavaModelException npe) {

diff --git a/model/org/eclipse/jdt/internal/core/Openable.java b/model/org/eclipse/jdt/internal/core/Openable.java
index cc6944b..a36fb8c 100644
--- a/model/org/eclipse/jdt/internal/core/Openable.java
+++ b/model/org/eclipse/jdt/internal/core/Openable.java
@@ -21,6 +21,7 @@
 import java.util.Enumeration;

 import java.util.Hashtable;

 import java.util.Locale;

+import java.util.Map;

 

 

 /**

@@ -95,7 +96,7 @@
  */

 protected void codeComplete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unitToSkip, int position, ICodeCompletionRequestor requestor) throws JavaModelException {

 	if (requestor == null) {

-		throw new IllegalArgumentException(Util.bind("codeAssist.nullRequestor"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("codeAssist.nullRequestor")); //$NON-NLS-1$

 	}

 	if (position < -1 || position > getBuffer().getLength()) {

 		throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));

@@ -103,7 +104,7 @@
 	SearchableEnvironment environment = (SearchableEnvironment) ((JavaProject) getJavaProject()).getSearchableNameEnvironment();

 	environment.unitToSkip = unitToSkip;

 

-	CompletionEngine engine = new CompletionEngine(environment, new CompletionRequestorWrapper(requestor), JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));

+	CompletionEngine engine = new CompletionEngine(environment, new CompletionRequestorWrapper(requestor), JavaModelManager.getOptions());

 	engine.complete(cu, position);

 	environment.unitToSkip = null;

 }

@@ -134,7 +135,7 @@
 	ISearchableNameEnvironment environment = ((JavaProject)getJavaProject()).getSearchableNameEnvironment();

 	

 	// fix for 1FVXGDK

-	SelectionEngine engine = new SelectionEngine(environment, requestor, JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));

+	SelectionEngine engine = new SelectionEngine(environment, requestor, JavaModelManager.getOptions());

 	engine.select(cu, offset, offset + length - 1);

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java b/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
index 2d49198..6f1cd78 100644
--- a/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
+++ b/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
@@ -212,7 +212,7 @@
 		forwardListLength++;

 		entry = entry._fNext;

 	}

-	System.out.println("Forward length: "/*nonNLS*/ + forwardListLength);

+	System.out.println("Forward length: " + forwardListLength); //$NON-NLS-1$

 	

 	int backwardListLength = 0;

 	entry = fEntryQueueTail;

@@ -220,7 +220,7 @@
 		backwardListLength++;

 		entry = entry._fPrevious;

 	}

-	System.out.println("Backward length: "/*nonNLS*/ + backwardListLength);

+	System.out.println("Backward length: " + backwardListLength); //$NON-NLS-1$

 

 	Enumeration keys = fEntryTable.keys();

 	java.util.Vector v = new java.util.Vector();

@@ -232,7 +232,7 @@
 			fCount = 1;

 		}

 		public String toString() {

-			return "Class: "/*nonNLS*/ + fClass + " has "/*nonNLS*/ + fCount + " entries."/*nonNLS*/;

+			return "Class: " + fClass + " has " + fCount + " entries."; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$

 		}

 	}

 	java.util.Hashtable h = new java.util.Hashtable();

@@ -369,7 +369,7 @@
 	if(newLoadFactor <= 1.0 && newLoadFactor > 0.0)

 		fLoadFactor = newLoadFactor;

 	else

-		throw new IllegalArgumentException(Util.bind("cache.invalidLoadFactor"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("cache.invalidLoadFactor")); //$NON-NLS-1$

 }

 	/**

 	 * Sets the maximum amount of space that the cache can store

@@ -397,7 +397,7 @@
  */

 public String toString() {

 	return 

-		"OverflowingLRUCache "/*nonNLS*/ + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +

+		"OverflowingLRUCache " + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$

 		this.toStringContents();

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/PackageDeclaration.java b/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
index c774187..c046e51 100644
--- a/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
+++ b/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
@@ -33,10 +33,10 @@
  * @private Debugging purposes

  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

-	buffer.append("package "/*nonNLS*/);

+	buffer.append("package "); //$NON-NLS-1$

 	buffer.append(getElementName());

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/PackageFragment.java b/model/org/eclipse/jdt/internal/core/PackageFragment.java
index 9ab3bb1..9cec2b6 100644
--- a/model/org/eclipse/jdt/internal/core/PackageFragment.java
+++ b/model/org/eclipse/jdt/internal/core/PackageFragment.java
@@ -45,9 +45,9 @@
 	int kind = getKind();

 	String extType;

 	if (kind == IPackageFragmentRoot.K_SOURCE) {

-		extType = "java"/*nonNLS*/;

+		extType = "java"; //$NON-NLS-1$

 	} else {

-		extType = "class"/*nonNLS*/;

+		extType = "class"; //$NON-NLS-1$

 	}

 	try {

 		IResource[] members = ((IContainer) resource).members();

@@ -89,7 +89,7 @@
  */

 public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] containers= new IJavaElement[] {container};

@@ -229,7 +229,7 @@
 	IJavaElement[] packages= ((IPackageFragmentRoot)getParent()).getChildren();

 	String name = getElementName();

 	int nameLength = name.length();

-	String packageName = isDefaultPackage() ? name : name+"."/*nonNLS*/;

+	String packageName = isDefaultPackage() ? name : name+"."; //$NON-NLS-1$

 	for (int i= 0; i < packages.length; i++) {

 		String otherName = packages[i].getElementName();

 		if (otherName.length() > nameLength && otherName.startsWith(packageName)) {

@@ -249,7 +249,7 @@
  */

 public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] containers= new IJavaElement[] {container};

@@ -280,7 +280,7 @@
  */

 public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] dests= new IJavaElement[] {this.getParent()};

@@ -300,15 +300,15 @@
  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (getElementName().length() == 0) {

-		buffer.append("[default]"/*nonNLS*/);

+		buffer.append("[default]"); //$NON-NLS-1$

 	} else {

 		buffer.append(getElementName());

 	}

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	} else {

 		if (tab > 0) {

-			buffer.append(" (...)"/*nonNLS*/);

+			buffer.append(" (...)"); //$NON-NLS-1$

 		}

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java b/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
index 6dc504d..d34c2cc 100644
--- a/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
+++ b/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
@@ -43,7 +43,7 @@
 			IResource child = members[i];

 			if (child.getType() != IResource.FOLDER) {

 				String extension = child.getProjectRelativePath().getFileExtension();

-				if (!"java"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {

+				if (!"java".equalsIgnoreCase(extension) && !"class".equalsIgnoreCase(extension)) { //$NON-NLS-1$ //$NON-NLS-2$

 					if (nonJavaResources.length == nonJavaResourcesCounter) {

 						// resize

 						System.arraycopy(

diff --git a/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java b/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
index 5de8071..4fd6366 100644
--- a/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
+++ b/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
@@ -55,7 +55,7 @@
 		// is actually the package fragment root)

 		if (fResource.getType() == IResource.FOLDER || fResource.getType() == IResource.PROJECT) {

 			Vector vChildren = new Vector(5);

-			computeFolderChildren((IContainer) fResource, ""/*nonNLS*/, vChildren);

+			computeFolderChildren((IContainer) fResource, "", vChildren); //$NON-NLS-1$

 			IJavaElement[] children = new IJavaElement[vChildren.size()];

 			vChildren.copyInto(children);

 			info.setChildren(children);

@@ -86,7 +86,7 @@
 				if (prefix.length() == 0) {

 					newPrefix = member.getName();

 				} else {

-					newPrefix = prefix + "."/*nonNLS*/ + member.getName();

+					newPrefix = prefix + "." + member.getName(); //$NON-NLS-1$

 				}

 				// eliminate binary output only if nested inside direct subfolders

 				if (!member.getFullPath().equals(outputLocationPath)) {

@@ -296,12 +296,12 @@
  */

 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (getElementName().length() == 0) {

-		buffer.append("[project root]"/*nonNLS*/);

+		buffer.append("[project root]"); //$NON-NLS-1$

 	} else {

 		buffer.append(getElementName());

 	}

 	if (info == null) {

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java b/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
index ff1c197..083ce1d 100644
--- a/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
+++ b/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
@@ -52,7 +52,7 @@
 			IResource member = members[i];

 			if (member.getType() == IResource.FILE) {

 				String extension = member.getProjectRelativePath().getFileExtension();

-				if (!"java"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {

+				if (!"java".equalsIgnoreCase(extension) && !"class".equalsIgnoreCase(extension)) { //$NON-NLS-1$ //$NON-NLS-2$

 					if (project.findPackageFragmentRoot(member.getFullPath()) == null) {

 						if (nonJavaResources.length == nonJavaResourcesCounter) {

 							// resize

diff --git a/model/org/eclipse/jdt/internal/core/Problem.java b/model/org/eclipse/jdt/internal/core/Problem.java
index cbcafc5..e7fed96 100644
--- a/model/org/eclipse/jdt/internal/core/Problem.java
+++ b/model/org/eclipse/jdt/internal/core/Problem.java
@@ -137,13 +137,13 @@
 public String toString() {

 

 

-	String s = "Pb("/*nonNLS*/ + (id & IgnoreCategoriesMask) + ") "/*nonNLS*/;

+	String s = "Pb(" + (id & IgnoreCategoriesMask) + ") "; //$NON-NLS-1$ //$NON-NLS-2$

 	if (message != null) {

 		s += message;

 	} else {

 		if (arguments != null)

 			for (int i = 0; i < arguments.length; i++)

-				s += " "/*nonNLS*/ + arguments[i];

+				s += " " + arguments[i]; //$NON-NLS-1$

 	}

 	return s;

 }

diff --git a/model/org/eclipse/jdt/internal/core/Region.java b/model/org/eclipse/jdt/internal/core/Region.java
index 15b66de..848fd31 100644
--- a/model/org/eclipse/jdt/internal/core/Region.java
+++ b/model/org/eclipse/jdt/internal/core/Region.java
@@ -137,7 +137,7 @@
 	for (int i= 0; i < roots.length; i++) {

 		buffer.append(roots[i].getElementName());

 		if (i < (roots.length - 1)) {

-			buffer.append(", "/*nonNLS*/);

+			buffer.append(", "); //$NON-NLS-1$

 		}

 	}

 	buffer.append(']');

diff --git a/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java b/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
index 50a35bf..b2f6e7d 100644
--- a/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
@@ -38,7 +38,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.renameElementProgress"/*nonNLS*/);

+	return Util.bind("operation.renameElementProgress"); //$NON-NLS-1$

 }

 /**

  * @see CopyElementsOperation#isRename()

diff --git a/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java b/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
index f26666b..d1dea29 100644
--- a/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
+++ b/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
@@ -34,7 +34,7 @@
  * @see MultiOperation

  */

 protected String getMainTaskName() {

-	return Util.bind("operation.renameResourceProgress"/*nonNLS*/);

+	return Util.bind("operation.renameResourceProgress"); //$NON-NLS-1$

 }

 /**

  * @see CopyResourceElementsOperation#isRename()

diff --git a/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java b/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
index 745ff1a..d69cbf5 100644
--- a/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
+++ b/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
@@ -6,282 +6,373 @@
  */

 import org.eclipse.core.runtime.*;

 import org.eclipse.core.resources.*;

+import org.eclipse.jdt.core.*;

 import org.eclipse.jdt.core.search.*;

+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;

 import org.eclipse.jdt.internal.compiler.env.*;

 import org.eclipse.jdt.internal.compiler.util.*;

 import org.eclipse.jdt.internal.codeassist.*;

-import org.eclipse.jdt.core.*;

-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;

+import org.eclipse.jdt.internal.core.SourceTypeElementInfo;;

 

 /**

  *	This class provides a <code>SearchableBuilderEnvironment</code> for code assist which

  *	uses the Java model as a search tool.  

  */

-

-public class SearchableEnvironment implements ISearchableNameEnvironment, IJavaSearchConstants {

+public class SearchableEnvironment

+	implements ISearchableNameEnvironment, IJavaSearchConstants {

 	protected NameLookup nameLookup;

 	protected ICompilationUnit unitToSkip;

 	public CompilationUnit unitToLookInside;

 

 	protected IJavaProject project;

-/**

- * Creates a SearchableEnvironment on the given project

- */

-public SearchableEnvironment(IJavaProject project) throws JavaModelException {

-	this.project = project;

-	this.nameLookup = (NameLookup)((JavaProject)project).getNameLookup();

-}

-/**

- * Returns the given type in the the given package if it exists,

- * otherwise <code>null</code>.

- */

-protected NameEnvironmentAnswer find(String typeName, String packageName) {

-	if (packageName == null)

-		packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;

-	IType type = this.nameLookup.findType(typeName, packageName, false, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

-	if (type == null) {

-		// look inside the compilation unit that is being searched currently

-		//for a non-public or inner type.

-		if (this.unitToLookInside != null) {

-			if (this.unitToLookInside.getParent().getElementName().equals(packageName)) {

-				try {

-					IType[] allTypes = this.unitToLookInside.getTypes();

-					for (int i= 0; i < allTypes.length; i++) {

-						if (allTypes[i].getElementName().equals(typeName)) {

-							type = allTypes[i];

-							break;

+

+	/**

+	 * Creates a SearchableEnvironment on the given project

+	 */

+	public SearchableEnvironment(IJavaProject project) throws JavaModelException {

+		this.project = project;

+		this.nameLookup = (NameLookup) ((JavaProject) project).getNameLookup();

+	}

+

+	/**

+	 * Returns the given type in the the given package if it exists,

+	 * otherwise <code>null</code>.

+	 */

+	protected NameEnvironmentAnswer find(String typeName, String packageName) {

+		if (packageName == null)

+			packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;

+		IType type =

+			this.nameLookup.findType(

+				typeName,

+				packageName,

+				false,

+				INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

+		if (type == null) {

+			// look inside the compilation unit that is being searched currently

+			//for a non-public or inner type.

+			if (this.unitToLookInside != null) {

+				if (this.unitToLookInside.getParent().getElementName().equals(packageName)) {

+					try {

+						IType[] allTypes = this.unitToLookInside.getTypes();

+						for (int i = 0; i < allTypes.length; i++) {

+							if (allTypes[i].getElementName().equals(typeName)) {

+								type = allTypes[i];

+								break;

+							}

 						}

+					} catch (JavaModelException e) {

 					}

-				} catch (JavaModelException e) {

 				}

 			}

 		}

-	}

-	if (type != null) {

-		if (type instanceof BinaryType) {

-			try {

-				return new NameEnvironmentAnswer((IBinaryType) ((BinaryType) type).getRawInfo());

-			} catch (JavaModelException npe) {

-				return null;

-			}

-		} else { //SourceType

-			try {

-				return new NameEnvironmentAnswer((ISourceType)((SourceType)type).getRawInfo());

-			} catch (JavaModelException npe) {

-				return null;

+		if (type != null) {

+			if (type instanceof BinaryType) {

+				try {

+					return new NameEnvironmentAnswer(

+						(IBinaryType) ((BinaryType) type).getRawInfo());

+				} catch (JavaModelException npe) {

+					return null;

+				}

+			} else { //SourceType

+				try {

+					// retrieve the requested type

+					SourceTypeElementInfo sourceType = (SourceTypeElementInfo)((SourceType)type).getRawInfo();

+					ISourceType topLevelType = sourceType;

+					while (topLevelType.getEnclosingType() != null) {

+						topLevelType = topLevelType.getEnclosingType();

+					}

+					// find all siblings (other types declared in same unit, since may be used for name resolution)

+					IType[] types = sourceType.getHandle().getCompilationUnit().getTypes();

+					ISourceType[] sourceTypes = new ISourceType[types.length];

+

+					// in the resulting collection, ensure the requested type is the first one

+					sourceTypes[0] = sourceType;

+					for (int i = 0, index = 1; i < types.length; i++) {

+						ISourceType otherType =

+							(ISourceType) ((JavaElement) types[i]).getRawInfo();

+						if (!otherType.equals(topLevelType))

+							sourceTypes[index++] = otherType;

+					}

+					return new NameEnvironmentAnswer(sourceTypes);

+				} catch (JavaModelException npe) {

+					return null;

+				}

 			}

 		}

-	}

-	return null;

-}

-/**

- * @see SearchableBuilderEnvironment

- */

-public void findPackages(char[] prefix, ISearchRequestor requestor) {

-	this.nameLookup.seekPackageFragments(new String(prefix), true, new SearchableEnvironmentRequestor(requestor));	

-}

-/**

- * @see INameEnvironment

- */

-public NameEnvironmentAnswer findType(char[][] compoundTypeName) {

-	if (compoundTypeName == null)

 		return null;

-	int length = compoundTypeName.length;

-	if (length == 1)

-		return find(new String(compoundTypeName[0]), null);

-	StringBuffer buffer = new StringBuffer(length * 6);

-	int lengthM1 = length - 1;

-	for(int i = 0; i < lengthM1; i++) {

-		buffer.append(compoundTypeName[i]);

-		if (i + 1 != lengthM1)

-			buffer.append('.');

 	}

-	String className = new String(compoundTypeName[lengthM1]);

-	return find(className, buffer.toString());

-}

-/**

- * @see INameEnvironment

- */

-public NameEnvironmentAnswer findType(char[] name, char[][] packages) {

-	if (name == null)

-		return null;

 

-	if (packages == null || packages.length == 0)

-		return find(new String(name), null);

-		

-	int length = packages.length;

-	StringBuffer buffer = new StringBuffer(length * 6);

-	for(int i = 0; i < length; i++) {

-		buffer.append(packages[i]);

-		if (i + 1 != length)

-			buffer.append('.');

+	/**

+	 * @see SearchableBuilderEnvironment

+	 */

+	public void findPackages(char[] prefix, ISearchRequestor requestor) {

+		this.nameLookup.seekPackageFragments(

+			new String(prefix),

+			true,

+			new SearchableEnvironmentRequestor(requestor));

 	}

-	String className = new String(name);

-	return find(className, buffer.toString());

-}

-/**

- * @see ISearchableNameEnvironment

- */

-public void findTypes(char[] prefix, final ISearchRequestor storage) {

 

-/*

-	if (true){

-		findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

-		return;		

+	/**

+	 * @see INameEnvironment

+	 */

+	public NameEnvironmentAnswer findType(char[][] compoundTypeName) {

+		if (compoundTypeName == null)

+			return null;

+		int length = compoundTypeName.length;

+		if (length == 1)

+			return find(new String(compoundTypeName[0]), null);

+		StringBuffer buffer = new StringBuffer(length * 6);

+		int lengthM1 = length - 1;

+		for (int i = 0; i < lengthM1; i++) {

+			buffer.append(compoundTypeName[i]);

+			if (i + 1 != lengthM1)

+				buffer.append('.');

+		}

+		String className = new String(compoundTypeName[lengthM1]);

+		return find(className, buffer.toString());

 	}

-*/	

-	try {

-		final String excludePath;

-		if (this.unitToSkip != null){

-			if (!(this.unitToSkip instanceof IJavaElement)){ // revert to model investigation

+

+	/**

+	 * @see INameEnvironment

+	 */

+	public NameEnvironmentAnswer findType(char[] name, char[][] packages) {

+		if (name == null)

+			return null;

+

+		if (packages == null || packages.length == 0)

+			return find(new String(name), null);

+

+		int length = packages.length;

+		StringBuffer buffer = new StringBuffer(length * 6);

+		for (int i = 0; i < length; i++) {

+			buffer.append(packages[i]);

+			if (i + 1 != length)

+				buffer.append('.');

+		}

+		String className = new String(name);

+		return find(className, buffer.toString());

+	}

+

+	/**

+	 * @see ISearchableNameEnvironment

+	 */

+	public void findTypes(char[] prefix, final ISearchRequestor storage) {

+

+		/*

+			if (true){

 				findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

 				return;		

 			}

-			excludePath = ((IJavaElement)this.unitToSkip).getUnderlyingResource().getFullPath().toString();

-		} else {

-			excludePath = null;

-		}

-		int lastDotIndex = CharOperation.lastIndexOf('.', prefix);

-		char[] qualification, simpleName;

-		if (lastDotIndex < 0){

-			qualification = null;

-			simpleName = CharOperation.toLowerCase(prefix);

-		} else {

-			qualification = CharOperation.subarray(prefix, 0, lastDotIndex);

-			simpleName = CharOperation.toLowerCase(CharOperation.subarray(prefix, lastDotIndex+1, prefix.length));

-		}

-		

-		SearchEngine searchEngine = new SearchEngine();

-

-		IProject projectRsc = (IProject) this.project.getUnderlyingResource();

-		IJavaSearchScope scope = searchEngine.createJavaSearchScope(new IResource[]{ projectRsc});

-

-		IProgressMonitor progressMonitor = new IProgressMonitor(){

-			boolean isCanceled = false;

-			public void beginTask(String name, int totalWork){}

-			public void done(){}

-			public void internalWorked(double work){}

-			public boolean isCanceled(){ return isCanceled; }

-			public void setCanceled(boolean value){ isCanceled = value; }

-			public void setTaskName(String name){}

-			public void subTask(String name){}

-			public void worked(int work){}

-		};

-		ITypeNameRequestor nameRequestor = new ITypeNameRequestor(){

-			public void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path){

-				if (excludePath != null && excludePath.equals(path)) return;	

-				if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return; // accept only top level types

-				storage.acceptClass(packageName, simpleTypeName, 0);

-			}

-			public void acceptInterface(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path){

-				if (excludePath != null && excludePath.equals(path)) return;	

-				if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return; // accept only top level types

-				storage.acceptInterface(packageName, simpleTypeName, 0);

-			}

-		};

+		*/

 		try {

-			searchEngine.searchAllTypeNames(

-				projectRsc.getWorkspace(),  

-				qualification, 

-				simpleName, 

-				PREFIX_MATCH, 

-				CASE_INSENSITIVE,

-				IJavaSearchConstants.TYPE,

-				scope,

-				nameRequestor,

-				CANCEL_IF_NOT_READY_TO_SEARCH,

-				progressMonitor);

-		} catch (OperationCanceledException e) {

-			findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

-		}

-	} catch(JavaModelException e){

-		findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

-	}

-}

-/**

- * Returns all types whose name starts with the given (qualified) <code>prefix</code>.

- *

- * If the <code>prefix</code> is unqualified, all types whose simple name matches

- * the <code>prefix</code> are returned.

- */

-private void findTypes(String prefix, ISearchRequestor storage, int type) {

-	SearchableEnvironmentRequestor requestor = new SearchableEnvironmentRequestor(storage, this.unitToSkip);

-	int index = prefix.lastIndexOf('.');

-	if (index == -1) {

-		this.nameLookup.seekTypes(prefix, null, true, type, requestor);

-	} else {

-		String packageName = prefix.substring(0, index);

-		String className = prefix.substring(index + 1);

-		JavaElementRequestor javaElementRequestor = new JavaElementRequestor();

-		this.nameLookup.seekPackageFragments(packageName, false, javaElementRequestor);

-		IPackageFragment[] packageFragments = javaElementRequestor.getPackageFragments();

-		if (packageFragments == null)

-			return;

-		for (int i = 0, packagesLength = packageFragments.length; i < packagesLength; i++) {

-			if (packageFragments[i] == null)

-				continue;

-			this.nameLookup.seekTypes(className, packageFragments[i], true, type, requestor);

-		}

-	}

-}

-/**

- * @see SearchableBuilderEnvironment

- */

-public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {

-	if (parentPackageName == null || parentPackageName.length == 0)

-		return isTopLevelPackage(subPackageName);

-	if (subPackageName == null)

-		return false;

-	int length = parentPackageName.length;

-	StringBuffer buffer = new StringBuffer((length + 1) * 6);

-	for(int i = 0; i < length; i++) {

-		if (parentPackageName[i] == null || isQualified(parentPackageName[i]))

-			return false;

-		buffer.append(parentPackageName[i]);

-		buffer.append('.');

-	}

-	if (isQualified(subPackageName)) {

-		return false;

-	}

-	buffer.append(subPackageName);

-	boolean result= this.nameLookup.findPackageFragments(buffer.toString(), false) != null;

-	return result;

-	

-}

-/**

- * Returns true if there are no '.' characters in the given name.

- */

-protected boolean isQualified(char[] name) {

-	if (name != null) {

-		return CharOperation.indexOf('.', name) > -1;

-	}

-	return false;

-}

-/**

- * @see SearchableBuilderEnvironment

- */

-public boolean isTopLevelPackage(char[] packageName) {

-	if (packageName == null)

-		return false;

-	boolean result= !isQualified(packageName)

-		&& this.nameLookup.findPackageFragments(new String(packageName), false) != null;

-	return result;

+			final String excludePath;

+			if (this.unitToSkip != null) {

+				if (!(this.unitToSkip instanceof IJavaElement)) {

+					// revert to model investigation

+					findTypes(

+						new String(prefix),

+						storage,

+						INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

+					return;

+				}

+				excludePath =

+					((IJavaElement) this.unitToSkip)

+						.getUnderlyingResource()

+						.getFullPath()

+						.toString();

+			} else {

+				excludePath = null;

+			}

+			int lastDotIndex = CharOperation.lastIndexOf('.', prefix);

+			char[] qualification, simpleName;

+			if (lastDotIndex < 0) {

+				qualification = null;

+				simpleName = CharOperation.toLowerCase(prefix);

+			} else {

+				qualification = CharOperation.subarray(prefix, 0, lastDotIndex);

+				simpleName =

+					CharOperation.toLowerCase(

+						CharOperation.subarray(prefix, lastDotIndex + 1, prefix.length));

+			}

 

-}

-/**

- * Returns a printable string for the array.

- */

-protected String toStringChar(char[] name) {

-	return "["/*nonNLS*/ + new String(name) + "]"/*nonNLS*/;

-}

-/**

- * Returns a printable string for the array.

- */

-protected String toStringCharChar(char[][] names) {

-	StringBuffer result= new StringBuffer();

-	for (int i= 0; i < names.length; i++) {

-		result.append(toStringChar(names[i]));

+			SearchEngine searchEngine = new SearchEngine();

+

+			IProject projectRsc = (IProject) this.project.getUnderlyingResource();

+			IJavaSearchScope scope =

+				searchEngine.createJavaSearchScope(new IResource[] { projectRsc });

+

+			IProgressMonitor progressMonitor = new IProgressMonitor() {

+				boolean isCanceled = false;

+				public void beginTask(String name, int totalWork) {

+				}

+				public void done() {

+				}

+				public void internalWorked(double work) {

+				}

+				public boolean isCanceled() {

+					return isCanceled;

+				}

+				public void setCanceled(boolean value) {

+					isCanceled = value;

+				}

+				public void setTaskName(String name) {

+				}

+				public void subTask(String name) {

+				}

+				public void worked(int work) {

+				}

+			};

+			ITypeNameRequestor nameRequestor = new ITypeNameRequestor() {

+				public void acceptClass(

+					char[] packageName,

+					char[] simpleTypeName,

+					char[][] enclosingTypeNames,

+					String path) {

+					if (excludePath != null && excludePath.equals(path))

+						return;

+					if (enclosingTypeNames != null && enclosingTypeNames.length > 0)

+						return; // accept only top level types

+					storage.acceptClass(packageName, simpleTypeName, IConstants.AccPublic);

+				}

+				public void acceptInterface(

+					char[] packageName,

+					char[] simpleTypeName,

+					char[][] enclosingTypeNames,

+					String path) {

+					if (excludePath != null && excludePath.equals(path))

+						return;

+					if (enclosingTypeNames != null && enclosingTypeNames.length > 0)

+						return; // accept only top level types

+					storage.acceptInterface(packageName, simpleTypeName, IConstants.AccPublic);

+				}

+			};

+			try {

+				searchEngine.searchAllTypeNames(

+					projectRsc.getWorkspace(),

+					qualification,

+					simpleName,

+					PREFIX_MATCH,

+					CASE_INSENSITIVE,

+					IJavaSearchConstants.TYPE,

+					scope,

+					nameRequestor,

+					CANCEL_IF_NOT_READY_TO_SEARCH,

+					progressMonitor);

+			} catch (OperationCanceledException e) {

+				findTypes(

+					new String(prefix),

+					storage,

+					INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

+			}

+		} catch (JavaModelException e) {

+			findTypes(

+				new String(prefix),

+				storage,

+				INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);

+		}

 	}

-	return result.toString();

-}

-}

+

+	/**

+	 * Returns all types whose name starts with the given (qualified) <code>prefix</code>.

+	 *

+	 * If the <code>prefix</code> is unqualified, all types whose simple name matches

+	 * the <code>prefix</code> are returned.

+	 */

+	private void findTypes(String prefix, ISearchRequestor storage, int type) {

+		SearchableEnvironmentRequestor requestor =

+			new SearchableEnvironmentRequestor(storage, this.unitToSkip);

+		int index = prefix.lastIndexOf('.');

+		if (index == -1) {

+			this.nameLookup.seekTypes(prefix, null, true, type, requestor);

+		} else {

+			String packageName = prefix.substring(0, index);

+			String className = prefix.substring(index + 1);

+			JavaElementRequestor javaElementRequestor = new JavaElementRequestor();

+			this.nameLookup.seekPackageFragments(packageName, false, javaElementRequestor);

+			IPackageFragment[] packageFragments =

+				javaElementRequestor.getPackageFragments();

+			if (packageFragments == null)

+				return;

+			for (int i = 0, packagesLength = packageFragments.length;

+				i < packagesLength;

+				i++) {

+				if (packageFragments[i] == null)

+					continue;

+				this.nameLookup.seekTypes(

+					className,

+					packageFragments[i],

+					true,

+					type,

+					requestor);

+			}

+		}

+	}

+

+	/**

+	 * @see SearchableBuilderEnvironment

+	 */

+	public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {

+		if (parentPackageName == null || parentPackageName.length == 0)

+			return isTopLevelPackage(subPackageName);

+		if (subPackageName == null)

+			return false;

+		int length = parentPackageName.length;

+		StringBuffer buffer = new StringBuffer((length + 1) * 6);

+		for (int i = 0; i < length; i++) {

+			if (parentPackageName[i] == null || isQualified(parentPackageName[i]))

+				return false;

+			buffer.append(parentPackageName[i]);

+			buffer.append('.');

+		}

+		if (isQualified(subPackageName)) {

+			return false;

+		}

+		buffer.append(subPackageName);

+		boolean result =

+			this.nameLookup.findPackageFragments(buffer.toString(), false) != null;

+		return result;

+

+	}

+

+	/**

+	 * Returns true if there are no '.' characters in the given name.

+	 */

+	protected boolean isQualified(char[] name) {

+		if (name != null) {

+			return CharOperation.indexOf('.', name) > -1;

+		}

+		return false;

+	}

+

+	/**

+	 * @see SearchableBuilderEnvironment

+	 */

+	public boolean isTopLevelPackage(char[] packageName) {

+		if (packageName == null)

+			return false;

+		boolean result =

+			!isQualified(packageName)

+				&& this.nameLookup.findPackageFragments(new String(packageName), false) != null;

+		return result;

+

+	}

+

+	/**

+	 * Returns a printable string for the array.

+	 */

+	protected String toStringChar(char[] name) {

+		return "["  //$NON-NLS-1$

+		+ new String(name) + "]" ; //$NON-NLS-1$

+	}

+

+	/**

+	 * Returns a printable string for the array.

+	 */

+	protected String toStringCharChar(char[][] names) {

+		StringBuffer result = new StringBuffer();

+		for (int i = 0; i < names.length; i++) {

+			result.append(toStringChar(names[i]));

+		}

+		return result.toString();

+	}

+}
\ No newline at end of file
diff --git a/model/org/eclipse/jdt/internal/core/SelectionRequestor.java b/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
index bc94fbc..cbbe942 100644
--- a/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
+++ b/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
@@ -60,7 +60,7 @@
 		for (int i= 0, max = parameterTypeNames.length; i < max; i++) {

 			String pkg = IPackageFragment.DEFAULT_PACKAGE_NAME;

 			if (parameterPackageNames[i] != null && parameterPackageNames[i].length > 0) {

-				pkg = new String(parameterPackageNames[i]) + "."/*nonNLS*/;

+				pkg = new String(parameterPackageNames[i]) + "."; //$NON-NLS-1$

 			}

 			parameterTypes[i]= Signature.createTypeSignature(

 				pkg + new String(parameterTypeNames[i]), true);

diff --git a/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java b/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
index a945598..2cd405c 100644
--- a/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
+++ b/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
@@ -57,7 +57,7 @@
  * Sets the classpath of the pre-specified project.

  */

 protected void executeOperation() throws JavaModelException {

-	beginTask(Util.bind("classpath.settingProgress"/*nonNLS*/), 2);

+	beginTask(Util.bind("classpath.settingProgress"), 2); //$NON-NLS-1$

 	JavaProject project= ((JavaProject) getElementsToProcess()[0]);

 	

 	project.setRawClasspath0(this.newRawPath);

@@ -164,9 +164,7 @@
 	if (!status.isOK()) {

 		return status;

 	}

-	IClasspathEntry[] classpath = this.newRawPath;

 	IJavaProject javaProject = (IJavaProject)getElementToProcess();

-	IPath projectPath= javaProject.getProject().getFullPath();

 

 	// retrieve output location

 	IPath outputLocation;

@@ -176,49 +174,7 @@
 		return e.getJavaModelStatus();

 	}

 

-	// check if any source entries coincidates with binary output - in which case nesting inside output is legal

-	boolean allowNestingInOutput = false;

-	boolean hasSource = false;

-	for (int i = 0 ; i < classpath.length; i++) {

-		if (classpath[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) hasSource = true;

-		if (classpath[i].getPath().equals(outputLocation)){

-			allowNestingInOutput = true;

-			break;

-		}

-	}

-	if (!hasSource) allowNestingInOutput = true; // if no source, then allowed

-	

-	// check all entries

-	for (int i = 0 ; i < classpath.length; i++) {

-		IClasspathEntry entry = classpath[i];

-		IPath entryPath = entry.getPath();

-

-		// no further check if entry coincidates with project or output location

-		if (entryPath.equals(projectPath)) continue;

-		if (entryPath.equals(outputLocation)) continue;

-		

-		// prevent nesting source entries in each other

-		if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){

-			for (int j = 0; j < classpath.length; j++){

-				IClasspathEntry otherEntry = classpath[j];

-				if (entry != otherEntry && otherEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE){

-					if (entryPath.isPrefixOf(otherEntry.getPath())){

-						return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);

-					}

-				}

-			}

-		}

-		// prevent nesting output location inside entry

-		if (entryPath.isPrefixOf(outputLocation)) {

-			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);

-		}

-

-		// prevent nesting entry inside output location - when distinct from project or a source folder

-		if (!allowNestingInOutput && outputLocation.isPrefixOf(entryPath)) {

-			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);

-		}

-	}

-	return JavaModelStatus.VERIFIED_OK;

+	return JavaConventions.validateClasspath(javaProject, this.newRawPath, outputLocation);

 }

 

 /**

diff --git a/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java b/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
index 3ea3048..591a6cf 100644
--- a/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
+++ b/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
@@ -85,7 +85,7 @@
 					IPath relativePath = f.getFullPath().removeFirstSegments(segments);

 					String name = relativePath.toOSString();

 					name = name.replace(File.pathSeparatorChar, '.');

-					if (name.endsWith("."/*nonNLS*/)) {

+					if (name.endsWith(".")) { //$NON-NLS-1$

 						name = name.substring(0, name.length() - 1);

 					}

 					IPackageFragment pkg = root.getPackageFragment(name);

@@ -104,7 +104,7 @@
  * a package fragment.

  */

 protected void executeOperation() throws JavaModelException {

-	beginTask(Util.bind("classpath.settingOutputLocationProgress"/*nonNLS*/), 2);

+	beginTask(Util.bind("classpath.settingOutputLocationProgress"), 2); //$NON-NLS-1$

 	JavaProject project= ((JavaProject) getElementsToProcess()[0]);

 	

 	IPath oldLocation= project.getOutputLocation();

@@ -166,27 +166,6 @@
 	if (!status.isOK()) {

 		return status;

 	}

-	if (fOutputLocation == null) {

-			return new JavaModelStatus(IJavaModelStatusConstants.NULL_PATH);

-	}

-	

-	if (fOutputLocation.isAbsolute()) {

-		IProject project = ((IJavaProject) fElementsToProcess[0]).getProject();

-

-		if (project.getFullPath().isPrefixOf(fOutputLocation)) {

-			//project relative path

-			String projectName = fOutputLocation.segment(0);

-			if (!projectName.equals(fElementsToProcess[0].getElementName())) {

-				//a workspace relative path outside of this project

-				return new JavaModelStatus(IJavaModelStatusConstants.PATH_OUTSIDE_PROJECT, fOutputLocation);

-			}

-		} else {

-			return new JavaModelStatus(IJavaModelStatusConstants.DEVICE_PATH, fOutputLocation);

-		}

-	} else {

-		return new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, fOutputLocation);

-	}

-

 	// retrieve classpath

 	IClasspathEntry[] classpath = null;

 	IJavaProject javaProject= (IJavaProject)getElementToProcess();

@@ -196,38 +175,6 @@
 	} catch (JavaModelException e) {

 		return e.getJavaModelStatus();

 	}

-

-	// check if any source entries coincidates with binary output - in which case nesting inside output is legal

-	boolean allowNestingInOutput = false;

-	boolean hasSource = false;

-	for (int i = 0 ; i < classpath.length; i++) {

-		if (classpath[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) hasSource = true;

-		if (classpath[i].getPath().equals(fOutputLocation)){

-			allowNestingInOutput = true;

-			break;

-		}

-	}

-	if (!hasSource) allowNestingInOutput = true; // if no source, then allowed

-

-	// check all entries

-	for (int i = 0 ; i < classpath.length; i++) {

-		IClasspathEntry entry = classpath[i];

-		IPath entryPath = entry.getPath();

-

-		// no further check if entry coincidates with project or output location

-		if (entryPath.equals(projectPath)) continue;

-		if (entryPath.equals(fOutputLocation)) continue;

-		

-		// prevent nesting output location inside entry

-		if (entryPath.isPrefixOf(fOutputLocation)) {

-			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, fOutputLocation);

-		}

-

-		// prevent nesting entry inside output location - when distinct from project or a source folder

-		if (!allowNestingInOutput && fOutputLocation.isPrefixOf(entryPath)) {

-			return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, fOutputLocation);

-		}

-	}

-	return JavaModelStatus.VERIFIED_OK;

+	return JavaConventions.validateClasspath((IJavaProject) fElementsToProcess[0], classpath, fOutputLocation);

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/SourceField.java b/model/org/eclipse/jdt/internal/core/SourceField.java
index 00d5b06..388b019 100644
--- a/model/org/eclipse/jdt/internal/core/SourceField.java
+++ b/model/org/eclipse/jdt/internal/core/SourceField.java
@@ -53,14 +53,14 @@
 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (info == null) {

 		buffer.append(getElementName());

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	} else {

 		try {

 			buffer.append(Signature.toString(this.getTypeSignature()));

-			buffer.append(" "/*nonNLS*/);

+			buffer.append(" "); //$NON-NLS-1$

 			buffer.append(this.getElementName());

 		} catch (JavaModelException e) {

-			buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());

+			buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$

 		}

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/SourceMapper.java b/model/org/eclipse/jdt/internal/core/SourceMapper.java
index ffeceb9..5272368 100644
--- a/model/org/eclipse/jdt/internal/core/SourceMapper.java
+++ b/model/org/eclipse/jdt/internal/core/SourceMapper.java
@@ -31,7 +31,9 @@
  * @see AttachSourceOperation

  * @see JarPackageFragment

  */

-public class SourceMapper extends ReferenceInfoAdapter implements ISourceElementRequestor {

+public class SourceMapper

+	extends ReferenceInfoAdapter

+	implements ISourceElementRequestor {

 

 	/**

 	 * The binary type source is being mapped for

@@ -70,7 +72,7 @@
 	/**

 	 * The unknown source range {-1, 0}

 	 */

-	protected static SourceRange fgUnknownRange= new SourceRange(-1, 0);

+	protected static SourceRange fgUnknownRange = new SourceRange(-1, 0);

 

 	/**

 	 * The position within the source of the start of the

@@ -96,420 +98,602 @@
 	protected IJavaElement searchedElement;

 

 	/**

+	 * imports references

+	 */

+	private Hashtable importsTable;

+	private Hashtable importsCounterTable;

+

+	/**

 	 * Enclosing type information

 	 */

-	 IType[] types;

-	 int[] typeDeclarationStarts;

-	 SourceRange[] typeNameRanges;

-	 int typeDepth;

-/**

- * Creates a <code>SourceMapper</code> that locates source in the zip file

- * at the given location in the specified package fragment root.

- */

-public SourceMapper(IPath zipPath, String rootPath, JavaModel model) {

-	fZipPath= zipPath;

-	fRootPath= rootPath.replace('\\', '/');

-	if (fRootPath.endsWith("/"/*nonNLS*/)) {

-		fRootPath = fRootPath.substring(0, fRootPath.lastIndexOf('/'));

+	IType[] types;

+	int[] typeDeclarationStarts;

+	SourceRange[] typeNameRanges;

+	int typeDepth;

+	/**

+	 * Creates a <code>SourceMapper</code> that locates source in the zip file

+	 * at the given location in the specified package fragment root.

+	 */

+	public SourceMapper(IPath zipPath, String rootPath, JavaModel model) {

+		fZipPath = zipPath;

+		fRootPath = rootPath.replace('\\', '/');

+		if (fRootPath.endsWith("/" )) { //$NON-NLS-1$

+			fRootPath = fRootPath.substring(0, fRootPath.lastIndexOf('/'));

+		}

+		fJavaModel = model;

+		fSourceRanges = new Hashtable();

+		importsTable = new Hashtable();

+		importsCounterTable = new Hashtable();

 	}

-	fJavaModel= model;

-	fSourceRanges= new Hashtable();

-}

-/**

- * @see ISourceElementRequestor

- */

-public void acceptImport(int declarationStart, int declarationEnd, char[] name, boolean onDemand) {

-	//do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void acceptInitializer(int modifiers, int declarationSourceStart, int declarationSourceEnd) {

-	//do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void acceptLineSeparatorPositions(int[] positions) {

-	//do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {

-	//do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void acceptProblem(IProblem problem) {

-	//do nothing

-}

-/**

- * Closes this <code>SourceMapper</code>'s zip file. Once this is done, this

- * <code>SourceMapper</code> cannot be used again.

- */

-public void close() throws JavaModelException {

-	fSourceRanges= null;

-}

-/**

- * Converts these type names to signatures.

- * @see Signature.

- */

-public String[] convertTypeNamesToSigs(char[][] typeNames) {

-	if (typeNames == null)

-		return fgEmptyStringArray;

-	int n = typeNames.length;

-	if (n == 0)

-		return fgEmptyStringArray;

-	String[] typeSigs = new String[n];

-	for (int i = 0; i < n; ++i) {

-		typeSigs[i] = Signature.createTypeSignature(typeNames[i], false);

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void acceptImport(

+		int declarationStart,

+		int declarationEnd,

+		char[] name,

+		boolean onDemand) {

+		char[][] imports = (char[][]) this.importsTable.get(fType);

+		int importsCounter;

+		if (imports == null) {

+			imports = new char[5][];

+			importsCounter = 0;

+		} else {

+			importsCounter = ((Integer) this.importsCounterTable.get(fType)).intValue();

+		}

+		if (imports.length == importsCounter) {

+			System.arraycopy(

+				imports,

+				0,

+				(imports = new char[importsCounter * 2][]),

+				0,

+				importsCounter);

+		}

+		imports[importsCounter++] = name;

+		this.importsTable.put(fType, imports);

+		this.importsCounterTable.put(fType, new Integer(importsCounter));

 	}

-	return typeSigs;

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterClass(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[] superclass, char[][] superinterfaces) {

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void acceptInitializer(

+		int modifiers,

+		int declarationSourceStart,

+		int declarationSourceEnd) {

+		//do nothing

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void acceptLineSeparatorPositions(int[] positions) {

+		//do nothing

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void acceptPackage(

+		int declarationStart,

+		int declarationEnd,

+		char[] name) {

+		//do nothing

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void acceptProblem(IProblem problem) {

+		//do nothing

+	}

+	

+	/**

+	 * Closes this <code>SourceMapper</code>'s zip file. Once this is done, this

+	 * <code>SourceMapper</code> cannot be used again.

+	 */

+	public void close() throws JavaModelException {

+		fSourceRanges = null;

+	}

+	

+	/**

+	 * Converts these type names to signatures.

+	 * @see Signature.

+	 */

+	public String[] convertTypeNamesToSigs(char[][] typeNames) {

+		if (typeNames == null)

+			return fgEmptyStringArray;

+		int n = typeNames.length;

+		if (n == 0)

+			return fgEmptyStringArray;

+		String[] typeSigs = new String[n];

+		for (int i = 0; i < n; ++i) {

+			typeSigs[i] = Signature.createTypeSignature(typeNames[i], false);

+		}

+		return typeSigs;

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterClass(

+		int declarationStart,

+		int modifiers,

+		char[] name,

+		int nameSourceStart,

+		int nameSourceEnd,

+		char[] superclass,

+		char[][] superinterfaces) {

 

-	this.typeDepth++;

-	if (this.typeDepth == this.types.length){ // need to grow

-		System.arraycopy(this.types, 0, this.types = new IType[this.typeDepth*2], 0, this.typeDepth);

-		System.arraycopy(this.typeNameRanges, 0, this.typeNameRanges = new SourceRange[this.typeDepth*2], 0, this.typeDepth);

-		System.arraycopy(this.typeDeclarationStarts, 0, this.typeDeclarationStarts = new int[this.typeDepth*2], 0, this.typeDepth);

+		this.typeDepth++;

+		if (this.typeDepth == this.types.length) { // need to grow

+			System.arraycopy(

+				this.types,

+				0,

+				this.types = new IType[this.typeDepth * 2],

+				0,

+				this.typeDepth);

+			System.arraycopy(

+				this.typeNameRanges,

+				0,

+				this.typeNameRanges = new SourceRange[this.typeDepth * 2],

+				0,

+				this.typeDepth);

+			System.arraycopy(

+				this.typeDeclarationStarts,

+				0,

+				this.typeDeclarationStarts = new int[this.typeDepth * 2],

+				0,

+				this.typeDepth);

+		}

+		this.types[typeDepth] = this.getType(new String(name));

+		this.typeNameRanges[typeDepth] =

+			new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

+		this.typeDeclarationStarts[typeDepth] = declarationStart;

 	}

-	this.types[typeDepth] = this.getType(new String(name));

-	this.typeNameRanges[typeDepth] = new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

-	this.typeDeclarationStarts[typeDepth] = declarationStart;

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterCompilationUnit() {

-	// do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterConstructor(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {

-	enterMethod(declarationStart, modifiers, null, name, nameSourceStart, nameSourceEnd, parameterTypes, parameterNames, exceptionTypes);

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterField(int declarationStart, int modifiers, char[] type, char[] name, int nameSourceStart, int nameSourceEnd) {

-	if (typeDepth >= 0 && fMemberDeclarationStart == -1) { // don't allow nested member (can only happen with anonymous inner classes)

-		fMemberDeclarationStart= declarationStart;

-		fMemberNameRange= new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

-		fMemberName= new String(name);

-	} 

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterInterface(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] superinterfaces) {

-	enterClass(declarationStart, modifiers, name, nameSourceStart, nameSourceEnd, null, superinterfaces);

-}

-/**

- * @see ISourceElementRequestor

- */

-public void enterMethod(int declarationStart, int modifiers, char[] returnType, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {

-	if (typeDepth >= 0 && fMemberDeclarationStart == -1) { // don't allow nested member (can only happen with anonymous inner classes)

-		fMemberName= new String(name);

-		fMemberNameRange= new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

-		fMemberDeclarationStart= declarationStart;

-		fMethodParameterTypes= parameterTypes;

-	} 

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitClass(int declarationEnd) {

-	if (typeDepth >= 0) {

-		IType currentType = this.types[typeDepth];

-		setSourceRange(

-			currentType, 

-			new SourceRange(

-				this.typeDeclarationStarts[typeDepth] , 

-				declarationEnd - this.typeDeclarationStarts[typeDepth]  + 1), 

-			this.typeNameRanges[typeDepth]);

-		this.typeDepth--;

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterCompilationUnit() {

+		// do nothing

 	}

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitCompilationUnit(int declarationEnd) {

-	//do nothing

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitConstructor(int declarationEnd) {

-	exitMethod(declarationEnd);

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitField(int declarationEnd) {

-	if (typeDepth >= 0 && fMemberDeclarationStart != -1) {

-		IType currentType = this.types[typeDepth];

-		setSourceRange(currentType.getField(fMemberName), new SourceRange(fMemberDeclarationStart, declarationEnd - fMemberDeclarationStart + 1), fMemberNameRange);

-		fMemberDeclarationStart = -1;

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterConstructor(

+		int declarationStart,

+		int modifiers,

+		char[] name,

+		int nameSourceStart,

+		int nameSourceEnd,

+		char[][] parameterTypes,

+		char[][] parameterNames,

+		char[][] exceptionTypes) {

+		enterMethod(

+			declarationStart,

+			modifiers,

+			null,

+			name,

+			nameSourceStart,

+			nameSourceEnd,

+			parameterTypes,

+			parameterNames,

+			exceptionTypes);

 	}

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitInterface(int declarationEnd) {

-	exitClass(declarationEnd);

-}

-/**

- * @see ISourceElementRequestor

- */

-public void exitMethod(int declarationEnd) {

-	if (typeDepth >= 0 && fMemberDeclarationStart != -1) {

-		IType currentType = this.types[typeDepth];

-		SourceRange sourceRange= new SourceRange(fMemberDeclarationStart, declarationEnd - fMemberDeclarationStart + 1);

-		setSourceRange(currentType.getMethod(fMemberName, convertTypeNamesToSigs(fMethodParameterTypes)), sourceRange, fMemberNameRange);

-		fMemberDeclarationStart = -1;

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterField(

+		int declarationStart,

+		int modifiers,

+		char[] type,

+		char[] name,

+		int nameSourceStart,

+		int nameSourceEnd) {

+		if (typeDepth >= 0

+			&& fMemberDeclarationStart == -1) {

+			// don't allow nested member (can only happen with anonymous inner classes)

+			fMemberDeclarationStart = declarationStart;

+			fMemberNameRange =

+				new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

+			fMemberName = new String(name);

+		}

 	}

-}

-/**

- * Locates and returns source code for the given (binary) type, in this

- * SourceMapper's ZIP file, or returns <code>null</code> if source

- * code cannot be found.

- */

-public char[] findSource(IType type) {

-	if (!type.isBinary()) {

-		return null;

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterInterface(

+		int declarationStart,

+		int modifiers,

+		char[] name,

+		int nameSourceStart,

+		int nameSourceEnd,

+		char[][] superinterfaces) {

+		enterClass(

+			declarationStart,

+			modifiers,

+			name,

+			nameSourceStart,

+			nameSourceEnd,

+			null,

+			superinterfaces);

 	}

-	BinaryType parent= (BinaryType)type.getDeclaringType();

-	BinaryType declType= (BinaryType)type;

-	while (parent != null) {

-		declType= parent;

-		parent= (BinaryType)declType.getDeclaringType();

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void enterMethod(

+		int declarationStart,

+		int modifiers,

+		char[] returnType,

+		char[] name,

+		int nameSourceStart,

+		int nameSourceEnd,

+		char[][] parameterTypes,

+		char[][] parameterNames,

+		char[][] exceptionTypes) {

+		if (typeDepth >= 0

+			&& fMemberDeclarationStart == -1) {

+			// don't allow nested member (can only happen with anonymous inner classes)

+			fMemberName = new String(name);

+			fMemberNameRange =

+				new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);

+			fMemberDeclarationStart = declarationStart;

+			fMethodParameterTypes = parameterTypes;

+		}

 	}

-	IBinaryType info= null;

-	try {

-	 info= (IBinaryType)declType.getRawInfo();

-	} catch (JavaModelException e) {

-		return null;

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitClass(int declarationEnd) {

+		if (typeDepth >= 0) {

+			IType currentType = this.types[typeDepth];

+			setSourceRange(

+				currentType,

+				new SourceRange(

+					this.typeDeclarationStarts[typeDepth],

+					declarationEnd - this.typeDeclarationStarts[typeDepth] + 1),

+				this.typeNameRanges[typeDepth]);

+			this.typeDepth--;

+		}

 	}

-	return this.findSource(type, info);

-}

-/**

- * Locates and returns source code for the given (binary) type, in this

- * SourceMapper's ZIP file, or returns <code>null</code> if source

- * code cannot be found.

- */

-public char[] findSource(IType type, IBinaryType info) {

-	String name = null;

-	// see 1FVVWZT

-	if (info instanceof ClassFileReader) {

-		char[] sourceFileName = ((ClassFileReader) info).sourceFileName();

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitCompilationUnit(int declarationEnd) {

+		//do nothing

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitConstructor(int declarationEnd) {

+		exitMethod(declarationEnd);

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitField(int declarationEnd) {

+		if (typeDepth >= 0 && fMemberDeclarationStart != -1) {

+			IType currentType = this.types[typeDepth];

+			setSourceRange(

+				currentType.getField(fMemberName),

+				new SourceRange(

+					fMemberDeclarationStart,

+					declarationEnd - fMemberDeclarationStart + 1),

+				fMemberNameRange);

+			fMemberDeclarationStart = -1;

+		}

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitInterface(int declarationEnd) {

+		exitClass(declarationEnd);

+	}

+	

+	/**

+	 * @see ISourceElementRequestor

+	 */

+	public void exitMethod(int declarationEnd) {

+		if (typeDepth >= 0 && fMemberDeclarationStart != -1) {

+			IType currentType = this.types[typeDepth];

+			SourceRange sourceRange =

+				new SourceRange(

+					fMemberDeclarationStart,

+					declarationEnd - fMemberDeclarationStart + 1);

+			setSourceRange(

+				currentType.getMethod(

+					fMemberName,

+					convertTypeNamesToSigs(fMethodParameterTypes)),

+				sourceRange,

+				fMemberNameRange);

+			fMemberDeclarationStart = -1;

+		}

+	}

+	

+	/**

+	 * Locates and returns source code for the given (binary) type, in this

+	 * SourceMapper's ZIP file, or returns <code>null</code> if source

+	 * code cannot be found.

+	 */

+	public char[] findSource(IType type) {

+		if (!type.isBinary()) {

+			return null;

+		}

+		BinaryType parent = (BinaryType) type.getDeclaringType();

+		BinaryType declType = (BinaryType) type;

+		while (parent != null) {

+			declType = parent;

+			parent = (BinaryType) declType.getDeclaringType();

+		}

+		IBinaryType info = null;

+		try {

+			info = (IBinaryType) declType.getRawInfo();

+		} catch (JavaModelException e) {

+			return null;

+		}

+		return this.findSource(type, info);

+	}

+	

+	/**

+	 * Locates and returns source code for the given (binary) type, in this

+	 * SourceMapper's ZIP file, or returns <code>null</code> if source

+	 * code cannot be found.

+	 */

+	public char[] findSource(IType type, IBinaryType info) {

+		char[] sourceFileName = info.sourceFileName();

 		if (sourceFileName == null)

 			return null; // no source file attribute

-		name = new String(sourceFileName);

-	} else {

-		return null;

-	}

+		String name = new String(sourceFileName);

 

-	IPackageFragment pkgFrag = type.getPackageFragment();

-	if (!pkgFrag.isDefaultPackage()) {

-		String pkg= type.getPackageFragment().getElementName().replace('.', '/');

-		name= pkg + '/' + name;

-	}

-	// try to get the entry

-	ZipEntry entry= null;

-	ZipFile zip = null;

-	char[] source= null;

-	try {

-		String fullName;

-		//add the root path if specified

-		if (!fRootPath.equals(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH)) {

-			fullName= fRootPath + '/' + name;

-		} else {

-			fullName= name;

+		IPackageFragment pkgFrag = type.getPackageFragment();

+		if (!pkgFrag.isDefaultPackage()) {

+			String pkg = type.getPackageFragment().getElementName().replace('.', '/');

+			name = pkg + '/' + name;

 		}

-		zip = getZip();

-		entry= zip.getEntry(fullName);

-		if (entry != null) {

-			// now read the source code

-			byte[] bytes= readEntry(zip, entry);

-			if (bytes != null) {

+		// try to get the entry

+		ZipEntry entry = null;

+		ZipFile zip = null;

+		char[] source = null;

+		try {

+			String fullName;

+			//add the root path if specified

+			if (!fRootPath.equals(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH)) {

+				fullName = fRootPath + '/' + name;

+			} else {

+				fullName = name;

+			}

+			zip = getZip();

+			entry = zip.getEntry(fullName);

+			if (entry != null) {

+				// now read the source code

+				byte[] bytes = readEntry(zip, entry);

+				if (bytes != null) {

+					try {

+						source = BufferManager.bytesToChar(bytes);

+					} catch (JavaModelException e) {

+						source = null;

+					}

+				}

+			}

+		} catch (CoreException e) {

+			return null;

+		} finally {

+			if (zip != null) {

 				try {

-					source= BufferManager.bytesToChar(bytes);

-				} catch (JavaModelException e) {

-					source= null;

+					zip.close();

+				} catch (IOException e) {

 				}

 			}

 		}

-	} catch (CoreException e) {

-		return null;

-	} finally {

-		if (zip != null) {

-			try {

-				zip.close();

-			} catch(IOException e) {}

+		return source;

+	}

+	

+	/**

+	 * Returns the SourceRange for the name of the given element, or

+	 * {-1, -1} if no source range is known for the name of the element.

+	 */

+	public SourceRange getNameRange(IJavaElement element) {

+		if (element.getElementType() == IJavaElement.METHOD

+			&& ((IMember) element).isBinary()) {

+			element = getUnqualifiedMethodHandle((IMethod) element);

 		}

-	}

-	return source;

-}

-/**

- * Returns the SourceRange for the name of the given element, or

- * {-1, -1} if no source range is known for the name of the element.

- */

-public SourceRange getNameRange(IJavaElement element) {

-	if (element.getElementType() == IJavaElement.METHOD && ((IMember)element).isBinary()) {

-		element= getUnqualifiedMethodHandle((IMethod)element);

-	}

-	SourceRange[] ranges= (SourceRange[])fSourceRanges.get(element);

-	if (ranges == null) {

-		return fgUnknownRange;

-	} else {

-		return ranges[1];

-	}

-}

-/**

- * Returns the <code>SourceRange</code> for the given element, or

- * {-1, -1} if no source range is known for the element.

- */

-public SourceRange getSourceRange(IJavaElement element) {

-	if (element.getElementType() == IJavaElement.METHOD && ((IMember)element).isBinary()) {

-		element= getUnqualifiedMethodHandle((IMethod)element);

-	}

-	SourceRange[] ranges= (SourceRange[])fSourceRanges.get(element);

-	if (ranges == null) {

-		return fgUnknownRange;

-	} else {

-		return ranges[0];

-	}

-}

-/**

- * Returns the type with the given <code>typeName</code>.  Returns inner classes

- * as well.

- */

-protected IType getType(String typeName) {

-	if (fType.getElementName().equals(typeName))

-		return fType;

-	else

-		return fType.getType(typeName);

-}

-/**

- * Creates a handle that has parameter types that are not

- * fully qualified so that the correct source is found.

- */

-protected IJavaElement getUnqualifiedMethodHandle(IMethod method) {

-

-	String[] qualifiedParameterTypes = method.getParameterTypes();

-	String[] unqualifiedParameterTypes = new String[qualifiedParameterTypes.length];

-	for (int i = 0; i < qualifiedParameterTypes.length; i++) {

-		StringBuffer unqualifiedName= new StringBuffer();

-		String qualifiedName= qualifiedParameterTypes[i];

-		int count = 0;

-		while (qualifiedName.charAt(count) == Signature.C_ARRAY) {

-			unqualifiedName.append(Signature.C_ARRAY);

-			++count;

-		}

-		if (qualifiedName.charAt(count) == Signature.C_RESOLVED) {

-			unqualifiedName.append(Signature.C_UNRESOLVED);

-			unqualifiedName.append(Signature.getSimpleName(qualifiedName));

+		SourceRange[] ranges = (SourceRange[]) fSourceRanges.get(element);

+		if (ranges == null) {

+			return fgUnknownRange;

 		} else {

-			unqualifiedName.append(qualifiedName.substring(count, qualifiedName.length()));

+			return ranges[1];

 		}

-		unqualifiedParameterTypes[i]= unqualifiedName.toString();

 	}

-	return ((IType) method.getParent()).getMethod(method.getElementName(), unqualifiedParameterTypes);

-}

-/**

- * Returns the <code>ZipFile</code> that source is located in.

- */

-public ZipFile getZip() throws CoreException {

-	return fJavaModel.fgJavaModelManager.getZipFile(fZipPath);

-}

-/**

- * Maps the given source code to the given binary type and its children.

- */

-public void mapSource(IType type, char[] contents) {

-	this.mapSource(type, contents, null);

-}

-/**

- * Maps the given source code to the given binary type and its children.

- * If a non-null java element is passed, finds the name range for the 

- * given java element without storing it.

- */

-public ISourceRange mapSource(IType type, char[] contents, IJavaElement searchedElement) {

-	fType= (BinaryType)type;

-

-	this.searchedElement = searchedElement;

-	this.types = new IType[1];

-	this.typeDeclarationStarts = new int[1];

-	this.typeNameRanges = new SourceRange[1];

-	this.typeDepth = -1;

-

-	Hashtable oldSourceRanges = (Hashtable)fSourceRanges.clone();

-	try {

-		IProblemFactory factory= new DefaultProblemFactory();

-		SourceElementParser parser = new SourceElementParser(this, factory);

-		parser.parseCompilationUnit(new BasicCompilationUnit(contents, type.getElementName() + ".java"/*nonNLS*/), false);

-		if (searchedElement != null) {

-			ISourceRange range = this.getNameRange(searchedElement);

-			return range;

+	

+	/**

+	 * Returns the <code>SourceRange</code> for the given element, or

+	 * {-1, -1} if no source range is known for the element.

+	 */

+	public SourceRange getSourceRange(IJavaElement element) {

+		if (element.getElementType() == IJavaElement.METHOD

+			&& ((IMember) element).isBinary()) {

+			element = getUnqualifiedMethodHandle((IMethod) element);

+		}

+		SourceRange[] ranges = (SourceRange[]) fSourceRanges.get(element);

+		if (ranges == null) {

+			return fgUnknownRange;

 		} else {

-			return null;

+			return ranges[0];

 		}

-	} finally {

-		if (searchedElement != null) {

-			fSourceRanges = oldSourceRanges;

+	}

+	

+	/**

+	 * Returns the type with the given <code>typeName</code>.  Returns inner classes

+	 * as well.

+	 */

+	protected IType getType(String typeName) {

+		if (fType.getElementName().equals(typeName))

+			return fType;

+		else

+			return fType.getType(typeName);

+	}

+	

+	/**

+	 * Creates a handle that has parameter types that are not

+	 * fully qualified so that the correct source is found.

+	 */

+	protected IJavaElement getUnqualifiedMethodHandle(IMethod method) {

+

+		String[] qualifiedParameterTypes = method.getParameterTypes();

+		String[] unqualifiedParameterTypes = new String[qualifiedParameterTypes.length];

+		for (int i = 0; i < qualifiedParameterTypes.length; i++) {

+			StringBuffer unqualifiedName = new StringBuffer();

+			String qualifiedName = qualifiedParameterTypes[i];

+			int count = 0;

+			while (qualifiedName.charAt(count) == Signature.C_ARRAY) {

+				unqualifiedName.append(Signature.C_ARRAY);

+				++count;

+			}

+			if (qualifiedName.charAt(count) == Signature.C_RESOLVED) {

+				unqualifiedName.append(Signature.C_UNRESOLVED);

+				unqualifiedName.append(Signature.getSimpleName(qualifiedName));

+			} else {

+				unqualifiedName.append(qualifiedName.substring(count, qualifiedName.length()));

+			}

+			unqualifiedParameterTypes[i] = unqualifiedName.toString();

 		}

-		fType= null;

-		this.searchedElement = null;

-		this.types = null;

-		this.typeDeclarationStarts = null;

-		this.typeNameRanges = null;

+		return ((IType) method.getParent()).getMethod(

+			method.getElementName(),

+			unqualifiedParameterTypes);

+	}

+	

+	/**

+	 * Returns the <code>ZipFile</code> that source is located in.

+	 */

+	public ZipFile getZip() throws CoreException {

+		return fJavaModel.fgJavaModelManager.getZipFile(fZipPath);

+	}

+	

+	/**

+	 * Maps the given source code to the given binary type and its children.

+	 */

+	public void mapSource(IType type, char[] contents) {

+		this.mapSource(type, contents, null);

+	}

+	

+	/**

+	 * Maps the given source code to the given binary type and its children.

+	 * If a non-null java element is passed, finds the name range for the 

+	 * given java element without storing it.

+	 */

+	public ISourceRange mapSource(

+		IType type,

+		char[] contents,

+		IJavaElement searchedElement) {

+		fType = (BinaryType) type;

+

+		this.importsTable.remove(fType);

+		this.importsCounterTable.remove(fType);

+		this.searchedElement = searchedElement;

+		this.types = new IType[1];

+		this.typeDeclarationStarts = new int[1];

+		this.typeNameRanges = new SourceRange[1];

 		this.typeDepth = -1;

-	}

-}

-/**

- * Returns the contents of the specified zip entry

- */

-protected byte[] readEntry(ZipFile zip, ZipEntry entry) {

-	InputStream stream = null;

-	try {

-		stream = zip.getInputStream(entry);

-		int remaining = (int) entry.getSize();

-		byte[] bytes = new byte[remaining];

-		int offset = 0;

-		while (remaining > 0) {

-			int read = stream.read(bytes, offset, remaining);

-			if (read == -1)

-				break;

-			remaining -= read;

-			offset += read;

+

+		Hashtable oldSourceRanges = (Hashtable) fSourceRanges.clone();

+		try {

+			IProblemFactory factory = new DefaultProblemFactory();

+			SourceElementParser parser = new SourceElementParser(this, factory);

+			parser.parseCompilationUnit(

+				new BasicCompilationUnit(contents, type.getElementName() + ".java" ), //$NON-NLS-1$

+				false);

+			if (searchedElement != null) {

+				ISourceRange range = this.getNameRange(searchedElement);

+				return range;

+			} else {

+				return null;

+			}

+		} finally {

+			if (searchedElement != null) {

+				fSourceRanges = oldSourceRanges;

+			}

+			fType = null;

+			this.searchedElement = null;

+			this.types = null;

+			this.typeDeclarationStarts = null;

+			this.typeNameRanges = null;

+			this.typeDepth = -1;

 		}

-		return bytes;

-	} catch (IOException e) {

-		return null;

-	} catch (ArrayIndexOutOfBoundsException e) {

-		return null;

-	} finally {

-		if (stream != null) {

-			try {

-				stream.close();

-			} catch (IOException ioe) {

+	}

+	

+	/**

+	 * Returns the contents of the specified zip entry

+	 */

+	protected byte[] readEntry(ZipFile zip, ZipEntry entry) {

+		InputStream stream = null;

+		try {

+			stream = zip.getInputStream(entry);

+			int remaining = (int) entry.getSize();

+			byte[] bytes = new byte[remaining];

+			int offset = 0;

+			while (remaining > 0) {

+				int read = stream.read(bytes, offset, remaining);

+				if (read == -1)

+					break;

+				remaining -= read;

+				offset += read;

+			}

+			return bytes;

+		} catch (IOException e) {

+			return null;

+		} catch (ArrayIndexOutOfBoundsException e) {

+			return null;

+		} finally {

+			if (stream != null) {

+				try {

+					stream.close();

+				} catch (IOException ioe) {

+				}

 			}

 		}

 	}

-}

-/** 

- * Sets the mapping for this element to its source ranges for its source range

- * and name range.

- *

- * @see fSourceRanges

- */

-protected void setSourceRange(IJavaElement element, SourceRange sourceRange, SourceRange nameRange) {

-	fSourceRanges.put(element, new SourceRange[] {sourceRange, nameRange});

-}

-}

+	

+	/** 

+	 * Sets the mapping for this element to its source ranges for its source range

+	 * and name range.

+	 *

+	 * @see fSourceRanges

+	 */

+	protected void setSourceRange(

+		IJavaElement element,

+		SourceRange sourceRange,

+		SourceRange nameRange) {

+		fSourceRanges.put(element, new SourceRange[] { sourceRange, nameRange });

+	}

+

+	/**

+	 * Return a char[][] array containing the imports of the attached source for the fType binary

+	 */

+	public char[][] getImports(BinaryType type) {

+		char[][] imports = (char[][]) this.importsTable.get(type);

+		if (imports != null) {

+			int importsCounter = ((Integer) this.importsCounterTable.get(type)).intValue();

+			if (imports.length != importsCounter) {

+				System.arraycopy(

+					imports,

+					0,

+					(imports = new char[importsCounter][]),

+					0,

+					importsCounter);

+			}

+		}

+		this.importsTable.put(type, imports);

+		return imports;

+	}

+}
\ No newline at end of file
diff --git a/model/org/eclipse/jdt/internal/core/SourceMethod.java b/model/org/eclipse/jdt/internal/core/SourceMethod.java
index e522c94..d8cad20 100644
--- a/model/org/eclipse/jdt/internal/core/SourceMethod.java
+++ b/model/org/eclipse/jdt/internal/core/SourceMethod.java
@@ -145,7 +145,7 @@
 		for (int i = 0; i < length; i++) {

 			buffer.append(Signature.toString(parameterTypes[i]));

 			if (i < length - 1) {

-				buffer.append(", "/*nonNLS*/);

+				buffer.append(", "); //$NON-NLS-1$

 			}

 		}

 	}

@@ -192,11 +192,11 @@
 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (info == null) {

 		buffer.append(getElementName());

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	} else {

 		try {

 			if (Flags.isStatic(this.getFlags())) {

-				buffer.append("static "/*nonNLS*/);

+				buffer.append("static "); //$NON-NLS-1$

 			}

 			if (!this.isConstructor()) {

 				buffer.append(Signature.toString(this.getReturnType()));

@@ -210,13 +210,13 @@
 				for (int i = 0; i < length; i++) {

 					buffer.append(Signature.toString(parameterTypes[i]));

 					if (i < length - 1) {

-						buffer.append(", "/*nonNLS*/);

+						buffer.append(", "); //$NON-NLS-1$

 					}

 				}

 			}

 			buffer.append(')');

 		} catch (JavaModelException e) {

-			buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());

+			buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$

 		}

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/SourceRange.java b/model/org/eclipse/jdt/internal/core/SourceRange.java
index e0aa405..22ad270 100644
--- a/model/org/eclipse/jdt/internal/core/SourceRange.java
+++ b/model/org/eclipse/jdt/internal/core/SourceRange.java
@@ -33,11 +33,11 @@
 }

 public String toString() {

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("[offset="/*nonNLS*/);

+	buffer.append("[offset="); //$NON-NLS-1$

 	buffer.append(this.offset);

-	buffer.append(", length="/*nonNLS*/);

+	buffer.append(", length="); //$NON-NLS-1$

 	buffer.append(this.length);

-	buffer.append("]"/*nonNLS*/);

+	buffer.append("]"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/SourceRefElement.java b/model/org/eclipse/jdt/internal/core/SourceRefElement.java
index c0f0f42..c1ee0d5 100644
--- a/model/org/eclipse/jdt/internal/core/SourceRefElement.java
+++ b/model/org/eclipse/jdt/internal/core/SourceRefElement.java
@@ -23,7 +23,7 @@
  */

 public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] containers= new IJavaElement[] {container};

@@ -104,7 +104,7 @@
  */

 public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (container == null) {

-		throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] containers= new IJavaElement[] {container};

@@ -163,7 +163,7 @@
  */

 public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	}

 	IJavaElement[] elements= new IJavaElement[] {this};

 	IJavaElement[] dests= new IJavaElement[] {this.getParent()};

diff --git a/model/org/eclipse/jdt/internal/core/SourceType.java b/model/org/eclipse/jdt/internal/core/SourceType.java
index 3fffc3f..e94abc9 100644
--- a/model/org/eclipse/jdt/internal/core/SourceType.java
+++ b/model/org/eclipse/jdt/internal/core/SourceType.java
@@ -263,7 +263,7 @@
  */

 public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {

 	if (project == null) {

-		throw new IllegalArgumentException(Util.bind("hierarchy.nullProject"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("hierarchy.nullProject")); //$NON-NLS-1$

 	}

 	

 	CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(

@@ -306,7 +306,7 @@
 	}

 	TypeResolveRequestor requestor = new TypeResolveRequestor();

 	SelectionEngine engine = 

-		new SelectionEngine(environment, requestor, JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));

+		new SelectionEngine(environment, requestor, JavaModelManager.getOptions());

 		

 	engine.selectType(info, typeName.toCharArray());

 	return requestor.answers;

@@ -317,17 +317,17 @@
 protected void toStringInfo(int tab, StringBuffer buffer, Object info) {

 	if (info == null) {

 		buffer.append(this.getElementName());

-		buffer.append(" (not open)"/*nonNLS*/);

+		buffer.append(" (not open)"); //$NON-NLS-1$

 	} else {

 		try {

 			if (this.isInterface()) {

-				buffer.append("interface "/*nonNLS*/);

+				buffer.append("interface "); //$NON-NLS-1$

 			} else {

-				buffer.append("class "/*nonNLS*/);

+				buffer.append("class "); //$NON-NLS-1$

 			}

 			buffer.append(this.getElementName());

 		} catch (JavaModelException e) {

-			buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());

+			buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$

 		}

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/TypeVector.java b/model/org/eclipse/jdt/internal/core/TypeVector.java
index 11c3657..bc8facf 100644
--- a/model/org/eclipse/jdt/internal/core/TypeVector.java
+++ b/model/org/eclipse/jdt/internal/core/TypeVector.java
@@ -89,12 +89,12 @@
 	size = 0;

 }

 public String toString() {

-	StringBuffer buffer = new StringBuffer("["/*nonNLS*/);

+	StringBuffer buffer = new StringBuffer("["); //$NON-NLS-1$

 	for (int i = 0; i < size; i++) {

-		buffer.append("\n"/*nonNLS*/);

+		buffer.append("\n"); //$NON-NLS-1$

 		buffer.append(elements[i]);

 	}

-	buffer.append("\n]"/*nonNLS*/);

+	buffer.append("\n]"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/Util.java b/model/org/eclipse/jdt/internal/core/Util.java
index a4e32ac..3c65b31 100644
--- a/model/org/eclipse/jdt/internal/core/Util.java
+++ b/model/org/eclipse/jdt/internal/core/Util.java
@@ -42,16 +42,16 @@
 

 	/* Bundle containing messages */

 	protected static ResourceBundle bundle;

-	private final static String bundleName = "org.eclipse.jdt.internal.core.messages"/*nonNLS*/;

+	private final static String bundleName = "org.eclipse.jdt.internal.core.messages"; //$NON-NLS-1$

 

-	public final static char[] SUFFIX_class = ".class"/*nonNLS*/.toCharArray();

-	public final static char[] SUFFIX_CLASS = ".CLASS"/*nonNLS*/.toCharArray();

-	public final static char[] SUFFIX_java = ".java"/*nonNLS*/.toCharArray();

-	public final static char[] SUFFIX_JAVA = ".JAVA"/*nonNLS*/.toCharArray();

+	public final static char[] SUFFIX_class = ".class".toCharArray(); //$NON-NLS-1$

+	public final static char[] SUFFIX_CLASS = ".CLASS".toCharArray(); //$NON-NLS-1$

+	public final static char[] SUFFIX_java = ".java".toCharArray(); //$NON-NLS-1$

+	public final static char[] SUFFIX_JAVA = ".JAVA".toCharArray(); //$NON-NLS-1$

 

 	static {

-		String ver = System.getProperty("java.version"/*nonNLS*/);

-		JDK1_1 = ((ver != null) && ver.startsWith("1.1"/*nonNLS*/));

+		String ver = System.getProperty("java.version"); //$NON-NLS-1$

+		JDK1_1 = ((ver != null) && ver.startsWith("1.1")); //$NON-NLS-1$

 		relocalize();

 	}	

 	/**

@@ -155,8 +155,8 @@
 	 * @see concat(String, String)

 	 */

 	public static String concat(String s1, char c, String s2) {

-		if (s1 == null) s1 = "null"/*nonNLS*/;

-		if (s2 == null) s2 = "null"/*nonNLS*/;

+		if (s1 == null) s1 = "null"; //$NON-NLS-1$

+		if (s2 == null) s2 = "null"; //$NON-NLS-1$

 		int l1 = s1.length();

 		int l2 = s2.length();

 		char[] buf = new char[l1 + 1 + l2];

@@ -176,8 +176,8 @@
 	 * String constructor copies its argument, but there's no way around this.

 	 */

 	public static String concat(String s1, String s2) {

-		if (s1 == null) s1 = "null"/*nonNLS*/;

-		if (s2 == null) s2 = "null"/*nonNLS*/;

+		if (s1 == null) s1 = "null"; //$NON-NLS-1$

+		if (s2 == null) s2 = "null"; //$NON-NLS-1$

 		int l1 = s1.length();

 		int l2 = s2.length();

 		char[] buf = new char[l1 + l2];

@@ -190,9 +190,9 @@
 	 * @see concat(String, String)

 	 */

 	public static String concat(String s1, String s2, String s3) {

-		if (s1 == null) s1 = "null"/*nonNLS*/;

-		if (s2 == null) s2 = "null"/*nonNLS*/;

-		if (s3 == null) s3 = "null"/*nonNLS*/;

+		if (s1 == null) s1 = "null"; //$NON-NLS-1$

+		if (s2 == null) s2 = "null"; //$NON-NLS-1$

+		if (s3 == null) s3 = "null"; //$NON-NLS-1$

 		int l1 = s1.length();

 		int l2 = s2.length();

 		int l3 = s3.length();

@@ -772,14 +772,14 @@
  */

 public static String bind(String id, String[] bindings) {

 	if (id == null)

-		return "No message available"/*nonNLS*/;

+		return "No message available"; //$NON-NLS-1$

 	String message = null;

 	try {

 		message = bundle.getString(id);

 	} catch (MissingResourceException e) {

 		// If we got an exception looking for the message, fail gracefully by just returning

 		// the id we were looking for.  In most cases this is semi-informative so is not too bad.

-		return "Missing message: "/*nonNLS*/ + id + " in: "/*nonNLS*/ + bundleName;

+		return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	if (bindings == null)

 		return message;

@@ -798,7 +798,7 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);

+					output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$

 				}

 			} else {

 				output.append(message.substring(end, length));

diff --git a/model/org/eclipse/jdt/internal/core/WorkingCopy.java b/model/org/eclipse/jdt/internal/core/WorkingCopy.java
index d2dde90..a3e0388 100644
--- a/model/org/eclipse/jdt/internal/core/WorkingCopy.java
+++ b/model/org/eclipse/jdt/internal/core/WorkingCopy.java
@@ -306,7 +306,7 @@
  */

 protected void toString(int tab, StringBuffer buffer) {

 	buffer.append(this.tabString(tab));

-	buffer.append("(working copy)\n"/*nonNLS*/);

+	buffer.append("(working copy)\n"); //$NON-NLS-1$

 	super.toString(tab, buffer);

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java b/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
index 4810cf9..e2d57f3 100644
--- a/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
+++ b/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
@@ -340,15 +340,15 @@
 	public String toString () {

 		StringBuffer buffer = new StringBuffer();

 		

-		buffer.append("DeltaKey("/*nonNLS*/);

+		buffer.append("DeltaKey("); //$NON-NLS-1$

 			

 		for (int i = 0; i < this.fLocalNames.length; i++) {

 			buffer.append(this.fLocalNames[i]);

 			if (i < this.fLocalNames.length - 1) {

-				buffer.append("/"/*nonNLS*/);

+				buffer.append("/"); //$NON-NLS-1$

 			}

 		}

-		buffer.append(")"/*nonNLS*/);

+		buffer.append(")"); //$NON-NLS-1$

 

 		return buffer.toString();

 	}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
index 3440f64..657031b 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
@@ -24,7 +24,7 @@
 	String computeSignature(String name, IType[] parameterTypes) {

 

 		if (parameterTypes.length == 0) {

-			return name + "()"/*nonNLS*/;

+			return name + "()"; //$NON-NLS-1$

 		}

 		

 		StringBuffer sb = new StringBuffer(name);

@@ -33,7 +33,7 @@
 			try {

 				((TypeImpl)parameterTypes[i]).appendSignature(sb, true);

 			} catch (ClassCastException e) {

-				throw new StateSpecificException("Incompatible parameter types"/*nonNLS*/);

+				throw new StateSpecificException("Incompatible parameter types"); //$NON-NLS-1$

 			}

 		}

 		sb.append(')');

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
index b6c4016..59418a2 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
@@ -41,6 +41,6 @@
  */

 public String toString() {

 	// don't use + with char[]

-	return new StringBuffer("AbstractMethodCollaboratorIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();

+	return new StringBuffer("AbstractMethodCollaboratorIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
index bb54ba7..4d61463 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
@@ -119,7 +119,7 @@
 		/* add the dependent */

 		fDependents[min] = nodeThatDependsOnMe;

 } catch (ArrayIndexOutOfBoundsException e) {

-	System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()"/*nonNLS*/);

+	System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()"); //$NON-NLS-1$

 }

 	}

 	/**

@@ -148,28 +148,28 @@
  * For debugging only. 

  */

 public void dump(Dumper dumper) {

-	dumper.dump("element"/*nonNLS*/, getElement());

+	dumper.dump("element", getElement()); //$NON-NLS-1$

 	if (getKind() == JCU_NODE) 

-		dumper.dump("types"/*nonNLS*/, getTypes());

+		dumper.dump("types", getTypes()); //$NON-NLS-1$

 		

 	Object[] dependencies = new Object[fDependencies.length];

 	for (int i = 0; i < fDependencies.length; ++i) {

 		dependencies[i] = fDependencies[i].getElement();

 	}

-	dumper.dump("dependencies"/*nonNLS*/, dependencies);

+	dumper.dump("dependencies", dependencies); //$NON-NLS-1$

 		

 	Object[] dependents = new Object[fNumDependents];

 	for (int i = 0; i < fDependents.length; ++i) {

 		dependents[i] = fDependents[i].getElement();

 	}

-	dumper.dump("dependents"/*nonNLS*/, dependents);

+	dumper.dump("dependents", dependents); //$NON-NLS-1$

 	

 }

 	/**

 	 * Make sure equality tests are never carried out on nodes

 	 */

 	public boolean equals(Object o) {

-		Assert.isTrue(false, "Internal Error - Equality not defined for dependency graph nodes"/*nonNLS*/);

+		Assert.isTrue(false, "Internal Error - Equality not defined for dependency graph nodes"); //$NON-NLS-1$

 		return false;

 	}

 	/**

@@ -338,7 +338,7 @@
 		for (int i = 0; i < recursionLevel; ++i)

 			sb.append(' ');

 		sb.append(this);

-		sb.append(": "/*nonNLS*/);

+		sb.append(": "); //$NON-NLS-1$

 		sb.append(refCount);

 		System.out.println(sb.toString());

 	}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
index ac15d5b..12c57b2 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
@@ -96,7 +96,7 @@
 public String getName() {

 	String name = fElementType.getName();

 	for (int i = 0; i < fNestingDepth; i++)

-		name += "[]"/*nonNLS*/;

+		name += "[]"; //$NON-NLS-1$

 	return name;

 }

 /**

@@ -111,7 +111,7 @@
 public String getSimpleName() {

 	String simpleName = fElementType.getSimpleName();

 	for (int i = 0; i < fNestingDepth; i++)

-		simpleName += "[]"/*nonNLS*/;

+		simpleName += "[]"; //$NON-NLS-1$

 	return simpleName;

 }

 /**

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java b/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
index 453d8b1..4b6e2c2 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
@@ -39,7 +39,6 @@
  */

 protected BatchImageBuilder(StateImpl state, ConfigurableOption[] options) {

 	fDC = (JavaDevelopmentContextImpl) state.getDevelopmentContext();

-	state.setCompilerOptions(options);

 	fCompilerOptions = options;

 	fNewState = state;

 	fWorkQueue = new WorkQueue();

@@ -54,15 +53,15 @@
 	fNotifier.begin();

 	try {

 		fNewState.readClassPath();

-		fNotifier.subTask(Util.bind("build.scrubbingOutput"/*nonNLS*/));

+		fNotifier.subTask(Util.bind("build.scrubbingOutput")); //$NON-NLS-1$

 		fNewState.getBinaryOutput().scrubOutput();

 		fNotifier.updateProgressDelta(0.05f);

-		fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));

+		fNotifier.subTask(Util.bind("build.analyzingPackages")); //$NON-NLS-1$

 		fNewState.buildInitialPackageMap();

 		fNotifier.updateProgressDelta(0.05f);

 

 		/* Force build all in build context */

-		fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));

+		fNotifier.subTask(Util.bind("build.analyzingSources")); //$NON-NLS-1$

 		IPackage[] pkgs = fNewState.getPackageMap().getAllPackagesAsArray();

 		for (int i = 0; i < pkgs.length; ++i) {

 			fNotifier.checkCancel();

@@ -105,13 +104,13 @@
 public void lazyBuild(PackageElement unit) {

 	//		String msg = "Attempt to lazy build " + unit.getPackage().getName() + "." + unit.getFileName();

 	//		System.err.println(msg + ". " + "Lazy building has been disabled.");

-	Assert.isTrue(false, "Internal Error - Lazy building has been disabled"/*nonNLS*/);

+	Assert.isTrue(false, "Internal Error - Lazy building has been disabled"); //$NON-NLS-1$

 }

 /**

  * Returns a string describe the builder

  * @see IImageBuilder

  */

 public String toString() {

-	return "batch image builder for:\n\tnew state: "/*nonNLS*/ + getNewState();

+	return "batch image builder for:\n\tnew state: " + getNewState(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java b/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
index fb4f4c9..1e84777 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
@@ -46,10 +46,10 @@
 }

 public void begin() {

 	if (fBuildMonitor != null) {

-		fBuildMonitor.beginBuild(fIsBatch ? Util.bind("build.beginBatch"/*nonNLS*/) : Util.bind("build.beginIncremental"/*nonNLS*/));

+		fBuildMonitor.beginBuild(fIsBatch ? Util.bind("build.beginBatch") : Util.bind("build.beginIncremental")); //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	if (fProgress != null) {

-		fProgress.beginTask(""/*nonNLS*/, fTotalWork);

+		fProgress.beginTask("", fTotalWork); //$NON-NLS-1$

 	}

 	this.previousSubtask = null;

 }

@@ -90,9 +90,9 @@
 	int start = message.indexOf('/', 1);

 	int end = message.lastIndexOf('/');

 	if (end <= start){

-		message = Util.bind("build.compiling"/*nonNLS*/, message.substring(start+1));

+		message = Util.bind("build.compiling", message.substring(start+1)); //$NON-NLS-1$

 	} else {

-		message = Util.bind("build.compilingContent"/*nonNLS*/, message.substring(start+1, end));

+		message = Util.bind("build.compilingContent", message.substring(start+1, end)); //$NON-NLS-1$

 	}

 	subTask(message);

 	updateProgressDelta(fProgressPerCompilationUnit/2);

@@ -100,12 +100,12 @@
 }

 public void done() {

 	updateProgress(1.0f);

-	subTask(Util.bind("build.done"/*nonNLS*/));

+	subTask(Util.bind("build.done")); //$NON-NLS-1$

 	if (fProgress != null) {

 		fProgress.done();

 	}

 	if (fBuildMonitor != null) {

-		fBuildMonitor.endBuild(fIsBatch ? Util.bind("build.endBatch"/*nonNLS*/) : Util.bind("build.endIncremental"/*nonNLS*/));

+		fBuildMonitor.endBuild(fIsBatch ? Util.bind("build.endBatch") : Util.bind("build.endIncremental")); //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	this.previousSubtask = null;

 }

@@ -154,16 +154,16 @@
 	int numNew = fNewErrorCount + fNewWarningCount;

 	int numFixed = fFixedErrorCount + fFixedWarningCount;

 	if (numNew == 0 && numFixed == 0) {

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	}

 	if (numFixed == 0) {

-		return '(' + numNew == 1 ? Util.bind("build.oneProblemFound"/*nonNLS*/, String.valueOf(numNew)) : Util.bind("build.problemsFound"/*nonNLS*/, String.valueOf(numNew)) +')';

+		return '(' + numNew == 1 ? Util.bind("build.oneProblemFound", String.valueOf(numNew)) : Util.bind("build.problemsFound", String.valueOf(numNew)) +')'; //$NON-NLS-2$ //$NON-NLS-1$

 	} else

 		if (numNew == 0) {

-			return '(' + numFixed == 1 ? Util.bind("build.oneProblemFixed"/*nonNLS*/, String.valueOf(numFixed)) : Util.bind("build.problemsFixed"/*nonNLS*/, String.valueOf(numFixed)) + ')';

+			return '(' + numFixed == 1 ? Util.bind("build.oneProblemFixed", String.valueOf(numFixed)) : Util.bind("build.problemsFixed", String.valueOf(numFixed)) + ')'; //$NON-NLS-2$ //$NON-NLS-1$

 		} else {

-			return '(' + (numFixed == 1 ? Util.bind("build.oneProblemFixed"/*nonNLS*/, String.valueOf(numFixed)) : Util.bind("build.problemsFixed"/*nonNLS*/, String.valueOf(numFixed)))

-					+ (numNew == 1 ? Util.bind("build.oneProblemFound"/*nonNLS*/, String.valueOf(numNew)) : Util.bind("build.problemsFound"/*nonNLS*/, String.valueOf(numNew))) + ')';

+			return '(' + (numFixed == 1 ? Util.bind("build.oneProblemFixed", String.valueOf(numFixed)) : Util.bind("build.problemsFixed", String.valueOf(numFixed))) //$NON-NLS-2$ //$NON-NLS-1$

+					+ (numNew == 1 ? Util.bind("build.oneProblemFound", String.valueOf(numNew)) : Util.bind("build.problemsFound", String.valueOf(numNew))) + ')'; //$NON-NLS-2$ //$NON-NLS-1$

 		}

 }

 /**

@@ -183,7 +183,7 @@
 }

 public void subTask(String message) {

 	String pm = problemsMessage();

-	String msg = pm.length() == 0 ? message : pm + " "/*nonNLS*/ + message;

+	String msg = pm.length() == 0 ? message : pm + " " + message; //$NON-NLS-1$

 

 	if (msg.equals(this.previousSubtask)) return; // avoid refreshing with same one

 	if (DEBUG) System.out.println(msg);

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java b/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
index 6f5d52f..d4dadea 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
@@ -206,7 +206,7 @@
 public String getDeclaredName() throws NotPresentException {

 

 	if (isAnonymous()) {

-		return ""/*nonNLS*/;

+		return ""; //$NON-NLS-1$

 	}

 

 	String name = fHandle.getSimpleName();

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java b/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
index 37a5509..a56bd4a 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
@@ -64,6 +64,6 @@
 }

 	public String toString() {

 		// don't use append(char[]) due to JDK1.2 problems

-		return new StringBuffer("CompilationUnit("/*nonNLS*/).append(getFileName()).append(")"/*nonNLS*/).toString();

+		return new StringBuffer("CompilationUnit(").append(getFileName()).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
index 260240a..fe2ac0b 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
@@ -9,7 +9,7 @@
 public class ConstructorImpl extends AbstractMemberHandle implements IConstructor {

 	ConstructorImpl (ClassOrInterfaceHandleImpl owner, IType[] paramTypes) {

 		fOwner = owner;

-		fSignature = computeSignature(""/*nonNLS*/, paramTypes);

+		fSignature = computeSignature("", paramTypes); //$NON-NLS-1$

 	}

 	public ConstructorImpl(ClassOrInterfaceHandleImpl owner, String signature) {

 		fOwner = owner;

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java b/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
index d023e60..e2afe9c 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
@@ -38,6 +38,6 @@
 		return fTypes;

 	}

 	public String toString() {

-		return (fProblems.length == 0 ? ""/*nonNLS*/ : "*"/*nonNLS*/) + "ConvertedCompilationResult("/*nonNLS*/ + fPackageElement + ")"/*nonNLS*/;

+		return (fProblems.length == 0 ? "" : "*") + "ConvertedCompilationResult(" + fPackageElement + ")"; //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-4$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
index 5407ba1..7d0040a 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
@@ -28,17 +28,17 @@
 	protected IImageContext fContext;

 

 	/* names for checklist items */

-	public static final String fgImage = "Image"/*nonNLS*/;

+	public static final String fgImage = "Image"; //$NON-NLS-1$

 	

-	public static final String fgPackageCategory = "Packages"/*nonNLS*/;

-	public static final String fgTypeCategory = "Types"/*nonNLS*/;

-	public static final String fgBinaryCategory = "Binaries"/*nonNLS*/;

-	public static final String fgMethodCategory = "Methods"/*nonNLS*/;

+	public static final String fgPackageCategory = "Packages"; //$NON-NLS-1$

+	public static final String fgTypeCategory = "Types"; //$NON-NLS-1$

+	public static final String fgBinaryCategory = "Binaries"; //$NON-NLS-1$

+	public static final String fgMethodCategory = "Methods"; //$NON-NLS-1$

 

-	public static final String fgPackage = "Package"/*nonNLS*/;

-	public static final String fgType = "Type"/*nonNLS*/;

-	public static final String fgBinary = "Binary"/*nonNLS*/;

-	public static final String fgMethod = "Method"/*nonNLS*/;

+	public static final String fgPackage = "Package"; //$NON-NLS-1$

+	public static final String fgType = "Type"; //$NON-NLS-1$

+	public static final String fgBinary = "Binary"; //$NON-NLS-1$

+	public static final String fgMethod = "Method"; //$NON-NLS-1$

 

 	/* convenience structure for delta calculation process */

 	class DeltaInfo {

@@ -99,7 +99,7 @@
 			fNewState = (StateImpl)newState;

 			fOldState = (StateImpl)oldState;

 		} catch (ClassCastException cce) {

-			Assert.isTrue(false, "Internal Error - Invalid states"/*nonNLS*/);

+			Assert.isTrue(false, "Internal Error - Invalid states"); //$NON-NLS-1$

 		}

 		fStatus = CHANGED;

 		fName = fgImage;

@@ -200,7 +200,7 @@
 	 */

 	public int compareTo(IDelta anotherDelta) {

 		/* is this used? */

-		Assert.isTrue(false, "TBD"/*nonNLS*/);

+		Assert.isTrue(false, "TBD"); //$NON-NLS-1$

 		return 0;

 	}

 /**

@@ -606,7 +606,7 @@
 	}

 	protected static void dump(IDelta delta, int depth) {

 		for (int i = 0; i < depth; ++i)

-			System.out.print("  "/*nonNLS*/);

+			System.out.print("  "); //$NON-NLS-1$

 		System.out.println(delta);

 		IDelta[] children = delta.getAffectedSubdeltas();

 		for (int i = 0; i < children.length; ++i) {

@@ -893,23 +893,23 @@
 	 * @return java.lang.String

 	 */

 	public String toString() {

-		StringBuffer sb = new StringBuffer("DeltaImpl("/*nonNLS*/);

+		StringBuffer sb = new StringBuffer("DeltaImpl("); //$NON-NLS-1$

 		switch (fStatus) {

-			case ADDED: sb.append("+"/*nonNLS*/);

+			case ADDED: sb.append("+"); //$NON-NLS-1$

 			break;

-			case REMOVED: sb.append("-"/*nonNLS*/);

+			case REMOVED: sb.append("-"); //$NON-NLS-1$

 			break;

-			case CHANGED: sb.append("*"/*nonNLS*/);

+			case CHANGED: sb.append("*"); //$NON-NLS-1$

 			break;

-			case SAME: sb.append("="/*nonNLS*/);

+			case SAME: sb.append("="); //$NON-NLS-1$

 			break;

-			case UNKNOWN: sb.append("?"/*nonNLS*/);

+			case UNKNOWN: sb.append("?"); //$NON-NLS-1$

 			break;

-			default: sb.append("(ERROR)"/*nonNLS*/);

+			default: sb.append("(ERROR)"); //$NON-NLS-1$

 		}

 		if (fKey.isRoot()) {

 			sb.append(fOldState);

-			sb.append("-->"/*nonNLS*/);

+			sb.append("-->"); //$NON-NLS-1$

 			sb.append(fNewState);

 		}

 		else {

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java b/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
index feeaac1..2ffce7b 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
@@ -106,7 +106,7 @@
 		}

 		catch (CloneNotSupportedException e) {

 			// Should not happen since we implement Cloneable

-			Assert.isTrue(false, "Unexpected clone exception in DependencyGraph.clone()"/*nonNLS*/);

+			Assert.isTrue(false, "Unexpected clone exception in DependencyGraph.clone()"); //$NON-NLS-1$

 			return null;

 		}

 	}

@@ -186,7 +186,7 @@
 				value = fZips.remove(((ZipNode)toRemove).getZipFile());

 				break;

 			default:

-				Assert.isTrue(false, "Attempt to delete unknown node type from dependency graph"/*nonNLS*/);

+				Assert.isTrue(false, "Attempt to delete unknown node type from dependency graph"); //$NON-NLS-1$

 		}

 		return (INode)value;

 	}

@@ -194,7 +194,7 @@
  * For debugging only. Dump the graph in readable form.

  */

 public void dump(Dumper dumper) {

-	dumper.dumpMessage("Namespaces"/*nonNLS*/, ""/*nonNLS*/);

+	dumper.dumpMessage("Namespaces", ""); //$NON-NLS-2$ //$NON-NLS-1$

 	dumper.indent();

 	for (Enumeration e = fNamespaces.elements(); e.hasMoreElements();) {

 		AbstractNode node = (AbstractNode) e.nextElement();

@@ -202,7 +202,7 @@
 	}

 	dumper.outdent();

 

-	dumper.dumpMessage("JCUs"/*nonNLS*/, ""/*nonNLS*/);

+	dumper.dumpMessage("JCUs", ""); //$NON-NLS-2$ //$NON-NLS-1$

 	dumper.indent();

 	for (Enumeration e = fCompilationUnits.elements(); e.hasMoreElements();) {

 		AbstractNode node = (AbstractNode) e.nextElement();

@@ -210,7 +210,7 @@
 	}

 	dumper.outdent();

 

-	dumper.dumpMessage("ZIPs"/*nonNLS*/, ""/*nonNLS*/);

+	dumper.dumpMessage("ZIPs", ""); //$NON-NLS-2$ //$NON-NLS-1$

 	dumper.indent();

 	for (Enumeration e = fZips.elements(); e.hasMoreElements();) {

 		AbstractNode node = (AbstractNode) e.nextElement();

@@ -312,7 +312,7 @@
 			return getNodeFor((IPath)o, create);

 		}

 		else {

-			Assert.isTrue(false, "Unknown kind of node"/*nonNLS*/);

+			Assert.isTrue(false, "Unknown kind of node"); //$NON-NLS-1$

 			return null;

 		}

 	}

@@ -477,7 +477,7 @@
 	 * For debugging only -- asserts graph integrity

 	 */

 	public void integrityCheck(Dictionary table) {

-		String msg = "Internal Error: the dependency graph is corrupt, do a full build to workaround error"/*nonNLS*/;

+		String msg = "Internal Error: the dependency graph is corrupt, do a full build to workaround error"; //$NON-NLS-1$

 		for (Enumeration e = table.elements(); e.hasMoreElements();) {

 			AbstractNode node = (AbstractNode) e.nextElement();

 

@@ -564,6 +564,6 @@
 		return fNamespaces.size() + fTypes.size() + fCompilationUnits.size();

 	}

 	public String toString() {

-		return "a DependencyGraph"/*nonNLS*/;

+		return "a DependencyGraph"; //$NON-NLS-1$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java b/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
index 9f30f02..a838444 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
@@ -24,6 +24,6 @@
  */

 public String toString() {

 	// don't use + with char[]

-	return new StringBuffer("FieldIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();

+	return new StringBuffer("FieldIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
index c2762ae..f5bbc14 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
@@ -44,6 +44,6 @@
  * toString method comment.

  */

 public String toString() {

-	return getDeclaringClass().getName() + "."/*nonNLS*/ + getName();

+	return getDeclaringClass().getName() + "." + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java b/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
index 3c67b9e..0f16b2f 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
@@ -40,7 +40,7 @@
 	public void printStackTrace() {

 		if (fThrowable != null) {

 			System.err.println(this);

-			System.err.println("Stack trace of embedded throwable:"/*nonNLS*/);

+			System.err.println("Stack trace of embedded throwable:"); //$NON-NLS-1$

 			fThrowable.printStackTrace();

 		} else {

 			super.printStackTrace();

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
index 210df5c..5a4fd51 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
@@ -88,9 +88,9 @@
 	 * purposes only.

 	 */

 	public String toString() {

-		StringBuffer buf = new StringBuffer("ImageContext with packages: \n"/*nonNLS*/);

+		StringBuffer buf = new StringBuffer("ImageContext with packages: \n"); //$NON-NLS-1$

 		for (int i = 0; i < fPackages.length; i++)

-			buf.append("	"/*nonNLS*/ + fPackages[i].getName() + "\n"/*nonNLS*/);

+			buf.append("	" + fPackages[i].getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$

 		return buf.toString();

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
index 1bf30c2..41a3091 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
@@ -199,7 +199,7 @@
 	 * Returns a string representation of the image handle.	

 	 */

 	public String toString() {

-		return "image"/*nonNLS*/;

+		return "image"; //$NON-NLS-1$

 	}

 /**

  * Returns the Type representing the primitive type void

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java b/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
index 1d35ceb..6c85695 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
@@ -114,7 +114,7 @@
 		Vector vResult = new Vector();

 //		try {

 			String extension = path.getFileExtension().toLowerCase();

-			if (extension.equals("java"/*nonNLS*/) || extension.equals("class"/*nonNLS*/)) {

+			if (extension.equals("java") || extension.equals("class")) { //$NON-NLS-1$ //$NON-NLS-2$

 				IPath pkgPath = path.removeLastSegments(1);

 				IPackage pkg = fState.getPathMap().packageHandleFromPath(pkgPath);

 				TypeStructureEntry[] tsEntries = fState.getAllTypesForPackage(pkg);

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java b/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
index 224ee43..398878f 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
@@ -155,7 +155,7 @@
 				IPath path = elementDelta.getFullPath();

 				String extension = path.getFileExtension();

 				if (extension != null) {

-					if (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {

+					if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) { //$NON-NLS-1$ //$NON-NLS-2$

 						SourceEntry entry = new SourceEntry(path, null, null);

 						PackageElement element = new PackageElement(pkg, entry);

 						pkgTable.put(entry.getFileName(), element);

@@ -198,17 +198,16 @@
 public void applySourceDelta(Hashtable deltas) {

 	fNotifier = new BuildNotifier(fDC, false);

 	fNotifier.begin();

-	fNotifier.subTask(Util.bind("build.preparingBuild"/*nonNLS*/));

+	fNotifier.subTask(Util.bind("build.preparingBuild")); //$NON-NLS-1$

 	fSourceDeltas = deltas;

 	fNewState = fOldState.copy(fNewProject, fImageContext);

 

 	// options might have changed since last builder run, thus refresh them

-	fCompilerOptions = JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());

-	fNewState.setCompilerOptions(fCompilerOptions);

+	fCompilerOptions = JavaModelManager.getOptions();

 	

 	try {

 		/* find out what has changed at the package level */

-		fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));

+		fNotifier.subTask(Util.bind("build.analyzingPackages")); //$NON-NLS-1$

 		computeAllPackages();

 		checkCancel();

 

@@ -236,7 +235,7 @@
 		}

 		

 		/* find out what has changed at the package element level */

-		fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));

+		fNotifier.subTask(Util.bind("build.analyzingSources")); //$NON-NLS-1$

 		computeAllClasses();

 		checkCancel();

 

@@ -560,7 +559,7 @@
 				for (int i = 0; i < oldRoots.length; i++) {

 					rootResource = null;

 					try {

-						oldRoots[i].getUnderlyingResource();

+						rootResource = oldRoots[i].getUnderlyingResource();

 					} catch (JavaModelException e) {

 					}

 					if (rootResource != null && rootResource.getFullPath().isPrefixOf(path)) {

@@ -582,8 +581,8 @@
 	for (int i = 0; i < children.length; ++i) {

 		String extension = children[i].getFullPath().getFileExtension();

 		if (extension == null

-			|| extension.equalsIgnoreCase("zip"/*nonNLS*/)

-			|| extension.equalsIgnoreCase("jar"/*nonNLS*/)) {

+			|| extension.equalsIgnoreCase("zip") //$NON-NLS-1$

+			|| extension.equalsIgnoreCase("jar")) { //$NON-NLS-1$

 			// TBD: Currently rely on empty extension indicating folder

 			computeAllPackages(children[i], oldRoots, newRoots);

 		}

@@ -628,7 +627,7 @@
 	// Process added packages

 	for (Enumeration addedPkgs = fAddedPackageHandles.elements(); addedPkgs.hasMoreElements();) {

 		IPackage pkg = (IPackage) addedPkgs.nextElement();

-		fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));

+		fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$

 

 		// Mark all dependents of missing namespace as needing compile.

 		markDependentsAsNeedingCompile(pkg);

@@ -643,7 +642,7 @@
 	// Process removed packages

 	for (Enumeration removedPkgs = fRemovedPackageHandles.elements(); removedPkgs.hasMoreElements();) {

 		IPackage pkg = (IPackage) removedPkgs.nextElement();

-		fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));

+		fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$

 

 		// Mark all dependents of namespace as needing compile.

 		markDependentsAsNeedingCompile(pkg);

@@ -658,7 +657,7 @@
 	// Process changed packages

 	for (Enumeration changedPkgs = fChangedPackageHandles.elements(); changedPkgs.hasMoreElements();) {

 		IPackage pkg = (IPackage) changedPkgs.nextElement();

-		fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));

+		fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$

 		computeNamespaceChanges(pkg);

 		fNotifier.updateProgressDelta(progressDelta);

 		fNotifier.checkCancel();

@@ -671,7 +670,7 @@
 	String typeName = type.getElementName();

 	if (parentTypeName != null) {

 		int len = parentTypeName.length() + typeName.length() + 1;

-		typeName = new StringBuffer(len).append(parentTypeName).append("$"/*nonNLS*/).append(typeName).toString();

+		typeName = new StringBuffer(len).append(parentTypeName).append("$").append(typeName).toString(); //$NON-NLS-1$

 	}

 	/* Remove it so that only non-matching ones remain in the table. */

 	TypeStructureEntry tsEntry = (TypeStructureEntry) oldTSEntries.remove(typeName);

@@ -914,7 +913,7 @@
 	StringBuffer sb = new StringBuffer();

 	IPath path = delta.getFullPath();

 	for (int i = path.segmentCount(); --i > 0;) {

-		sb.append("  "/*nonNLS*/);

+		sb.append("  "); //$NON-NLS-1$

 	}

 	switch (delta.getKind()) {

 		case IResourceDelta.ADDED:

@@ -1048,7 +1047,7 @@
 

 					/* skip non-java resources */

 					String extension = path.getFileExtension();

-					if (extension != null && (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {

+					if (extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) { //$NON-NLS-1$ //$NON-NLS-2$

 						set.put(path, path);

 					}

 				}

@@ -1072,7 +1071,7 @@
 		IResourceDelta changed = (IResourceDelta) e.nextElement();

 		String extension = changed.getFullPath().getFileExtension();

 		if (extension != null) {

-			if (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/)) {

+			if (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")) { //$NON-NLS-1$ //$NON-NLS-2$

 				return true;

 			}

 		}

@@ -1127,7 +1126,7 @@
 			/* skip java resources */

 			String extension = path.getFileExtension();

 			if (extension != null) {

-				if ((extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {

+				if ((extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) { //$NON-NLS-1$ //$NON-NLS-2$

 					/* if there is an added or removed jcu or binary, the source entries have changed */

 					int status = fileDeltas[j].getKind();

 					if (status == IResourceDelta.ADDED || status == IResourceDelta.REMOVED) {

@@ -1423,7 +1422,7 @@
  * @see IImageBuilder

  */

 public String toString() {

-	return "incremental image builder for:\n"/*nonNLS*/ + "\tnew state: "/*nonNLS*/ + getNewState() + "\n"/*nonNLS*/ + "\told state: "/*nonNLS*/ + getOldState();

+	return "incremental image builder for:\n" + "\tnew state: " + getNewState() + "\n" + "\told state: " + getOldState(); //$NON-NLS-1$ //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-3$

 }

 /**

  * If this type is a subtype is the originator of an abstract method

@@ -1634,7 +1633,7 @@
 	for (int i = 0; i < types.length; ++i) {

 		IType superclass = getBuilderType(types[i]).getSuperclass();

 		if (superclass != null) {

-			String key = '<' + superclass.getDeclaredName() + ">/0"/*nonNLS*/;

+			String key = '<' + superclass.getDeclaredName() + ">/0"; //$NON-NLS-1$

 			if (indictments.tryMethodEvidence(key.toCharArray())) {

 				return true;

 			}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java b/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
index b9040e5..c37effa 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
@@ -56,7 +56,7 @@
 						fMethodOwners = new Hashtable(11);

 					fMethodOwners.put(owner, owner);

 					fMethodOwnersArray = null;

-					if (i.getName().startsWith("<"/*nonNLS*/)) {

+					if (i.getName().startsWith("<")) { //$NON-NLS-1$

 						fHasConstructorIndictments = true;

 					}

 					break;

@@ -71,7 +71,7 @@
 					fAbstractMethodTable.put(i.getKey(), i);

 					break;

 				default:

-					Assert.isTrue(false, "Internal Error - Unexpected kind of indictment"/*nonNLS*/);

+					Assert.isTrue(false, "Internal Error - Unexpected kind of indictment"); //$NON-NLS-1$

 					break;

 			}

 		}

@@ -161,13 +161,13 @@
 	 */

 	public String toString() {

 		return 

-			  "IndictmentSet("/*nonNLS*/

-			+ "\n  hierarchyChange: "/*nonNLS*/ + fHierarchyChange

-			+ "\n  types:\n"/*nonNLS*/ + fTypesTable

-			+ "\n  interfaces:\n"/*nonNLS*/ + fAbstractMethodTable

-			+ "\n  methods:\n"/*nonNLS*/ + fMethodsTable

-			+ "\n  fields:\n"/*nonNLS*/ + fFieldsTable

-			+ "\n)"/*nonNLS*/;

+			  "IndictmentSet(" //$NON-NLS-1$

+			+ "\n  hierarchyChange: " + fHierarchyChange //$NON-NLS-1$

+			+ "\n  types:\n" + fTypesTable //$NON-NLS-1$

+			+ "\n  interfaces:\n" + fAbstractMethodTable //$NON-NLS-1$

+			+ "\n  methods:\n" + fMethodsTable //$NON-NLS-1$

+			+ "\n  fields:\n" + fFieldsTable //$NON-NLS-1$

+			+ "\n)"; //$NON-NLS-1$

 				

 	}

 /**

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java b/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
index 192d626..3438cb2 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
@@ -86,6 +86,6 @@
 	 * purposes only.

 	 */

 	public String toString() {

-		return "JCUNode("/*nonNLS*/ + fUnit.getFileName() + ")"/*nonNLS*/;

+		return "JCUNode(" + fUnit.getFileName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java b/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
index 43dd321..f18efd9 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
@@ -60,7 +60,7 @@
 			if (e.getThrowable() instanceof CoreException) {

 				throw (CoreException) e.getThrowable();

 			} else {

-				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("build.builderName"/*nonNLS*/), e));

+				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("build.builderName"), e)); //$NON-NLS-1$

 			}

 		} catch (OperationCanceledException e) {

 			// Do nothing for now, and avoid propagating the exception.  

@@ -74,7 +74,7 @@
 				// forcing a full build next time.

 				setLastBuiltState(null);

 			}

-			if (monitor != null) monitor.subTask(Util.bind("build.completed"/*nonNLS*/));

+			if (monitor != null) monitor.subTask(Util.bind("build.completed")); //$NON-NLS-1$

 		}

 		return getRequiredProjects(getLastBuiltState(monitor));

 	}

@@ -93,28 +93,28 @@
 		Hashtable deltas = new Hashtable(11);

 		IProject project = getProject();

 

-		if (monitor != null) monitor.subTask(Util.bind("build.readingDelta"/*nonNLS*/, project.getName()));

+		if (monitor != null) monitor.subTask(Util.bind("build.readingDelta", project.getName())); //$NON-NLS-1$

 		IResourceDelta delta = getDelta(project);

 		if (delta == null){

 			//System.out.println("Missing delta for: "+ project.getName());			

-			if (monitor != null) monitor.subTask(""/*nonNLS*/);

+			if (monitor != null) monitor.subTask(""); //$NON-NLS-1$

 			return null;

 		} else {

 			deltas.put(project, delta);

 		}

 		IProject[] prereqs = getRequiredProjects(oldState);

 		for (int i = 0; i < prereqs.length; ++i) {

-			if (monitor != null)  monitor.subTask(Util.bind("build.readingDelta"/*nonNLS*/, prereqs[i].getName()));

+			if (monitor != null)  monitor.subTask(Util.bind("build.readingDelta", prereqs[i].getName())); //$NON-NLS-1$

 			delta = getDelta(prereqs[i]);

 			if (delta == null){

 				//System.out.println("Missing delta for: "+ prereqs[i].getName());			

-				if (monitor != null) monitor.subTask(""/*nonNLS*/);

+				if (monitor != null) monitor.subTask(""); //$NON-NLS-1$

 				return null;

 			} else {

 				deltas.put(prereqs[i], delta);

 			}

 		}

-		if (monitor != null) monitor.subTask(""/*nonNLS*/);

+		if (monitor != null) monitor.subTask(""); //$NON-NLS-1$

 		return deltas;

 	}

 /**

@@ -127,7 +127,7 @@
 		return !Util.equalArraysOrNull(oldRoots, newRoots);

 	} catch (JavaModelException e) {

 		throw new CoreException(

-				new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist"/*nonNLS*/, getProject().getFullPath().toString()), e));

+				new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist", getProject().getFullPath().toString()), e)); //$NON-NLS-1$

 	}

 }

 	/**

@@ -143,7 +143,7 @@
 

 		/* create and invoke the batch builder */

 		// Pass the compiler options, needed for 1FVXS80: ITPJCORE:ALL - .class files are missing their LocalVariableTable

-		ConfigurableOption[] options = JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());

+		ConfigurableOption[] options = JavaModelManager.getOptions();

 		setLastBuiltState(null); // free possible existing state

 		IImageBuilder builder = dc.createState(project, null, problemReporter, options);

 		setLastBuiltState(builder.getNewState());

@@ -237,8 +237,8 @@
 	int flags = change.getFlags();

 	boolean contentChanged = isChanged && (flags & IResourceDelta.CONTENT) != 0;

 	String extension = change.getFullPath().getFileExtension();

-	boolean isJavaOrClassFile = extension != null && (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/));

-	boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/));

+	boolean isJavaOrClassFile = extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")); //$NON-NLS-1$ //$NON-NLS-2$

+	boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")); //$NON-NLS-1$ //$NON-NLS-2$

 	

 	// care about added, removed and modified (content actually modified) .java and .class files

 	if (isJavaOrClassFile && (isAdded || isRemoved || contentChanged))

@@ -288,7 +288,7 @@
 		IPath newOutputLocation = getJavaProject().getOutputLocation();

 		return !oldOutputLocation.equals(newOutputLocation);

 	} catch (JavaModelException e) {

-		throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist"/*nonNLS*/, getProject().getFullPath().toString()), e));

+		throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist", getProject().getFullPath().toString()), e)); //$NON-NLS-1$

 	}

 }

 protected void setLastBuiltState(IState state) {

@@ -300,9 +300,9 @@
 public String toString() {

 	IState lastBuiltState = getLastBuiltState(null);

 	if (lastBuiltState == null) {

-		return "JavaBuilder(no built state)"/*nonNLS*/;

+		return "JavaBuilder(no built state)"; //$NON-NLS-1$

 	} else {

-		return "JavaBuilder("/*nonNLS*/ + lastBuiltState + ")"/*nonNLS*/;

+		return "JavaBuilder(" + lastBuiltState + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
index 3b894ea..118f597 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
@@ -18,8 +18,10 @@
 import org.eclipse.jdt.core.IPackageFragment;

 import org.eclipse.jdt.internal.compiler.Compiler;

 import org.eclipse.jdt.internal.compiler.ConfigurableOption;

+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;

 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;

 import org.eclipse.jdt.internal.core.Util;

+import org.eclipse.jdt.internal.core.JavaModelManager;

 import org.eclipse.jdt.internal.core.builder.IBinaryBroker;

 import org.eclipse.jdt.internal.core.builder.IBuildListener;

 import org.eclipse.jdt.internal.core.builder.IBuildMonitor;

@@ -70,12 +72,12 @@
 	/**

 	 * The default package.

 	 */

-	private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang"/*nonNLS*/, false);

+	private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang", false); //$NON-NLS-1$

 

 	/**

 	 * The root class handle

 	 */

-	private final IType fRootClass = fDefaultPackage.getClassHandle("Object"/*nonNLS*/);

+	private final IType fRootClass = fDefaultPackage.getClassHandle("Object"); //$NON-NLS-1$

 

 	/**

 	 * Primitive types

@@ -195,7 +197,7 @@
 	}

 public IState getCurrentState() throws NotPresentException {

 	if (fCurrentState == null) {

-		throw new NotPresentException("Internal Error - No current state"/*nonNLS*/);

+		throw new NotPresentException("Internal Error - No current state"); //$NON-NLS-1$

 	}

 	return fCurrentState;

 }

@@ -203,15 +205,7 @@
  * Reads the default compiler options.

  */

 protected static ConfigurableOption[] getDefaultCompilerOptions() {

-	ConfigurableOption[] options = Compiler.getDefaultOptions(Locale.getDefault());

-

-	/**

-	 * Ugly because this requires knowledge of the compiler's

-	 * internal problem representation.

-	 */

-	setCompilerOption(options, 11, 1);

-	setCompilerOption(options, 12, 1);

-	return options;

+	return JavaModelManager.getOptions();

 }

 /**

  * Returns the default package handle (java.lang).

@@ -303,7 +297,7 @@
 		char c = localSig.charAt(position);

 		if (c == 'L' || c == 'Q') {

 			/* its a class type */

-			int endIndex = localSig.indexOf(";"/*nonNLS*/) + 1;

+			int endIndex = localSig.indexOf(";") + 1; //$NON-NLS-1$

 			parmType = classTypeFromName(localSig.substring(position, endIndex));

 			localSig = localSig.substring(endIndex);

 		} else {

@@ -405,17 +399,7 @@
  */

 public void setBuildProgressListener(IProgressListener listener) {

 }

-/**

- * Sets a compiler option.  This seems awkward.

- */

-protected static void setCompilerOption(ConfigurableOption[] options, int optionID, int valueIndex) {

-	for (int i = 0; i < options.length; i++) {

-		if (options[i].getID() == optionID) {

-			options[i].setValueIndex(valueIndex);

-			return;

-		}

-	}

-}

+

 /**

  * setCurrentState method comment.

  */

@@ -429,6 +413,6 @@
 		fProgressMonitor = monitor;

 	}

 	public String toString() {

-		return "a JavaDevelopmentContextImpl("/*nonNLS*/ + fCurrentState + ")"/*nonNLS*/;

+		return "a JavaDevelopmentContextImpl(" + fCurrentState + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java b/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
index b98c6ab..11927c5 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
Binary files differ
diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java b/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
index 4d8740e..bb99d27 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
@@ -57,7 +57,7 @@
 	 * only (NON-NLS).

 	 */

 	public String toString() {

-		StringBuffer buf = new StringBuffer("MethodIndictment("/*nonNLS*/);

+		StringBuffer buf = new StringBuffer("MethodIndictment("); //$NON-NLS-1$

 		buf.append(fName);

 		buf.append('/');

 		buf.append(fParmCount);

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
index 9f37f90..7864051 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
@@ -61,14 +61,14 @@
 	 * unqualified source signature format.

 	 */

 	protected String getSourceParameters() {

-		String sourceSig = "("/*nonNLS*/;

+		String sourceSig = "("; //$NON-NLS-1$

 

 		/* append parameter types to signature */

 		IType[] parms = getParameterTypes();

 		for (int i = 0; i < parms.length; i++) {

 			sourceSig += parms[i].getSimpleName().replace('L', 'Q');

 		}

-		sourceSig += ")"/*nonNLS*/;

+		sourceSig += ")"; //$NON-NLS-1$

 		return sourceSig;

 	}

 /**

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java b/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
index 283589f..74aea1c 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
@@ -249,7 +249,7 @@
  * For debugging only

  */

 public String toString() {

-	StringBuffer buf = new StringBuffer("ModifiedBuilderType("/*nonNLS*/);

+	StringBuffer buf = new StringBuffer("ModifiedBuilderType("); //$NON-NLS-1$

 	return buf.append(fOldTSEntry.getType().getName()).append(')').toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java b/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
index 8520582..2c53ebf 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
@@ -62,6 +62,6 @@
 	 * purposes only.

 	 */

 	public String toString() {

-		return "NamespaceNode("/*nonNLS*/ + fPackage.getName() + ")"/*nonNLS*/;

+		return "NamespaceNode(" + fPackage.getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java b/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
index 1b40365..aff7c62 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
@@ -48,6 +48,6 @@
  * For debugging only

  */

 public String toString() {

-	return "NewBuilderType("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;

+	return "NewBuilderType(" + fNewTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
index 2b5be96..71dde76 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
@@ -9,7 +9,7 @@
 

 public abstract class NonStateSpecificHandleImpl implements IHandle {

 public boolean equals(Object obj) {

-	Assert.isTrue(false, "TBD"/*nonNLS*/);

+	Assert.isTrue(false, "TBD"); //$NON-NLS-1$

 	return false;

 }

 	public IDevelopmentContext getDevelopmentContext() {

@@ -107,7 +107,7 @@
 	return result;

 }

 public String toString() {

-	Assert.isTrue(false, "TBD"/*nonNLS*/);

+	Assert.isTrue(false, "TBD"); //$NON-NLS-1$

 	return null;

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java b/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
index 7d947d4..f65be18 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
@@ -56,6 +56,6 @@
  * For debugging only

  */

 public String toString() {

-	return "OldBuilderType("/*nonNLS*/ + fOldTSEntry.getType().getName() + ")"/*nonNLS*/;

+	return "OldBuilderType(" + fOldTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java b/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
index a37998d..5cbcc5f 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
@@ -214,7 +214,7 @@
 	for (int i=0; i<elementCount; i++) {

 		if (i != 0) buffer.append (',');

 		if (buffer.length() > 1000) {

-			buffer.append("..."/*nonNLS*/);

+			buffer.append("..."); //$NON-NLS-1$

 			break;

 		}

 		buffer.append (orderedList[i]);

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
index 99c8630..1a6c0c9 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
@@ -19,7 +19,7 @@
 	String fName;

 	boolean fIsUnnamed;

 

-	public static final String DEFAULT_PACKAGE_PREFIX = "Default-"/*nonNLS*/;

+	public static final String DEFAULT_PACKAGE_PREFIX = "Default-"; //$NON-NLS-1$

 /**

  * Creates a new package

  * @param name of package

@@ -203,9 +203,9 @@
 public static String readableName(IPackage pkg) {

 	String name = pkg.getName();

 	if (pkg.isUnnamed()) {

-		return Util.bind("build.defaultPackageName"/*nonNLS*/, name.substring(DEFAULT_PACKAGE_PREFIX.length()));

+		return Util.bind("build.defaultPackageName", name.substring(DEFAULT_PACKAGE_PREFIX.length())); //$NON-NLS-1$

 	} else {

-		return Util.bind("build.packageName"/*nonNLS*/, name);

+		return Util.bind("build.packageName", name); //$NON-NLS-1$

 	}

 }

 	/**

@@ -213,9 +213,9 @@
 	 * only (NON-NLS).

 	 */

 	public String toString() {

-		String result = "package "/*nonNLS*/;

+		String result = "package "; //$NON-NLS-1$

 		if (isUnnamed()) 

-			result += "{unnamed, id="/*nonNLS*/ + getName() + "}"/*nonNLS*/;

+			result += "{unnamed, id=" + getName() + "}"; //$NON-NLS-2$ //$NON-NLS-1$

 		else

 			result += getName();

 		return result;

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java b/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
index 8bf3a15..4f34fc8 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
@@ -146,7 +146,7 @@
 	public IPackage[] getReferencingPackages(IImageContext context) 

 	  throws NotPresentException {

 		if (!isPresent())

-			throw new NotPresentException(Util.bind("element.notPresent"/*nonNLS*/));

+			throw new NotPresentException(Util.bind("element.notPresent")); //$NON-NLS-1$

 

 		IPackage[] pkgs = fState.getReferencingPackages(fHandle, context);

 

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java b/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
index 8f88cf2..ed4d744 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
@@ -112,15 +112,15 @@
 		IPackage[] pkgs = getAllPackagesAsArray();

 		Arrays.sort(pkgs, StateImpl.getPackageComparator());

 		StringBuffer sb = new StringBuffer();

-		sb.append(super.toString() + ":\n"/*nonNLS*/);

+		sb.append(super.toString() + ":\n"); //$NON-NLS-1$

 		for (int i = 0; i < pkgs.length; ++i) {

-			sb.append("  "/*nonNLS*/ + pkgs[i].getName() + ": "/*nonNLS*/);

+			sb.append("  " + pkgs[i].getName() + ": "); //$NON-NLS-2$ //$NON-NLS-1$

 			IPath[] fragments = getFragments(pkgs[i]);

 			for (int j = 0; j < fragments.length; ++j) {

-				if (j != 0) sb.append(", "/*nonNLS*/);

+				if (j != 0) sb.append(", "); //$NON-NLS-1$

 				sb.append(fragments[j]);

 			}

-			sb.append("\n"/*nonNLS*/);

+			sb.append("\n"); //$NON-NLS-1$

 		}

 		return sb.toString();

 	}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java b/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
index 6f80669..869afaa 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
@@ -73,9 +73,9 @@
 	 * This method is for debugging purposes only.

 	 */

 	public String toString() {

-		StringBuffer buf = new StringBuffer("PackageMapEntry("/*nonNLS*/);

+		StringBuffer buf = new StringBuffer("PackageMapEntry("); //$NON-NLS-1$

 		buf.append(fPkg);

-		buf.append(")"/*nonNLS*/);

+		buf.append(")"); //$NON-NLS-1$

 		return buf.toString();

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java b/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
index 4a85e78..98908ac 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
@@ -61,10 +61,10 @@
 IPackage packageHandleFromPath(IPath path) {

 	IPackage[] pkgs = (IPackage[])fTable.get(path);

 	if (pkgs == null) {

-		throw new Error(Util.bind("build.noPackagePath"/*nonNLS*/, path.toString()));

+		throw new Error(Util.bind("build.noPackagePath", path.toString())); //$NON-NLS-1$

 	}

 	if (pkgs.length != 1) {

-		throw new Error(Util.bind("build.ambiguousPackage"/*nonNLS*/, path.toString()));

+		throw new Error(Util.bind("build.ambiguousPackage", path.toString())); //$NON-NLS-1$

 	}

 	return pkgs[0];

 }

@@ -120,23 +120,23 @@
 		}

 		Collections.sort(list, StateImpl.getPathComparator());

 		StringBuffer sb = new StringBuffer();

-		sb.append(super.toString() + ":\n"/*nonNLS*/);

+		sb.append(super.toString() + ":\n"); //$NON-NLS-1$

 		for (int i = 0; i < list.size(); ++i) {

 			IPath path = (IPath) list.get(i);

-			sb.append("  "/*nonNLS*/ + path + ": "/*nonNLS*/);

+			sb.append("  " + path + ": "); //$NON-NLS-2$ //$NON-NLS-1$

 			IPackage[] pkgs = packageHandlesFromPath(path);

 			if (pkgs.length == 1) {

 				sb.append(pkgs[0].getName());

 			}

 			else {

 				Arrays.sort(pkgs, StateImpl.getPackageComparator());

-				sb.append("("/*nonNLS*/ + pkgs.length + " packages)"/*nonNLS*/);

+				sb.append("(" + pkgs.length + " packages)"); //$NON-NLS-2$ //$NON-NLS-1$

 				for (int j = 0; j < pkgs.length; ++j) {

-					sb.append("\n    "/*nonNLS*/);

+					sb.append("\n    "); //$NON-NLS-1$

 					sb.append(pkgs[j].getName());

 				}

 			}

-			sb.append("\n"/*nonNLS*/);

+			sb.append("\n"); //$NON-NLS-1$

 		}

 		return sb.toString();

 	}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
index ecf1893..db45948 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
@@ -149,23 +149,23 @@
 public String getSimpleName() {

 	switch (fTypeCode) {

 		case TC_BOOLEAN :

-			return "boolean"/*nonNLS*/;

+			return "boolean"; //$NON-NLS-1$

 		case TC_BYTE :

-			return "byte"/*nonNLS*/;

+			return "byte"; //$NON-NLS-1$

 		case TC_CHAR :

-			return "char"/*nonNLS*/;

+			return "char"; //$NON-NLS-1$

 		case TC_DOUBLE :

-			return "double"/*nonNLS*/;

+			return "double"; //$NON-NLS-1$

 		case TC_FLOAT :

-			return "float"/*nonNLS*/;

+			return "float"; //$NON-NLS-1$

 		case TC_INT :

-			return "int"/*nonNLS*/;

+			return "int"; //$NON-NLS-1$

 		case TC_LONG :

-			return "long"/*nonNLS*/;

+			return "long"; //$NON-NLS-1$

 		case TC_SHORT :

-			return "short"/*nonNLS*/;

+			return "short"; //$NON-NLS-1$

 		case TC_VOID :

-			return "void"/*nonNLS*/;

+			return "void"; //$NON-NLS-1$

 		default :

 	}

 	return null;

@@ -219,25 +219,25 @@
 protected static String typeSignature(int typeCode) {

 	switch (typeCode) {

 		case TC_VOID :

-			return "V"/*nonNLS*/;

+			return "V"; //$NON-NLS-1$

 		case TC_BOOLEAN :

-			return "Z"/*nonNLS*/;

+			return "Z"; //$NON-NLS-1$

 		case TC_BYTE :

-			return "B"/*nonNLS*/;

+			return "B"; //$NON-NLS-1$

 		case TC_CHAR :

-			return "C"/*nonNLS*/;

+			return "C"; //$NON-NLS-1$

 		case TC_SHORT :

-			return "S"/*nonNLS*/;

+			return "S"; //$NON-NLS-1$

 		case TC_INT :

-			return "I"/*nonNLS*/;

+			return "I"; //$NON-NLS-1$

 		case TC_LONG :

-			return "J"/*nonNLS*/;

+			return "J"; //$NON-NLS-1$

 		case TC_FLOAT :

-			return "F"/*nonNLS*/;

+			return "F"; //$NON-NLS-1$

 		case TC_DOUBLE :

-			return "D"/*nonNLS*/;

+			return "D"; //$NON-NLS-1$

 		default :

-			return "unknown"/*nonNLS*/;

+			return "unknown"; //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
index 812c532..a0d71a0 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
@@ -197,6 +197,6 @@
  * purposes only. Non-NLS.

  */

 public String toString() {

-	return "ProblemDetail("/*nonNLS*/ + getMessage() + ")"/*nonNLS*/;

+	return "ProblemDetail(" + getMessage() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
index 9d06ddf..25ce837 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
@@ -25,7 +25,7 @@
  */

 private ProblemFactory(Locale locale) {

 	fLocale = locale;

-	fCompilerResources = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.messages"/*nonNLS*/, locale);

+	fCompilerResources = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.messages", locale); //$NON-NLS-1$

 	initializeMessageTemplates();

 }

 /**

@@ -53,7 +53,7 @@
 	StringBuffer output = new StringBuffer(80);

 	String message = fMessageTemplates[ (id & ProblemIrritants.IgnoreCategoriesMask)];

 	if (message == null) {

-		return "Unable to retrieve the error message for problem id: "/*nonNLS*/+ id + ". Check compiler resources."/*nonNLS*/;

+		return "Unable to retrieve the error message for problem id: "+ id + ". Check compiler resources."; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 	int length = message.length();

 	int start = -1, end = length;

@@ -66,7 +66,7 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					return "Corrupted compiler resources for problem id: "/*nonNLS*/ + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources."/*nonNLS*/;

+					return "Corrupted compiler resources for problem id: " + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources."; //$NON-NLS-1$ //$NON-NLS-2$

 				}

 			} else {

 				output.append(message.substring(end, length));

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
index 3b7e49c..9d92795 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
@@ -170,12 +170,12 @@
 	 * @return a string representation of the receiver

 	 */

 	public String toString() {

-		StringBuffer buf = new StringBuffer("ProblemTable(\n\t"/*nonNLS*/);

-		buf.append("type problems: "/*nonNLS*/);

+		StringBuffer buf = new StringBuffer("ProblemTable(\n\t"); //$NON-NLS-1$

+		buf.append("type problems: "); //$NON-NLS-1$

 		buf.append(fTable);

-		buf.append("\n\timage problems: "/*nonNLS*/);

+		buf.append("\n\timage problems: "); //$NON-NLS-1$

 		buf.append(fImageProblems);

-		buf.append(")"/*nonNLS*/);

+		buf.append(")"); //$NON-NLS-1$

 		return buf.toString();

 	}

 

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java b/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
index 745d9c0..6973b16 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
@@ -103,7 +103,7 @@
 			IResource resource = (IResource) members[i];

 			switch (resource.getType()) {

 				case IResource.FILE :

-					if (resource.getName().toLowerCase().endsWith(".class"/*nonNLS*/)) {

+					if (resource.getName().toLowerCase().endsWith(".class")) { //$NON-NLS-1$

 						resource.delete(true, null);

 					}

 					break;

@@ -141,8 +141,7 @@
 	} catch (IOException e) {

 		return new byte[0];

 	} catch (CoreException e) {

-		return new byte[0];

-	}

+		return new byte[0];	}

 }

 /**

  * Returns the container for a path.

@@ -176,7 +175,7 @@
  * Returns the path in the output folder for the given type.

  */

 private IPath getPathForBinary(IType type) {

-	return getOutputPath().append(type.getName().replace('.', '/') + ".class"/*nonNLS*/);

+	return getOutputPath().append(type.getName().replace('.', '/') + ".class"); //$NON-NLS-1$

 }

 /**

  * Returns the container at the given path, creating it and any parent folders if necessary.

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java b/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
index 628a236..90194e8 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
@@ -65,7 +65,7 @@
 				if (this.outputLocation.equals(this.sourceFolders[i].getFullPath())) continue; // do nothing if output is same as source folder

 				if (!hasNotified){

 					hasNotified = true;

-					if (notifier != null) notifier.subTask(Util.bind("build.copyingResources"/*nonNLS*/));

+					if (notifier != null) notifier.subTask(Util.bind("build.copyingResources")); //$NON-NLS-1$

 				}

 				this.sourceFolders[i].accept(this);

 			}

@@ -87,7 +87,7 @@
 	switch (resource.getType()){

 		case IResource.FILE :

 			if (sourceFolderPath == null) return false; // resource is not inside the classpath		

-			if (!"java"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files

+			if (!"java".equals(resource.getFileExtension())){ // ignore source files //$NON-NLS-1$

 				

 				IFile currentFile = (IFile) resource;

 				IPath pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());

@@ -140,7 +140,7 @@
 	

 	switch (resource.getType()){

 		case IResource.FILE :

-			if (!"java"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files

+			if (!"java".equals(resource.getFileExtension())){ // ignore source files //$NON-NLS-1$

 				

 				IFile currentFile = (IFile) resource;

 				pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());

@@ -195,7 +195,7 @@
 			if (this.outputLocation.equals(this.sourceFolders[i].getFullPath())) continue; // do nothing if output is same as source folder

 			if (!hasNotified){

 				hasNotified = true;

-				if (notifier != null) notifier.subTask(Util.bind("build.updatingResources"/*nonNLS*/));

+				if (notifier != null) notifier.subTask(Util.bind("build.updatingResources")); //$NON-NLS-1$

 			}

 		}

 	}

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
index 10bef72..5590bef 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
@@ -104,7 +104,7 @@
 		if (path.isPrefixOf(sEntryPath)) {

 			String extension = sEntryPath.getFileExtension();

 			// test most frequent cases first

-			if (extension != null && (extension.toLowerCase().equals("java"/*nonNLS*/) || extension.toLowerCase().equals("class"/*nonNLS*/))) {

+			if (extension != null && (extension.toLowerCase().equals("java") || extension.toLowerCase().equals("class"))) { //$NON-NLS-1$ //$NON-NLS-2$

 				getProblemsForSourceEntry(sEntry, vResults);

 			} else {

 				if (fState.isZipElement(sEntryPath)) {

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java b/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
index 48067b1..efd6f1d 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
@@ -123,6 +123,6 @@
 	 * @return a string representation of the receiver

 	 */

 	public String toString() {

-		return "SourceElementTable("/*nonNLS*/ + fPackageTable + ")"/*nonNLS*/;

+		return "SourceElementTable(" + fPackageTable + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java b/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
index d42409f..a63718d 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
@@ -94,7 +94,7 @@
 	return s.replace('/', File.separatorChar);

 }

 	public String getZipEntryName() {

-		return fZipEntryPath == null ? fZipEntryFileName : fZipEntryPath + "/"/*nonNLS*/ + fZipEntryFileName;

+		return fZipEntryPath == null ? fZipEntryFileName : fZipEntryPath + "/" + fZipEntryFileName; //$NON-NLS-1$

 	}

 	public int hashCode() {

 		int code = fPath.hashCode();

@@ -112,10 +112,10 @@
 	 */

 	public boolean isBinary() {

 		if (fZipEntryFileName != null) {

-			return fZipEntryFileName.endsWith(".class"/*nonNLS*/);

+			return fZipEntryFileName.endsWith(".class"); //$NON-NLS-1$

 		}

 		String extension = fPath.getFileExtension();

-		return extension != null && extension.equalsIgnoreCase("class"/*nonNLS*/);

+		return extension != null && extension.equalsIgnoreCase("class"); //$NON-NLS-1$

 	}

 	/**

 	 * Returns true if the source entry comes from a compilation unit, otherwise

@@ -123,16 +123,16 @@
 	 */

 	public boolean isSource() {

 		if (fZipEntryFileName != null) {

-			return fZipEntryFileName.endsWith(".java"/*nonNLS*/);

+			return fZipEntryFileName.endsWith(".java"); //$NON-NLS-1$

 		}

 		String extension = fPath.getFileExtension();

-		return extension != null && extension.equalsIgnoreCase("java"/*nonNLS*/);

+		return extension != null && extension.equalsIgnoreCase("java"); //$NON-NLS-1$

 	}

 /**

  * Returns a String that represents the value of this object.

  * @return a string representation of the receiver

  */

 public String toString() {

-	return fZipEntryFileName == null ? fPath.toString() : fPath.toString() + ", entry: "/*nonNLS*/ + this.getZipEntryName();

+	return fZipEntryFileName == null ? fPath.toString() : fPath.toString() + ", entry: " + this.getZipEntryName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
index 76a1bf4..d1dc34f 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
@@ -62,7 +62,7 @@
 	 */

 	public String toString() {

 		return 

-			"SourceFragmentImpl("/*nonNLS*/ + fPath 

-				+ (fZipEntryName == null ? ""/*nonNLS*/ : " : "/*nonNLS*/ + fZipEntryName) + ")"/*nonNLS*/;

+			"SourceFragmentImpl(" + fPath  //$NON-NLS-1$

+				+ (fZipEntryName == null ? "" : " : " + fZipEntryName) + ")"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
index 0dce2cd..b22c4dc 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
Binary files differ
diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
index 52fcb91..01bf636 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
@@ -75,7 +75,7 @@
 	int magic = in.readInt();

 	int version = in.readShort();

 	if (magic != MAGIC) { // magic = "STAT"e

-		throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));

+		throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$

 	}

 

 	/* dispatch to appropriate reader */

@@ -85,7 +85,7 @@
 		case VERSION6:

 			return new StateSnapV6().read(dc, project, in);

 		default:

-			throw new IOException(Util.bind("build.unhandledVersionFormat"/*nonNLS*/));

+			throw new IOException(Util.bind("build.unhandledVersionFormat")); //$NON-NLS-1$

 	}

 }

 /** 

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
index 7584b6f..898311c 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
@@ -114,14 +114,14 @@
 			// NOP

 			break;

 		default:

-			Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);

+			Assert.isTrue(false, "Unknown kind of handle"); //$NON-NLS-1$

 	}

 }

 /** 

  * Add a SourceEntry to the pool.

  */

 public void add(SourceEntry entry) {

-	Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool"/*nonNLS*/);

+	Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool"); //$NON-NLS-1$

 	if (!fSet.includes(entry)) {

 		add(entry.getPath());

 		String zipEntryPath = entry.fZipEntryPath;

@@ -171,12 +171,12 @@
 	try {

 		IHandle result = (IHandle)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -192,12 +192,12 @@
 	try {

 		IPackage result = (IPackage)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -207,12 +207,12 @@
 	try {

 		IPath result = (IPath)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -222,12 +222,12 @@
 	try {

 		SourceEntry result = (SourceEntry)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -237,12 +237,12 @@
 	try {

 		String result = (String)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -263,7 +263,7 @@
 		return result;

 	}

 	else {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /**

@@ -273,12 +273,12 @@
 	try {

 		IType result = (IType)fSet.get(index);

 		if (result == null) {

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		return result;

 	}

 	catch (ClassCastException e) {

-		throw new IOException("Error in format"/*nonNLS*/);

+		throw new IOException("Error in format"); //$NON-NLS-1$

 	}

 }

 /** 

@@ -306,10 +306,10 @@
 			++nN;

 		}

 		else {

-			Assert.isTrue(false, "Unexpected pool item"/*nonNLS*/);

+			Assert.isTrue(false, "Unexpected pool item"); //$NON-NLS-1$

 		}

 	}

-	return "nStr="/*nonNLS*/ + nStr + ", nID="/*nonNLS*/ + nID + ", nSE="/*nonNLS*/ + nSE + ", nH="/*nonNLS*/ + nH + ",nN="/*nonNLS*/ + nN;

+	return "nStr=" + nStr + ", nID=" + nID + ", nSE=" + nSE + ", nH=" + nH + ",nN=" + nN; //$NON-NLS-1$ //$NON-NLS-5$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-4$

 	

 }

 /** 

@@ -323,7 +323,7 @@
 		return fSet.index(obj);

 	}

 	catch (IllegalArgumentException e) {

-		throw new IllegalArgumentException("Internal error in state serialization. Expected object missing from constant pool: "/*nonNLS*/ + obj);

+		throw new IllegalArgumentException("Internal error in state serialization. Expected object missing from constant pool: " + obj); //$NON-NLS-1$

 	}

 }

 /**

@@ -397,7 +397,7 @@
 				fSet.put(i, readNumber(in, tag));

 				break;

 			default:

-				throw new IOException("Unexpected kind of pool item"/*nonNLS*/);

+				throw new IOException("Unexpected kind of pool item"); //$NON-NLS-1$

 		}

 	}

 }

@@ -415,7 +415,7 @@
 		case 5: {

 			// primitive type

 			// Should not occur since primitive types are well known and not written

-			throw new IOException("Error in format"/*nonNLS*/);

+			throw new IOException("Error in format"); //$NON-NLS-1$

 		}

 		case 6: {

 			// array type

@@ -433,7 +433,7 @@
 			// method

 			IType declaringClass = getType(in.readInt());

 			if (declaringClass.isPrimitive() || declaringClass.isArray()) {

-				throw new IOException("Error in format"/*nonNLS*/);

+				throw new IOException("Error in format"); //$NON-NLS-1$

 			}

 			String name = getString(in.readInt());

 			int numParams = in.readByte() & 0xFF;

@@ -447,7 +447,7 @@
 			// constructor

 			IType declaringClass = getType(in.readInt());

 			if (declaringClass.isPrimitive() || declaringClass.isArray()) {

-				throw new IOException("Error in format"/*nonNLS*/);

+				throw new IOException("Error in format"); //$NON-NLS-1$

 			}

 			int numParams = in.readByte() & 0xFF;

 			IType[] params = new IType[numParams];

@@ -460,7 +460,7 @@
 			// field 

 			IType declaringClass = getType(in.readInt());

 			if (declaringClass.isPrimitive() || declaringClass.isArray()) {

-				throw new IOException("Error in format"/*nonNLS*/);

+				throw new IOException("Error in format"); //$NON-NLS-1$

 			}

 			String name = getString(in.readInt());

 			return declaringClass.getFieldHandle(name);

@@ -469,7 +469,7 @@
 			// image

 			return dc.getImage();

 		default:

-			throw new IOException("Unexpected kind of pool item"/*nonNLS*/);

+			throw new IOException("Unexpected kind of pool item"); //$NON-NLS-1$

 	}

 }

 /**

@@ -490,7 +490,7 @@
 			// Double

 			return new Double(Double.longBitsToDouble(in.readLong()));

 		default:

-			throw new IOException("Unexpected type of number"/*nonNLS*/);

+			throw new IOException("Unexpected type of number"); //$NON-NLS-1$

 	}

 }

 /** 

@@ -539,7 +539,7 @@
 			writeNumber((Number)obj, out);  // tags 12 through 15

 		}

 		else {

-			Assert.isTrue(false, "Unexpected kind of pool item"/*nonNLS*/);

+			Assert.isTrue(false, "Unexpected kind of pool item"); //$NON-NLS-1$

 		}

 	}

 }

@@ -559,7 +559,7 @@
 			if (t.isPrimitive()) {

 				// tag=5

 				// Primitive types should not show up since they are well known and are not written.

-				throw new IOException("Error in format"/*nonNLS*/);

+				throw new IOException("Error in format"); //$NON-NLS-1$

 			}

 			else if (t.isArray()) {

 				ArrayTypeHandleImpl at = (ArrayTypeHandleImpl)t;

@@ -611,7 +611,7 @@
 			out.writeByte(11);

 			break;

 		default:

-			Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);

+			Assert.isTrue(false, "Unknown kind of handle"); //$NON-NLS-1$

 	}

 }

 /** 

@@ -635,7 +635,7 @@
 		out.writeLong(Double.doubleToLongBits(num.doubleValue()));

 	}

 	else {

-		Assert.isTrue(false, "Unexpected type of number"/*nonNLS*/);

+		Assert.isTrue(false, "Unexpected type of number"); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
index e7f9d4f..75baf0d 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
@@ -75,7 +75,7 @@
 				pool.add(((ZipNode)node).getZipFile());

 				break;

 			default:

-				Assert.isTrue(false, "Unexpected kind of node"/*nonNLS*/);

+				Assert.isTrue(false, "Unexpected kind of node"); //$NON-NLS-1$

 		}

 		// Don't need to process node dependents here, since they're nodes as well

 		// and will have their info added to the pool above.

@@ -153,7 +153,7 @@
 	pool.add(tsEntry.getType());

 }

 protected void badFormat() throws IOException {

-	throw new IOException("Error in format"/*nonNLS*/);

+	throw new IOException("Error in format"); //$NON-NLS-1$

 }

 /**

  * Check that the next section has the given name.

@@ -202,7 +202,7 @@
  * Read the build context.

  */

 protected IImageContext readBuildContext(IDevelopmentContext dc, StateSnapConstantPool pool, DataInputStream in) throws IOException {

-	checkSection(in, "BuildContext"/*nonNLS*/);

+	checkSection(in, "BuildContext"); //$NON-NLS-1$

 	int numPkgs = in.readInt();

 	if (numPkgs == -1) {

 		return null;

@@ -218,7 +218,7 @@
  * The state is needed to create CompilationUnit objects from SourceEntry objects.

  */

 protected DependencyGraph readDependencyGraph(StateSnapConstantPool pool, DataInputStream in, StateImpl state) throws IOException {

-	checkSection(in, "DependencyGraph"/*nonNLS*/);

+	checkSection(in, "DependencyGraph"); //$NON-NLS-1$

 	DependencyGraph graph = new DependencyGraph();

 	

 	// Avoid creating package elements for each node and dependency.

@@ -268,7 +268,7 @@
  * Read the package map.

  */

 protected PackageMap readPackageMap(StateSnapConstantPool pool, DataInputStream in) throws IOException {

-	checkSection(in, "PackageMap"/*nonNLS*/);

+	checkSection(in, "PackageMap"); //$NON-NLS-1$

 	PackageMap map = new PackageMap();

 	int size = in.readInt();

 	for (int i = 0; i < size; ++i) {

@@ -286,7 +286,7 @@
  * Read the principal structure table.

  */

 protected Hashtable readPrincipalStructureTable(StateSnapConstantPool pool, DataInputStream in, StateImpl state) throws IOException {

-	checkSection(in, "PrincipalStructureTable"/*nonNLS*/);

+	checkSection(in, "PrincipalStructureTable"); //$NON-NLS-1$

 	int numEntries = in.readInt();

 	Hashtable table = new Hashtable(numEntries * 2 + 1);

 	for (int i = 0; i < numEntries; ++i) {

@@ -314,7 +314,7 @@
  * Read the problem reporter.

  */

 protected IProblemReporter readProblemReporter(IProject project, StateSnapConstantPool pool, DataInputStream in) throws IOException {

-	checkSection(in, "Problems"/*nonNLS*/);

+	checkSection(in, "Problems"); //$NON-NLS-1$

 	IProblemReporter reporter = null;

 	boolean isProblemTable = in.readBoolean();

 	if (isProblemTable) {

@@ -330,14 +330,14 @@
 		try {

 			clazz = Class.forName(className);

 		} catch (ClassNotFoundException e) {

-			throw new IOException("Class "/*nonNLS*/ + className + " was not found."/*nonNLS*/);

+			throw new IOException("Class " + className + " was not found."); //$NON-NLS-2$ //$NON-NLS-1$

 		}

 		try {

 			reporter = (IProblemReporter) clazz.newInstance();

 		} catch (InstantiationException e) {

-			throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());

+			throw new IOException("Could not instanciate " + clazz.getName()); //$NON-NLS-1$

 		} catch (IllegalAccessException e) {

-			throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());

+			throw new IOException("Could not instanciate " + clazz.getName()); //$NON-NLS-1$

 		}

 		reporter.initialize(project, JavaModelManager.getJavaModelManager().getDevelopmentContext(project));

 	}

@@ -347,7 +347,7 @@
  * Read the source element table.

  */

 protected SourceElementTable readSourceElementTable(StateSnapConstantPool pool, DataInputStream in) throws IOException {

-	checkSection(in, "SourceElementTable"/*nonNLS*/);

+	checkSection(in, "SourceElementTable"); //$NON-NLS-1$

 	SourceElementTable table = new SourceElementTable();

 	int numPackages = in.readInt();

 	for (int i = 0; i < numPackages; ++i) {

@@ -476,7 +476,7 @@
  * Write the build context.

  */

 protected void writeBuildContext(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("BuildContext"/*nonNLS*/);

+	out.writeUTF("BuildContext"); //$NON-NLS-1$

 	IImageContext ctx = state.getBuildContext();

 	if (ctx == null) {

 		out.writeInt(-1);

@@ -493,7 +493,7 @@
  * Write the dependency graph.

  */

 protected void writeDependencyGraph(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("DependencyGraph"/*nonNLS*/);

+	out.writeUTF("DependencyGraph"); //$NON-NLS-1$

 	DependencyGraph graph = state.getInternalDependencyGraph();

 	graph.integrityCheck();

 	/**

@@ -508,7 +508,7 @@
 		out.writeBoolean(true);

 		SourceEntry sEntry = state.getSourceEntry(jcu.getPackageElement());

 		if (sEntry == null) {

-			System.out.println("Warning: StatSnap: Attempt to serialize dependency graph node for missing JCU: "/*nonNLS*/ + jcu.getPackageElement() + ". Skipping..."/*nonNLS*/);

+			System.out.println("Warning: StatSnap: Attempt to serialize dependency graph node for missing JCU: " + jcu.getPackageElement() + ". Skipping..."); //$NON-NLS-1$ //$NON-NLS-2$

 		} else {

 			Assert.isNotNull(sEntry);

 			out.writeInt(pool.index(sEntry));

@@ -572,7 +572,7 @@
  * Write the package map.

  */

 protected void writePackageMap(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("PackageMap"/*nonNLS*/);

+	out.writeUTF("PackageMap"); //$NON-NLS-1$

 	PackageMap map = state.getPackageMap();

 	out.writeInt(map.size());

 	int count = 0;

@@ -592,7 +592,7 @@
  * Write the principal structure table.

  */

 protected void writePrincipalStructureTable(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("PrincipalStructureTable"/*nonNLS*/);

+	out.writeUTF("PrincipalStructureTable"); //$NON-NLS-1$

 	Hashtable table = state.getPrincipalStructureTable();

 	int num = table.size();

 	out.writeInt(num);

@@ -621,7 +621,7 @@
  * Write the problem reporter.

  */

 protected void writeProblemReporter(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("Problems"/*nonNLS*/);

+	out.writeUTF("Problems"); //$NON-NLS-1$

 	IProblemReporter reporter = state.getProblemReporter();

 	if (reporter instanceof ProblemTable) {

 		out.writeBoolean(true);

@@ -645,7 +645,7 @@
  * Write the source element table.

  */

 protected void writeSourceElementTable(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {

-	out.writeUTF("SourceElementTable"/*nonNLS*/);

+	out.writeUTF("SourceElementTable"); //$NON-NLS-1$

 	SourceElementTable table = state.getSourceElementTable();

 	int num = table.numPackages();

 	out.writeInt(num);

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
index 622b1e5..b799ee9 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
@@ -28,6 +28,6 @@
  */

 public String toString() {

 	// don't use + with char[]

-	return new StringBuffer("TypeIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();

+	return new StringBuffer("TypeIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
index cf0bf75..97d8a65 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
@@ -28,6 +28,6 @@
  */

 public String toString() {

 	// don't use + with char[]

-	return new StringBuffer("TypeHierarchyIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();

+	return new StringBuffer("TypeHierarchyIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
index a7b9c0d..d398e6e 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
@@ -16,7 +16,7 @@
 				typeA = (IType)a;

 				typeB = (IType)b;

 			} catch (ClassCastException e) {

-				Assert.isTrue(false, "Should only be comparing ITypes"/*nonNLS*/);

+				Assert.isTrue(false, "Should only be comparing ITypes"); //$NON-NLS-1$

 			}

 			return typeA.getName().compareTo(typeB.getName());

 		}

@@ -149,7 +149,7 @@
  * a String of length 0.

  */

 public String getDeclaredName() throws NotPresentException {

-	return ""/*nonNLS*/;

+	return ""; //$NON-NLS-1$

 }

 /**

  * If the class or interface represented by this Type object is

@@ -476,6 +476,6 @@
 	 * only (NON-NLS).

 	 */

 	public String toString() {

-		return "type "/*nonNLS*/ + getName();

+		return "type " + getName(); //$NON-NLS-1$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
index 373d854..8f50227 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
@@ -126,7 +126,7 @@
  * a String of length 0.

  */

 public String getDeclaredName() throws NotPresentException {

-	return ""/*nonNLS*/;

+	return ""; //$NON-NLS-1$

 }

 /**

  * If the class or interface represented by this Type object is

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
index bd9a84b..e99317d 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
@@ -63,6 +63,6 @@
 	 * purposes only.

 	 */

 	public String toString() {

-		return "TypeNode("/*nonNLS*/ + fType.getFileName() + ")"/*nonNLS*/;

+		return "TypeNode(" + fType.getFileName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java b/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
index 3e11a4f..bdb9564 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
@@ -92,11 +92,11 @@
  * @return a string representation of the receiver

  */

 public String toString() {

-	StringBuffer buf = new StringBuffer("TypeStructureEntry("/*nonNLS*/);

+	StringBuffer buf = new StringBuffer("TypeStructureEntry("); //$NON-NLS-1$

 	if (fType != null) {

 		buf.append(fType.getName());

 	}

-	buf.append(")"/*nonNLS*/);

+	buf.append(")"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java b/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
index 21812de..83dd0ef 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
@@ -52,6 +52,6 @@
  * For debugging only

  */

 public String toString() {

-	return "UnmodifiedBuilderType("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;

+	return "UnmodifiedBuilderType(" + fNewTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java b/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
index 8f263a0..7186c89 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
@@ -61,7 +61,7 @@
 	} else {

 		if (entry.status != NEEDS_COMPILE) {

 			if (entry.status == COMPILED) {

-				System.out.println("Warning: image builder wants to recompile already compiled element: "/*nonNLS*/ + element);

+				System.out.println("Warning: image builder wants to recompile already compiled element: " + element); //$NON-NLS-1$

 			}

 			entry.status = NEEDS_COMPILE;

 			needsCompileList.addElement(element);

@@ -79,7 +79,7 @@
 		entries.put(element, entry);		

 	} else {

 		if (entry.status != NEEDS_COMPILE) {

-			System.out.println("Warning: Java builder compiled the same element twice: "/*nonNLS*/ + element);

+			System.out.println("Warning: Java builder compiled the same element twice: " + element); //$NON-NLS-1$

 		}

 		needsCompileList.removeElement(element);

 	}

@@ -117,6 +117,6 @@
 	return entry != null && entry.status == NEEDS_COMPILE;

 }

 public String toString() {

-	return "WorkQueue: "/*nonNLS*/ + needsCompileList;

+	return "WorkQueue: " + needsCompileList; //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java b/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
index 2f51cb3..635086d 100644
--- a/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
+++ b/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
@@ -57,6 +57,6 @@
  * purposes only.

  */

 public String toString() {

-	return "ZipNode("/*nonNLS*/ + fZipFile + ")"/*nonNLS*/;

+	return "ZipNode(" + fZipFile + ")"; //$NON-NLS-1$ //$NON-NLS-2$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java b/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
index 2e7995f..e3cc003 100644
--- a/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
+++ b/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
@@ -7,16 +7,17 @@
 import org.eclipse.core.resources.*;

 import org.eclipse.core.runtime.*;

 

+import org.eclipse.jdt.core.*;

+import org.eclipse.jdt.core.eval.*;

 import org.eclipse.jdt.internal.codeassist.ISelectionRequestor;

 import org.eclipse.jdt.internal.codeassist.ICompletionRequestor;

 import org.eclipse.jdt.internal.compiler.*;

 import org.eclipse.jdt.internal.compiler.env.INameEnvironment;

-import org.eclipse.jdt.core.*;

-import org.eclipse.jdt.core.eval.*;

 import org.eclipse.jdt.internal.compiler.util.CharOperation;

 import org.eclipse.jdt.internal.core.*;

 import org.eclipse.jdt.internal.core.builder.impl.JavaBuilder;

 import org.eclipse.jdt.internal.core.builder.impl.ProblemFactory;

+import org.eclipse.jdt.internal.core.ClassFile;

 import org.eclipse.jdt.internal.eval.*;

 

 import java.util.Locale;

@@ -52,7 +53,7 @@
  */

 protected void checkBuilderState() throws JavaModelException {

 	if (!getProject().hasBuildState()) {

-		throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.EVALUATION_ERROR, Util.bind("eval.needBuiltState"/*nonNLS*/)));

+		throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.EVALUATION_ERROR, Util.bind("eval.needBuiltState"))); //$NON-NLS-1$

 	}

 }

 /**

@@ -64,7 +65,7 @@
 		position,

 		this.project.getSearchableNameEnvironment(),

 		new CompletionRequestorWrapper(requestor),

-		JavaModelManager.convertConfigurableOptions(JavaCore.getOptions())

+		JavaModelManager.getOptions()

 	);

 }

 /**

@@ -78,7 +79,7 @@
 		offset + length - 1,

 		this.project.getSearchableNameEnvironment(),

 		requestor,

-		JavaModelManager.convertConfigurableOptions(JavaCore.getOptions())

+		JavaModelManager.getOptions()

 	);

 	return requestor.getElements();

 }

@@ -90,7 +91,7 @@
 		GlobalVariableWrapper wrapper = (GlobalVariableWrapper)variable;

 		this.context.deleteVariable(wrapper.variable);

 	} else {

-		throw new Error("Unknown implementation of IGlobalVariable"/*nonNLS*/);

+		throw new Error("Unknown implementation of IGlobalVariable"); //$NON-NLS-1$

 	}

 }

 /**

@@ -137,6 +138,15 @@
 				}

 				this.context.setImports(importsNames);

 			}

+		} else {

+			// try to retrieve imports from the source

+			SourceMapper sourceMapper = ((ClassFile) declaringType.getClassFile()).getSourceMapper();

+			if (sourceMapper != null) {

+				char[][] imports = sourceMapper.getImports((BinaryType) declaringType);

+				if (imports != null) {

+					this.context.setImports(imports);

+				}

+			}

 		}

 	}

 	try {

@@ -193,7 +203,7 @@
  * Returns the compiler's configurable options.

  */

 protected ConfigurableOption[] getCompilerOptions() throws JavaModelException {

-	return JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());

+	return JavaModelManager.getOptions();

 }

 /**

  * @see org.eclipse.jdt.core.eval.IEvaluationContext#getImports

diff --git a/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java b/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
index 41e2274..c8a6c62 100644
--- a/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
+++ b/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
@@ -162,30 +162,37 @@
 public String toString() {

 	StringBuffer buffer = new StringBuffer();

 	if (this.modifiers == IConstants.AccPublic) {

-		buffer.append("public "/*nonNLS*/);

+		buffer.append("public "); //$NON-NLS-1$

 	}

 	if (this.isClass()) {

-		buffer.append("class "/*nonNLS*/);

+		buffer.append("class "); //$NON-NLS-1$

 	} else {

-		buffer.append("interface "/*nonNLS*/);

+		buffer.append("interface "); //$NON-NLS-1$

 	}

 	if (this.name != null) {

 		buffer.append(this.name);

 	}

 	if (this.superclass != null) {

-		buffer.append("\n  extends "/*nonNLS*/);

+		buffer.append("\n  extends "); //$NON-NLS-1$

 		buffer.append(this.superclass);

 	}

 	int length;

 	if (this.superInterfaces != null && (length = this.superInterfaces.length) != 0) {

-		buffer.append("\n implements "/*nonNLS*/);

+		buffer.append("\n implements "); //$NON-NLS-1$

 		for (int i = 0; i < length; i++) {

 			buffer.append(this.superInterfaces[i]);

 			if (i != length - 1) {

-				buffer.append(", "/*nonNLS*/);

+				buffer.append(", "); //$NON-NLS-1$

 			}

 		}

 	}

 	return buffer.toString();

 }

+

+/**

+ * @see org.eclipse.jdt.internal.compiler.env.IBinaryType.

+ */

+public char[] sourceFileName() {

+	return null;

+}

 }

diff --git a/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java b/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
index 1b204e5..b873877 100644
--- a/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
@@ -75,7 +75,7 @@
 			return name;

 		}

 		public String toString(){

-			StringBuffer buffer = new StringBuffer("Queue:\n"/*nonNLS*/);

+			StringBuffer buffer = new StringBuffer("Queue:\n"); //$NON-NLS-1$

 			for (int i = this.start; i <= this.end; i++){

 				buffer.append(names[i]).append('\n');		

 			}

@@ -178,6 +178,10 @@
 		this.nameLookup = project.getNameLookup();

 		this.hierarchyResolver = 

 			new HierarchyResolver(this.searchableEnvironment, this, new DefaultProblemFactory());

+		if (focusType != null) {

+			char[] fullyQualifiedName = focusType.getFullyQualifiedName().toCharArray();

+			this.hierarchyResolver.setFocusType(CharOperation.splitOn('.', fullyQualifiedName));

+		}

 		this.hierarchyResolver.resolve(genericTypes, compilationUnits);

 		if (focusType != null && focusType.getJavaProject().equals(project)) {

 			this.searchableEnvironment.unitToLookInside = null;

@@ -319,7 +323,7 @@
  */

 private void createInfoFromClassFileInJar(Openable classFile, Vector infos) throws JavaModelException {

 	IJavaElement pkg = classFile.getParent();

-	String classFilePath = pkg.getElementName().replace('.', '/') + "/"/*nonNLS*/ + classFile.getElementName();

+	String classFilePath = pkg.getElementName().replace('.', '/') + "/" + classFile.getElementName(); //$NON-NLS-1$

 	IGenericType info = null;

 	java.util.zip.ZipFile zipFile = null;

 	try {

@@ -443,7 +447,7 @@
 	IIndexSearchRequestor searchRequestor = new IndexSearchAdapter(){

 		public void acceptSuperTypeReference(String resourcePath, char[] qualification, char[] typeName, char[] enclosingTypeName, char classOrInterface, char[] superQualification, char[] superTypeName, char superClassOrInterface, int modifiers) {

 			pathRequestor.acceptPath(resourcePath);

-			if (resourcePath.endsWith("class"/*nonNLS*/)){

+			if (resourcePath.endsWith("class")){ //$NON-NLS-1$

 				HierarchyBinaryType binaryType = (HierarchyBinaryType)binariesFromIndexMatches.get(resourcePath);

 				if (binaryType == null){

 					binaryType = new HierarchyBinaryType(modifiers, qualification, typeName, enclosingTypeName, classOrInterface);

diff --git a/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java b/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
index de684ca..afb64f0 100644
--- a/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
+++ b/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
@@ -1022,7 +1022,7 @@
 		}

 		fProgressMonitor = monitor;

 		if (monitor != null) {

-			monitor.beginTask(Util.bind("hierarchy.creating"/*nonNLS*/), IProgressMonitor.UNKNOWN);

+			monitor.beginTask(Util.bind("hierarchy.creating"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$

 		}

 		compute();

 		if (fType != null) {

@@ -1097,7 +1097,7 @@
 		return false;

 	}

 	if (superclassName == null) {

-		superclassName = "Object"/*nonNLS*/;

+		superclassName = "Object"; //$NON-NLS-1$

 	}

 	int dot = -1;

 	String simpleSuper = (dot = superclassName.lastIndexOf('.')) > -1 ?

@@ -1133,24 +1133,24 @@
  */

 public String toString() {

 	StringBuffer buffer = new StringBuffer();

-	buffer.append("Focus: "/*nonNLS*/);

-	buffer.append(fType == null ? "<NONE>"/*nonNLS*/ : fType.getFullyQualifiedName());

-	buffer.append("\n"/*nonNLS*/);

+	buffer.append("Focus: "); //$NON-NLS-1$

+	buffer.append(fType == null ? "<NONE>" : fType.getFullyQualifiedName()); //$NON-NLS-1$

+	buffer.append("\n"); //$NON-NLS-1$

 	if (exists()) {

 		if (fType != null) {

-			buffer.append("Super types:\n"/*nonNLS*/);

+			buffer.append("Super types:\n"); //$NON-NLS-1$

 			toString(buffer, fType, 1, true);

-			buffer.append("Sub types:\n"/*nonNLS*/);

+			buffer.append("Sub types:\n"); //$NON-NLS-1$

 			toString(buffer, fType, 1, false);

 		} else {

-			buffer.append("Sub types of root classes:\n"/*nonNLS*/);

+			buffer.append("Sub types of root classes:\n"); //$NON-NLS-1$

 			IType[] roots= getRootClasses();

 			for (int i= 0; i < roots.length; i++) {

 				toString(buffer, roots[i], 1, false);

 			}

 		}

 	} else {

-		buffer.append("(Hierarchy became stale)"/*nonNLS*/);

+		buffer.append("(Hierarchy became stale)"); //$NON-NLS-1$

 	}

 	return buffer.toString();

 }

@@ -1161,7 +1161,7 @@
  */

 private void toString(StringBuffer buffer, IType type, int indent, boolean ascendant) {

 	for (int i= 0; i < indent; i++) {

-		buffer.append("  "/*nonNLS*/);

+		buffer.append("  "); //$NON-NLS-1$

 	}

 	buffer.append(type.getFullyQualifiedName());

 	buffer.append('\n');

diff --git a/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java b/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
index b7454d9..4b6b41e 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
@@ -22,11 +22,11 @@
 	fFileName = filename;

 

 	String file = new String(filename);

-	int start = file.lastIndexOf("/"/*nonNLS*/) + 1;

-	if (start == 0 || start < file.lastIndexOf("\\"/*nonNLS*/))

-		start = file.lastIndexOf("\\"/*nonNLS*/) + 1;

+	int start = file.lastIndexOf("/") + 1; //$NON-NLS-1$

+	if (start == 0 || start < file.lastIndexOf("\\")) //$NON-NLS-1$

+		start = file.lastIndexOf("\\") + 1; //$NON-NLS-1$

 

-	int end = file.lastIndexOf("."/*nonNLS*/);

+	int end = file.lastIndexOf("."); //$NON-NLS-1$

 	if (end == -1)

 		end = file.length();

 

@@ -42,6 +42,6 @@
 	return fMainTypeName;

 }

 public String toString() {

-	return "CompilationUnit["/*nonNLS*/ + new String(fFileName) + "]"/*nonNLS*/; 

+	return "CompilationUnit[" + new String(fFileName) + "]";  //$NON-NLS-2$ //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java b/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
index 421510e..e7da005 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
@@ -33,7 +33,7 @@
  * Creates a new empty COMPILATION_UNIT document fragment.

  */

 DOMCompilationUnit() {

-	fHeader=""/*nonNLS*/;

+	fHeader=""; //$NON-NLS-1$

 }

 /**

  * Creates a new COMPILATION_UNIT on the given range of the document.

@@ -47,7 +47,7 @@
  */

 DOMCompilationUnit(char[] document, int[] sourceRange) {

 	super(document, sourceRange, null, new int[]{-1, -1});

-	fHeader = ""/*nonNLS*/;

+	fHeader = ""; //$NON-NLS-1$

 }

 /**

  * @see DOMNode#appendContents(CharArrayBuffer)

@@ -75,7 +75,7 @@
 	if (parent.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {

 		return ((IPackageFragment)parent).getCompilationUnit(getName());

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -102,7 +102,7 @@
 		topLevelType= firstType;

 	}

 	if (topLevelType != null) {

-		return topLevelType.getName() + ".java"/*nonNLS*/; 

+		return topLevelType.getName() + ".java";  //$NON-NLS-1$

 	} else {

 		return null;

 	}

@@ -174,6 +174,6 @@
  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "COMPILATION_UNIT: "/*nonNLS*/ + getName();

+	return "COMPILATION_UNIT: " + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMField.java b/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
index e9d22f5..d6e1b1a 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
@@ -229,7 +229,7 @@
 			DOMBuilder builder = new DOMBuilder();

 			IDOMField[] details= builder.createFields(source.toCharArray());

 			if (details.length == 0) {

-				throw new DOMException(Util.bind("dom.cannotDetail"/*nonNLS*/));

+				throw new DOMException(Util.bind("dom.cannotDetail")); //$NON-NLS-1$

 			} else {

 				node= this;

 				for (int i= 0; i < details.length; i++) {

@@ -316,7 +316,7 @@
 	if (parent.getElementType() == IJavaElement.TYPE) {

 		return ((IType)parent).getField(getName());

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -561,7 +561,7 @@
  */

 public void setName(String name) throws IllegalArgumentException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	} else {

 		super.setName(name);

 		setTypeAltered(true);

@@ -572,7 +572,7 @@
  */

 public void setType(String typeName) throws IllegalArgumentException {

 	if (typeName == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullType"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullType")); //$NON-NLS-1$

 	}

 	becomeDetailed();

 	expand();

@@ -603,6 +603,6 @@
  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "FIELD: "/*nonNLS*/ + getName();

+	return "FIELD: " + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java b/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
index 5a9baf6..a966e74 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
@@ -27,7 +27,7 @@
  * Creates a new empty IMPORT node.

  */

 DOMImport() {

-	fName = "java.lang.*"/*nonNLS*/;

+	fName = "java.lang.*"; //$NON-NLS-1$

 	setMask(MASK_DETAILED_SOURCE_INDEXES, true);

 }

 /**

@@ -78,7 +78,7 @@
 protected void appendFragmentedContents(CharArrayBuffer buffer) {

 	if (fNameRange[0] < 0) {

 		buffer

-			.append("import "/*nonNLS*/)

+			.append("import ") //$NON-NLS-1$

 			.append(fName)

 			.append(';')

 			.append(JavaModelManager.LINE_SEPARATOR);

@@ -112,7 +112,7 @@
 	if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {

 		return ((ICompilationUnit)parent).getImport(getName());

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -138,16 +138,16 @@
  */

 public void setName(String name) {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	}

 	becomeDetailed();

 	super.setName(name);

-	fOnDemand = name.endsWith(".*"/*nonNLS*/);

+	fOnDemand = name.endsWith(".*"); //$NON-NLS-1$

 }

 /**

  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "IMPORT: "/*nonNLS*/ + getName();

+	return "IMPORT: " + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java b/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
index 0a1e6a2..86a735a 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
@@ -102,7 +102,7 @@
 			.append(getBody())

 			.append(fDocument, fBodyRange[1] + 1, fSourceRange[1] - fBodyRange[1]);

 	} else {

-		buffer.append("{}"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);

+		buffer.append("{}").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$

 	}

 }

 /**

@@ -156,7 +156,7 @@
 		}

 		return ((IType) parent).getInitializer(count);

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -219,6 +219,6 @@
  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "INITIALIZER"/*nonNLS*/;

+	return "INITIALIZER"; //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java b/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
index 76e25ee..09596ae 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
@@ -281,7 +281,7 @@
 	/* see 1FVIJAH */

 	if (comment != null) {

 		String commentString = new String(comment);

-		if (commentString.indexOf("@deprecated"/*nonNLS*/) >= 0) {

+		if (commentString.indexOf("@deprecated") >= 0) { //$NON-NLS-1$

 			fFlags= fFlags | IConstants.AccDeprecated;

 			return;

 		}

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java b/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
index 921ef4c..59c20e4 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
@@ -226,7 +226,7 @@
  */

 public void addException(String name) throws IllegalArgumentException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("dom.nullExceptionType"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.nullExceptionType")); //$NON-NLS-1$

 	}

 	if (fExceptions == null) {

 		fExceptions= new String[1];

@@ -241,10 +241,10 @@
  */

 public void addParameter(String type, String name) throws IllegalArgumentException {

 	if (type == null) {

-		throw new IllegalArgumentException(Util.bind("dom.nullTypeParameter"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.nullTypeParameter")); //$NON-NLS-1$

 	}

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("dom.nullNameParameter"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.nullNameParameter")); //$NON-NLS-1$

 	}

 	if (fParameterNames == null) {

 		fParameterNames= new String[1];

@@ -306,7 +306,7 @@
 		if (fExceptionRange[0] >= 0) {

 			buffer.append(fDocument, start, fExceptionRange[0] - start);

 		} else {

-			buffer.append(" throws "/*nonNLS*/);

+			buffer.append(" throws "); //$NON-NLS-1$

 		}

 		// add exception list

 		if (fExceptionList != null) {

@@ -414,7 +414,7 @@
 		}

 		return ((IType)parent).getMethod(name, sigs);

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -573,7 +573,7 @@
 	fBody= body;

 	setHasBody(body != null);

 	if (!hasBody()) {

-		fBody= ";"/*nonNLS*/+JavaModelManager.LINE_SEPARATOR;

+		fBody= ";"+JavaModelManager.LINE_SEPARATOR; //$NON-NLS-1$

 	}

 }

 /**

@@ -615,7 +615,7 @@
  */

 public void setName(String name) {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	} else {

 		super.setName(name);

 	}

@@ -631,17 +631,17 @@
 			fParameterNames= null;

 			fParameterList= new char[] {'(',')'};

 		} else {

-			throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));

+			throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes")); //$NON-NLS-1$

 		}

 	} else if (names.length != types.length) {

-		throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes")); //$NON-NLS-1$

 	} else if (names.length == 0) {

 		setParameters(null, null);

 	} else {

 		fParameterNames= names;

 		fParameterTypes= types;

 		CharArrayBuffer parametersBuffer = new CharArrayBuffer();

-		parametersBuffer.append("("/*nonNLS*/);

+		parametersBuffer.append("("); //$NON-NLS-1$

 		char[] comma = new char[] {',', ' '};

 		for (int i = 0; i < names.length; i++) {

 			if (i > 0) {

@@ -662,7 +662,7 @@
  */

 public void setReturnType(String name) throws IllegalArgumentException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("dom.nullReturnType"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.nullReturnType")); //$NON-NLS-1$

 	}

 	becomeDetailed();

 	fragment();

@@ -705,9 +705,9 @@
  */

 public String toString() {

 	if (isConstructor()) {

-		return "CONSTRUCTOR"/*nonNLS*/;

+		return "CONSTRUCTOR"; //$NON-NLS-1$

 	} else {

-		return "METHOD: "/*nonNLS*/ + getName();

+		return "METHOD: " + getName(); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java b/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
index 660f13c..aa6ca79 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
@@ -331,23 +331,23 @@
 void basicAddChild(IDOMNode child) throws IllegalArgumentException, DOMException {

 	// verify child may be added

 	if (!canHaveChildren()) {

-		throw new DOMException(Util.bind("dom.unableAddChild"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.unableAddChild")); //$NON-NLS-1$

 	}

 	if (child == null) {

-		throw new IllegalArgumentException(Util.bind("dom.addNullChild"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.addNullChild")); //$NON-NLS-1$

 	}

 	if (!isAllowableChild(child)) {

-		throw new DOMException(Util.bind("dom.addIncompatibleChild"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addIncompatibleChild")); //$NON-NLS-1$

 	}

 	if (child.getParent() != null) {

-		throw new DOMException(Util.bind("dom.addChildWithParent"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addChildWithParent")); //$NON-NLS-1$

 	}

 	/* NOTE: To test if the child is an ancestor of this node, we

 	 * need only test if the root of this node is the child (the child

 	 * is already a root since we have just guarenteed it has no parent).

 	 */

 	if (child == getRoot()) {

-		throw new DOMException(Util.bind("dom.addAncestorAsChild"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addAncestorAsChild")); //$NON-NLS-1$

 	}

 

 	DOMNode node= (DOMNode)child;

@@ -379,7 +379,7 @@
 	if (!isDetailed()) {

 		DOMNode detailed= getDetailedNode();

 		if (detailed == null) {

-			throw new DOMException(Util.bind("dom.cannotDetail"/*nonNLS*/));

+			throw new DOMException(Util.bind("dom.cannotDetail")); //$NON-NLS-1$

 		}

 		if (detailed != this) {

 			shareContents(detailed);

@@ -652,23 +652,23 @@
 public void insertSibling(IDOMNode sibling) throws IllegalArgumentException, DOMException {

 	// verify sibling may be added

 	if (sibling == null) {

-		throw new IllegalArgumentException(Util.bind("dom.addNullSibling"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.addNullSibling")); //$NON-NLS-1$

 	}

 	if (fParent == null) {

-		throw new DOMException(Util.bind("dom.addSiblingBeforeRoot"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addSiblingBeforeRoot")); //$NON-NLS-1$

 	}

 	if (!fParent.isAllowableChild(sibling)) {

-		throw new DOMException(Util.bind("dom.addIncompatibleSibling"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addIncompatibleSibling")); //$NON-NLS-1$

 	}

 	if (sibling.getParent() != null) {

-		throw new DOMException(Util.bind("dom.addSiblingWithParent"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addSiblingWithParent")); //$NON-NLS-1$

 	}

 	/* NOTE: To test if the sibling is an ancestor of this node, we

 	 * need only test if the root of this node is the child (the sibling

 	 * is already a root since we have just guaranteed it has no parent).

 	 */

 	if (sibling == getRoot()) {

-		throw new DOMException(Util.bind("dom.addAncestorAsSibling"/*nonNLS*/));

+		throw new DOMException(Util.bind("dom.addAncestorAsSibling")); //$NON-NLS-1$

 	}

 

 	DOMNode node= (DOMNode)sibling;

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java b/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
index dec2d57..dee0aaf 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
@@ -70,9 +70,10 @@
 protected void appendFragmentedContents(CharArrayBuffer buffer) {

 	if (fNameRange[0] < 0) {

 		buffer

-			.append("package "/*nonNLS*/)

+			.append("package ") //$NON-NLS-1$

 			.append(fName)

 			.append(';')

+			.append(JavaModelManager.LINE_SEPARATOR)

 			.append(JavaModelManager.LINE_SEPARATOR);

 	} else {

 		buffer

@@ -104,7 +105,7 @@
 	if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {

 		return ((ICompilationUnit)parent).getPackageDeclaration(getName());

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -130,6 +131,6 @@
  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "PACKAGE: "/*nonNLS*/ + getName();

+	return "PACKAGE: " + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/DOMType.java b/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
index f113224..320560e 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
@@ -226,7 +226,7 @@
  */

 public void addSuperInterface(String name) throws IllegalArgumentException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("dom.addNullInterface"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.addNullInterface")); //$NON-NLS-1$

 	}

 	if (fSuperInterfaces == null) {

 		fSuperInterfaces= new String[1];

@@ -264,7 +264,7 @@
 		if (getMask(MASK_TYPE_HAS_SUPERCLASS)) {

 			hasSuperclass = true;

 			if (fExtendsRange[0] < 0) {

-				buffer.append(" extends "/*nonNLS*/);

+				buffer.append(" extends "); //$NON-NLS-1$

 			} else {

 				buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);

 			}

@@ -277,7 +277,7 @@
 		if (getMask(MASK_TYPE_HAS_INTERFACES)) {

 			hasInterfaces = true;

 			if (fImplementsRange[0] < 0) {

-				buffer.append(" implements "/*nonNLS*/);

+				buffer.append(" implements "); //$NON-NLS-1$

 			} else {

 				buffer.append(fDocument, fImplementsRange[0], fImplementsRange[1] + 1 - fImplementsRange[0]);

 			}

@@ -307,7 +307,7 @@
 	} else {

 		if (getMask(MASK_TYPE_HAS_INTERFACES)) {

 			if (fExtendsRange[0] < 0) {

-				buffer.append(" extends "/*nonNLS*/);

+				buffer.append(" extends "); //$NON-NLS-1$

 			} else {

 				buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);

 			}

@@ -377,7 +377,7 @@
 	} else if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {

 		return ((ICompilationUnit)parent).getType(getName());

 	} else {

-		throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$

 	}

 }

 /**

@@ -527,9 +527,9 @@
 	fragment();

 	setMask(MASK_TYPE_IS_CLASS, b);

 	if (b) {

-		fTypeKeyword= "class"/*nonNLS*/;

+		fTypeKeyword= "class"; //$NON-NLS-1$

 	} else {

-		fTypeKeyword= "interface"/*nonNLS*/;

+		fTypeKeyword= "interface"; //$NON-NLS-1$

 		setSuperclass(null);

 	}

 }

@@ -556,7 +556,7 @@
  */

 public void setName(String name) throws IllegalArgumentException {

 	if (name == null) {

-		throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$

 	}

 	super.setName(name);

 	Enumeration children= getChildren();

@@ -588,7 +588,7 @@
 public void setSuperInterfaces(String[] names) {

 	becomeDetailed();

 	if (names == null) {

-		throw new IllegalArgumentException(Util.bind("dom.nullInterfaces"/*nonNLS*/));

+		throw new IllegalArgumentException(Util.bind("dom.nullInterfaces")); //$NON-NLS-1$

 	}

 	fragment();

 	fSuperInterfaces= names;

@@ -601,7 +601,7 @@
 		CharArrayBuffer buffer = new CharArrayBuffer();

 		for (int i = 0; i < names.length; i++) {

 			if (i > 0) {

-				buffer.append(", "/*nonNLS*/);

+				buffer.append(", "); //$NON-NLS-1$

 			}

 			buffer.append(names[i]);

 		}

@@ -636,6 +636,6 @@
  * @see IDOMNode#toString()

  */

 public String toString() {

-	return "TYPE: "/*nonNLS*/ + getName();

+	return "TYPE: " + getName(); //$NON-NLS-1$

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java b/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
index 49830eb..214c053 100644
--- a/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
@@ -27,7 +27,7 @@
 	String importName = new String(name);

 	/** name is set to contain the '*' */

 	if (onDemand) {

-		importName+=".*"/*nonNLS*/;

+		importName+=".*"; //$NON-NLS-1$

 	}

 	fNode= new DOMImport(fDocument, sourceRange, importName, onDemand);

 	addChild(fNode);	

diff --git a/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java b/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
index 6a73282..8e5fd4b 100644
--- a/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
+++ b/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
@@ -53,12 +53,12 @@
  * For debugging only

  */

 public String toString() {

-	StringBuffer buf = new StringBuffer("ReferenceInfo("/*nonNLS*/);

+	StringBuffer buf = new StringBuffer("ReferenceInfo("); //$NON-NLS-1$

 	for (int i = 0; i < fNames.length; i++) {

 		buf.append(fNames[i]);

-		buf.append(" "/*nonNLS*/);

+		buf.append(" "); //$NON-NLS-1$

 	}

-	buf.append(")"/*nonNLS*/);

+	buf.append(")"); //$NON-NLS-1$

 	return buf.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/messages.properties b/model/org/eclipse/jdt/internal/core/messages.properties
index a49d452..a3c90e4 100644
--- a/model/org/eclipse/jdt/internal/core/messages.properties
+++ b/model/org/eclipse/jdt/internal/core/messages.properties
@@ -75,7 +75,7 @@
 build.analyzing = Analyzing {0}

 build.preparingBuild = Preparing for build

 build.compiling = Compiling {0}

-build.readingDelta = Reading resource change information for : {0}

+build.readingDelta = Reading resource change information for: {0}

 build.completed = Java build completed

 build.builderName = Java Builder

 build.compilingContent = Compiling content of {0}

@@ -149,6 +149,7 @@
 file.notFound = File not found.

 file.badFormat = Bad format.

 variable.badFormat = Bad format for variables.

+option.badFormat = Bad format for options.

 path.nullPath = Path cannot be null.

 path.mustBeAbsolute = Path must be absolute.

 cache.invalidLoadFactor = Incorrect load factor

diff --git a/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java b/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
index e846e1a..eaf8532 100644
--- a/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
+++ b/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
@@ -19,7 +19,7 @@
 	if (!directory.exists()) {

 		directory.mkdirs();

 	} else if (!directory.isDirectory()) {

-		throw new IllegalArgumentException("Directory arguments should be a directory."/*nonNLS*/);

+		throw new IllegalArgumentException("Directory arguments should be a directory."); //$NON-NLS-1$

 	}

 	fDirectory = directory;	

 }

@@ -30,7 +30,7 @@
 synchronized public RandomAccessFile allocateAnonymousFile() throws IOException {

 	

 	File file = getAnonymousFile();

-	return new RandomAccessFile(file, "rw"/*nonNLS*/);

+	return new RandomAccessFile(file, "rw"); //$NON-NLS-1$

 }

 /**

  * Returns a URL on a newly allocated file with the given initial content.

@@ -38,17 +38,17 @@
  */

 synchronized public URL allocateAnonymousURL(byte[] bytes) throws IOException {

 	try {

-		byte hasharray[] = java.security.MessageDigest.getInstance("SHA"/*nonNLS*/).digest(bytes);

+		byte hasharray[] = java.security.MessageDigest.getInstance("SHA").digest(bytes); //$NON-NLS-1$

 		StringBuffer sb = new StringBuffer();

 		for (int i = 0; i < hasharray.length; i++) {

 			sb.append(Character.forDigit((int)((hasharray[i] >> 4) & 0x0F), 16));

 			sb.append(Character.forDigit((int)(hasharray[i] & 0x0F), 16));

 		}

-		sb.append(".jnk"/*nonNLS*/);

+		sb.append(".jnk"); //$NON-NLS-1$

 		String fileName = sb.toString();

 		File file = fileForName(fileName);

 		if (!file.exists()) {

-			RandomAccessFile raf = new RandomAccessFile(file, "rw"/*nonNLS*/);

+			RandomAccessFile raf = new RandomAccessFile(file, "rw"); //$NON-NLS-1$

 			raf.write(bytes);

 			raf.close();

 		}

@@ -64,7 +64,7 @@
 static public URL convertFileToURL(File file) {

 	try {

 		String path = file.getCanonicalPath().replace(java.io.File.separatorChar, '/');

-		return new URL("file"/*nonNLS*/, ""/*nonNLS*/, "/"/*nonNLS*/ + path);

+		return new URL("file", "", "/" + path); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

 	}

 	catch (IOException ioe) {

 		throw new Error();

@@ -121,7 +121,7 @@
 		sb.append(Character.forDigit((int)(l % 36), 36));

 		l /= 36;

 	}

-	sb.append(".jnk"/*nonNLS*/);

+	sb.append(".jnk"); //$NON-NLS-1$

 	return sb.toString();

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/util/DiskCache.java b/model/org/eclipse/jdt/internal/core/util/DiskCache.java
index 7213985..ad02b6f 100644
--- a/model/org/eclipse/jdt/internal/core/util/DiskCache.java
+++ b/model/org/eclipse/jdt/internal/core/util/DiskCache.java
@@ -171,9 +171,9 @@
 

 	EntryCache fEntryCache;

 

-	static final String CONTENTS_FILE_NAME = "contents"/*nonNLS*/;

-	static final String TEMP_CONTENTS_FILE_NAME = "tempcont"/*nonNLS*/;

-	static final String CONTENTS_VERSION = "DiskCache.V1.0"/*nonNLS*/;

+	static final String CONTENTS_FILE_NAME = "contents"; //$NON-NLS-1$

+	static final String TEMP_CONTENTS_FILE_NAME = "tempcont"; //$NON-NLS-1$

+	static final String CONTENTS_VERSION = "DiskCache.V1.0"; //$NON-NLS-1$

 

 	/**

 	 * Set to true when cache is modified, cleared when saved.

@@ -217,7 +217,7 @@
 	 */

 	public OutputStream add(final String key, int size, byte[] extraInfo) throws IOException {

 		if (size > fSpaceLimit*1024) {

-			throw new IOException("Entry size greater than cache size"/*nonNLS*/);

+			throw new IOException("Entry size greater than cache size"); //$NON-NLS-1$

 		}

 		final File file;

 		OutputStream output;

@@ -518,7 +518,7 @@
 			int spaceUsed = in.readInt();  /* Ignored -- updated as entries are read */

 			int numEntries = in.readInt();

 			if (!sig.equals(CONTENTS_VERSION)) {

-				throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));

+				throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$

 			}

 

 			/* Read to a temp. array of entries.  The entries are in most- to 

@@ -736,7 +736,7 @@
 				}

 			}				

 		};

-		fPeriodicSaveThread.setName("DiskCache periodic save"/*nonNLS*/);

+		fPeriodicSaveThread.setName("DiskCache periodic save"); //$NON-NLS-1$

 		fPeriodicSaveThread.start();

 					

 	}

diff --git a/model/org/eclipse/jdt/internal/core/util/Dumper.java b/model/org/eclipse/jdt/internal/core/util/Dumper.java
index 2f61613..bc32cd2 100644
--- a/model/org/eclipse/jdt/internal/core/util/Dumper.java
+++ b/model/org/eclipse/jdt/internal/core/util/Dumper.java
@@ -62,30 +62,30 @@
 	if (!oneLine) {

 		++fTabLevel;

 	}

-	fWriter.print("["/*nonNLS*/);

+	fWriter.print("["); //$NON-NLS-1$

 	for (int i = 0; i < len; ++i) {

 		if (!oneLine) {

 			if ((i % maxPerLine) == 0) {

 				fWriter.println();

 				tabIfNeeded();

 				fWriter.print(i);

-				fWriter.print(": "/*nonNLS*/);

+				fWriter.print(": "); //$NON-NLS-1$

 			}

 		}

 		fWriter.print(val[i]);

 		if (i + 1 < len) {

-			fWriter.print(", "/*nonNLS*/);

+			fWriter.print(", "); //$NON-NLS-1$

 		}

 	}

 	if (oneLine) {

-		fWriter.print("]"/*nonNLS*/);

+		fWriter.print("]"); //$NON-NLS-1$

 		fWriter.println();

 	}

 	else {

 		fWriter.println();

 		--fTabLevel;

 		tabIfNeeded();

-		fWriter.print("]"/*nonNLS*/);

+		fWriter.print("]"); //$NON-NLS-1$

 		fWriter.println();

 	}

 }

@@ -94,7 +94,7 @@
  */

 public void dump(Object[] val) {

 	int len = val.length;

-	fWriter.print("["/*nonNLS*/);

+	fWriter.print("["); //$NON-NLS-1$

 	if (len > 0) {

 		fWriter.println();

 		++fTabLevel;

@@ -104,7 +104,7 @@
 		--fTabLevel;

 		tabIfNeeded();

 	}

-	fWriter.println("]"/*nonNLS*/);

+	fWriter.println("]"); //$NON-NLS-1$

 }

 /**

  * Dumps the given array.

@@ -116,20 +116,20 @@
 	if (!oneLine) {

 		++fTabLevel;

 	}

-	fWriter.print("["/*nonNLS*/);

+	fWriter.print("["); //$NON-NLS-1$

 	boolean newLine = !oneLine;

 	for (int i = 0; i < len; ++i) {

 		if (newLine) {

 			fWriter.println();

 			tabIfNeeded();

 		}

-		fWriter.print("\""/*nonNLS*/ + val[i] + "\""/*nonNLS*/);

+		fWriter.print("\"" + val[i] + "\""); //$NON-NLS-1$ //$NON-NLS-2$

 		if (i + 1 < len) {

-			fWriter.print(", "/*nonNLS*/);

+			fWriter.print(", "); //$NON-NLS-1$

 		}

 		newLine = (i != 0 && (i % maxPerLine) == 0);

 	}

-	fWriter.print("]"/*nonNLS*/);

+	fWriter.print("]"); //$NON-NLS-1$

 	if (oneLine || newLine) {

 		fWriter.println();

 	}

@@ -144,18 +144,18 @@
 	tabIfNeeded();

 	if (val instanceof IDumpable) {

 		IDumpable dumpable = (IDumpable) val;

-		fWriter.println(classNameFor(val) + " {"/*nonNLS*/);

+		fWriter.println(classNameFor(val) + " {"); //$NON-NLS-1$

 		int originalLevel = fTabLevel;

 		++fTabLevel;

 		try {

 			dumpable.dump(this);

 		}

 		catch (Throwable t) {

-			fWriter.println("*ERR*"/*nonNLS*/);

+			fWriter.println("*ERR*"); //$NON-NLS-1$

 		}

 		fTabLevel = originalLevel;

 		tabIfNeeded();

-		fWriter.println("}"/*nonNLS*/);

+		fWriter.println("}"); //$NON-NLS-1$

 	}

 	else {

 		fWriter.println(val);

@@ -211,7 +211,7 @@
  */

 public void dump(String name, String val) {

 	prefix(name);

-	fWriter.println(val == null ? "null"/*nonNLS*/ : "\""/*nonNLS*/ + val + "\""/*nonNLS*/);

+	fWriter.println(val == null ? "null" : "\"" + val + "\""); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$

 }

 /**

  * Dumps the given value, with the given name as a prefix.

@@ -264,7 +264,7 @@
 void prefix(String name) {

 	tabIfNeeded();

 	fWriter.print(name);

-	fWriter.print(": "/*nonNLS*/);

+	fWriter.print(": "); //$NON-NLS-1$

 }

 /**

  * Print an object directly, without a newline.

@@ -289,7 +289,7 @@
  */

 void tabIfNeeded() {

 	for (int i = 0; i < fTabLevel; ++i) {

-		fWriter.print("  "/*nonNLS*/);

+		fWriter.print("  "); //$NON-NLS-1$

 	}

 }

 }

diff --git a/model/org/eclipse/jdt/internal/core/util/LRUCache.java b/model/org/eclipse/jdt/internal/core/util/LRUCache.java
index fbac18a..b6b72e4 100644
--- a/model/org/eclipse/jdt/internal/core/util/LRUCache.java
+++ b/model/org/eclipse/jdt/internal/core/util/LRUCache.java
@@ -80,7 +80,7 @@
 		 */

 		public String toString() {

 

-			return "LRUCacheEntry ["/*nonNLS*/ + _fKey + "-->"/*nonNLS*/ + _fValue + "]"/*nonNLS*/;

+			return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]"; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	}	

 

@@ -444,7 +444,7 @@
  */

 public String toString() {

 	return 

-		"LRUCache "/*nonNLS*/ + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +

+		"LRUCache " + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$

 		this.toStringContents();

 }

 /**

@@ -471,9 +471,9 @@
 		String toString = sorter.sortedStrings[i];

 		Object value = this.get(sorter.sortedObjects[i]);

 		result.append(toString);		

-		result.append(" -> "/*nonNLS*/);

+		result.append(" -> "); //$NON-NLS-1$

 		result.append(value);

-		result.append("\n"/*nonNLS*/);

+		result.append("\n"); //$NON-NLS-1$

 	}

 	return result.toString();

 }

diff --git a/model/org/eclipse/jdt/internal/core/util/LookupTable.java b/model/org/eclipse/jdt/internal/core/util/LookupTable.java
index 74888e9..777bc91 100644
--- a/model/org/eclipse/jdt/internal/core/util/LookupTable.java
+++ b/model/org/eclipse/jdt/internal/core/util/LookupTable.java
@@ -62,7 +62,7 @@
 	    	entry = null;

 	    	return next;

 		}

-	    throw new NoSuchElementException("LookupTable Enumerator"/*nonNLS*/);

+	    throw new NoSuchElementException("LookupTable Enumerator"); //$NON-NLS-1$

 	}

 	}      	

 	/**

@@ -94,10 +94,10 @@
 	 */

 	public LookupTable(int initialCapacity, float loadFactor) {

 	if (initialCapacity < 0)

-	    throw new IllegalArgumentException("Illegal Capacity: "/*nonNLS*/+

+	    throw new IllegalArgumentException("Illegal Capacity: "+ //$NON-NLS-1$

 											   initialCapacity);

 		if (loadFactor <= 0)

-			throw new IllegalArgumentException("Illegal Load: "/*nonNLS*/+loadFactor);

+			throw new IllegalArgumentException("Illegal Load: "+loadFactor); //$NON-NLS-1$

 

 		if (initialCapacity==0)

 			initialCapacity = 1;

@@ -428,27 +428,27 @@
 		for (int i = 0; i < keys.length; ++i) {

 			if (keys[i] == null) {

 				if (values[i] != null) {

-					System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": key is null, but value isn't at index "/*nonNLS*/ + i);

+					System.err.println("LookupTable sanity check in " + where + ": key is null, but value isn't at index " + i); //$NON-NLS-2$ //$NON-NLS-1$

 					throw new Error();

 				}

 			}

 			else {

 				if (values[i] == null) {

-					System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": value is null, but key isn't at index "/*nonNLS*/ + i);

+					System.err.println("LookupTable sanity check in " + where + ": value is null, but key isn't at index " + i); //$NON-NLS-2$ //$NON-NLS-1$

 					throw new Error();

 				}

 				else {

 					++n;

 					Object value = get(keys[i]);

 					if (value == null || value != values[i]) {

-						System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": key doesn't hash to proper value: "/*nonNLS*/ + keys[i]);

+						System.err.println("LookupTable sanity check in " + where + ": key doesn't hash to proper value: " + keys[i]); //$NON-NLS-2$ //$NON-NLS-1$

 						throw new Error();

 					}

 				}

 			}

 		}

 		if (n != count) {

-			System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": count is "/*nonNLS*/ + count + " but there are "/*nonNLS*/ + n + " entries"/*nonNLS*/);

+			System.err.println("LookupTable sanity check in " + where + ": count is " + count + " but there are " + n + " entries"); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 			throw new Error();

 		}

 	}

@@ -473,7 +473,7 @@
 	 */

 	public synchronized String toString() {

 	StringBuffer buf = new StringBuffer();

-	buf.append("{"/*nonNLS*/);

+	buf.append("{"); //$NON-NLS-1$

 	boolean first = true;

 	for (int i = 0, max = keys.length; i < max; i++) {

 		if (keys[i] != null) {

@@ -481,18 +481,18 @@
 				first = false;

 			}

 			else {

-				buf.append(", "/*nonNLS*/);

+				buf.append(", "); //$NON-NLS-1$

 			}

 			if (buf.length() > 1000) {

-				buf.append("..."/*nonNLS*/);

+				buf.append("..."); //$NON-NLS-1$

 				break;

 			}

 			else {

-			    buf.append(keys[i]).append("="/*nonNLS*/).append(values[i]);

+			    buf.append(keys[i]).append("=").append(values[i]); //$NON-NLS-1$

 		    }

 	    }

 	}

-	buf.append("}"/*nonNLS*/);

+	buf.append("}"); //$NON-NLS-1$

 	return buf.toString();

 	}

 }

diff --git a/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java b/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
index 6846b44..356e552 100644
--- a/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
+++ b/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
@@ -117,9 +117,9 @@
 		String key = this.keyTable[i];

 		if (key != null) {

 			buffer.append(key);

-			buffer.append(" -> "/*nonNLS*/);

+			buffer.append(" -> "); //$NON-NLS-1$

 			buffer.append(this.valueTable[i]);

-			buffer.append("\n"/*nonNLS*/);

+			buffer.append("\n"); //$NON-NLS-1$

 		}

 	}

 	return buffer.toString();

diff --git a/model/org/eclipse/jdt/internal/core/util/StringMatcher.java b/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
index 3d161d9..33492d8 100644
--- a/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
+++ b/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
@@ -229,9 +229,9 @@
 	 * @param p, a String object that is a simple regular expression with ‘*’ and/or ‘?’

 	 */

 	private void parseWildCards() {

-		if(fPattern.startsWith("*"/*nonNLS*/))

+		if(fPattern.startsWith("*")) //$NON-NLS-1$

 			fHasLeadingStar = true;

-		if(fPattern.endsWith("*"/*nonNLS*/)) {

+		if(fPattern.endsWith("*")) { //$NON-NLS-1$

 			/* make sure it's not an escaped wildcard */

 			if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {

 				fHasTrailingStar = true;

diff --git a/plugin.jars b/plugin.jars
index c6ba09b..95b28d5 100644
--- a/plugin.jars
+++ b/plugin.jars
@@ -1,4 +1,5 @@
 jdtcore.jar=\

+	Eclipse Java Ant Compiler,\

 	Eclipse Java Batch Compiler,\

 	Eclipse Java Code Assist,\

 	Eclipse Java Formatter,\

diff --git a/scripts/pluginUpdate.xml b/scripts/pluginUpdate.xml
index 10a526c..2f2dd9e 100644
--- a/scripts/pluginUpdate.xml
+++ b/scripts/pluginUpdate.xml
@@ -30,6 +30,7 @@
 		

 		<echo message="UPDATE jdtcoresrc.zip" />

 		<zip zipfile="${dest}/jdtcoresrc.zip">

+		    <zipfileset dir="Eclipse Java Ant Compiler" />

 		    <zipfileset dir="Eclipse Java Batch Compiler" />

 		    <zipfileset dir="Eclipse Java Code Assist" />

 		    <zipfileset dir="Eclipse Java Compiler" />

diff --git a/search/org/eclipse/jdt/core/search/SearchEngine.java b/search/org/eclipse/jdt/core/search/SearchEngine.java
index ef7e758..b3d61db 100644
--- a/search/org/eclipse/jdt/core/search/SearchEngine.java
+++ b/search/org/eclipse/jdt/core/search/SearchEngine.java
@@ -246,7 +246,7 @@
 		/* initialize progress monitor */

 		IProgressMonitor progressMonitor = resultCollector.getProgressMonitor();

 		if (progressMonitor != null) {

-			progressMonitor.beginTask(Util.bind("engine.searching"/*nonNLS*/), 105); // 5 for getting paths, 100 for locating matches

+			progressMonitor.beginTask(Util.bind("engine.searching"), 105); // 5 for getting paths, 100 for locating matches //$NON-NLS-1$

 		}

 

 		/* index search */

@@ -417,7 +417,7 @@
  */	

 public void searchDeclarationsOfAccessedFields(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {

 	MatchLocator locator = new MatchLocator(

-		(SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.FIELD, IJavaSearchConstants.REFERENCES, true),

+		(SearchPattern)createSearchPattern("*", IJavaSearchConstants.FIELD, IJavaSearchConstants.REFERENCES, true), //$NON-NLS-1$

 		IInfoConstants.DeclarationInfo,

 		resultCollector,

 		new JavaWorkspaceScope());

@@ -464,7 +464,7 @@
  */	

 public void searchDeclarationsOfReferencedTypes(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {

 	MatchLocator locator = new MatchLocator(

-		(SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, true),

+		(SearchPattern)createSearchPattern("*", IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, true), //$NON-NLS-1$

 		IInfoConstants.DeclarationInfo,

 		resultCollector,

 		new JavaWorkspaceScope());

@@ -514,7 +514,7 @@
  */	

 public void searchDeclarationsOfSentMessages(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {

 	MatchLocator locator = new MatchLocator(

-		(SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.METHOD, IJavaSearchConstants.REFERENCES, true),

+		(SearchPattern)createSearchPattern("*", IJavaSearchConstants.METHOD, IJavaSearchConstants.REFERENCES, true), //$NON-NLS-1$

 		IInfoConstants.DeclarationInfo,

 		resultCollector,

 		new JavaWorkspaceScope());

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java b/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
index 67bf68d..ce99882 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
@@ -190,10 +190,10 @@
 

 	public void open() throws IOException {

 		if (!opened) {

-			raf= new SafeRandomAccessFile(indexFile, "r"/*nonNLS*/);

+			raf= new SafeRandomAccessFile(indexFile, "r"); //$NON-NLS-1$

 			String sig= raf.readUTF();

 			if (!sig.equals(IIndexConstants.SIGNATURE))

-				throw new IOException(Util.bind("exception.wrongFormat"/*nonNLS*/));

+				throw new IOException(Util.bind("exception.wrongFormat")); //$NON-NLS-1$

 			int summaryBlockNum= raf.readInt();

 			raf.seek(summaryBlockNum * (long) IIndexConstants.BLOCK_SIZE);

 			summary= new IndexSummary();

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java b/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
index a48657d..8ac2060 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
@@ -152,7 +152,7 @@
 			firstInBlock= true;

 			firstIndexBlock= true;

 			firstFileListBlock= true;

-			indexOut= new SafeRandomAccessFile(this.indexFile, "rw"/*nonNLS*/);

+			indexOut= new SafeRandomAccessFile(this.indexFile, "rw"); //$NON-NLS-1$

 			opened= true;

 		}

 	}

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java b/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
index 8ede6b7..dc89837 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
@@ -46,15 +46,15 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(word.length * 2);

-	buffer.append("EntryResult: word="/*nonNLS*/);

+	buffer.append("EntryResult: word="); //$NON-NLS-1$

 	buffer.append(word);

-	buffer.append(", refs={"/*nonNLS*/);

+	buffer.append(", refs={"); //$NON-NLS-1$

 	for (int i = 0; i < fileRefs.length; i++){

 		if (i > 0) buffer.append(',');

 		buffer.append(' ');

 		buffer.append(fileRefs[i]);

 	}

-	buffer.append(" }"/*nonNLS*/);

+	buffer.append(" }"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java b/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
index 701ec78..b6d03a0 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
@@ -48,7 +48,7 @@
 	public String getType() {

 		int lastDot= file.getPath().lastIndexOf('.');

 		if (lastDot == -1)

-			return ""/*nonNLS*/;

+			return ""; //$NON-NLS-1$

 		return file.getPath().substring(lastDot + 1);

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java b/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
index d1e22b0..1a63d47 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
@@ -79,11 +79,11 @@
 		return elementSize;

 	}

 	public String toString() {

-		String s= ""/*nonNLS*/;

+		String s= ""; //$NON-NLS-1$

 		Object object;

 		for (int i= 0, length= valueTable.length; i < length; i++)

 			if ((object= valueTable[i]) != null)

-				s += new String(keyTable[i]) + " -> "/*nonNLS*/ + object.toString() + "\n"/*nonNLS*/;

+				s += new String(keyTable[i]) + " -> " + object.toString() + "\n"; //$NON-NLS-2$ //$NON-NLS-1$

 		return s;

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java b/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
index 33b33d4..c6fb814 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
@@ -75,7 +75,7 @@
 	public String getType() {

 		String extension= file.getFileExtension();

 		if (extension == null)

-			return ""/*nonNLS*/;

+			return ""; //$NON-NLS-1$

 		return extension;

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java b/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
index a1a1ce0..fdd136d 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
@@ -12,7 +12,7 @@
 	/**

 	 * The signature of the index file.

 	 */

-	public static final String SIGNATURE= "INDEX FILE 0.001"/*nonNLS*/;

+	public static final String SIGNATURE= "INDEX FILE 0.001"; //$NON-NLS-1$

 	/**

 	 * The signature of the index file.

 	 */

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/Index.java b/search/org/eclipse/jdt/internal/core/index/impl/Index.java
index f989c1f..324ad5b 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/Index.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/Index.java
@@ -53,7 +53,7 @@
 	 */

 	private String toString;

 	public Index(File indexDirectory) throws IOException {

-		this(indexDirectory,".index"/*nonNLS*/);

+		this(indexDirectory,".index"); //$NON-NLS-1$

 	}

 	public Index(File indexDirectory, String indexName) throws IOException {

 		super();

@@ -215,7 +215,7 @@
 		//System.out.println("merge");

 

 		//initialisation of tempIndex

-		File tempFile= new File(indexFile.getAbsolutePath() + "TempVA"/*nonNLS*/);

+		File tempFile= new File(indexFile.getAbsolutePath() + "TempVA"); //$NON-NLS-1$

 

 		boolean exists= indexFile.exists();

 		IndexInput mainIndexInput= new BlocksIndexInput(indexFile);

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java b/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
index b5cf187..d515907 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
@@ -45,7 +45,7 @@
 		char[] word;

 		int blockNum;

 		public String toString(){

-			return "FirstWordInBlock: "/*nonNLS*/ + new String(word) + ", blockNum: "/*nonNLS*/ + blockNum;

+			return "FirstWordInBlock: " + new String(word) + ", blockNum: " + blockNum; //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	}

 

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java b/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
index d115c7d..5eb1270 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
@@ -20,10 +20,10 @@
 public class IndexedFile implements IQueryResult {

 	protected String path;

 	protected int fileNumber;

-	protected static final String INFO_BEGIN= "("/*nonNLS*/;

-	protected static final String INFO_END= ")"/*nonNLS*/;

-	protected static final String INFO_SEPARATOR= ","/*nonNLS*/;

-	protected static final String INFO_VALUE_SEPARATOR= ":"/*nonNLS*/;

+	protected static final String INFO_BEGIN= "("; //$NON-NLS-1$

+	protected static final String INFO_END= ")"; //$NON-NLS-1$

+	protected static final String INFO_SEPARATOR= ","; //$NON-NLS-1$

+	protected static final String INFO_VALUE_SEPARATOR= ":"; //$NON-NLS-1$

 	protected static final int MAX_PROPERTIES_SIZE= 2 * 1024;

 	protected Hashtable properties;

 	protected int propertiesSize= 2 * (INFO_BEGIN.length() + INFO_END.length());

@@ -131,7 +131,7 @@
 	}

 	public String propertiesToString() {

 		if (properties.isEmpty())

-			return ""/*nonNLS*/;

+			return ""; //$NON-NLS-1$

 		StringBuffer prop= new StringBuffer(INFO_BEGIN);

 		for (Enumeration e= getPropertyNames(); e.hasMoreElements();) {

 			String property= (String) e.nextElement();

@@ -160,6 +160,6 @@
 			properties.put(propertyName, value);

 	}

 	public String toString() {

-		return "IndexedFile("/*nonNLS*/ + fileNumber + ": "/*nonNLS*/ + path + ")"/*nonNLS*/;

+		return "IndexedFile(" + fileNumber + ": " + path + ")"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java b/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
index bae4d88..37b8e1c 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
@@ -56,7 +56,7 @@
 	public String getType() {

 		String extension= file.getFileExtension();

 		if (extension == null)

-			return ""/*nonNLS*/;

+			return ""; //$NON-NLS-1$

 		return extension;

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java b/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
index db9f920..1c277de 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
@@ -19,7 +19,7 @@
 	protected ZipEntry zipEntry;

 	protected byte[] byteContents;

 	protected Path zipFilePath;

-	public static final String JAR_FILE_ENTRY_SEPARATOR = "|"/*nonNLS*/;

+	public static final String JAR_FILE_ENTRY_SEPARATOR = "|"; //$NON-NLS-1$

 /**

  * JarFileEntryDocument constructor comment.

  */

@@ -59,7 +59,7 @@
 	 * @see IDocument#getType

 	 */

 	public String getType() {

-		return "class"/*nonNLS*/;

+		return "class"; //$NON-NLS-1$

 	}

 public void setBytes(byte[] byteContents) {

 	this.byteContents = byteContents;

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java b/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
index 7ca6386..8a6272a 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
@@ -86,7 +86,7 @@
 		 */

 		public String toString() {

 

-			return "LRUCacheEntry ["/*nonNLS*/ + _fKey + "-->"/*nonNLS*/ + _fValue + "]"/*nonNLS*/;

+			return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]"; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$

 		}

 	}

 

@@ -451,7 +451,7 @@
 	 */

 	public String toString() {

 

-		return "LRUCache "/*nonNLS*/ + (getCurrentSpace() * 100.0 / getSpaceLimit()) + "% full"/*nonNLS*/;

+		return "LRUCache " + (getCurrentSpace() * 100.0 / getSpaceLimit()) + "% full"; //$NON-NLS-1$ //$NON-NLS-2$

 	}

 	/**

 	 * Updates the timestamp for the given entry, ensuring that the queue is 

diff --git a/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java b/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
index a65cd3b..f385a5b 100644
--- a/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
+++ b/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
@@ -61,9 +61,9 @@
 		size= 0;

 	}

 	public String toString() {

-		String s= ""/*nonNLS*/;

+		String s= ""; //$NON-NLS-1$

 		for (int i= 0; i < size; i++)

-			s += elements[i].toString() + "\n"/*nonNLS*/;

+			s += elements[i].toString() + "\n"; //$NON-NLS-1$

 		return s;

 	}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java b/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
index 6e468c8..af6828c 100644
--- a/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
+++ b/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
@@ -67,7 +67,7 @@
 				zipFileName + 

 				JAR_FILE_ENTRY_SEPARATOR + 

 				type.getFullyQualifiedName().replace('.', '/') +

-				".class"/*nonNLS*/;

+				".class"; //$NON-NLS-1$

 			this.resourcePaths.put(resourcePath, resourcePath);

 			paths.put(jar.getPath(), type);

 		} else {

diff --git a/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java b/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
index 5d3a2a4..d2fba13 100644
--- a/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
+++ b/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
@@ -74,7 +74,7 @@
 		isComplete &= search(searchIndexes[i]);

 	}

 	if (JobManager.VERBOSE){

-		System.out.println("-> execution time: "/*nonNLS*/ + executionTime + " ms. for : "/*nonNLS*/+this);

+		System.out.println("-> execution time: " + executionTime + " ms. for : "+this); //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	return isComplete;

 }

@@ -96,7 +96,7 @@
 			try {

 				monitor.exitRead(); // free read lock

 				monitor.enterWrite(); // ask permission to write

-				if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());

+				if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile()); //$NON-NLS-1$

 				index.save();

 			} catch(IOException e){

 				return FAILED;

@@ -116,6 +116,6 @@
 	}

 }

 public String toString(){

-	return "searching "/*nonNLS*/ + pattern.toString();

+	return "searching " + pattern.toString(); //$NON-NLS-1$

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java b/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
index a24d5c6..6894d48 100644
--- a/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
+++ b/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
@@ -56,7 +56,7 @@
 			try {

 				monitor.exitRead(); // free read lock

 				monitor.enterWrite(); // ask permission to write

-				if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());

+				if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile()); //$NON-NLS-1$

 				index.save();

 			} catch(IOException e){

 				return FAILED;

diff --git a/search/org/eclipse/jdt/internal/core/search/Util.java b/search/org/eclipse/jdt/internal/core/search/Util.java
index 460cf7c..fa0580d 100644
--- a/search/org/eclipse/jdt/internal/core/search/Util.java
+++ b/search/org/eclipse/jdt/internal/core/search/Util.java
@@ -10,7 +10,7 @@
 public class Util {

 	/* Bundle containing messages */

 	protected static ResourceBundle bundle;

-	private final static String bundleName = "org.eclipse.jdt.internal.core.search.messages"/*nonNLS*/;

+	private final static String bundleName = "org.eclipse.jdt.internal.core.search.messages"; //$NON-NLS-1$

 	static {

 		relocalize();

 	}

@@ -34,14 +34,14 @@
  */

 public static String bind(String id, String[] bindings) {

 	if (id == null)

-		return "No message available"/*nonNLS*/;

+		return "No message available"; //$NON-NLS-1$

 	String message = null;

 	try {

 		message = bundle.getString(id);

 	} catch (MissingResourceException e) {

 		// If we got an exception looking for the message, fail gracefully by just returning

 		// the id we were looking for.  In most cases this is semi-informative so is not too bad.

-		return "Missing message: "/*nonNLS*/ + id + " in: "/*nonNLS*/ + bundleName;

+		return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$

 	}

 	if (bindings == null)

 		return message;

@@ -60,7 +60,7 @@
 				} catch (NumberFormatException nfe) {

 					output.append(message.substring(end + 1, start + 1));

 				} catch (ArrayIndexOutOfBoundsException e) {

-					output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);

+					output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$

 				}

 			} else {

 				output.append(message.substring(end, length));

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java b/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
index 3f6d3ed..ee59e69 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
@@ -68,6 +68,6 @@
 	}

 }

 public String toString(){

-	return "indexing "/*nonNLS*/ + resource.getName();

+	return "indexing " + resource.getName(); //$NON-NLS-1$

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java b/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
index 5b1bd84..9b3968e 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
@@ -69,6 +69,6 @@
 	}

 }

 public String toString(){

-	return "indexing "/*nonNLS*/ + resource.getName();

+	return "indexing " + resource.getName(); //$NON-NLS-1$

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java b/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
index bc57a19..009feeb 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
@@ -73,11 +73,11 @@
 			}

 				

 			if (JobManager.VERBOSE)

-				System.out.println("INDEX : "/*nonNLS*/ + zip.getName());

+				System.out.println("INDEX : " + zip.getName()); //$NON-NLS-1$

 			long initialTime = System.currentTimeMillis();

 

 			final Hashtable indexedFileNames = new Hashtable(100);

-			IQueryResult[] results = index.queryInDocumentNames(""/*nonNLS*/); // all file names

+			IQueryResult[] results = index.queryInDocumentNames(""); // all file names //$NON-NLS-1$

 			int resultLength = results == null ? 0 : results.length;

 			if (resultLength != 0) {

 				/* check integrity of the existing index file

@@ -135,11 +135,11 @@
 			}

 			if (JobManager.VERBOSE)

 				System.out.println(

-					"INDEX : "/*nonNLS*/

+					"INDEX : " //$NON-NLS-1$

 						+ zip.getName()

-						+ " COMPLETE in "/*nonNLS*/

+						+ " COMPLETE in " //$NON-NLS-1$

 						+ (System.currentTimeMillis() - initialTime)

-						+ " ms"/*nonNLS*/); 

+						+ " ms");  //$NON-NLS-1$

 		} finally {

 			if (zip != null)

 				zip.close();

@@ -160,12 +160,12 @@
 		if (resource != null) {

 			IPath location = resource.getLocation();

 			if (location == null){

-				toString = "indexing "/*nonNLS*/;

+				toString = "indexing "; //$NON-NLS-1$

 			} else {

-			    toString = "indexing "/*nonNLS*/ + location.toFile().toString();

+			    toString = "indexing " + location.toFile().toString(); //$NON-NLS-1$

 			}

 		} else {

-		    toString = "indexing "/*nonNLS*/ + this.path.toFile().toString();

+		    toString = "indexing " + this.path.toFile().toString(); //$NON-NLS-1$

 		}

 	}

 	return toString;

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java b/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
index e9756c4..6f52cfd 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
@@ -13,16 +13,16 @@
 import java.util.zip.*;

 

 public class BinaryIndexer extends AbstractIndexer {

-	public static final String[] FILE_TYPES= new String[] {"class"/*nonNLS*/};

-	private static final char[] BYTE = "byte"/*nonNLS*/.toCharArray();

-	private static final char[] CHAR = "char"/*nonNLS*/.toCharArray();

-	private static final char[] DOUBLE = "double"/*nonNLS*/.toCharArray();

-	private static final char[] FLOAT = "float"/*nonNLS*/.toCharArray();

-	private static final char[] INT = "int"/*nonNLS*/.toCharArray();

-	private static final char[] LONG = "long"/*nonNLS*/.toCharArray();

-	private static final char[] SHORT = "short"/*nonNLS*/.toCharArray();

-	private static final char[] BOOLEAN = "boolean"/*nonNLS*/.toCharArray();

-	private static final char[] VOID = "void"/*nonNLS*/.toCharArray();

+	public static final String[] FILE_TYPES= new String[] {"class"}; //$NON-NLS-1$

+	private static final char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$

+	private static final char[] CHAR = "char".toCharArray(); //$NON-NLS-1$

+	private static final char[] DOUBLE = "double".toCharArray(); //$NON-NLS-1$

+	private static final char[] FLOAT = "float".toCharArray(); //$NON-NLS-1$

+	private static final char[] INT = "int".toCharArray(); //$NON-NLS-1$

+	private static final char[] LONG = "long".toCharArray(); //$NON-NLS-1$

+	private static final char[] SHORT = "short".toCharArray(); //$NON-NLS-1$

+	private static final char[] BOOLEAN = "boolean".toCharArray(); //$NON-NLS-1$

+	private static final char[] VOID = "void".toCharArray(); //$NON-NLS-1$

 

 	private boolean needReferences;

 

@@ -359,8 +359,8 @@
 	return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));

 }

 private final char[] extractName(int[] constantPoolOffsets, ClassFileReader reader, int index) {

-	int constantPoolIndex = reader.u2At(constantPoolOffsets[index] + 3);

-	int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[constantPoolIndex] + 1)];

+	int nameAndTypeIndex = reader.u2At(constantPoolOffsets[index] + 3);

+	int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[nameAndTypeIndex] + 1)];

 	return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));

 }

 /**

@@ -442,14 +442,14 @@
 		char[][] superinterfaces = replace('/', '.', reader.getInterfaceNames());

 		if (DEBUG) {

 			if (packageName != null) {

-				System.out.println("package name = "/*nonNLS*/ + new String(packageName));

+				System.out.println("package name = " + new String(packageName)); //$NON-NLS-1$

 			}

 			if (name != null) {

-				System.out.println("class name = "/*nonNLS*/ + new String(name));

+				System.out.println("class name = " + new String(name)); //$NON-NLS-1$

 			}

 			if (superinterfaces != null) {

 				for (int i = 0, max = superinterfaces.length; i < max; i++) {

-					System.out.println("superinterfaces["/*nonNLS*/ + i + "]= "/*nonNLS*/ + new String(superinterfaces[i]));

+					System.out.println("superinterfaces[" + i + "]= " + new String(superinterfaces[i])); //$NON-NLS-1$ //$NON-NLS-2$

 				}

 			} 

 		}

@@ -460,7 +460,7 @@
 			char[] superclass = replace('/', '.', reader.getSuperclassName());

 			if (DEBUG) {

 				if (superclass != null) {

-					System.out.println("superclass name = "/*nonNLS*/ + new String(superclass));

+					System.out.println("superclass name = " + new String(superclass)); //$NON-NLS-1$

 				}

 			}

 			addClassDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames, superclass, superinterfaces);

@@ -477,19 +477,19 @@
 				char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());

 				if (DEBUG) {

 					if (method.getSelector() != null) {

-						System.out.println("method selector = "/*nonNLS*/ + new String(method.getSelector()));

+						System.out.println("method selector = " + new String(method.getSelector())); //$NON-NLS-1$

 					}

 					if (parameterTypes != null) {

 						for (int j = 0, max2 = parameterTypes.length; j < max2; j++) {

-							System.out.println("parameterTypes["/*nonNLS*/ + j + "]= "/*nonNLS*/ + new String(parameterTypes[j]));

+							System.out.println("parameterTypes[" + j + "]= " + new String(parameterTypes[j])); //$NON-NLS-1$ //$NON-NLS-2$

 						}

 					}

 					if (returnType != null) {

-						System.out.println("return type = "/*nonNLS*/ + new String(returnType));

+						System.out.println("return type = " + new String(returnType)); //$NON-NLS-1$

 					}

 					if (exceptionTypes != null) {

 						for (int j = 0, max2 = exceptionTypes.length; j < max2; j++) {

-							System.out.println("exceptionTypes["/*nonNLS*/ + j + "]= "/*nonNLS*/ + new String(exceptionTypes[j]));

+							System.out.println("exceptionTypes[" + j + "]= " + new String(exceptionTypes[j])); //$NON-NLS-1$ //$NON-NLS-2$

 						}

 					}

 				}

@@ -510,10 +510,10 @@
 				char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));

 				if (DEBUG) {

 					if (fieldName != null) {

-						System.out.println("field name = "/*nonNLS*/ + new String(fieldName));

+						System.out.println("field name = " + new String(fieldName)); //$NON-NLS-1$

 					}

 					if (fieldType != null) {

-						System.out.println("field type = "/*nonNLS*/ + new String(fieldType));

+						System.out.println("field type = " + new String(fieldType)); //$NON-NLS-1$

 					}

 				}

 				addFieldDeclaration(fieldType, fieldName);

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java b/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
index e74bdad..b15a260 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
@@ -9,20 +9,20 @@
 public interface IIndexConstants extends IJobConstants {

 

 	/* index encoding */

-	char[] REF= "ref/"/*nonNLS*/.toCharArray();

-	char[] FIELD_REF= "fieldRef/"/*nonNLS*/.toCharArray();

-	char[] METHOD_REF= "methodRef/"/*nonNLS*/.toCharArray();

-	char[] CONSTRUCTOR_REF= "constructorRef/"/*nonNLS*/.toCharArray();

-	char[] TYPE_REF= "typeRef/"/*nonNLS*/.toCharArray();

-	char[] SUPER_REF = "superRef/"/*nonNLS*/.toCharArray();

-	char[] TYPE_DECL = "typeDecl/"/*nonNLS*/.toCharArray();

+	char[] REF= "ref/".toCharArray(); //$NON-NLS-1$

+	char[] FIELD_REF= "fieldRef/".toCharArray(); //$NON-NLS-1$

+	char[] METHOD_REF= "methodRef/".toCharArray(); //$NON-NLS-1$

+	char[] CONSTRUCTOR_REF= "constructorRef/".toCharArray(); //$NON-NLS-1$

+	char[] TYPE_REF= "typeRef/".toCharArray(); //$NON-NLS-1$

+	char[] SUPER_REF = "superRef/".toCharArray(); //$NON-NLS-1$

+	char[] TYPE_DECL = "typeDecl/".toCharArray(); //$NON-NLS-1$

 	int 	TYPE_DECL_LENGTH = 9;

-	char[] CLASS_DECL= "typeDecl/C/"/*nonNLS*/.toCharArray();

-	char[] INTERFACE_DECL= "typeDecl/I/"/*nonNLS*/.toCharArray();

-	char[] METHOD_DECL= "methodDecl/"/*nonNLS*/.toCharArray();

-	char[] CONSTRUCTOR_DECL= "constructorDecl/"/*nonNLS*/.toCharArray();

-	char[] FIELD_DECL= "fieldDecl/"/*nonNLS*/.toCharArray();

-	char[] OBJECT = "Object"/*nonNLS*/.toCharArray();

+	char[] CLASS_DECL= "typeDecl/C/".toCharArray(); //$NON-NLS-1$

+	char[] INTERFACE_DECL= "typeDecl/I/".toCharArray(); //$NON-NLS-1$

+	char[] METHOD_DECL= "methodDecl/".toCharArray(); //$NON-NLS-1$

+	char[] CONSTRUCTOR_DECL= "constructorDecl/".toCharArray(); //$NON-NLS-1$

+	char[] FIELD_DECL= "fieldDecl/".toCharArray(); //$NON-NLS-1$

+	char[] OBJECT = "Object".toCharArray(); //$NON-NLS-1$

 	char[][] COUNTS= 

 		new char[][] { new char[] {'0'}, new char[] {'1'}, new char[] {'2'}, new char[] {'3'}, new char[] {'4'}, new char[] {'5'}, new char[] {'6'}, new char[] {'7'}, new char[] {'8'}, new char[] {'9'}

 	};

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java b/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
index b51827b..cb18b03 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
@@ -45,7 +45,7 @@
 			try {

 				monitor.exitRead(); // free read lock

 				monitor.enterWrite(); // ask permission to write

-				if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());

+				if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile()); //$NON-NLS-1$

 				index.save();

 			} catch(IOException e){

 				return FAILED;

@@ -54,12 +54,12 @@
 				monitor.enterRead(); // reacquire read permission

 			}

 		}

-		final String OK = "OK"/*nonNLS*/;

-		final String DELETED = "DELETED"/*nonNLS*/;	

+		final String OK = "OK"; //$NON-NLS-1$

+		final String DELETED = "DELETED";	 //$NON-NLS-1$

 		final long indexLastModified = index.getIndexFile().lastModified();

 

 		final Hashtable indexedFileNames = new Hashtable(100);

-		IQueryResult[] results = index.queryInDocumentNames(""/*nonNLS*/); // all file names

+		IQueryResult[] results = index.queryInDocumentNames(""); // all file names //$NON-NLS-1$

 		for (int i = 0, max = results == null ? 0 : results.length; i < max; i++){

 			String fileName = results[i].getPath();

 			indexedFileNames.put(fileName, DELETED);

@@ -68,7 +68,7 @@
 			public boolean visit(IResource resource) {

 				if (resource.getType() == IResource.FILE) {

 					String extension = resource.getFileExtension();

-					if ((extension != null) && extension.equalsIgnoreCase("java"/*nonNLS*/)) {

+					if ((extension != null) && extension.equalsIgnoreCase("java")) { //$NON-NLS-1$

 						IPath path = resource.getLocation();

 						if (path != null){

 							File resourceFile = path.toFile();

@@ -108,6 +108,6 @@
 	return COMPLETE;

 }

 public String toString(){

-	return "indexing project "/*nonNLS*/ + project.getName();

+	return "indexing project " + project.getName(); //$NON-NLS-1$

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java b/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
index c56c431..6c95ded 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
@@ -57,13 +57,13 @@
 public void add(IFile resource){

 	if (JavaCore.getPlugin() == null || this.workspace == null) return;	

 	String extension = resource.getFileExtension();

-	if ("java"/*nonNLS*/.equals(extension)){

+	if ("java".equals(extension)){ //$NON-NLS-1$

 		AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, this);

 		if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {

 			job.initializeContents();

 		}

 		request(job);

-	} else if ("class"/*nonNLS*/.equals(extension)){

+	} else if ("class".equals(extension)){ //$NON-NLS-1$

 		AddClassFileToIndex job = new AddClassFileToIndex(resource, this);

 		if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {

 			job.initializeContents();

@@ -77,7 +77,7 @@
  */

 public void checkIndexConsistency() {

 

-	if (VERBOSE) System.out.println("STARTING - ensuring consistency"/*nonNLS*/);

+	if (VERBOSE) System.out.println("STARTING - ensuring consistency"); //$NON-NLS-1$

 

 	boolean wasEnabled = isEnabled();	

 	try {

@@ -94,15 +94,15 @@
 		}

 	} finally {

 		if (wasEnabled) enable();

-		if (VERBOSE) System.out.println("DONE - ensuring consistency"/*nonNLS*/);

+		if (VERBOSE) System.out.println("DONE - ensuring consistency"); //$NON-NLS-1$

 	}

 }

 private String computeIndexName(String pathString) {

 	byte[] pathBytes = pathString.getBytes();

 	checksumCalculator.reset();

 	checksumCalculator.update(pathBytes);

-	String fileName = Long.toString(checksumCalculator.getValue()) + ".index"/*nonNLS*/;

-	if (VERBOSE) System.out.println(" index name: "/*nonNLS*/ + pathString + " <----> "/*nonNLS*/ + fileName);

+	String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$

+	if (VERBOSE) System.out.println(" index name: " + pathString + " <----> " + fileName); //$NON-NLS-1$ //$NON-NLS-2$

 	IPath indexPath = getJavaPluginWorkingLocation();

 	String indexDirectory = indexPath.toOSString();

 	if (indexDirectory.endsWith(File.separator)) {

@@ -183,7 +183,7 @@
 			if (index == null) {

 				// New index: add same index for given path and canonical path

 				String indexPath = computeIndexName(canonicalPath.toOSString());

-				index = IndexFactory.newIndex(indexPath, "Index for "/*nonNLS*/ + canonicalPath.toOSString());

+				index = IndexFactory.newIndex(indexPath, "Index for " + canonicalPath.toOSString()); //$NON-NLS-1$

 				indexes.put(canonicalPath, index);

 				indexes.put(path, index);

 				monitors.put(index, new ReadWriteMonitor());

@@ -257,7 +257,7 @@
  * Name of the background process

  */

 public String processName(){

-	return Util.bind("process.name"/*nonNLS*/, IndexManager.class.getName());

+	return Util.bind("process.name", IndexManager.class.getName()); //$NON-NLS-1$

 }

 /**

  * Recreates the index for a given path, keeping the same read-write monitor.

@@ -273,7 +273,7 @@
 			// Add same index for given path and canonical path

 			String indexPath = computeIndexName(canonicalPath.toOSString());

 			ReadWriteMonitor monitor = (ReadWriteMonitor)monitors.remove(index);

-			index = IndexFactory.newIndex(indexPath, "Index for "/*nonNLS*/ + canonicalPath.toOSString());

+			index = IndexFactory.newIndex(indexPath, "Index for " + canonicalPath.toOSString()); //$NON-NLS-1$

 			index.empty();

 			indexes.put(canonicalPath, index);

 			indexes.put(path, index);

@@ -318,7 +318,7 @@
 			if (monitor == null) continue; // index got deleted since acquired

 			try {

 				monitor.enterWrite();

-				if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());

+				if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile()); //$NON-NLS-1$

 				index.save();

 			} finally {

 				monitor.exitWrite();

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.java b/search/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.java
index a03484a..032b165 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.java
@@ -48,6 +48,6 @@
 	return COMPLETE;

 }

 public String toString(){

-	return "removing from index "/*nonNLS*/ + resourceName;

+	return "removing from index " + resourceName; //$NON-NLS-1$

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java b/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
index 62853a9..f2b3553 100644
--- a/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
+++ b/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
@@ -31,7 +31,7 @@
  */

 public class SourceIndexer extends AbstractIndexer {

 	

-	public static final String[] FILE_TYPES= new String[] {"java"/*nonNLS*/};

+	public static final String[] FILE_TYPES= new String[] {"java"}; //$NON-NLS-1$

 	protected DefaultProblemFactory problemFactory= new DefaultProblemFactory(Locale.getDefault());

 	

 /**

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
index f00abd2..fc0b28a 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
@@ -60,85 +60,6 @@
 			isCaseSensitive);

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof ConstructorDeclaration)) return false;

-

-	ConstructorDeclaration constructor = (ConstructorDeclaration)node;

-

-	// constructor name is stored in selector field

-	if (this.declaringSimpleName != null 

-			&& !this.matchesName(this.declaringSimpleName, constructor.selector))

-		return false;

-

-	// declaring type

-	MethodBinding binding = constructor.binding;

-	if (resolve && binding != null) {

-		ReferenceBinding declaringBinding = binding.declaringClass;

-		if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringBinding))

-			return false;

-	}

-		

-	// argument types

-	int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (argumentCount > -1) {

-		int parameterCount = constructor.arguments == null ? 0 : constructor.arguments.length;

-		if (parameterCount != argumentCount)

-			return false;

-

-		if (resolve && binding != null) {

-			for (int i = 0; i < parameterCount; i++) {

-				char[] qualification = this.parameterQualifications[i];

-				char[] type = this.parameterSimpleNames[i];

-				if (!this.matchesType(type, qualification, binding.parameters[i]))

-					return false;

-			}

-		}

-	}

-

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof MethodBinding)) return false;

-

-	MethodBinding method = (MethodBinding)binding;

-

-	// must be a constructor

-	if (!method.isConstructor()) return false;

-	

-	// declaring type

-	ReferenceBinding declaringType = method.declaringClass;

-	if (declaringType != null) {

-		if (!method.isStatic() && !method.isPrivate()) {

-			if (!this.matchesAsSubtype(declaringType, this.declaringSimpleName, this.declaringQualification))

-				return false;

-		} else {

-			if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringType))

-				return false;

-		}

-	}

-

-	// parameter types

-	int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (parameterCount > -1) {

-		int argumentCount = method.parameters == null ? 0 : method.parameters.length;

-		if (parameterCount != argumentCount)

-			return false;

-		for (int i = 0; i < parameterCount; i++) {

-			char[] qualification = this.parameterQualifications[i];

-			char[] type = this.parameterSimpleNames[i];

-			if (!this.matchesType(type, qualification, method.parameters[i]))

-				return false;

-		}

-	}

-

-	return true;

-}

-/**

  * @see SearchPattern#matchesBinary(Object, Object)

  */

 public boolean matchesBinary(Object binaryInfo, Object enclosingBinaryInfo) {

@@ -209,39 +130,116 @@
 public String toString(){

 

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("ConstructorDeclarationPattern: "/*nonNLS*/);

+	buffer.append("ConstructorDeclarationPattern: "); //$NON-NLS-1$

 	if (declaringQualification != null) buffer.append(declaringQualification).append('.');

 	if (declaringSimpleName != null) 

 		buffer.append(declaringSimpleName);

-	else if (declaringQualification != null) buffer.append("*"/*nonNLS*/);

+	else if (declaringQualification != null) buffer.append("*"); //$NON-NLS-1$

 

 	buffer.append('(');

 	if (parameterSimpleNames == null) {

-		buffer.append("..."/*nonNLS*/);

+		buffer.append("..."); //$NON-NLS-1$

 	} else {

 		for (int i = 0, max = parameterSimpleNames.length; i < max; i++){

-			if (i > 0) buffer.append(", "/*nonNLS*/);

+			if (i > 0) buffer.append(", "); //$NON-NLS-1$

 			if (parameterQualifications[i] != null) buffer.append(parameterQualifications[i]).append('.');

 			if (parameterSimpleNames[i] == null) buffer.append('*'); else buffer.append(parameterSimpleNames[i]);

 		}

 	}

 	buffer.append(')');

-	buffer.append(", "/*nonNLS*/);

+	buffer.append(", "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof ConstructorDeclaration)) return IMPOSSIBLE_MATCH;

+

+	ConstructorDeclaration constructor = (ConstructorDeclaration)node;

+

+	if (resolve) {

+		return this.matchLevel(constructor.binding);

+	} else {

+		// constructor name is stored in selector field

+		if (this.declaringSimpleName != null 

+				&& !this.matchesName(this.declaringSimpleName, constructor.selector))

+			return IMPOSSIBLE_MATCH;

+			

+		// parameter types

+		int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+		if (parameterCount > -1) {

+			int argumentCount = constructor.arguments == null ? 0 : constructor.arguments.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+		}

+

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

+	int level;

+

+	MethodBinding constructor = (MethodBinding)binding;

+	

+	// must be a constructor

+	if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH;

+

+	// declaring type

+	ReferenceBinding declaringType = constructor.declaringClass;

+	if (!constructor.isStatic() && !constructor.isPrivate()) {

+		level = this.matchLevelAsSubtype(declaringType, this.declaringSimpleName, this.declaringQualification);

+	} else {

+		level = this.matchLevelForType(this.declaringSimpleName, this.declaringQualification, declaringType);

+	}

+	if (level == IMPOSSIBLE_MATCH) {

+		return IMPOSSIBLE_MATCH;

+	}

+		

+	// parameter types

+	int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+	if (parameterCount > -1) {

+		int argumentCount = constructor.parameters == null ? 0 : constructor.parameters.length;

+		if (parameterCount != argumentCount)

+			return IMPOSSIBLE_MATCH;

+		for (int i = 0; i < parameterCount; i++) {

+			char[] qualification = this.parameterQualifications[i];

+			char[] type = this.parameterSimpleNames[i];

+			int newLevel = this.matchLevelForType(type, qualification, constructor.parameters[i]);

+			switch (newLevel) {

+				case IMPOSSIBLE_MATCH:

+					return IMPOSSIBLE_MATCH;

+				case ACCURATE_MATCH: // keep previous level

+					break;

+				default: // ie. INACCURATE_MATCH

+					level = newLevel;

+					break;

+			}

+		}

+	}

+

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/ConstructorReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/ConstructorReferencePattern.java
index ec87423..adc2999 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/ConstructorReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/ConstructorReferencePattern.java
@@ -58,90 +58,6 @@
 			isCaseSensitive);

 }

 /**

- * Returns whether this constructor pattern  matches the given allocation expression.

- * Look at resolved information only if specified.

- */

-private boolean matches(AllocationExpression allocation, boolean resolve) {

-

-	// constructor name is simple type name

-	char[][] typeName = allocation.type.getTypeName();

-	if (this.declaringSimpleName != null 

-			&& !this.matchesName(this.declaringSimpleName, typeName[typeName.length-1]))

-		return false;

-

-	// declaring type

-	MethodBinding binding = allocation.binding;

-	if (resolve && binding != null) {

-		ReferenceBinding declaringBinding = binding.declaringClass;

-		if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringBinding))

-			return false;

-	}

-		

-	// argument types

-	int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (argumentCount > -1) {

-		int parameterCount = allocation.arguments == null ? 0 : allocation.arguments.length;

-		if (parameterCount != argumentCount)

-			return false;

-

-		if (resolve && binding != null) {

-			for (int i = 0; i < parameterCount; i++) {

-				char[] qualification = this.parameterQualifications[i];

-				char[] type = this.parameterSimpleNames[i];

-				if (!this.matchesType(type, qualification, binding.parameters[i]))

-					return false;

-			}

-		}

-	}

-

-	return true;

-}

-/**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (node instanceof AllocationExpression) {

-		return this.matches((AllocationExpression)node, resolve);

-	} else if (node instanceof ExplicitConstructorCall) {

-		return this.matches((ExplicitConstructorCall)node, resolve);

-	}

-	return false;

-}

-/**

- * Returns whether this constructor pattern  matches the given explicit constructor call.

- * Look at resolved information only if specified.

- */

-private boolean matches(ExplicitConstructorCall call, boolean resolve) {

-	// TBD: constructor name is super simple type name

-

-	// declaring type

-	MethodBinding binding = call.binding;

-	if (resolve && binding != null) {

-		ReferenceBinding declaringBinding = binding.declaringClass;

-		if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringBinding))

-			return false;

-	}

-		

-	// argument types

-	int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (argumentCount > -1) {

-		int parameterCount = call.arguments == null ? 0 : call.arguments.length;

-		if (parameterCount != argumentCount)

-			return false;

-

-		if (resolve && binding != null) {

-			for (int i = 0; i < parameterCount; i++) {

-				char[] qualification = this.parameterQualifications[i];

-				char[] type = this.parameterSimpleNames[i];

-				if (!this.matchesType(type, qualification, binding.parameters[i]))

-					return false;

-			}

-		}

-	}

-

-	return true;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -173,38 +89,141 @@
 public String toString(){

 

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("ConstructorReferencePattern: "/*nonNLS*/);

+	buffer.append("ConstructorReferencePattern: "); //$NON-NLS-1$

 	if (declaringQualification != null) buffer.append(declaringQualification).append('.');

 	if (declaringSimpleName != null) 

 		buffer.append(declaringSimpleName);

-	else if (declaringQualification != null) buffer.append("*"/*nonNLS*/);

+	else if (declaringQualification != null) buffer.append("*"); //$NON-NLS-1$

 	buffer.append('(');

 	if (parameterSimpleNames == null) {

-		buffer.append("..."/*nonNLS*/);

+		buffer.append("..."); //$NON-NLS-1$

 	} else {

 		for (int i = 0, max = parameterSimpleNames.length; i < max; i++){

-			if (i > 0) buffer.append(", "/*nonNLS*/);

+			if (i > 0) buffer.append(", "); //$NON-NLS-1$

 			if (parameterQualifications[i] != null) buffer.append(parameterQualifications[i]).append('.');

 			if (parameterSimpleNames[i] == null) buffer.append('*'); else buffer.append(parameterSimpleNames[i]);

 		}

 	}

 	buffer.append(')');

-	buffer.append(", "/*nonNLS*/);

+	buffer.append(", "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * Returns whether this constructor pattern  matches the given allocation expression.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(AllocationExpression allocation, boolean resolve) {

+

+	// constructor name is simple type name

+	char[][] typeName = allocation.type.getTypeName();

+	if (this.declaringSimpleName != null 

+			&& !this.matchesName(this.declaringSimpleName, typeName[typeName.length-1]))

+		return IMPOSSIBLE_MATCH;

+

+	if (resolve) {

+		return this.matchLevel(allocation.binding);

+	} else {

+		// argument types

+		int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+		if (argumentCount > -1) {

+			int parameterCount = allocation.arguments == null ? 0 : allocation.arguments.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+		}

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (node instanceof AllocationExpression) {

+		return this.matchLevel((AllocationExpression)node, resolve);

+	} else if (node instanceof ExplicitConstructorCall) {

+		return this.matchLevel((ExplicitConstructorCall)node, resolve);

+	}

+	return IMPOSSIBLE_MATCH;

+}

+

+/**

+ * Returns whether this constructor pattern  matches the given explicit constructor call.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(ExplicitConstructorCall call, boolean resolve) {

+	// TBD: constructor name is super simple type name

+

+	if (resolve) {

+		return this.matchLevel(call.binding);

+	} else {

+		// argument types

+		int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+		if (argumentCount > -1) {

+			int parameterCount = call.arguments == null ? 0 : call.arguments.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+		}

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding binding).

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

+	int level;

+

+	// declaring type

+	MethodBinding method = (MethodBinding)binding;

+	ReferenceBinding declaringBinding = method.declaringClass;

+	level = this.matchLevelForType(this.declaringSimpleName, this.declaringQualification, declaringBinding);

+	if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH;

+		

+	// argument types

+	int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+	if (argumentCount > -1) {

+		if (method.parameters == null) {

+			level = INACCURATE_MATCH;

+		} else {

+			int parameterCount = method.parameters.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+

+			for (int i = 0; i < parameterCount; i++) {

+				char[] qualification = this.parameterQualifications[i];

+				char[] type = this.parameterSimpleNames[i];

+				int newLevel = this.matchLevelForType(type, qualification, method.parameters[i]);

+				switch (newLevel) {

+					case IMPOSSIBLE_MATCH:

+						return IMPOSSIBLE_MATCH;

+					case ACCURATE_MATCH: // keep previous level

+						break;

+					default: // ie. INACCURATE_MATCH

+						level = newLevel;

+						break;

+				}

+			}

+		}

+	}

+

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/FieldDeclarationPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/FieldDeclarationPattern.java
index 4100d26..e16148e 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/FieldDeclarationPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/FieldDeclarationPattern.java
@@ -85,71 +85,6 @@
 	return CLASS;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof FieldDeclaration)) return false;

-

-	FieldDeclaration field = (FieldDeclaration)node;

-	if (!field.isField()) return false; // ignore field initializers

-	

-	// field name

-	if (!this.matchesName(this.name, field.name))

-		return false;

-

-	// declaring type

-	FieldBinding binding = field.binding;

-	if (resolve && binding != null) {

-		ReferenceBinding declaringBinding = binding.declaringClass;

-		if (declaringBinding != null && !this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringBinding))

-			return false;

-	}

-

-	// field type

-	if (this.typeQualification == null) {

-		TypeReference fieldType = field.type;

-		char[][] fieldTypeName = fieldType.getTypeName();

-		char[] sourceName = this.toArrayName(

-			fieldTypeName[fieldTypeName.length-1], 

-			fieldType.dimensions());

-		if (!this.matchesName(this.typeSimpleName, sourceName))

-			return false;

-	} else {

-		if (resolve 

-				&& binding != null 

-				&& !this.matchesType(this.typeSimpleName, this.typeQualification, binding.type))

-			return false;

-	}

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof FieldBinding)) return false;

-

-	FieldBinding field = (FieldBinding)binding;

-	

-	// field name

-	if (!this.matchesName(this.name, field.readableName()))

-		return false;

-

-	// declaring type

-	ReferenceBinding declaringBinding = field.declaringClass;

-	if (declaringBinding != null 

-		&& !this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringBinding)) {

-			

-		return false;

-	}

-

-	// field type

-	if(!this.matchesType(this.typeSimpleName, this.typeQualification, field.type)) {

-		return false;

-	}

-	

-	return true;

-}

-/**

  * @see SearchPattern#matchesBinary(Object, Object)

  */

 public boolean matchesBinary(Object binaryInfo, Object enclosingBinaryInfo) {

@@ -222,38 +157,106 @@
 public String toString(){

 

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("FieldDeclarationPattern: "/*nonNLS*/);

+	buffer.append("FieldDeclarationPattern: "); //$NON-NLS-1$

 	if (declaringQualification != null) buffer.append(declaringQualification).append('.');

 	if (declaringSimpleName != null) 

 		buffer.append(declaringSimpleName).append('.');

-	else if (declaringQualification != null) buffer.append("*."/*nonNLS*/);

+	else if (declaringQualification != null) buffer.append("*."); //$NON-NLS-1$

 	if (name == null) {

-		buffer.append("*"/*nonNLS*/);

+		buffer.append("*"); //$NON-NLS-1$

 	} else {

 		buffer.append(name);

 	}

 	if (typeQualification != null) 

-		buffer.append(" --> "/*nonNLS*/).append(typeQualification).append('.');

-	else if (typeSimpleName != null) buffer.append(" --> "/*nonNLS*/);

+		buffer.append(" --> ").append(typeQualification).append('.'); //$NON-NLS-1$

+	else if (typeSimpleName != null) buffer.append(" --> "); //$NON-NLS-1$

 	if (typeSimpleName != null) 

 		buffer.append(typeSimpleName);

-	else if (typeQualification != null) buffer.append("*"/*nonNLS*/);

-	buffer.append(", "/*nonNLS*/);

+	else if (typeQualification != null) buffer.append("*"); //$NON-NLS-1$

+	buffer.append(", "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof FieldDeclaration)) return IMPOSSIBLE_MATCH;

+

+	FieldDeclaration field = (FieldDeclaration)node;

+

+	if (resolve) {

+		return this.matchLevel(field.binding);

+	} else {

+		if (!field.isField()) return IMPOSSIBLE_MATCH; // ignore field initializers

+		

+		// field name

+		if (!this.matchesName(this.name, field.name))

+			return IMPOSSIBLE_MATCH;

+

+		// field type

+		TypeReference fieldType = field.type;

+		char[][] fieldTypeName = fieldType.getTypeName();

+		char[] sourceName = this.toArrayName(

+			fieldTypeName[fieldTypeName.length-1], 

+			fieldType.dimensions());

+		if (!this.matchesName(this.typeSimpleName, sourceName))

+			return IMPOSSIBLE_MATCH;

+

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof FieldBinding)) return IMPOSSIBLE_MATCH;

+	int level;

+

+	FieldBinding field = (FieldBinding)binding;

+	

+	// field name

+	if (!this.matchesName(this.name, field.readableName()))

+		return IMPOSSIBLE_MATCH;

+

+	// declaring type

+	ReferenceBinding declaringBinding = field.declaringClass;

+	if (declaringBinding == null ) {

+		return INACCURATE_MATCH;

+	} else {

+		level = this.matchLevelForType(this.declaringSimpleName, this.declaringQualification, declaringBinding);

+		if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH;

+	}

+

+	// field type

+	int newLevel = this.matchLevelForType(this.typeSimpleName, this.typeQualification, field.type);

+	switch (newLevel) {

+		case IMPOSSIBLE_MATCH:

+			return IMPOSSIBLE_MATCH;

+		case ACCURATE_MATCH: // keep previous level

+			break;

+		default: // ie. INACCURATE_MATCH

+			level = newLevel;

+			break;

+	}

+	

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/FieldReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/FieldReferencePattern.java
index 28b132b..4995bd0 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/FieldReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/FieldReferencePattern.java
@@ -112,92 +112,6 @@
 	return METHOD | FIELD;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (node instanceof FieldReference) {

-		return this.matches((FieldReference)node, resolve);

-	} else if (node instanceof NameReference) {

-		return this.matches((NameReference)node, resolve);

-	}

-	return false;

-}

-/**

- * Returns whether this field reference pattern matches the given field reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(FieldReference fieldRef, boolean resolve) {	

-	// field name

-	if (!this.matchesName(this.name, fieldRef.token))

-		return false;

-

-	if (resolve) {

-		// receiver type and field type

-		FieldBinding binding = fieldRef.binding;

-		if (binding != null && !this.matches(fieldRef.receiverType, fieldRef.isSuperAccess(), binding))

-			return false;

-	}

-

-	return true;

-}

-/**

- * Returns whether this field reference pattern matches the given name reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(NameReference nameRef, boolean resolve) {	

-	// field name

-	boolean nameMatch = true;

-	if (this.name != null) {

-		if (nameRef instanceof SingleNameReference) {

-			nameMatch = matchesName(this.name, ((SingleNameReference)nameRef).token);

-		} else { // QualifiedNameReference

-			nameMatch = false;

-			QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

-			char[][] tokens = qNameRef.tokens;

-			for (int i = qNameRef.indexOfFirstFieldBinding-1, max = tokens.length; i < max && !nameMatch; i++){

-				if (i >= 0) nameMatch = matchesName(this.name, tokens[i]);

-			}

-		}				

-	} 

-	if (!nameMatch) return false;

-

-	if (resolve){	

-		Binding binding = nameRef.binding;

-		if (binding != null){

-			if (nameRef instanceof SingleNameReference){

-				if (binding instanceof FieldBinding){

-					if (!this.matches(nameRef.receiverType, false, (FieldBinding) binding)){

-						return false;

-					}

-				} else {

-					return false; // must be a field binding

-				}

-			} else { // QualifiedNameReference

-				QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

-				TypeBinding receiverType = qNameRef.receiverType;

-				FieldBinding fieldBinding = null;

-				if (!(binding instanceof FieldBinding 

-						&& matchesName(this.name, (fieldBinding = (FieldBinding)binding).name) 

-						&& matches(receiverType, false, fieldBinding))){

-					if (binding instanceof VariableBinding){

-						receiverType = ((VariableBinding) binding).type;

-					}

-					boolean otherMatch = false;

-					int otherMax = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;

-					for (int i = 0; i < otherMax && !otherMatch; i++){

-						FieldBinding otherBinding = qNameRef.otherBindings[i];

-						if (otherBinding == null) break;

-						otherMatch = matchesName(this.name, otherBinding.name) && matches(receiverType, false, otherBinding);

-						receiverType = otherBinding.type;

-					}

-					if (!otherMatch) return false;

-				}

-			}

-		}

-	}

-	return true;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -224,25 +138,6 @@
 	return true;

 }

 /**

- * Finds out whether the given ast node matches this search pattern.

- * Returns IMPOSSIBLE_MATCH if it doesn't.

- * Returns TRUSTED_MATCH if it matches exactly this search pattern (ie. 

- * it doesn't need to be resolved or it has already been resolved.)

- * Returns POSSIBLE_MATCH if it potentially matches 

- * this search pattern and it needs to be resolved to get more information.

- */

-public int matchLevel(AstNode node) {

-	if (this.matches(node, false)) {

-		if (this.needsResolve 

-			|| node instanceof NameReference) { // ensure it is a field

-			return POSSIBLE_MATCH;

-		} else {

-			return TRUSTED_MATCH;

-		}

-	}

-	return IMPOSSIBLE_MATCH;

-}

-/**

  * @see SearchPattern#matchReportReference

  */

 protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException {

@@ -272,38 +167,38 @@
 public String toString(){

 

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("FieldReferencePattern: "/*nonNLS*/);

+	buffer.append("FieldReferencePattern: "); //$NON-NLS-1$

 	if (declaringQualification != null) buffer.append(declaringQualification).append('.');

 	if (declaringSimpleName != null) 

 		buffer.append(declaringSimpleName).append('.');

-	else if (declaringQualification != null) buffer.append("*."/*nonNLS*/);

+	else if (declaringQualification != null) buffer.append("*."); //$NON-NLS-1$

 	if (name != null) {

 		buffer.append(name);

 	} else {

-		buffer.append("*"/*nonNLS*/);

+		buffer.append("*"); //$NON-NLS-1$

 	}

 	if (typeQualification != null) 

-		buffer.append(" --> "/*nonNLS*/).append(typeQualification).append('.');

-	else if (typeSimpleName != null) buffer.append(" --> "/*nonNLS*/);

+		buffer.append(" --> ").append(typeQualification).append('.'); //$NON-NLS-1$

+	else if (typeSimpleName != null) buffer.append(" --> "); //$NON-NLS-1$

 	if (typeSimpleName != null) 

 		buffer.append(typeSimpleName);

-	else if (typeQualification != null) buffer.append("*"/*nonNLS*/);

-	buffer.append(", "/*nonNLS*/);

+	else if (typeQualification != null) buffer.append("*"); //$NON-NLS-1$

+	buffer.append(", "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

 

@@ -313,24 +208,130 @@
 }

 

 /**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (node instanceof FieldReference) {

+		return this.matchLevel((FieldReference)node, resolve);

+	} else if (node instanceof NameReference) {

+		return this.matchLevel((NameReference)node, resolve);

+	}

+	return IMPOSSIBLE_MATCH;

+}

+

+/**

+ * Returns whether this field reference pattern matches the given field reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(FieldReference fieldRef, boolean resolve) {	

+	// field name

+	if (!this.matchesName(this.name, fieldRef.token))

+		return IMPOSSIBLE_MATCH;

+

+	if (resolve) {

+		// receiver type and field type

+		return this.matchLevel(fieldRef.receiverType, fieldRef.isSuperAccess(), fieldRef.binding);

+	} else {

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * Returns whether this field reference pattern matches the given name reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(NameReference nameRef, boolean resolve) {	

+	// field name

+	boolean nameMatch = true;

+	if (this.name != null) {

+		if (nameRef instanceof SingleNameReference) {

+			nameMatch = this.matchesName(this.name, ((SingleNameReference)nameRef).token);

+		} else { // QualifiedNameReference

+			nameMatch = false;

+			QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

+			char[][] tokens = qNameRef.tokens;

+			for (int i = qNameRef.indexOfFirstFieldBinding-1, max = tokens.length; i < max && !nameMatch; i++){

+				if (i >= 0) nameMatch = this.matchesName(this.name, tokens[i]);

+			}

+		}				

+	} 

+	if (!nameMatch) return IMPOSSIBLE_MATCH;

+

+	if (resolve) {	

+		Binding binding = nameRef.binding;

+		if (binding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			if (nameRef instanceof SingleNameReference){

+				if (binding instanceof FieldBinding){

+					return this.matchLevel(nameRef.receiverType, false, (FieldBinding) binding);

+				} else {

+					return IMPOSSIBLE_MATCH; // must be a field binding

+				}

+			} else { // QualifiedNameReference

+				QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

+				TypeBinding receiverType = qNameRef.receiverType;

+				FieldBinding fieldBinding = null;

+				if (binding instanceof FieldBinding && this.matchesName(this.name, (fieldBinding = (FieldBinding)binding).name)) {

+					return this.matchLevel(receiverType, false, fieldBinding);

+				} else {

+					if (binding instanceof VariableBinding){

+						receiverType = ((VariableBinding) binding).type;

+					}

+					int otherLevel = IMPOSSIBLE_MATCH;

+					int otherMax = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;

+					for (int i = 0; i < otherMax && (otherLevel == IMPOSSIBLE_MATCH); i++){

+						FieldBinding otherBinding = qNameRef.otherBindings[i];

+						if (this.matchesName(this.name, otherBinding.name)) {

+							otherLevel = this.matchLevel(receiverType, false, otherBinding);

+						}

+						receiverType = otherBinding.type;

+					}

+					return otherLevel;

+				}

+			}

+		}

+	} else {

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

  * Returns whether this field reference pattern matches the given field binding and receiver type.

  */

-private boolean matches(TypeBinding receiverType, boolean isSuperAccess, FieldBinding binding) {

+private int matchLevel(TypeBinding receiverType, boolean isSuperAccess, FieldBinding binding) {

+	if (receiverType == null || binding == null) return INACCURATE_MATCH;

+	int level;

+	

 	// receiver type

 	ReferenceBinding receiverBinding = 

 		isSuperAccess || binding.isStatic() ? 

 			binding.declaringClass : 

 			(ReferenceBinding)receiverType;

-	if (receiverBinding != null 

-		&& !this.matchesAsSubtype(receiverBinding, this.declaringSimpleName, this.declaringQualification)

-		&& !this.matchesType(this.allSuperDeclaringTypeNames, receiverBinding)) {

-			return false;

+	if (receiverBinding == null) {

+		return INACCURATE_MATCH;

+	} else {

+		level = this.matchLevelAsSubtype(receiverBinding, this.declaringSimpleName, this.declaringQualification);

+		if (level == IMPOSSIBLE_MATCH) {

+			level = this.matchLevelForType(this.allSuperDeclaringTypeNames, receiverBinding);

+			if (level == IMPOSSIBLE_MATCH) {

+				return IMPOSSIBLE_MATCH;

+			}

+		}

 	}

 

 	// field type

-	if (!this.matchesType(this.typeSimpleName, this.typeQualification, binding.type))

-		return false;

+	int newLevel = this.matchLevelForType(this.typeSimpleName, this.typeQualification, binding.type);

+	switch (newLevel) {

+		case IMPOSSIBLE_MATCH:

+			return IMPOSSIBLE_MATCH;

+		case ACCURATE_MATCH: // keep previous level

+			break;

+		default: // ie. INACCURATE_MATCH

+			level = newLevel;

+			break;

+	}

 

-	return true;

+	return level;

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 892bcac..33270d5 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -41,6 +41,7 @@
 

 import org.eclipse.jdt.core.search.IJavaSearchResultCollector;

 import org.eclipse.jdt.core.search.IJavaSearchScope;

+import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;

 

 /**

  * Locate matches in compilation units.

@@ -51,727 +52,709 @@
 	public IJavaSearchResultCollector collector;

 	public IJavaSearchScope scope;

 

-	private MatchLocatorParser parser;

-	private LookupEnvironment lookupEnvironment;

-	private IResource currentResource;

-	private Openable currentOpenable;

-public MatchLocator(

-	SearchPattern pattern,

-	int detailLevel,

-	IJavaSearchResultCollector collector, 

-	IJavaSearchScope scope) {

-		

-	this.pattern = pattern;

-	this.detailLevel = detailLevel;

-	this.collector = collector;

-	this.scope = scope;

-}

-/**

- * Add an additional binary type

- */

-public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

-	this.lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

-}

-/**

- * Add an additional compilation unit.

- */

-public void accept(ICompilationUnit sourceUnit) {

-	CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

-	CompilationUnitDeclaration parsedUnit = this.parser.dietParse(sourceUnit, result);

+	public MatchLocatorParser parser;

+	public LookupEnvironment lookupEnvironment;

+	public HashtableOfObject parsedUnits;

+	private PotentialMatch[] potentialMatches;

+	private int potentialMatchesIndex;

+	private int potentialMatchesLength;

 

-	this.lookupEnvironment.buildTypeBindings(parsedUnit);

-	this.lookupEnvironment.completeTypeBindings(parsedUnit, true);

-}

-/**

- * Add an additional source type

- */

-public void accept(ISourceType sourceType, PackageBinding packageBinding) {

-	while (sourceType.getEnclosingType() != null) sourceType = sourceType.getEnclosingType();

-	CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1); // need to hold onto this

-	CompilationUnitDeclaration unit =

-		SourceTypeConverter.buildCompilationUnit(sourceType, true, true, lookupEnvironment.problemReporter, result);

+	public MatchLocator(

+		SearchPattern pattern,

+		int detailLevel,

+		IJavaSearchResultCollector collector,

+		IJavaSearchScope scope) {

 

-	if (unit != null) {

-		this.lookupEnvironment.buildTypeBindings(unit);

-		this.lookupEnvironment.completeTypeBindings(unit, true);

-	}

-}

-/**

- * Creates an IField from the given field declaration and simple type names. 

- */

-private IField createFieldHandle(FieldDeclaration field, char[][] definingTypeNames) {

-	IType type = this.createTypeHandle(definingTypeNames);

-	return type.getField(new String(field.name));

-}

-/**

- * Creates an IImportDeclaration from the given import statement

- */

-private IImportDeclaration createImportHandle(ImportReference importRef) {

-	char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');

-	if (importRef.onDemand) {

-		importName = CharOperation.concat(importName, ".*"/*nonNLS*/.toCharArray());

-	}

-	return ((CompilationUnit)this.currentOpenable).getImport(

-			new String(importName));

-}

-/**

- * Creates an IInitializer from the given field declaration and simple type names. 

- */

-private IInitializer createInitializerHandle(TypeDeclaration typeDecl, FieldDeclaration initializer, char[][] definingTypeNames) {

-	IType type = this.createTypeHandle(definingTypeNames);

-

-	// find occurence count of the given initializer in its type declaration

-	int occurrenceCount = 0;

-	FieldDeclaration[] fields = typeDecl.fields;

-	for (int i = 0, length = fields.length; i < length; i++) {

-		FieldDeclaration field = fields[i];

-		if (!field.isField()) {

-			occurrenceCount++;

-			if (field.equals(initializer)) {

-				break;

-			}

-		}

+		this.pattern = pattern;

+		this.detailLevel = detailLevel;

+		this.collector = collector;

+		this.scope = scope;

 	}

 	

-	return type.getInitializer(occurrenceCount);

-}

-/**

- * Creates an IMethod from the given method declaration and simple type names. 

- */

-private IMethod createMethodHandle(AbstractMethodDeclaration method, char[][] definingTypeNames) {

-	IType type = this.createTypeHandle(definingTypeNames);

-	Argument[] arguments = method.arguments;

-	int length = arguments == null ? 0 : arguments.length;

-	String[] parameterTypeSignatures = new String[length];

-	for (int i = 0; i < length; i++) {

-		TypeReference parameterType = arguments[i].type;

-		char[] typeName = CharOperation.concatWith(parameterType.getTypeName(), '.');

-		for (int j = 0; j < parameterType.dimensions(); j++) {

-			typeName = CharOperation.concat(typeName, "[]"/*nonNLS*/.toCharArray());

-		}

-		parameterTypeSignatures[i] = Signature.createTypeSignature(typeName, false);

+	/**

+	 * Add an additional binary type

+	 */

+	public void accept(IBinaryType binaryType, PackageBinding packageBinding) {

+		this.lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding);

 	}

-	return type.getMethod(

-		new String(method.selector), 

-		parameterTypeSignatures);

-}

-/**

- * Creates an IType from the given simple type names. 

- */

-private IType createTypeHandle(char[][] simpleTypeNames) {

-	// creates compilation unit

-	CompilationUnit unit = (CompilationUnit) this.currentOpenable;

 

-	// create type

-	int length = simpleTypeNames.length;

-	IType type = unit.getType(new String(simpleTypeNames[0]));

-	for (int i = 1; i < length; i++) {

-		type = type.getType(new String(simpleTypeNames[i]));

+	/**

+	 * Add an additional compilation unit.

+	 */

+	public void accept(ICompilationUnit sourceUnit) {

+		CompilationResult result = new CompilationResult(sourceUnit, 1, 1);

+		CompilationUnitDeclaration parsedUnit =

+			this.parser.dietParse(sourceUnit, result);

+

+		this.lookupEnvironment.buildTypeBindings(parsedUnit);

+		this.lookupEnvironment.completeTypeBindings(parsedUnit, true);

 	}

-	return type;

-}

-private char[] getContents(IFile file) {

-	BufferedInputStream input = null;

-	try {

-		input = new BufferedInputStream(file.getContents(true));

-		StringBuffer buffer= new StringBuffer();

-		int nextChar = input.read();

-		while (nextChar != -1) {

-			buffer.append( (char)nextChar );

-			nextChar = input.read();

-		}

-		int length = buffer.length();

-		char[] result = new char[length];

-		buffer.getChars(0, length, result, 0);

-		return result;

-	} catch (IOException e) {

-		return null;

-	} catch (CoreException e) {

-		return null;

-	} finally {

-		if (input != null) {

+

+	/**

+	 * Add an additional source type

+	 */

+	public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {

+		ISourceType sourceType = sourceTypes[0];

+		while (sourceType.getEnclosingType() != null)

+			sourceType = sourceType.getEnclosingType();

+		CompilationUnitDeclaration unit;

+		if (sourceType instanceof SourceTypeElementInfo) {

+			// get source

+			SourceTypeElementInfo elementInfo = (SourceTypeElementInfo) sourceType;

+			IType type = elementInfo.getHandle();

 			try {

-				input.close();

-			} catch (IOException e) {

-				// nothing can be done if the file cannot be closed

-			}

-		}

-	}

-}

-protected IResource getCurrentResource() {

-	return this.currentResource;

-}

-protected Scanner getScanner() {

-	return this.parser == null ? null : this.parser.scanner;

-}

-/**

- * Locate the matches in the given files and report them using the search requestor. 

- */

-public void locateMatches(String[] filePaths, IWorkspace workspace) throws JavaModelException {

-	Util.sort(filePaths); // sort by projects

-	JavaModelManager manager = JavaModelManager.getJavaModelManager();

-	HandleFactory factory = new HandleFactory(workspace.getRoot(), manager);

-	JavaProject previousJavaProject = null;

-	int length = filePaths.length;

-	double increment = 100.0 / length;

-	double totalWork = 0;

-	int lastProgress = 0;

-	boolean couldInitializePattern = false;

-	for (int i = 0; i < length; i++) {

-		IProgressMonitor monitor = this.collector.getProgressMonitor();

-		if (monitor != null && monitor.isCanceled()) {

-			throw new OperationCanceledException();

-		}

-		String pathString = filePaths[i];

-		this.currentOpenable = factory.createOpenable(pathString);

-		if (this.currentOpenable == null) continue;  // match is outside classpath

+				final IFile file = (IFile) type.getUnderlyingResource();

+				final char[] source = PotentialMatch.getContents(file);

 

-		// create new parser and lookup environment if this is a new project

-		try {

-			JavaProject javaProject = (JavaProject)this.currentOpenable.getJavaProject();

-			this.currentResource = this.currentOpenable.getUnderlyingResource();

-			if (this.currentResource == null) { // case of a file in an external jar

-				this.currentResource = javaProject.getProject();

-			}

-			if (!javaProject.equals(previousJavaProject)) {

-				// create parser for this project

-				couldInitializePattern = this.createParser(javaProject);

-				previousJavaProject = javaProject;

-			}

-			if (!couldInitializePattern) continue; // the pattern could not be initialized: the match cannot be in this project

-		} catch (JavaModelException e) {

-			// file doesn't exist -> skip it

-			continue;

-		}

+				// get main type name

+				final String fileName = file.getFullPath().lastSegment();

+				final char[] mainTypeName =

+					fileName.substring(0, fileName.length() - 5).toCharArray();

 

-		// locate matches in current file and report them

-		try {

-			if (this.currentOpenable instanceof CompilationUnit) {

-				this.locateMatchesInCompilationUnit();

-			} else if (this.currentOpenable instanceof org.eclipse.jdt.internal.core.ClassFile) {

-				this.locateMatchesInClassFile();

-			}

-		} catch (AbortCompilation e) {

-			// problem with class path: it could not find base classes

-			throw new JavaModelException(e, IJavaModelStatusConstants.BUILDER_INITIALIZATION_ERROR);

-		} catch (CoreException e) {

-			if (e instanceof JavaModelException) {

-				throw (JavaModelException)e;

-			} else {

-				throw new JavaModelException(e);

-			}

-		}

-		if (monitor != null) {

-			totalWork = totalWork + increment;

-			int worked = (int)totalWork - lastProgress;

-			monitor.worked(worked);

-			lastProgress = (int)totalWork;

-		}

-	}

-}

-/**

- * Locate declaration in the current class file. This class file is always in a jar.

- */

-private void locateMatchesInClassFile() throws CoreException, JavaModelException {

-	org.eclipse.jdt.internal.core.ClassFile classFile = (org.eclipse.jdt.internal.core.ClassFile)this.currentOpenable;

-	BinaryType binaryType = (BinaryType)classFile.getType();

-	IBinaryType info;

-	if (classFile.isOpen()) {

-		// reuse the info from the java model cache

-		info = (IBinaryType)binaryType.getRawInfo();

-	} else {

-		// create a temporary info

-		try {

-			IJavaElement pkg = classFile.getParent();

-			PackageFragmentRoot root = (PackageFragmentRoot)pkg.getParent();

-			if (root.isArchive()) {

-				// class file in a jar

-				String pkgPath = pkg.getElementName().replace('.', '/');

-				String classFilePath = 

-					(pkgPath.length() > 0) ?

-						pkgPath + "/"/*nonNLS*/ + classFile.getElementName() :

-						classFile.getElementName();

-				ZipFile zipFile = null;

-				try {

-					zipFile = ((JarPackageFragmentRoot)root).getJar();

-					info = org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(

-						zipFile,

-						classFilePath);

-				} finally {

-					if (zipFile != null) {

-						try {

-							zipFile.close();

-						} catch (IOException e) {

-							// ignore 

-						}

+				// source unit

+				ICompilationUnit sourceUnit = new ICompilationUnit() {

+					public char[] getContents() {

+						return source;

 					}

-				}

-			} else {

-				// class file in a directory

-				String osPath = this.currentResource.getFullPath().toOSString();

-				info = org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(osPath);

-			}

-		} catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException e) {

-			e.printStackTrace();

-			return;

-		} catch (java.io.IOException e) {

-			throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);

-		}

-		

-	}

-

-	// check class definition

-	if (this.pattern.matchesBinary(info, null)) {

-		this.reportBinaryMatch(binaryType, info, IJavaSearchResultCollector.EXACT_MATCH);

-	}

-

-	boolean compilationAborted = false;

-	if (this.pattern.needsResolve) {

-		// resolve

-		BinaryTypeBinding binding = null;

-		try {

-			binding = this.lookupEnvironment.cacheBinaryType(info);

-			if (binding == null) { // it was already cached as a result of a previous query

-				char[][] compoundName = CharOperation.splitOn('.', binaryType.getFullyQualifiedName().toCharArray());

-				ReferenceBinding referenceBinding = this.lookupEnvironment.getCachedType(compoundName);

-				if (referenceBinding != null && (referenceBinding instanceof BinaryTypeBinding)) {

-					// if the binding could be found and if it comes from a source type,

-					binding = (BinaryTypeBinding)referenceBinding;

-				}

-			}

-

-			// check methods

-			if (binding != null) {

-				MethodBinding[] methods = binding.methods();

-				for (int i = 0; i < methods.length; i++) {

-					MethodBinding method = methods[i];

-					if (this.pattern.matches(method)) {

-						IMethod methodHandle = 

-							binaryType.getMethod(

-								new String(method.isConstructor() ? binding.compoundName[binding.compoundName.length-1] : method.selector),

-								Signature.getParameterTypes(new String(method.signature()).replace('/', '.'))

-							);

-						this.reportBinaryMatch(methodHandle, info, IJavaSearchResultCollector.EXACT_MATCH);

+					public char[] getFileName() {

+						return fileName.toCharArray();

 					}

-				}

-			}

-		

-			// check fields

-			if (binding != null) {

-				FieldBinding[] fields = binding.fields();

-				for (int i = 0; i < fields.length; i++) {

-					FieldBinding field = fields[i];

-					if (this.pattern.matches(field)) {

-						IField fieldHandle = binaryType.getField(new String(field.name));

-						this.reportBinaryMatch(fieldHandle, info, IJavaSearchResultCollector.EXACT_MATCH);

+					public char[] getMainTypeName() {

+						return mainTypeName;

 					}

+				};

+

+				// diet parse

+				CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0);

+				unit = this.parser.dietParse(sourceUnit, compilationResult);

+			} catch (JavaModelException e) {

+				unit = null;

+			}

+		} else {

+			CompilationResult result =

+				new CompilationResult(sourceType.getFileName(), 0, 0);

+			unit =

+				SourceTypeConverter.buildCompilationUnit(

+					sourceTypes,

+					true,

+					true,

+					lookupEnvironment.problemReporter,

+					result);

+		}

+

+		if (unit != null) {

+			this.lookupEnvironment.buildTypeBindings(unit);

+			this.lookupEnvironment.completeTypeBindings(unit, true);

+			this.parsedUnits.put(sourceType.getQualifiedName(), unit);

+		}

+	}

+

+	/**

+	 * Creates an IField from the given field declaration and simple type names. 

+	 */

+	private IField createFieldHandle(

+		FieldDeclaration field,

+		char[][] definingTypeNames) {

+		IType type = this.createTypeHandle(definingTypeNames);

+		return type.getField(new String(field.name));

+	}

+

+	/**

+	 * Creates an IImportDeclaration from the given import statement

+	 */

+	private IImportDeclaration createImportHandle(ImportReference importRef) {

+		char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');

+		if (importRef.onDemand) {

+			importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$

+		}

+		return ((CompilationUnit) this.getCurrentOpenable()).getImport(

+			new String(importName));

+	}

+

+	/**

+	 * Creates an IInitializer from the given field declaration and simple type names. 

+	 */

+	private IInitializer createInitializerHandle(

+		TypeDeclaration typeDecl,

+		FieldDeclaration initializer,

+		char[][] definingTypeNames) {

+		IType type = this.createTypeHandle(definingTypeNames);

+

+		// find occurence count of the given initializer in its type declaration

+		int occurrenceCount = 0;

+		FieldDeclaration[] fields = typeDecl.fields;

+		for (int i = 0, length = fields.length; i < length; i++) {

+			FieldDeclaration field = fields[i];

+			if (!field.isField()) {

+				occurrenceCount++;

+				if (field.equals(initializer)) {

+					break;

 				}

 			}

-		} catch (AbortCompilation e) {

-			binding = null;

 		}

 

-		// no need to check binary info if resolve was successful

-		compilationAborted = binding == null;

-		if (!compilationAborted) return;

+		return type.getInitializer(occurrenceCount);

 	}

 

-	// if compilation was aborted it is a problem with the class path: 

-	// report as a potential match if binary info matches the pattern

-	int accuracy = compilationAborted ? IJavaSearchResultCollector.POTENTIAL_MATCH : IJavaSearchResultCollector.EXACT_MATCH;

-	

-	// check methods

-	IBinaryMethod[] methods = info.getMethods();

-	int length = methods == null ? 0 : methods.length;

-	for (int i = 0; i < length; i++) {

-		IBinaryMethod method = methods[i];

-		if (this.pattern.matchesBinary(method, info)) {

-			IMethod methodHandle = 

-				binaryType.getMethod(

-					new String(method.isConstructor() ? info.getName() : method.getSelector()),

-					Signature.getParameterTypes(new String(method.getMethodDescriptor()).replace('/', '.'))

-				);

-			this.reportBinaryMatch(methodHandle, info, accuracy);

+	/**

+	 * Creates an IMethod from the given method declaration and simple type names. 

+	 */

+	private IMethod createMethodHandle(

+		AbstractMethodDeclaration method,

+		char[][] definingTypeNames) {

+		IType type = this.createTypeHandle(definingTypeNames);

+		Argument[] arguments = method.arguments;

+		int length = arguments == null ? 0 : arguments.length;

+		String[] parameterTypeSignatures = new String[length];

+		for (int i = 0; i < length; i++) {

+			TypeReference parameterType = arguments[i].type;

+			char[] typeName = CharOperation.concatWith(parameterType.getTypeName(), '.');

+			for (int j = 0; j < parameterType.dimensions(); j++) {

+				typeName = CharOperation.concat(typeName, "[]" .toCharArray()); //$NON-NLS-1$

+			}

+			parameterTypeSignatures[i] = Signature.createTypeSignature(typeName, false);

 		}

+		return type.getMethod(new String(method.selector), parameterTypeSignatures);

 	}

 

-	// check fields

-	IBinaryField[] fields = info.getFields();

-	length = fields == null ? 0 : fields.length;

-	for (int i = 0; i < length; i++) {

-		IBinaryField field = fields[i];

-		if (this.pattern.matchesBinary(field, info)) {

-			IField fieldHandle = binaryType.getField(new String(field.getName()));

-			this.reportBinaryMatch(fieldHandle, info, accuracy);

+	/**

+	 * Creates an IType from the given simple type names. 

+	 */

+	private IType createTypeHandle(char[][] simpleTypeNames) {

+		// creates compilation unit

+		CompilationUnit unit = (CompilationUnit) this.getCurrentOpenable();

+

+		// create type

+		int length = simpleTypeNames.length;

+		IType type = unit.getType(new String(simpleTypeNames[0]));

+		for (int i = 1; i < length; i++) {

+			type = type.getType(new String(simpleTypeNames[i]));

 		}

+		return type;

 	}

-}

-private void locateMatchesInCompilationUnit() throws CoreException {

-	// get source

-	final char[] source = getContents((IFile)this.currentResource);

+	protected IResource getCurrentResource() {

+		return this.potentialMatches[this.potentialMatchesIndex].resource;

+	}

+	protected Scanner getScanner() {

+		return this.parser == null ? null : this.parser.scanner;

+	}

 

-	// get main type name

-	String pathString = this.currentResource.toString();

-	int lastDot = pathString.lastIndexOf('/');

-	// remove folder path and extension ".java"

-	final char[] mainTypeName = pathString.substring(lastDot+1, pathString.length()-5).toCharArray(); 

+	/**

+	 * Locate the matches in the given files and report them using the search requestor. 

+	 */

+	public void locateMatches(String[] filePaths, IWorkspace workspace)

+		throws JavaModelException {

+		Util.sort(filePaths); // sort by projects

+		JavaModelManager manager = JavaModelManager.getJavaModelManager();

+		HandleFactory factory = new HandleFactory(workspace.getRoot(), manager);

+		JavaProject previousJavaProject = null;

+		int length = filePaths.length;

+		double increment = 100.0 / length;

+		double totalWork = 0;

+		int lastProgress = 0;

+		boolean couldInitializePattern = false;

+		this.potentialMatches = new PotentialMatch[10];

+		this.potentialMatchesLength = 0;

+		for (int i = 0; i < length; i++) {

+			IProgressMonitor monitor = this.collector.getProgressMonitor();

+			if (monitor != null && monitor.isCanceled()) {

+				throw new OperationCanceledException();

+			}

+			String pathString = filePaths[i];

+			Openable openable = factory.createOpenable(pathString);

+			if (openable == null)

+				continue; // match is outside classpath

 

-	// parse

-	ICompilationUnit sourceUnit = new ICompilationUnit() {

-		public char[] getContents() {

-			return source;

-		}

-		public char[] getFileName() {

-			return MatchLocator.this.currentResource.getName().toCharArray();

-		}

-		public char[] getMainTypeName() {

-			return mainTypeName;

-		}

-	};

-	MatchSet set = new MatchSet(this);

-	this.parser.matchSet = set;

-	CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0);  

-	CompilationUnitDeclaration parsedUnit = this.parser.parse(sourceUnit, compilationResult);

-

-	if (parsedUnit != null) {

-		// report matches that don't need resolve

-		set.cuHasBeenResolved = false;

-		set.accuracy = IJavaSearchResultCollector.EXACT_MATCH;

-		set.reportMatching(parsedUnit);

-		

-		// resolve if needed

-		if (set.needsResolve()) {

-			if (parsedUnit.types != null) {

-				/**

-				 * First approximation: reset the lookup environment -> this will recreate the bindings for the current CU

-				 * Optimization: the binding resolution should be done for all compilation units at once

-				 */

-				this.lookupEnvironment.reset();

-

-				try {

-					lookupEnvironment.buildTypeBindings(parsedUnit);

-					if (parsedUnit.scope != null) {

-						lookupEnvironment.completeTypeBindings(parsedUnit, true);

-						parsedUnit.scope.faultInTypes();

-						parsedUnit.resolve();

-						//this.pattern.initializeFromLookupEnvironment(this.lookupEnvironment);

+			// create new parser and lookup environment if this is a new project

+			IResource resource = null;

+			try {

+				JavaProject javaProject = (JavaProject) openable.getJavaProject();

+				resource = openable.getUnderlyingResource();

+				if (resource == null) { // case of a file in an external jar

+					resource = javaProject.getProject();

+				}

+				if (!javaProject.equals(previousJavaProject)) {

+					// locate matches in previous project

+					if (previousJavaProject != null) {

+						this.locateMatches();

+						this.potentialMatchesLength = 0;

 					}

-					// report matches that needed resolve

-					set.cuHasBeenResolved = true;

-					set.accuracy = IJavaSearchResultCollector.EXACT_MATCH;

-					set.reportMatching(parsedUnit);

-				} catch (AbortCompilation e) {

-					// could not resolve (reasons include "could not find library class") -> ignore and report the unresolved nodes

-					set.cuHasBeenResolved = false;

-					set.accuracy = IJavaSearchResultCollector.POTENTIAL_MATCH;

-					set.reportMatching(parsedUnit);

+

+					// create parser for this project

+					couldInitializePattern = this.createParser(javaProject);

+					previousJavaProject = javaProject;

 				}

+				if (!couldInitializePattern)

+					continue;

+				// the pattern could not be initialized: the match cannot be in this project

+			} catch (JavaModelException e) {

+				// file doesn't exist -> skip it

+				continue;

+			}

+

+			// add potential match

+			this.addPotentialMatch(resource, openable);

+

+			if (monitor != null) {

+				totalWork = totalWork + increment;

+				int worked = (int) totalWork - lastProgress;

+				monitor.worked(worked);

+				lastProgress = (int) totalWork;

 			}

 		}

+

+		// last project

+		if (previousJavaProject != null) {

+			this.locateMatches();

+			this.potentialMatchesLength = 0;

+		}

+

 	}

-}

-/**

- * Locates the package declarations corresponding to this locator's pattern. 

- */

-public void locatePackageDeclarations(IWorkspace workspace) throws JavaModelException {

-	this.locatePackageDeclarations(this.pattern, workspace);

-}

-/**

- * Locates the package declarations corresponding to the search pattern. 

- */

-private void locatePackageDeclarations(SearchPattern searchPattern, IWorkspace workspace) throws JavaModelException {

-	if (searchPattern instanceof OrPattern) {

-		OrPattern orPattern = (OrPattern)searchPattern;

-		this.locatePackageDeclarations(orPattern.leftPattern, workspace);

-		this.locatePackageDeclarations(orPattern.rightPattern, workspace);

-	} else if (searchPattern instanceof PackageDeclarationPattern) {

-		PackageDeclarationPattern pkgPattern = (PackageDeclarationPattern)searchPattern;

-		String pkgName = new String(pkgPattern.pkgName);

-		IJavaProject[] projects = JavaModelManager.getJavaModel(workspace).getJavaProjects();

-		for (int i = 0, length = projects.length; i < length; i++) {

-			IJavaProject javaProject = projects[i];

-			IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();

-			for (int j = 0, rootsLength = roots.length; j < rootsLength; j++) {

-				IJavaElement[] pkgs = roots[j].getChildren();

-				for (int k = 0, pksLength = pkgs.length; k < pksLength; k++) {

-					IJavaElement pkg = pkgs[k];

-					if (pkgPattern.matchesName(pkgPattern.pkgName, pkg.getElementName().toCharArray())) {

-						this.currentResource = pkg.getUnderlyingResource();

-						if (this.currentResource == null) { // case of a file in an external jar

-							this.currentResource = javaProject.getProject();

-						}

-						try {

-							this.report(-1, -2, pkg, IJavaSearchResultCollector.EXACT_MATCH);

-						} catch (CoreException e) {

-							if (e instanceof JavaModelException) {

-								throw (JavaModelException)e;

-							} else {

-								throw new JavaModelException(e);

+

+	/**

+	 * Locates the package declarations corresponding to this locator's pattern. 

+	 */

+	public void locatePackageDeclarations(IWorkspace workspace)

+		throws JavaModelException {

+		this.locatePackageDeclarations(this.pattern, workspace);

+	}

+

+	/**

+	 * Locates the package declarations corresponding to the search pattern. 

+	 */

+	private void locatePackageDeclarations(

+		SearchPattern searchPattern,

+		IWorkspace workspace)

+		throws JavaModelException {

+		if (searchPattern instanceof OrPattern) {

+			OrPattern orPattern = (OrPattern) searchPattern;

+			this.locatePackageDeclarations(orPattern.leftPattern, workspace);

+			this.locatePackageDeclarations(orPattern.rightPattern, workspace);

+		} else

+			if (searchPattern instanceof PackageDeclarationPattern) {

+				PackageDeclarationPattern pkgPattern =

+					(PackageDeclarationPattern) searchPattern;

+				String pkgName = new String(pkgPattern.pkgName);

+				IJavaProject[] projects =

+					JavaModelManager.getJavaModel(workspace).getJavaProjects();

+				for (int i = 0, length = projects.length; i < length; i++) {

+					IJavaProject javaProject = projects[i];

+					IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();

+					for (int j = 0, rootsLength = roots.length; j < rootsLength; j++) {

+						IJavaElement[] pkgs = roots[j].getChildren();

+						for (int k = 0, pksLength = pkgs.length; k < pksLength; k++) {

+							IJavaElement pkg = pkgs[k];

+							if (pkgPattern

+								.matchesName(pkgPattern.pkgName, pkg.getElementName().toCharArray())) {

+								IResource resource = pkg.getUnderlyingResource();

+								if (resource == null) { // case of a file in an external jar

+									resource = javaProject.getProject();

+								}

+								this.potentialMatchesIndex = 0;

+								this.potentialMatches =

+									new PotentialMatch[] { new PotentialMatch(this, resource, null)};

+								try {

+									this.report(-1, -2, pkg, IJavaSearchResultCollector.EXACT_MATCH);

+								} catch (CoreException e) {

+									if (e instanceof JavaModelException) {

+										throw (JavaModelException) e;

+									} else {

+										throw new JavaModelException(e);

+									}

+								}

 							}

 						}

 					}

 				}

 			}

+	}

+

+	public void report(

+		int sourceStart,

+		int sourceEnd,

+		IJavaElement element,

+		int accuracy)

+		throws CoreException {

+		if (this.scope.encloses(element)) {

+			this.collector.accept(

+				this.getCurrentResource(),

+				sourceStart,

+				sourceEnd + 1,

+				element,

+				accuracy);

 		}

 	}

-}

-public void report(int sourceStart, int sourceEnd, IJavaElement element, int accuracy) throws CoreException {

-	if (this.scope.encloses(element)) {

-		this.collector.accept(

-			this.currentResource,

-			sourceStart,

-			sourceEnd + 1,

-			element, 

-			accuracy

-		);

-	}

-}

-private void reportBinaryMatch(IMember binaryMember, IBinaryType info, int accuracy) throws CoreException, JavaModelException {

-	ISourceRange range = binaryMember.getNameRange();

-	if (range.getOffset() == -1) {

-		ClassFile classFile = (ClassFile)binaryMember.getClassFile();

-		SourceMapper mapper = classFile.getSourceMapper();

-		if (mapper != null) {

-			IType type = classFile.getType();

-			char[] contents = mapper.findSource(type, info);

-			if (contents != null) {

-				range = mapper.mapSource(type, contents, binaryMember);

-			}

-		}

-	}

-	int startIndex = range.getOffset();

-	int endIndex = startIndex + range.getLength() - 1;

-	this.report(startIndex, endIndex, binaryMember, accuracy);

-}

-/**

- * Reports the given field declaration to the search requestor.

- * Its defining types have the given simple names.

- */

-public void reportFieldDeclaration(

-	FieldDeclaration fieldDeclaration, 

-	char[][] definingTypeNames, 

-	int accuracy) throws CoreException {

-		

-	// create field handle

-	IType type = this.createTypeHandle(definingTypeNames);

-	IField field = type.getField(new String(fieldDeclaration.name));

-	

-	// accept field declaration

-	this.report(fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd, field, accuracy);

-}

-/**

- * Reports the given import to the search requestor.

- */

-public void reportImport(ImportReference reference, int accuracy) throws CoreException {

 

-	// create defining import handle

-	IImportDeclaration importHandle = this.createImportHandle(reference);

-	

-	// accept reference

-	this.pattern.matchReportReference(reference, importHandle, accuracy, this);	

-}

-/**

- * Reports the given method declaration to the search requestor.

- * Its defining types have the given simple names.

- */

-public void reportMethodDeclaration(

-	AbstractMethodDeclaration methodDeclaration, 

-	char[][] definingTypeNames,

-	int accuracy) throws CoreException {

-		

-	// create method handle

-	IMethod method = this.createMethodHandle(methodDeclaration, definingTypeNames);

-

-	// compute source positions of the selector 

-	Scanner scanner = parser.scanner;

-	int nameSourceStart = methodDeclaration.sourceStart;

-	scanner.resetTo(nameSourceStart, methodDeclaration.sourceEnd);

-	try {

-		scanner.getNextToken();

-	} catch(InvalidInputException e) {

-	}

-	int nameSourceEnd = scanner.currentPosition-1;

-

-	// accept method declaration

-	this.report(nameSourceStart, nameSourceEnd, method, accuracy);

-}

-/**

- * Reports the given package declaration to the search requestor.

- */

-public void reportPackageDeclaration(ImportReference node) {

-	// TBD

-}

-/**

- * Reports the given package reference to the search requestor.

- */

-public void reportPackageReference(ImportReference node) {

-	// TBD

-}

-/**

- * Reports the given qualified reference to the search requestor.

- */

-public void reportQualifiedReference(

-	int sourceStart,

-	int sourceEnd,

-	char[][] qualifiedName,

-	IJavaElement element,

-	int accuracy) throws CoreException {

-		

-	// compute source positions of the qualified reference 

-	Scanner scanner = parser.scanner;

-	scanner.resetTo(sourceStart, sourceEnd);

-

-	int refSourceStart = -1, refSourceEnd = -1;

-	int tokenNumber = qualifiedName.length;

-	int token = -1;

-	int previousValid = -1;

-	int i = 0;

-	do {

-		int currentPosition = scanner.currentPosition;

-		// read token

-		try {

-			token = scanner.getNextToken();

-		} catch(InvalidInputException e) {

-		}

-		if (token != TerminalSymbols.TokenNameEOF) {

-			char[] currentTokenSource = scanner.getCurrentTokenSource();

-			while (i < tokenNumber && !CharOperation.equals(currentTokenSource, qualifiedName[i++])) {

-			}

-			if (CharOperation.equals(currentTokenSource, qualifiedName[i-1]) && (previousValid == -1 || previousValid == i-2)) {

-				previousValid = i-1;

-				if (refSourceStart == -1) {

-					refSourceStart = currentPosition;

+	public void reportBinaryMatch(

+		IMember binaryMember,

+		IBinaryType info,

+		int accuracy)

+		throws CoreException, JavaModelException {

+		ISourceRange range = binaryMember.getNameRange();

+		if (range.getOffset() == -1) {

+			ClassFile classFile = (ClassFile) binaryMember.getClassFile();

+			SourceMapper mapper = classFile.getSourceMapper();

+			if (mapper != null) {

+				IType type = classFile.getType();

+				char[] contents = mapper.findSource(type, info);

+				if (contents != null) {

+					range = mapper.mapSource(type, contents, binaryMember);

 				}

-				refSourceEnd = scanner.currentPosition-1;

-			} else {

-				i = 0;

-				refSourceStart = -1;

-				previousValid = -1;

 			}

-			// read '.'

+		}

+		int startIndex = range.getOffset();

+		int endIndex = startIndex + range.getLength() - 1;

+		this.report(startIndex, endIndex, binaryMember, accuracy);

+	}

+

+	/**

+	 * Reports the given field declaration to the search requestor.

+	 * Its defining types have the given simple names.

+	 */

+	public void reportFieldDeclaration(

+		FieldDeclaration fieldDeclaration,

+		char[][] definingTypeNames,

+		int accuracy)

+		throws CoreException {

+

+		// create field handle

+		IType type = this.createTypeHandle(definingTypeNames);

+		IField field = type.getField(new String(fieldDeclaration.name));

+

+		// accept field declaration

+		this.report(

+			fieldDeclaration.sourceStart,

+			fieldDeclaration.sourceEnd,

+			field,

+			accuracy);

+	}

+

+	/**

+	 * Reports the given import to the search requestor.

+	 */

+	public void reportImport(ImportReference reference, int accuracy)

+		throws CoreException {

+

+		// create defining import handle

+		IImportDeclaration importHandle = this.createImportHandle(reference);

+

+		// accept reference

+		this.pattern.matchReportReference(reference, importHandle, accuracy, this);

+	}

+

+	/**

+	 * Reports the given method declaration to the search requestor.

+	 * Its defining types have the given simple names.

+	 */

+	public void reportMethodDeclaration(

+		AbstractMethodDeclaration methodDeclaration,

+		char[][] definingTypeNames,

+		int accuracy)

+		throws CoreException {

+

+		// create method handle

+		IMethod method = this.createMethodHandle(methodDeclaration, definingTypeNames);

+

+		// compute source positions of the selector 

+		Scanner scanner = parser.scanner;

+		int nameSourceStart = methodDeclaration.sourceStart;

+		scanner.setSourceBuffer(

+			this.potentialMatches[this.potentialMatchesIndex].getSource());

+		scanner.resetTo(nameSourceStart, methodDeclaration.sourceEnd);

+		try {

+			scanner.getNextToken();

+		} catch (InvalidInputException e) {

+		}

+		int nameSourceEnd = scanner.currentPosition - 1;

+

+		// accept method declaration

+		this.report(nameSourceStart, nameSourceEnd, method, accuracy);

+	}

+

+	/**

+	 * Reports the given package declaration to the search requestor.

+	 */

+	public void reportPackageDeclaration(ImportReference node) {

+		// TBD

+	}

+

+	/**

+	 * Reports the given package reference to the search requestor.

+	 */

+	public void reportPackageReference(ImportReference node) {

+		// TBD

+	}

+

+	/**

+	 * Reports the given qualified reference to the search requestor.

+	 */

+	public void reportQualifiedReference(

+		int sourceStart,

+		int sourceEnd,

+		char[][] qualifiedName,

+		IJavaElement element,

+		int accuracy)

+		throws CoreException {

+

+		// compute source positions of the qualified reference 

+		Scanner scanner = parser.scanner;

+		scanner.setSourceBuffer(

+			this.potentialMatches[this.potentialMatchesIndex].getSource());

+		scanner.resetTo(sourceStart, sourceEnd);

+

+		int refSourceStart = -1, refSourceEnd = -1;

+		int tokenNumber = qualifiedName.length;

+		int token = -1;

+		int previousValid = -1;

+		int i = 0;

+		do {

+			int currentPosition = scanner.currentPosition;

+			// read token

 			try {

 				token = scanner.getNextToken();

-			} catch(InvalidInputException e) {

+			} catch (InvalidInputException e) {

 			}

-		} 

-	} while (token != TerminalSymbols.TokenNameEOF && i < tokenNumber);

-

-	// accept method declaration

-	if (refSourceStart != -1) {

-		this.report(refSourceStart, refSourceEnd, element, accuracy);

-	} else {

-		this.report(sourceStart, sourceEnd, element, accuracy);

-	}

-}

-/**

- * Reports the given reference to the search requestor.

- * It is done in the given method and the method's defining types 

- * have the given simple names.

- */

-public void reportReference(

-	AstNode reference, 

-	AbstractMethodDeclaration methodDeclaration, 

-	char[][] definingTypeNames, 

-	int accuracy) throws CoreException {

-		

-	// create defining method handle

-	IMethod method = this.createMethodHandle(methodDeclaration, definingTypeNames);

-	

-	// accept reference

-	if (reference instanceof QualifiedNameReference || reference instanceof QualifiedTypeReference) {

-		this.pattern.matchReportReference((AstNode)reference, method, accuracy, this);

-	} else if (reference instanceof MessageSend) { // message ref are starting at the selector start

-		this.report((int)(((MessageSend)reference).nameSourcePosition >> 32), reference.sourceEnd, method, accuracy);

-	} else {

-		this.report(reference.sourceStart, reference.sourceEnd, method, accuracy);

-	}

-}

-/**

- * Reports the given reference to the search requestor.

- * It is done in the given field and given type.

- * The field's defining types have the given simple names.

- */

-public void reportReference(

-	AstNode reference,

-	TypeDeclaration typeDeclaration,

-	FieldDeclaration fieldDeclaration, 

-	char[][] definingTypeNames, 

-	int accuracy) throws CoreException {

-

-	if (fieldDeclaration.isField()) {

-		// create defining field handle

-		IField field = this.createFieldHandle(fieldDeclaration, definingTypeNames);

-	

-		// accept reference

-		if (reference instanceof QualifiedNameReference || reference instanceof QualifiedTypeReference) {

-			this.pattern.matchReportReference((AstNode)reference, field, accuracy, this);

-		} else if (reference instanceof MessageSend) { // message ref are starting at the selector start

-			this.report((int)(((MessageSend)reference).nameSourcePosition >> 32), reference.sourceEnd, field, accuracy);

-		} else {

-			this.report(reference.sourceStart, reference.sourceEnd, field, accuracy);

+			if (token != TerminalSymbols.TokenNameEOF) {

+				char[] currentTokenSource = scanner.getCurrentTokenSource();

+				while (i < tokenNumber

+					&& !CharOperation.equals(currentTokenSource, qualifiedName[i++])) {

+				}

+				if (CharOperation.equals(currentTokenSource, qualifiedName[i - 1])

+					&& (previousValid == -1 || previousValid == i - 2)) {

+					previousValid = i - 1;

+					if (refSourceStart == -1) {

+						refSourceStart = currentPosition;

+					}

+					refSourceEnd = scanner.currentPosition - 1;

+				} else {

+					i = 0;

+					refSourceStart = -1;

+					previousValid = -1;

+				}

+				// read '.'

+				try {

+					token = scanner.getNextToken();

+				} catch (InvalidInputException e) {

+				}

+			}

 		}

-	} else { // initializer

-		// create defining initializer

-		IInitializer initializer = this.createInitializerHandle(typeDeclaration, fieldDeclaration, definingTypeNames);

-		

+		while (token != TerminalSymbols.TokenNameEOF && i < tokenNumber);

+

 		// accept reference

-		if (reference instanceof QualifiedNameReference || reference instanceof QualifiedTypeReference) {

-			this.pattern.matchReportReference((AstNode)reference, initializer, accuracy, this);

-		} else if (reference instanceof MessageSend) { // message ref are starting at the selector start

-			this.report((int)(((MessageSend)reference).nameSourcePosition >> 32), reference.sourceEnd, initializer, accuracy);

+		if (refSourceStart != -1) {

+			this.report(refSourceStart, refSourceEnd, element, accuracy);

 		} else {

-			this.report(reference.sourceStart, reference.sourceEnd, initializer, accuracy);

+			this.report(sourceStart, sourceEnd, element, accuracy);

 		}

 	}

-}

-/**

- * Reports the given super type reference to the search requestor.

- * It is done in the given defining type (with the given simple names).

- */

-public void reportSuperTypeReference(

-	TypeReference typeRef, 

-	char[][] definingTypeNames, 

-	int accuracy) throws CoreException {

-		

-	// create defining type handle

-	IType type = this.createTypeHandle(definingTypeNames);

-	

-	// accept type reference

-	this.pattern.matchReportReference(typeRef, type, accuracy, this);

-}

-/**

- * Reports the given type declaration to the search requestor.

- * Its simple names are the names of its outer most type to this type.

- */

-public void reportTypeDeclaration(

-	TypeDeclaration typeDeclaration, 

-	char[][] simpleTypeNames, 

-	int accuracy) throws CoreException {

-		

-	// create type handle

-	IType type = this.createTypeHandle(simpleTypeNames);

-	

-	// accept class or interface declaration

-	this.report(typeDeclaration.sourceStart, typeDeclaration.sourceEnd, type, accuracy);

-}

 

-/**

- * Create a new parser for the given project, as well as a lookup environment.

- * Asks the pattern to initialize itself from the lookup environment.

- * Returns whether it was able to initialize the pattern.

- */

-private boolean createParser(JavaProject project) throws JavaModelException {

-	INameEnvironment nameEnvironment = project.getSearchableNameEnvironment();

-	IProblemFactory problemFactory = new DefaultProblemFactory();

+	/**

+	 * Reports the given reference to the search requestor.

+	 * It is done in the given method and the method's defining types 

+	 * have the given simple names.

+	 */

+	public void reportReference(

+		AstNode reference,

+		AbstractMethodDeclaration methodDeclaration,

+		char[][] definingTypeNames,

+		int accuracy)

+		throws CoreException {

 

-	CompilerOptions options = new CompilerOptions(null);

-	ProblemReporter problemReporter =

-		new ProblemReporter(

-			DefaultErrorHandlingPolicies.proceedWithAllProblems(),

-			options,

-			problemFactory);

-	this.lookupEnvironment = new LookupEnvironment(this, options, problemReporter, nameEnvironment);

-	this.parser = new MatchLocatorParser(problemReporter);

-	return this.pattern.initializeFromLookupEnvironment(this.lookupEnvironment);

-}

-}

+		// create defining method handle

+		IMethod method = this.createMethodHandle(methodDeclaration, definingTypeNames);

+

+		// accept reference

+		if (reference instanceof QualifiedNameReference

+			|| reference instanceof QualifiedTypeReference) {

+			this.pattern.matchReportReference((AstNode) reference, method, accuracy, this);

+		} else

+			if (reference instanceof MessageSend) {

+				// message ref are starting at the selector start

+				this.report(

+					(int) (((MessageSend) reference).nameSourcePosition >> 32),

+					reference.sourceEnd,

+					method,

+					accuracy);

+			} else {

+				this.report(reference.sourceStart, reference.sourceEnd, method, accuracy);

+			}

+	}

+

+	/**

+	 * Reports the given reference to the search requestor.

+	 * It is done in the given field and given type.

+	 * The field's defining types have the given simple names.

+	 */

+	public void reportReference(

+		AstNode reference,

+		TypeDeclaration typeDeclaration,

+		FieldDeclaration fieldDeclaration,

+		char[][] definingTypeNames,

+		int accuracy)

+		throws CoreException {

+

+		if (fieldDeclaration.isField()) {

+			// create defining field handle

+			IField field = this.createFieldHandle(fieldDeclaration, definingTypeNames);

+

+			// accept reference

+			if (reference instanceof QualifiedNameReference

+				|| reference instanceof QualifiedTypeReference) {

+				this.pattern.matchReportReference((AstNode) reference, field, accuracy, this);

+			} else

+				if (reference instanceof MessageSend) {

+					// message ref are starting at the selector start

+					this.report(

+						(int) (((MessageSend) reference).nameSourcePosition >> 32),

+						reference.sourceEnd,

+						field,

+						accuracy);

+				} else {

+					this.report(reference.sourceStart, reference.sourceEnd, field, accuracy);

+				}

+		} else { // initializer

+			// create defining initializer

+			IInitializer initializer =

+				this.createInitializerHandle(

+					typeDeclaration,

+					fieldDeclaration,

+					definingTypeNames);

+

+			// accept reference

+			if (reference instanceof QualifiedNameReference

+				|| reference instanceof QualifiedTypeReference) {

+				this.pattern.matchReportReference(

+					(AstNode) reference,

+					initializer,

+					accuracy,

+					this);

+			} else

+				if (reference instanceof MessageSend) {

+					// message ref are starting at the selector start

+					this.report(

+						(int) (((MessageSend) reference).nameSourcePosition >> 32),

+						reference.sourceEnd,

+						initializer,

+						accuracy);

+				} else {

+					this.report(reference.sourceStart, reference.sourceEnd, initializer, accuracy);

+				}

+		}

+	}

+

+	/**

+	 * Reports the given super type reference to the search requestor.

+	 * It is done in the given defining type (with the given simple names).

+	 */

+	public void reportSuperTypeReference(

+		TypeReference typeRef,

+		char[][] definingTypeNames,

+		int accuracy)

+		throws CoreException {

+

+		// create defining type handle

+		IType type = this.createTypeHandle(definingTypeNames);

+

+		// accept type reference

+		this.pattern.matchReportReference(typeRef, type, accuracy, this);

+	}

+

+	/**

+	 * Reports the given type declaration to the search requestor.

+	 * Its simple names are the names of its outer most type to this type.

+	 */

+	public void reportTypeDeclaration(

+		TypeDeclaration typeDeclaration,

+		char[][] simpleTypeNames,

+		int accuracy)

+		throws CoreException {

+

+		// create type handle

+		IType type = this.createTypeHandle(simpleTypeNames);

+

+		// accept class or interface declaration

+		this.report(

+			typeDeclaration.sourceStart,

+			typeDeclaration.sourceEnd,

+			type,

+			accuracy);

+	}

+

+	private void addPotentialMatch(IResource resource, Openable openable)

+		throws JavaModelException {

+		try {

+			if (this.potentialMatchesLength == this.potentialMatches.length) {

+				System.arraycopy(

+					this.potentialMatches,

+					0,

+					this.potentialMatches = new PotentialMatch[this.potentialMatchesLength * 2],

+					0,

+					this.potentialMatchesLength);

+			}

+			this.potentialMatches[this.potentialMatchesLength++] =

+				new PotentialMatch(this, resource, openable);

+		} catch (AbortCompilation e) {

+			// problem with class path: it could not find base classes

+			throw new JavaModelException(

+				e,

+				IJavaModelStatusConstants.BUILDER_INITIALIZATION_ERROR);

+		}

+	}

+

+	/**

+	 * Create a new parser for the given project, as well as a lookup environment.

+	 * Asks the pattern to initialize itself from the lookup environment.

+	 * Returns whether it was able to initialize the pattern.

+	 */

+	private boolean createParser(JavaProject project) throws JavaModelException {

+		INameEnvironment nameEnvironment = project.getSearchableNameEnvironment();

+		IProblemFactory problemFactory = new DefaultProblemFactory();

+

+		CompilerOptions options = new CompilerOptions(null);

+		ProblemReporter problemReporter =

+			new ProblemReporter(

+				DefaultErrorHandlingPolicies.proceedWithAllProblems(),

+				options,

+				problemFactory);

+		this.lookupEnvironment =

+			new LookupEnvironment(this, options, problemReporter, nameEnvironment);

+		this.parser = new MatchLocatorParser(problemReporter);

+		this.parsedUnits = new HashtableOfObject(10);

+		return this.pattern.initializeFromLookupEnvironment(this.lookupEnvironment);

+	}

+

+	protected Openable getCurrentOpenable() {

+		return this.potentialMatches[this.potentialMatchesIndex].openable;

+	}

+

+	/**

+	 * Locate the matches amongst the potential matches.

+	 */

+	private void locateMatches() throws JavaModelException {

+		// binding resolution

+		this.lookupEnvironment.completeTypeBindings();

+

+		// potential match resolution

+		for (this.potentialMatchesIndex = 0;

+			this.potentialMatchesIndex < this.potentialMatchesLength;

+			this.potentialMatchesIndex++) {

+			try {

+				PotentialMatch potentialMatch =

+					this.potentialMatches[this.potentialMatchesIndex];

+				potentialMatch.locateMatches();

+				potentialMatch.reset();

+			} catch (AbortCompilation e) {

+				// problem with class path: it could not find base classes

+				throw new JavaModelException(

+					e,

+					IJavaModelStatusConstants.BUILDER_INITIALIZATION_ERROR);

+			} catch (CoreException e) {

+				if (e instanceof JavaModelException) {

+					throw (JavaModelException) e;

+				} else {

+					throw new JavaModelException(e);

+				}

+			}

+		}

+	}

+}
\ No newline at end of file
diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
index 4370011..2c8d886 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
@@ -24,70 +24,77 @@
 }

 protected void classInstanceCreation(boolean alwaysQualified) {

 	super.classInstanceCreation(alwaysQualified);

-	this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	}

 }

 protected void consumeExplicitConstructorInvocation(int flag, int recFlag) {

 	super.consumeExplicitConstructorInvocation(flag, recFlag);

-	this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	}

 }

 protected void consumeFieldAccess(boolean isSuperAccess) {

 	super.consumeFieldAccess(isSuperAccess);

-	this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	}

 }

 protected void consumeMethodInvocationName() {

 	super.consumeMethodInvocationName();

-	this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	}

 }

 protected void consumeMethodInvocationPrimary() {

 	super.consumeMethodInvocationPrimary();

-	this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	}

 }

 protected void consumeMethodInvocationSuper() {

 	super.consumeMethodInvocationSuper();

-	this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.expressionStack[this.expressionPtr]);

+	}

 }

 protected void consumeSingleTypeImportDeclarationName() {

 	super.consumeSingleTypeImportDeclarationName();

-	this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	}

 }

 protected void consumeTypeImportOnDemandDeclarationName() {

 	super.consumeTypeImportOnDemandDeclarationName();

-	this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(this.astStack[this.astPtr]);

+	}

 }

 protected TypeReference getTypeReference(int dim) {

 	TypeReference typeRef = super.getTypeReference(dim);

-	this.matchSet.checkMatching(typeRef); // NB: Don't check container since type reference can happen anywhere

+	if (this.matchSet != null) { 

+		this.matchSet.checkMatching(typeRef); // NB: Don't check container since type reference can happen anywhere

+	}

 	return typeRef;

 }

 protected NameReference getUnspecifiedReference() {

 	NameReference nameRef = super.getUnspecifiedReference();

-	this.matchSet.checkMatching(nameRef); // NB: Don't check container since unspecified reference can happen anywhere

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(nameRef); // NB: Don't check container since unspecified reference can happen anywhere

+	}

 	return nameRef;

 }

 protected NameReference getUnspecifiedReferenceOptimized() {

 	NameReference nameRef = super.getUnspecifiedReferenceOptimized();

-	this.matchSet.checkMatching(nameRef); // NB: Don't check container since unspecified reference can happen anywhere

+	if (this.matchSet != null) {

+		this.matchSet.checkMatching(nameRef); // NB: Don't check container since unspecified reference can happen anywhere

+	}

 	return nameRef;

 }

 /**

- * Parses the given source unit in 2 times:

- * - first do a diet parse to determine the structure of the compilation unit

- * - then do a method body parse of each method to determine the references

- */

-public CompilationUnitDeclaration parse(

-	ICompilationUnit sourceUnit, 

-	CompilationResult compilationResult) {

-

-	this.diet = true;

-	CompilationUnitDeclaration unit = super.parse(sourceUnit, compilationResult);

-	this.diet = false;

-	this.parseBodies(unit);

-	return unit;

-}

-/**

  * Parses the method bodies in the given compilation unit

  */

-private void parseBodies(CompilationUnitDeclaration unit) {

+public void parseBodies(CompilationUnitDeclaration unit) {

 	TypeDeclaration[] types = unit.types;

 	if (types != null) {

 		for (int i = 0; i < types.length; i++) {

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MatchSet.java b/search/org/eclipse/jdt/internal/core/search/matching/MatchSet.java
index fb5befe..1b1c8a5 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MatchSet.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MatchSet.java
@@ -42,18 +42,18 @@
 	this.matchContainer = locator.pattern.matchContainer();

 }

 public void addPossibleMatch(AstNode node) {

-	this.potentialMatchingNodes.put(node, node);

+	this.potentialMatchingNodes.put(node, new Integer(SearchPattern.POSSIBLE_MATCH));

 }

 public void addTrustedMatch(AstNode node) {

-	this.matchingNodes.put(node, node);

+	this.matchingNodes.put(node, new Integer(SearchPattern.ACCURATE_MATCH));

 }

 public void checkMatching(AstNode node) {

-	int matchLevel = this.locator.pattern.matchLevel(node);

+	int matchLevel = this.locator.pattern.matchLevel(node, false);

 	switch (matchLevel) {

 		case SearchPattern.POSSIBLE_MATCH:

 			this.addPossibleMatch(node);

 			break;

-		case SearchPattern.TRUSTED_MATCH:

+		case SearchPattern.ACCURATE_MATCH:

 			this.addTrustedMatch(node);

 	}

 }

@@ -109,9 +109,15 @@
 	AstNode[] nodes = this.matchingNodes(method.declarationSourceStart, method.declarationSourceEnd);

 	for (int i = 0; i < nodes.length; i++) {

 		AstNode node = nodes[i];

-		this.matchingNodes.remove(node);

+		Integer level = (Integer)this.matchingNodes.remove(node);

 		if ((this.matchContainer & SearchPattern.METHOD) != 0) {

-			this.locator.reportReference(node, method, definingTypeNames, this.accuracy);

+			this.locator.reportReference(

+				node, 

+				method, 

+				definingTypeNames, 

+				level.intValue() == SearchPattern.ACCURATE_MATCH ?

+					IJavaSearchResultCollector.EXACT_MATCH :

+					IJavaSearchResultCollector.POTENTIAL_MATCH);

 		}

 	}

 	if (this.potentialMatchingNodes(method.declarationSourceStart, method.declarationSourceEnd).length == 0) {

@@ -128,8 +134,9 @@
 		// move the potential matching nodes that exactly match the search pattern to the matching nodes set

 		for (Enumeration potentialMatches = this.potentialMatchingNodes.keys(); potentialMatches.hasMoreElements();) {

 			AstNode node = (AstNode) potentialMatches.nextElement();

-			if (this.locator.pattern.matches(node)) {

-				this.matchingNodes.put(node, node);

+			int level = this.locator.pattern.matchLevel(node, true);

+			if (level == SearchPattern.ACCURATE_MATCH || level == SearchPattern.INACCURATE_MATCH) {

+				this.matchingNodes.put(node, new Integer(level));

 			}

 		}

 		this.potentialMatchingNodes = new Hashtable();

@@ -137,8 +144,8 @@
 	

 	// package declaration

 	ImportReference pkg = unit.currentPackage;

-	if (pkg != null && this.matchingNodes.get(pkg) == pkg) {

-		this.matchingNodes.remove(pkg);

+	Integer level;

+	if (pkg != null && (level = (Integer)this.matchingNodes.remove(pkg)) != null) {

 		if ((this.matchContainer & SearchPattern.COMPILATION_UNIT) != 0) {

 			this.locator.reportPackageDeclaration(pkg);

 		}

@@ -149,10 +156,13 @@
 	if (imports != null) {

 		for (int i = 0; i < imports.length; i++) {

 			ImportReference importRef = imports[i];

-			if (this.matchingNodes.get(importRef) == importRef) {

-				this.matchingNodes.remove(importRef);

+			if ((level = (Integer)this.matchingNodes.remove(importRef)) != null) {

 				if ((this.matchContainer & SearchPattern.COMPILATION_UNIT) != 0) {

-					this.locator.reportImport(importRef, this.accuracy);

+					this.locator.reportImport(

+						importRef, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 		}

@@ -163,10 +173,14 @@
 	if (types != null) {

 		for (int i = 0; i < types.length; i++) {

 			TypeDeclaration type = types[i];

-			if (this.matchingNodes.get(type) == type) {

-				this.matchingNodes.remove(type);

+			if ((level = (Integer)this.matchingNodes.remove(type)) != null) {

 				if ((this.matchContainer & SearchPattern.COMPILATION_UNIT) != 0) {

-					this.locator.reportTypeDeclaration(type, new char[][] {type.name}, this.accuracy);

+					this.locator.reportTypeDeclaration(

+						type, 

+						new char[][] {type.name}, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 			this.reportMatching(type, EMPTY_CHAR_CHAR);

@@ -182,9 +196,16 @@
 	AstNode[] nodes = this.matchingNodes(field.declarationSourceStart, field.declarationSourceEnd);

 	for (int i = 0; i < nodes.length; i++) {

 		AstNode node = nodes[i];

-		this.matchingNodes.remove(node);

+		Integer level = (Integer)this.matchingNodes.remove(node);

 		if ((this.matchContainer & SearchPattern.FIELD) != 0) {

-			this.locator.reportReference(node, type, field, definingTypeNames, this.accuracy);

+			this.locator.reportReference(

+				node, 

+				type, 

+				field, 

+				definingTypeNames, 

+				level.intValue() == SearchPattern.ACCURATE_MATCH ?

+					IJavaSearchResultCollector.EXACT_MATCH :

+					IJavaSearchResultCollector.POTENTIAL_MATCH);

 		}

 	}

 }

@@ -195,16 +216,21 @@
  */

 private void reportMatching(TypeDeclaration type, char[][] enclosingTypeNames) throws CoreException {

 	char[][] definingTypeNames = CharOperation.arrayConcat(enclosingTypeNames, type.name);

+	Integer level;

 	

 	// fields

 	FieldDeclaration[] fields = type.fields;

 	if (fields != null) {

 		for (int i = 0; i < fields.length; i++) {

 			FieldDeclaration field = fields[i];

-			if (this.matchingNodes.get(field) == field) {

-				this.matchingNodes.remove(field);

+			if ((level = (Integer)this.matchingNodes.remove(field)) != null) {

 				if ((this.matchContainer & SearchPattern.CLASS) != 0) {

-					this.locator.reportFieldDeclaration(field, definingTypeNames, this.accuracy);

+					this.locator.reportFieldDeclaration(

+						field, 

+						definingTypeNames, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 			this.reportMatching(field, definingTypeNames, type);

@@ -216,10 +242,14 @@
 	if (methods != null) {

 		for (int i = 0; i < methods.length; i++) {

 			AbstractMethodDeclaration method = methods[i];

-			if (this.matchingNodes.get(method) == method) {

-				this.matchingNodes.remove(method);

+			if ((level = (Integer)this.matchingNodes.remove(method)) != null) {

 				if ((this.matchContainer & SearchPattern.CLASS) != 0) {

-					this.locator.reportMethodDeclaration(method, definingTypeNames, this.accuracy);

+					this.locator.reportMethodDeclaration(

+						method, 

+						definingTypeNames, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 			this.reportMatching(method, definingTypeNames);

@@ -231,11 +261,15 @@
 	if (memberTypes != null) {

 		for (int i = 0; i < memberTypes.length; i++) {

 			MemberTypeDeclaration memberType = memberTypes[i];

-			if (this.matchingNodes.get(memberType) == memberType) {

-				this.matchingNodes.remove(memberType);

+			if ((level = (Integer)this.matchingNodes.remove(memberType)) != null) {

 				if ((this.matchContainer & SearchPattern.CLASS) != 0) {

 					char[][] memberTypeNames = CharOperation.arrayConcat(definingTypeNames, memberType.name);

-					this.locator.reportTypeDeclaration(memberType, memberTypeNames, this.accuracy);

+					this.locator.reportTypeDeclaration(

+						memberType, 

+						memberTypeNames, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 			this.reportMatching(memberType, definingTypeNames);

@@ -244,20 +278,28 @@
 

 	// super types

 	TypeReference superClass = type.superclass;

-	if (superClass != null && this.matchingNodes.get(superClass) == superClass) {

-		this.matchingNodes.remove(superClass);

+	if (superClass != null && (level = (Integer)this.matchingNodes.remove(superClass)) != null) {

 		if ((this.matchContainer & SearchPattern.CLASS) != 0) {

-			this.locator.reportSuperTypeReference(superClass, definingTypeNames, this.accuracy);

+			this.locator.reportSuperTypeReference(

+				superClass, 

+				definingTypeNames, 

+				level.intValue() == SearchPattern.ACCURATE_MATCH ?

+					IJavaSearchResultCollector.EXACT_MATCH :

+					IJavaSearchResultCollector.POTENTIAL_MATCH);

 		}

 	}

 	TypeReference[] superInterfaces = type.superInterfaces;

 	if (superInterfaces != null) {

 		for (int i = 0; i < superInterfaces.length; i++) {

 			TypeReference superInterface = superInterfaces[i];

-			if (this.matchingNodes.get(superInterface) == superInterface) {

-				this.matchingNodes.remove(superInterface);

+			if ((level = (Integer)this.matchingNodes.get(superInterface)) != null) {

 				if ((this.matchContainer & SearchPattern.CLASS) != 0) {

-					this.locator.reportSuperTypeReference(superInterface, definingTypeNames, this.accuracy);

+					this.locator.reportSuperTypeReference(

+						superInterface, 

+						definingTypeNames, 

+						level.intValue() == SearchPattern.ACCURATE_MATCH ?

+							IJavaSearchResultCollector.EXACT_MATCH :

+							IJavaSearchResultCollector.POTENTIAL_MATCH);

 				}

 			}

 		}

@@ -266,17 +308,55 @@
 }

 public String toString() {

 	StringBuffer result = new StringBuffer();

-	result.append("Exact matches:"/*nonNLS*/);

+	result.append("Exact matches:"); //$NON-NLS-1$

 	for (Enumeration enum = this.matchingNodes.keys(); enum.hasMoreElements();) {

-		result.append("\n"/*nonNLS*/);

+		result.append("\n"); //$NON-NLS-1$

 		AstNode node = (AstNode)enum.nextElement();

-		result.append(node.toString(1));

+		Object value = this.matchingNodes.get(node);

+		if (value instanceof Integer) {

+			result.append('\t');

+			int accuracy = ((Integer)value).intValue();

+			switch (accuracy) {

+				case SearchPattern.IMPOSSIBLE_MATCH:

+					result.append("IMPOSSIBLE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.POSSIBLE_MATCH:

+					result.append("POSSIBLE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.INACCURATE_MATCH:

+					result.append("INACCURATE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.ACCURATE_MATCH:

+					result.append("ACCURATE_MATCH: "); //$NON-NLS-1$

+					break;

+			}

+		} 

+		result.append(node.toString(0));

 	}

-	result.append("\nPotential matches:"/*nonNLS*/);

+	result.append("\nPotential matches:"); //$NON-NLS-1$

 	for (Enumeration enum = this.potentialMatchingNodes.keys(); enum.hasMoreElements();) {

-		result.append("\n"/*nonNLS*/);

+		result.append("\n"); //$NON-NLS-1$

 		AstNode node = (AstNode)enum.nextElement();

-		result.append(node.toString(1));

+		Object value = this.potentialMatchingNodes.get(node);

+		if (value instanceof Integer) {

+			result.append("\t"); //$NON-NLS-1$

+			int accuracy = ((Integer)value).intValue();

+			switch (accuracy) {

+				case SearchPattern.IMPOSSIBLE_MATCH:

+					result.append("IMPOSSIBLE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.POSSIBLE_MATCH:

+					result.append("POSSIBLE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.INACCURATE_MATCH:

+					result.append("INACCURATE_MATCH: "); //$NON-NLS-1$

+					break;

+				case SearchPattern.ACCURATE_MATCH:

+					result.append("ACCURATE_MATCH: "); //$NON-NLS-1$

+					break;

+			}

+		}

+		result.append(node.toString(0));

 	}

 	return result.toString();

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
index cb75308..462d715 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
@@ -70,7 +70,7 @@
 	}

 }

 public String getPatternName(){

-	return "MethodDeclarationPattern: "/*nonNLS*/;

+	return "MethodDeclarationPattern: "; //$NON-NLS-1$

 }

 /**

  * @see SearchPattern#indexEntryPrefix

@@ -90,117 +90,6 @@
 	return CLASS;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof MethodDeclaration)) return false;

-

-	MethodDeclaration method = (MethodDeclaration)node;

-	

-	// selector

-	if (!this.matchesName(this.selector, method.selector))

-		return false;

-

-	// declaring type

-	MethodBinding binding = method.binding;

-	if (resolve && binding != null) {

-		ReferenceBinding declaringType = binding.declaringClass;

-		if (declaringType != null) {

-			if (!binding.isStatic() && !binding.isPrivate()) {

-				if (!this.matchesAsSubtype(declaringType, this.declaringSimpleName, this.declaringQualification))

-					return false;

-			} else {

-				if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringType))

-					return false;

-			}

-		}

-	}

-

-	// return type

-	if (this.returnQualification == null) {

-		if (this.returnSimpleName != null) {

-			TypeReference methodReturnType = method.returnType;

-			if (methodReturnType != null) {

-				char[][] methodReturnTypeName = methodReturnType.getTypeName();

-				char[] sourceName = this.toArrayName(

-					methodReturnTypeName[methodReturnTypeName.length-1], 

-					methodReturnType.dimensions());

-				if (!this.matchesName(this.returnSimpleName, sourceName))

-					return false;

-			}

-		}

-	} else {

-		if (resolve 

-				&& binding != null 

-				&& !this.matchesType(this.returnSimpleName, this.returnQualification, binding.returnType))

-			return false;

-	}

-		

-	// parameter types

-	int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (parameterCount > -1) {

-		int argumentCount = method.arguments == null ? 0 : method.arguments.length;

-		if (parameterCount != argumentCount)

-			return false;

-	

-		if (resolve && binding != null) {

-			for (int i = 0; i < parameterCount; i++) {

-				char[] qualification = this.parameterQualifications[i];

-				char[] type = this.parameterSimpleNames[i];

-				if (!this.matchesType(type, qualification, binding.parameters[i]))

-					return false;

-			}

-		}

-	}

-

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof MethodBinding)) return false;

-

-	MethodBinding method = (MethodBinding)binding;

-	

-	// selector

-	if (!this.matchesName(this.selector, method.selector))

-		return false;

-

-	// declaring type

-	ReferenceBinding declaringType = method.declaringClass;

-	if (declaringType != null) {

-		if (!method.isStatic() && !method.isPrivate()) {

-			if (!this.matchesAsSubtype(declaringType, this.declaringSimpleName, this.declaringQualification))

-				return false;

-		} else {

-			if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, declaringType))

-				return false;

-		}

-	}

-

-	// return type

-	if (!this.matchesType(this.returnSimpleName, this.returnQualification, method.returnType)) {

-		return false;

-	}

-		

-	// parameter types

-	int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

-	if (parameterCount > -1) {

-		int argumentCount = method.parameters == null ? 0 : method.parameters.length;

-		if (parameterCount != argumentCount)

-			return false;

-		for (int i = 0; i < parameterCount; i++) {

-			char[] qualification = this.parameterQualifications[i];

-			char[] type = this.parameterSimpleNames[i];

-			if (!this.matchesType(type, qualification, method.parameters[i]))

-				return false;

-		}

-	}

-

-	return true;

-}

-/**

  * @see SearchPattern#matchesBinary(Object, Object)

  */

 public boolean matchesBinary(Object binaryInfo, Object enclosingBinaryInfo) {

@@ -246,4 +135,104 @@
 

 	return true;

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof MethodDeclaration)) return IMPOSSIBLE_MATCH;

+

+	MethodDeclaration method = (MethodDeclaration)node;

+

+	if (resolve) {

+		return this.matchLevel(method.binding);

+	} else {

+		// selector

+		if (!this.matchesName(this.selector, method.selector))

+			return IMPOSSIBLE_MATCH;

+

+		// return type

+		TypeReference methodReturnType = method.returnType;

+		if (methodReturnType != null) {

+			char[][] methodReturnTypeName = methodReturnType.getTypeName();

+			char[] sourceName = this.toArrayName(

+				methodReturnTypeName[methodReturnTypeName.length-1], 

+				methodReturnType.dimensions());

+			if (!this.matchesName(this.returnSimpleName, sourceName))

+				return IMPOSSIBLE_MATCH;

+		}

+			

+		// parameter types

+		int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+		if (parameterCount > -1) {

+			int argumentCount = method.arguments == null ? 0 : method.arguments.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+		}

+

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

+	int level;

+

+	MethodBinding method = (MethodBinding)binding;

+	

+	// selector

+	if (!this.matchesName(this.selector, method.selector))

+		return IMPOSSIBLE_MATCH;

+

+	// declaring type

+	ReferenceBinding declaringType = method.declaringClass;

+	if (!method.isStatic() && !method.isPrivate()) {

+		level = this.matchLevelAsSubtype(declaringType, this.declaringSimpleName, this.declaringQualification);

+	} else {

+		level = this.matchLevelForType(this.declaringSimpleName, this.declaringQualification, declaringType);

+	}

+	if (level == IMPOSSIBLE_MATCH) {

+		return IMPOSSIBLE_MATCH;

+	}

+

+	// return type

+	int newLevel = this.matchLevelForType(this.returnSimpleName, this.returnQualification, method.returnType);

+	switch (newLevel) {

+		case IMPOSSIBLE_MATCH:

+			return IMPOSSIBLE_MATCH;

+		case ACCURATE_MATCH: // keep previous level

+			break;

+		default: // ie. INACCURATE_MATCH

+			level = newLevel;

+			break;

+	}

+		

+	// parameter types

+	int parameterCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+	if (parameterCount > -1) {

+		int argumentCount = method.parameters == null ? 0 : method.parameters.length;

+		if (parameterCount != argumentCount)

+			return IMPOSSIBLE_MATCH;

+		for (int i = 0; i < parameterCount; i++) {

+			char[] qualification = this.parameterQualifications[i];

+			char[] type = this.parameterSimpleNames[i];

+			newLevel = this.matchLevelForType(type, qualification, method.parameters[i]);

+			switch (newLevel) {

+				case IMPOSSIBLE_MATCH:

+					return IMPOSSIBLE_MATCH;

+				case ACCURATE_MATCH: // keep previous level

+					break;

+				default: // ie. INACCURATE_MATCH

+					level = newLevel;

+					break;

+			}

+		}

+	}

+

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
index d1146ef..5388e09 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
@@ -85,45 +85,45 @@
 	if (declaringQualification != null) buffer.append(declaringQualification).append('.');

 	if (declaringSimpleName != null) 

 		buffer.append(declaringSimpleName).append('.');

-	else if (declaringQualification != null) buffer.append("*."/*nonNLS*/);

+	else if (declaringQualification != null) buffer.append("*."); //$NON-NLS-1$

 	if (selector != null) {

 		buffer.append(selector);

 	} else {

-		buffer.append("*"/*nonNLS*/);

+		buffer.append("*"); //$NON-NLS-1$

 	}

 	buffer.append('(');

 	if (parameterSimpleNames == null) {

-		buffer.append("..."/*nonNLS*/);

+		buffer.append("..."); //$NON-NLS-1$

 	} else {

 		for (int i = 0, max = parameterSimpleNames.length; i < max; i++){

-			if (i > 0) buffer.append(", "/*nonNLS*/);

+			if (i > 0) buffer.append(", "); //$NON-NLS-1$

 			if (parameterQualifications[i] != null) buffer.append(parameterQualifications[i]).append('.');

 			if (parameterSimpleNames[i] == null) buffer.append('*'); else buffer.append(parameterSimpleNames[i]);

 		}

 	}

 	buffer.append(')');

 	if (returnQualification != null) 

-		buffer.append(" --> "/*nonNLS*/).append(returnQualification).append('.');

-	else if (returnSimpleName != null) buffer.append(" --> "/*nonNLS*/);

+		buffer.append(" --> ").append(returnQualification).append('.'); //$NON-NLS-1$

+	else if (returnSimpleName != null) buffer.append(" --> "); //$NON-NLS-1$

 	if (returnSimpleName != null) 

 		buffer.append(returnSimpleName);

-	else if (returnQualification != null) buffer.append("*"/*nonNLS*/);

-	buffer.append(", "/*nonNLS*/);

+	else if (returnQualification != null) buffer.append("*"); //$NON-NLS-1$

+	buffer.append(", "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MethodReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/MethodReferencePattern.java
index 03c11ef..0b95a2c 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MethodReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MethodReferencePattern.java
@@ -70,7 +70,7 @@
 	}

 }

 public String getPatternName(){

-	return "MethodReferencePattern: "/*nonNLS*/;

+	return "MethodReferencePattern: "; //$NON-NLS-1$

 }

 /**

  * @see SearchPattern#indexEntryPrefix

@@ -84,76 +84,120 @@
 			isCaseSensitive);

 }

 /**

- * Returns whether the code gen will use an invoke virtual for 

- * this message send or not.

- */

-private boolean isVirtualInvoke(MessageSend messageSend) {

-	return !messageSend.binding.isStatic() && !messageSend.isSuperAccess() && !messageSend.binding.isPrivate();

-}

-/**

  * @see SearchPattern#matchContainer()

  */

 protected int matchContainer() {

 	return METHOD | FIELD;

 }

-/**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof MessageSend)) return false;

 

+public boolean initializeFromLookupEnvironment(LookupEnvironment env) {

+	this.allSuperDeclaringTypeNames = this.collectSuperTypeNames(this.declaringQualification, this.declaringSimpleName, this.matchMode, env);

+	return this.allSuperDeclaringTypeNames == null || this.allSuperDeclaringTypeNames != NOT_FOUND_DECLARING_TYPE; 

+}

+

+/**

+ * Returns whether the code gen will use an invoke virtual for 

+ * this message send or not.

+ */

+private boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) {

+	return !method.isStatic() && !messageSend.isSuperAccess() && !method.isPrivate();

+}

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof MessageSend)) return IMPOSSIBLE_MATCH;

 	MessageSend messageSend = (MessageSend)node;

 

+	if (resolve) {

+		return this.matchLevel(messageSend.binding, messageSend);

+	} else {

+		// selector

+		if (this.selector != null && !this.matchesName(this.selector, messageSend.selector))

+			return IMPOSSIBLE_MATCH;

+			

+		// argument types

+		int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

+		if (argumentCount > -1) {

+			int parameterCount = messageSend.arguments == null ? 0 : messageSend.arguments.length;

+			if (parameterCount != argumentCount)

+				return IMPOSSIBLE_MATCH;

+		}

+

+		return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding, MessageSend messageSend) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

+	int level;

+

+	MethodBinding method = (MethodBinding)binding;

+

 	// selector

-	if (this.selector != null && !this.matchesName(this.selector, messageSend.selector))

-		return false;

+	if (this.selector != null && !this.matchesName(this.selector, method.selector))

+		return IMPOSSIBLE_MATCH;

 

 	// receiver type

-	MethodBinding binding = messageSend.binding;

 	ReferenceBinding receiverType = 

 		binding == null ? 

 			null : 

-			(!isVirtualInvoke(messageSend) ? binding.declaringClass : (ReferenceBinding)messageSend.receiverType);

-	if (resolve && receiverType != null) {

-		if (this.isVirtualInvoke(messageSend)) {

-			if (!this.matchesAsSubtype(receiverType, this.declaringSimpleName, this.declaringQualification)

-				&& !this.matchesType(this.allSuperDeclaringTypeNames, receiverType)) {

-					return false;

+			(!isVirtualInvoke(method, messageSend) ? method.declaringClass : (ReferenceBinding)messageSend.receiverType);

+	if (this.isVirtualInvoke(method, messageSend)) {

+		level = this.matchLevelAsSubtype(receiverType, this.declaringSimpleName, this.declaringQualification);

+		if (level == IMPOSSIBLE_MATCH) {

+			level = this.matchLevelForType(this.allSuperDeclaringTypeNames, receiverType);

+			if (level == IMPOSSIBLE_MATCH) {

+				return IMPOSSIBLE_MATCH;

 			}

-		} else {

-			if (!this.matchesType(this.declaringSimpleName, this.declaringQualification, receiverType))

-				return false;

 		}

+	} else {

+		level = this.matchLevelForType(this.declaringSimpleName, this.declaringQualification, receiverType);

+		if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH;

 	}

 

 	// return type

-	if (resolve && binding != null) {

-		if (!this.matchesType(this.returnSimpleName, this.returnQualification, binding.returnType))

-			return false;

+	int newLevel = this.matchLevelForType(this.returnSimpleName, this.returnQualification, method.returnType);

+	switch (newLevel) {

+		case IMPOSSIBLE_MATCH:

+			return IMPOSSIBLE_MATCH;

+		case ACCURATE_MATCH: // keep previous level

+			break;

+		default: // ie. INACCURATE_MATCH

+			level = newLevel;

+			break;

 	}

 		

 	// argument types

 	int argumentCount = this.parameterSimpleNames == null ? -1 : this.parameterSimpleNames.length;

 	if (argumentCount > -1) {

-		int parameterCount = messageSend.arguments == null ? 0 : messageSend.arguments.length;

-		if (parameterCount != argumentCount)

-			return false;

-

-		if (resolve && binding != null) {

+		if (method.parameters == null) {

+			level = INACCURATE_MATCH;

+		} else {

+			int parameterCount = method.parameters.length;

+			if (parameterCount != argumentCount) return IMPOSSIBLE_MATCH;

 			for (int i = 0; i < parameterCount; i++) {

 				char[] qualification = this.parameterQualifications[i];

 				char[] type = this.parameterSimpleNames[i];

-				if (!this.matchesType(type, qualification, binding.parameters[i]))

-					return false;

+				newLevel = this.matchLevelForType(type, qualification, method.parameters[i]);

+				switch (newLevel) {

+					case IMPOSSIBLE_MATCH:

+						return IMPOSSIBLE_MATCH;

+					case ACCURATE_MATCH: // keep previous level

+						break;

+					default: // ie. INACCURATE_MATCH

+						level = newLevel;

+						break;

+				}

 			}

 		}

 	}

 

-	return true;

-}

-

-public boolean initializeFromLookupEnvironment(LookupEnvironment env) {

-	this.allSuperDeclaringTypeNames = this.collectSuperTypeNames(this.declaringQualification, this.declaringSimpleName, this.matchMode, env);

-	return this.allSuperDeclaringTypeNames == null || this.allSuperDeclaringTypeNames != NOT_FOUND_DECLARING_TYPE; 

+	return level;

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
index cf93522..6976f87 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java
@@ -77,18 +77,6 @@
 			| rightPattern.matchContainer();

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	return this.leftPattern.matches(node, resolve) || this.rightPattern.matches(node, resolve);

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	return this.leftPattern.matches(binding) || this.rightPattern.matches(binding);

-}

-/**

  * see SearchPattern.matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -100,14 +88,15 @@
  * @see SearchPattern#matchReportReference

  */

 protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException {

-	if (this.leftPattern.matches(reference)) {

+	int leftLevel = this.leftPattern.matchLevel(reference, true);

+	if (leftLevel == ACCURATE_MATCH || leftLevel == INACCURATE_MATCH) {

 		this.leftPattern.matchReportReference(reference, element, accuracy, locator);

 	} else {

 		this.rightPattern.matchReportReference(reference, element, accuracy, locator);

 	}

 }

 public String toString(){

-	return this.leftPattern.toString() + "\n| "/*nonNLS*/ + this.rightPattern.toString();

+	return this.leftPattern.toString() + "\n| " + this.rightPattern.toString(); //$NON-NLS-1$

 }

 

 /**

@@ -120,4 +109,50 @@
 	boolean rightInit = this.rightPattern.initializeFromLookupEnvironment(env);

 	return leftInit || rightInit;

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	switch (this.leftPattern.matchLevel(node, resolve)) {

+		case IMPOSSIBLE_MATCH:

+			return this.rightPattern.matchLevel(node, resolve);

+		case POSSIBLE_MATCH:

+			return POSSIBLE_MATCH;

+		case INACCURATE_MATCH:

+			int rightLevel = this.rightPattern.matchLevel(node, resolve);

+			if (rightLevel != IMPOSSIBLE_MATCH) {

+				return rightLevel;

+			} else {

+				return INACCURATE_MATCH;

+			}

+		case ACCURATE_MATCH:

+			return ACCURATE_MATCH;

+		default:

+			return IMPOSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	switch (this.leftPattern.matchLevel(binding)) {

+		case IMPOSSIBLE_MATCH:

+			return this.rightPattern.matchLevel(binding);

+		case POSSIBLE_MATCH:

+			return POSSIBLE_MATCH;

+		case INACCURATE_MATCH:

+			int rightLevel = this.rightPattern.matchLevel(binding);

+			if (rightLevel != IMPOSSIBLE_MATCH) {

+				return rightLevel;

+			} else {

+				return INACCURATE_MATCH;

+			}

+		case ACCURATE_MATCH:

+			return ACCURATE_MATCH;

+		default:

+			return IMPOSSIBLE_MATCH;

+	}

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
index 4ed9757..2a44927 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java
@@ -51,13 +51,6 @@
 	return 0;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	// used only in the case of a OrPattern

-	return true;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -66,24 +59,32 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("PackageDeclarationPattern: <"/*nonNLS*/);

+	buffer.append("PackageDeclarationPattern: <"); //$NON-NLS-1$

 	if (this.pkgName != null) buffer.append(this.pkgName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	// used only in the case of a OrPattern

+	return ACCURATE_MATCH;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
index cc402d8..091c41c 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java
@@ -102,110 +102,6 @@
 	return this.matchesName(this.pkgName, name);

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (node instanceof QualifiedTypeReference) {

-		return this.matches((QualifiedTypeReference)node, resolve);

-	} else if (node instanceof ImportReference) {

-		return this.matches((ImportReference)node, resolve);

-	} else if (node instanceof QualifiedNameReference) {

-		return this.matches((QualifiedNameReference)node, resolve);

-	}

-	return false;

-}

-/**

- * Returns whether this package reference pattern matches the given import reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(ImportReference importRef, boolean resolve) {

-	if (importRef.onDemand) {

-		return this.matches(importRef.tokens);

-	} else {

-		int length = importRef.tokens.length - 1;

-		char[][] tokens = new char[length][];

-		System.arraycopy(importRef.tokens, 0, tokens, 0, length);

-		return this.matches(tokens);

-	}

-}

-/**

- * Returns whether this package reference pattern matches the given qualified name reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(QualifiedNameReference qNameRef, boolean resolve) {

-	Binding binding = qNameRef.binding;

-	if (!resolve || binding == null || !binding.isValidBinding()) {

-		if (this.pkgName != null) {

-			switch (this.matchMode) {

-				case EXACT_MATCH:

-				case PREFIX_MATCH:

-					return CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive);

-				case PATTERN_MATCH:

-					char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, ".*"/*nonNLS*/.toCharArray());

-					return CharOperation.match(pattern, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive);

-			}

-		}

-	} else {

-		TypeBinding typeBinding = null;

-		char[][] tokens = qNameRef.tokens;

-		int lastIndex = tokens.length-1;

-		switch (qNameRef.bits & Statement.RestrictiveFlagMASK) {

-			case BindingIds.FIELD : // reading a field

-				typeBinding = ((FieldBinding)binding).declaringClass;

-				// no valid match amongst fields

-				int otherBindingsCount = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;			

-				lastIndex -= otherBindingsCount + 1;

-				if (lastIndex < 0) return false;

-				break;

-			case BindingIds.LOCAL : // reading a local variable

-				return false; // no package match in it

-			case BindingIds.TYPE : //=============only type ==============

-				typeBinding = (TypeBinding)binding;

-		}

-		if (typeBinding instanceof ArrayBinding) {

-			typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

-		}

-		if (typeBinding instanceof ReferenceBinding) {

-			PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;

-			return this.matches(pkgBinding.compoundName);

-		}

-		return false;

-	}

-	return true;

-}

-/**

- * Returns whether this package reference pattern matches the given type reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(QualifiedTypeReference typeRef, boolean resolve) {

-	if (!resolve) {

-		if (this.pkgName != null) {

-			switch (this.matchMode) {

-				case EXACT_MATCH:

-				case PREFIX_MATCH:

-					return CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive);

-				case PATTERN_MATCH:

-					char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, ".*"/*nonNLS*/.toCharArray());

-					return CharOperation.match(pattern, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive);

-			}

-		}

-	} else {

-		TypeBinding typeBinding = typeRef.binding;

-		if (typeBinding != null){

-			if (typeBinding instanceof ArrayBinding) {

-				typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

-			}

-			if (typeBinding instanceof ReferenceBinding) {

-				PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;

-				return this.matches(pkgBinding.compoundName);

-			}

-			return false;

-		}

-			

-	}

-	return true;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -246,24 +142,186 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("PackageReferencePattern: <"/*nonNLS*/);

+	buffer.append("PackageReferencePattern: <"); //$NON-NLS-1$

 	if (this.pkgName != null) buffer.append(this.pkgName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (node instanceof QualifiedTypeReference) {

+		return this.matchLevel((QualifiedTypeReference)node, resolve);

+	} else if (node instanceof ImportReference) {

+		return this.matchLevel((ImportReference)node, resolve);

+	} else if (node instanceof QualifiedNameReference) {

+		return this.matchLevel((QualifiedNameReference)node, resolve);

+	}

+	return IMPOSSIBLE_MATCH;

+}

+

+/**

+ * Returns whether this package reference pattern matches the given import reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(ImportReference importRef, boolean resolve) {

+	if (importRef.onDemand) {

+		if (this.matches(importRef.tokens)) {

+			return ACCURATE_MATCH;

+		} else {

+			return IMPOSSIBLE_MATCH;

+		}

+	} else {

+		int length = importRef.tokens.length - 1;

+		char[][] tokens = new char[length][];

+		System.arraycopy(importRef.tokens, 0, tokens, 0, length);

+		if (this.matches(tokens)) {

+			return ACCURATE_MATCH;

+		} else {

+			return IMPOSSIBLE_MATCH;

+		}

+	}

+}

+

+/**

+ * Returns whether this package reference pattern matches the given qualified name reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(QualifiedNameReference qNameRef, boolean resolve) {

+	if (!resolve) {

+		if (this.pkgName == null) {

+			return POSSIBLE_MATCH;

+		} else {

+			switch (this.matchMode) {

+				case EXACT_MATCH:

+				case PREFIX_MATCH:

+					if (CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive)) {

+						return POSSIBLE_MATCH;

+					} else {

+						return IMPOSSIBLE_MATCH;

+					}

+				case PATTERN_MATCH:

+					char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, ".*".toCharArray()); //$NON-NLS-1$

+					if (CharOperation.match(pattern, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive)) {

+						return POSSIBLE_MATCH;

+					} else {

+						return IMPOSSIBLE_MATCH;

+					}

+				default:

+					return IMPOSSIBLE_MATCH;

+			}

+		}

+	} else {

+		Binding binding = qNameRef.binding;

+		if (binding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			TypeBinding typeBinding = null;

+			char[][] tokens = qNameRef.tokens;

+			int lastIndex = tokens.length-1;

+			switch (qNameRef.bits & Statement.RestrictiveFlagMASK) {

+				case BindingIds.FIELD : // reading a field

+					typeBinding = ((FieldBinding)binding).declaringClass;

+					// no valid match amongst fields

+					int otherBindingsCount = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;			

+					lastIndex -= otherBindingsCount + 1;

+					if (lastIndex < 0) return IMPOSSIBLE_MATCH;

+					break;

+				case BindingIds.LOCAL : // reading a local variable

+					return IMPOSSIBLE_MATCH; // no package match in it

+				case BindingIds.TYPE : //=============only type ==============

+					typeBinding = (TypeBinding)binding;

+			}

+			if (typeBinding instanceof ArrayBinding) {

+				typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

+			}

+			if (typeBinding == null) {

+				return INACCURATE_MATCH;

+			} else {

+				if (typeBinding instanceof ReferenceBinding) {

+					PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;

+					if (pkgBinding == null) {

+						return INACCURATE_MATCH;

+					} else if (this.matches(pkgBinding.compoundName)) {

+						return ACCURATE_MATCH;

+					} else {

+						return IMPOSSIBLE_MATCH;

+					}

+				} else {

+					return IMPOSSIBLE_MATCH;

+				}

+			}

+		}

+	}

+}

+

+/**

+ * Returns whether this package reference pattern matches the given type reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(QualifiedTypeReference typeRef, boolean resolve) {

+	if (!resolve) {

+		if (this.pkgName == null) {

+			return POSSIBLE_MATCH;

+		} else {

+			switch (this.matchMode) {

+				case EXACT_MATCH:

+				case PREFIX_MATCH:

+					if (CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {

+						return POSSIBLE_MATCH;

+					} else {

+						return IMPOSSIBLE_MATCH;

+					}

+				case PATTERN_MATCH:

+					char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, ".*".toCharArray()); //$NON-NLS-1$

+					if (CharOperation.match(pattern, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {

+						return POSSIBLE_MATCH;

+					} else {

+						return IMPOSSIBLE_MATCH;

+					}

+				default:

+					return IMPOSSIBLE_MATCH;

+			}

+		}

+	} else {

+		TypeBinding typeBinding = typeRef.binding;

+		if (typeBinding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			if (typeBinding instanceof ArrayBinding) {

+				typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

+			}

+			if (typeBinding == null) {

+				return INACCURATE_MATCH;

+			} else if (typeBinding instanceof ReferenceBinding) {

+				PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;

+				if (this.matches(pkgBinding.compoundName)) {

+					return ACCURATE_MATCH;

+				} else {

+					return IMPOSSIBLE_MATCH;

+				}

+			} else {

+				return IMPOSSIBLE_MATCH;

+			}

+		}

+			

+	}

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/SearchPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/SearchPattern.java
index 491bb23..c822dd0 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/SearchPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/SearchPattern.java
@@ -33,14 +33,14 @@
 	/* match level */

 	public static final int IMPOSSIBLE_MATCH = 0;

 	public static final int POSSIBLE_MATCH = 1;

-	public static final int TRUSTED_MATCH = 2;

-

 	/* match container */

 	public static final int COMPILATION_UNIT = 1;

 	public static final int CLASS = 2;

 	public static final int FIELD = 4;

 	public static final int METHOD = 8;

 	

+	public static final int ACCURATE_MATCH = 2;

+	public static final int INACCURATE_MATCH = 3;

 	public static final char[][][] NOT_FOUND_DECLARING_TYPE = new char[0][][];

 

 public SearchPattern(int matchMode, boolean isCaseSensitive) {

@@ -54,7 +54,7 @@
  */

 private static SearchPattern createConstructorPattern(String patternString, int limitTo, int matchMode, boolean isCaseSensitive) {

 

-	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)"/*nonNLS*/, true);

+	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)", true); //$NON-NLS-1$

 	final int InsideName = 1;

 	final int InsideParameter = 2;

 	String lastToken = null;

@@ -71,7 +71,7 @@
 

 			// read declaring type and selector

 			case InsideName :

-				if (token.equals("."/*nonNLS*/)){

+				if (token.equals(".")){ //$NON-NLS-1$

 					if (declaringQualification == null){

 						if (typeName == null) return null;

 						declaringQualification = typeName;

@@ -79,12 +79,12 @@
 						declaringQualification += token + typeName;

 					}

 					typeName = null;

-				} else if (token.equals("("/*nonNLS*/)){

+				} else if (token.equals("(")){ //$NON-NLS-1$

 					parameterTypes = new String[5];

 					parameterCount = 0;

 					mode = InsideParameter;

-				} else if (token.equals(" "/*nonNLS*/)){

-					if (!(" "/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(lastToken))){

+				} else if (token.equals(" ")){ //$NON-NLS-1$

+					if (!(" ".equals(lastToken) || ".".equals(lastToken))){ //$NON-NLS-1$ //$NON-NLS-2$

 						break;

 					}

 				} else { // name

@@ -94,15 +94,15 @@
 				break;

 			// read parameter types

 			case InsideParameter :

-				if (token.equals(" "/*nonNLS*/)){

-				} else if (token.equals(","/*nonNLS*/)){

+				if (token.equals(" ")){ //$NON-NLS-1$

+				} else if (token.equals(",")){ //$NON-NLS-1$

 					if (parameterType == null) return null;

 					if (parameterTypes.length == parameterCount){

 						System.arraycopy(parameterTypes, 0, parameterTypes = new String[parameterCount*2], 0, parameterCount);

 					}

 					parameterTypes[parameterCount++] = parameterType;

 					parameterType = null;

-				} else if (token.equals (")"/*nonNLS*/)){

+				} else if (token.equals (")")){ //$NON-NLS-1$

 					foundClosingParenthesis = true;

 					if (parameterType != null){

 						if (parameterTypes.length == parameterCount){

@@ -115,7 +115,7 @@
 					if (parameterType == null){

 						parameterType = token;

 					} else {

-						if (!("."/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(token) || "[]"/*nonNLS*/.equals(token))) return null;

+						if (!(".".equals(lastToken) || ".".equals(token) || "[]".equals(token))) return null; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 						parameterType += token;

 					}

 				}

@@ -176,7 +176,7 @@
  */

 private static SearchPattern createFieldPattern(String patternString, int limitTo, int matchMode, boolean isCaseSensitive) {

 

-	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)"/*nonNLS*/, true);

+	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)", true); //$NON-NLS-1$

 	final int InsideDeclaringPart = 1;

 	final int InsideType = 2;

 	String lastToken = null;

@@ -191,7 +191,7 @@
 

 			// read declaring type and fieldName

 			case InsideDeclaringPart :

-				if (token.equals("."/*nonNLS*/)){

+				if (token.equals(".")){ //$NON-NLS-1$

 					if (declaringType == null){

 						if (fieldName == null) return null;

 						declaringType = fieldName;

@@ -199,8 +199,8 @@
 						declaringType += token + fieldName;

 					}

 					fieldName = null;

-				} else if (token.equals(" "/*nonNLS*/)){

-					if (!(" "/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(lastToken))){

+				} else if (token.equals(" ")){ //$NON-NLS-1$

+					if (!(" ".equals(lastToken) || ".".equals(lastToken))){ //$NON-NLS-1$ //$NON-NLS-2$

 						mode = InsideType;

 					}

 				} else { // name

@@ -210,11 +210,11 @@
 				break;

 			// read type 

 			case InsideType:

-				if (!token.equals(" "/*nonNLS*/)){

+				if (!token.equals(" ")){ //$NON-NLS-1$

 					if (type == null){

 						type = token;

 					} else {

-						if (!(!("."/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(token) || "[]"/*nonNLS*/.equals(token)))) return null;

+						if (!(!(".".equals(lastToken) || ".".equals(token) || "[]".equals(token)))) return null; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 						type += token;

 					}

 				}

@@ -281,7 +281,7 @@
  */

 private static SearchPattern createMethodPattern(String patternString, int limitTo, int matchMode, boolean isCaseSensitive) {

 

-	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)"/*nonNLS*/, true);

+	StringTokenizer tokenizer = new StringTokenizer(patternString, " .(,)", true); //$NON-NLS-1$

 	final int InsideSelector = 1;

 	final int InsideParameter = 2;

 	final int InsideReturnType = 3;

@@ -299,7 +299,7 @@
 

 			// read declaring type and selector

 			case InsideSelector :

-				if (token.equals("."/*nonNLS*/)){

+				if (token.equals(".")){ //$NON-NLS-1$

 					if (declaringType == null){

 						if (selector == null) return null;

 						declaringType = selector;

@@ -307,12 +307,12 @@
 						declaringType += token + selector;

 					}

 					selector = null;

-				} else if (token.equals("("/*nonNLS*/)){

+				} else if (token.equals("(")){ //$NON-NLS-1$

 					parameterTypes = new String[5];

 					parameterCount = 0;

 					mode = InsideParameter;

-				} else if (token.equals(" "/*nonNLS*/)){

-					if (!(" "/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(lastToken))){

+				} else if (token.equals(" ")){ //$NON-NLS-1$

+					if (!(" ".equals(lastToken) || ".".equals(lastToken))){ //$NON-NLS-1$ //$NON-NLS-2$

 						mode = InsideReturnType;

 					}

 				} else { // name

@@ -322,15 +322,15 @@
 				break;

 			// read parameter types

 			case InsideParameter :

-				if (token.equals(" "/*nonNLS*/)){

-				} else if (token.equals(","/*nonNLS*/)){

+				if (token.equals(" ")){ //$NON-NLS-1$

+				} else if (token.equals(",")){ //$NON-NLS-1$

 					if (parameterType == null) return null;

 					if (parameterTypes.length == parameterCount){

 						System.arraycopy(parameterTypes, 0, parameterTypes = new String[parameterCount*2], 0, parameterCount);

 					}

 					parameterTypes[parameterCount++] = parameterType;

 					parameterType = null;

-				} else if (token.equals (")"/*nonNLS*/)){

+				} else if (token.equals (")")){ //$NON-NLS-1$

 					foundClosingParenthesis = true;

 					if (parameterType != null){

 						if (parameterTypes.length == parameterCount){

@@ -343,18 +343,18 @@
 					if (parameterType == null){

 						parameterType = token;

 					} else {

-						if (!("."/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(token) || "[]"/*nonNLS*/.equals(token))) return null;

+						if (!(".".equals(lastToken) || ".".equals(token) || "[]".equals(token))) return null; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 						parameterType += token;

 					}

 				}

 				break;

 			// read return type

 			case InsideReturnType:

-				if (!token.equals(" "/*nonNLS*/)){

+				if (!token.equals(" ")){ //$NON-NLS-1$

 					if (returnType == null){

 						returnType = token;

 					} else {

-						if (!(!("."/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(token) || "[]"/*nonNLS*/.equals(token)))) return null;

+						if (!(!(".".equals(lastToken) || ".".equals(token) || "[]".equals(token)))) return null; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 						returnType += token;

 					}

 				}

@@ -643,16 +643,16 @@
  */

 private static SearchPattern createTypePattern(String patternString, int limitTo, int matchMode, boolean isCaseSensitive) {

 

-	StringTokenizer tokenizer = new StringTokenizer(patternString, " ."/*nonNLS*/, true);

+	StringTokenizer tokenizer = new StringTokenizer(patternString, " .", true); //$NON-NLS-1$

 	String type = null;

 	String lastToken = null;

 	while (tokenizer.hasMoreTokens()){

 		String token = tokenizer.nextToken();

-		if (!token.equals(" "/*nonNLS*/)){

+		if (!token.equals(" ")){ //$NON-NLS-1$

 			if (type == null){

 				type = token;

 			} else {

-				if (!("."/*nonNLS*/.equals(lastToken) || "."/*nonNLS*/.equals(token) || "[]"/*nonNLS*/.equals(token))) return null;

+				if (!(".".equals(lastToken) || ".".equals(token) || "[]".equals(token))) return null; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$

 				type += token;

 			}

 		}

@@ -753,24 +753,6 @@
  */

 protected abstract int matchContainer();

 /**

- * Finds out whether the given resolved ast node matches this search pattern.

- */

-public boolean matches(AstNode node) {

-	return this.matches(node, true);

-}

-/**

- * Returns whether this pattern matches the given node.

- * Look at resolved information only if specified.

- */

-protected abstract boolean matches(AstNode node, boolean resolve);

-/**

- * Finds out whether the given binding matches this search pattern.

- * Default is to return false.

- */

-public boolean matches(Binding binding) {

-	return false;

-}

-/**

  * Finds out whether the given binary info matches this search pattern.

  * Default is to return false.

  */

@@ -820,43 +802,10 @@
 		);

 }

 /**

- * Returns whether the given type binding matches the given simple name pattern 

- * and qualification pattern.

- */

-protected boolean matchesType(char[] simpleNamePattern, char[] qualificationPattern, TypeBinding type) {

-	if (type == null) return false; 

-	return 

-		this.matchesType(

-			simpleNamePattern, 

-			qualificationPattern, 

-			type.qualifiedPackageName().length == 0 ? 

-				type.qualifiedSourceName() : 

-				CharOperation.concat(type.qualifiedPackageName(), type.qualifiedSourceName(), '.')

-		);

-}

-/**

  * Checks whether an entry matches the current search pattern

  */

 protected abstract boolean matchIndexEntry();

 /**

- * Finds out whether the given ast node matches this search pattern.

- * Returns IMPOSSIBLE_MATCH if it doesn't.

- * Returns TRUSTED_MATCH if it matches exactly this search pattern (ie. 

- * it doesn't need to be resolved or it has already been resolved.)

- * Returns POSSIBLE_MATCH if it potentially matches 

- * this search pattern and it needs to be resolved to get more information.

- */

-public int matchLevel(AstNode node) {

-	if (this.matches(node, false)) {

-		if (this.needsResolve) {

-			return POSSIBLE_MATCH;

-		} else {

-			return TRUSTED_MATCH;

-		}

-	}

-	return IMPOSSIBLE_MATCH;

-}

-/**

  * Reports the match of the given reference.

  */

 protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException {

@@ -876,7 +825,7 @@
 	return result;

 }

 public String toString(){

-	return "SearchPattern"/*nonNLS*/;

+	return "SearchPattern"; //$NON-NLS-1$

 }

 

 /**

@@ -974,44 +923,103 @@
 }

 

 /**

+ * Finds out whether the given ast node matches this search pattern.

+ * Returns IMPOSSIBLE_MATCH if it doesn't.

+ * Returns POSSIBLE_MATCH if it potentially matches this search pattern 

+ * and it has not been reolved, and it needs to be resolved to get more information.

+ * Returns ACCURATE_MATCH if it matches exactly this search pattern (ie. 

+ * it doesn't need to be resolved or it has already been resolved.)

+ * Returns INACCURATE_MATCH if it potentially exactly this search pattern (ie. 

+ * it has already been resolved but resolving failed.)

+ */

+public abstract int matchLevel(AstNode node, boolean resolve);

+

+/**

+ * Finds out whether the given binding matches this search pattern.

+ * Returns ACCURATE_MATCH if it does.

+ * Returns INACCURATE_MATCH if resolve failed.

+ * Default is to return INACCURATE_MATCH.

+ */

+public int matchLevel(Binding binding) {

+	return INACCURATE_MATCH;

+}

+

+/**

  * Returns whether the given reference type binding matches or is a subtype of a type

  * that matches the given simple name pattern and qualification pattern.

+ * Returns ACCURATE_MATCH if it does.

+ * Returns INACCURATE_MATCH if resolve fails

+ * Returns IMPOSSIBLE_MATCH if it doesn't.

  */

-protected boolean matchesAsSubtype(ReferenceBinding type, char[] simpleNamePattern, char[] qualificationPattern) {

+protected int matchLevelAsSubtype(ReferenceBinding type, char[] simpleNamePattern, char[] qualificationPattern) {

+	if (type == null) return INACCURATE_MATCH;

+	

+	int level;

+	

 	// matches type

-	if (this.matchesType(simpleNamePattern, qualificationPattern, type))

-		return true;

+	if ((level = this.matchLevelForType(simpleNamePattern, qualificationPattern, type)) != IMPOSSIBLE_MATCH)

+		return level;

 	

 	// matches superclass

-	ReferenceBinding superclass = type.superclass();

-	if (superclass != null) {

-		if (this.matchesAsSubtype(superclass, simpleNamePattern, qualificationPattern))

-			return true;

+	if (!type.isInterface() && !CharOperation.equals(type.compoundName, TypeConstants.JAVA_LANG_OBJECT)) {

+		if ((level = this.matchLevelAsSubtype(type.superclass(), simpleNamePattern, qualificationPattern)) != IMPOSSIBLE_MATCH) {

+			return level;

+		}

 	}

 

 	// matches interfaces

 	ReferenceBinding[] interfaces = type.superInterfaces();

-	for (int i = 0; i < interfaces.length; i++) {

-		if (this.matchesAsSubtype(interfaces[i], simpleNamePattern, qualificationPattern))

-			return true;

+	if (interfaces == null) {

+		return INACCURATE_MATCH;

+	} else {

+		for (int i = 0; i < interfaces.length; i++) {

+			if ((level = this.matchLevelAsSubtype(interfaces[i], simpleNamePattern, qualificationPattern)) != IMPOSSIBLE_MATCH) {

+				return level;

+			};

+		}

 	}

 

-	return false;

+	return IMPOSSIBLE_MATCH;

 }

 

 /**

  * Returns whether one of the given declaring types is the given receiver type.

+ * Returns ACCURATE_MATCH if it does.

+ * Returns INACCURATE_MATCH if resolve failed.

+ * Returns IMPOSSIBLE_MATCH if it doesn't.

  */

-protected boolean matchesType(char[][][] declaringTypes, ReferenceBinding receiverType) {

+protected int matchLevelForType(char[][][] declaringTypes, ReferenceBinding receiverType) {

+	if (receiverType == null) return INACCURATE_MATCH;

 	if (declaringTypes == null) {

-		return true; // we were not able to compute the declaring types, default to true

+		return INACCURATE_MATCH; // we were not able to compute the declaring types, default to inaccurate

 	} else {

 		for (int i = 0, max = declaringTypes.length; i < max; i++) {

 			if (CharOperation.equals(declaringTypes[i], receiverType.compoundName)) {

-				return true;

+				return ACCURATE_MATCH;

 			}

 		}

-		return false;

+		return IMPOSSIBLE_MATCH;

+	}

+}

+

+/**

+ * Returns whether the given type binding matches the given simple name pattern 

+ * and qualification pattern.

+ * Returns ACCURATE_MATCH if it does.

+ * Returns INACCURATE_MATCH if resolve failed.

+ * Returns IMPOSSIBLE_MATCH if it doesn't.

+ */

+protected int matchLevelForType(char[] simpleNamePattern, char[] qualificationPattern, TypeBinding type) {

+	if (type == null) return INACCURATE_MATCH;

+	if (this.matchesType(

+			simpleNamePattern, 

+			qualificationPattern, 

+			type.qualifiedPackageName().length == 0 ? 

+				type.qualifiedSourceName() : 

+				CharOperation.concat(type.qualifiedPackageName(), type.qualifiedSourceName(), '.'))) {

+		return ACCURATE_MATCH;

+	} else {

+		return IMPOSSIBLE_MATCH;

 	}

 }

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/SuperInterfaceReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/SuperInterfaceReferencePattern.java
index f4902c3..68caa7c 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/SuperInterfaceReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/SuperInterfaceReferencePattern.java
@@ -15,20 +15,6 @@
 	super(superQualification, superSimpleName, matchMode, isCaseSensitive);

 }

 /**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof ReferenceBinding)) return false;

-

-	ReferenceBinding[] superInterfaces = ((ReferenceBinding)binding).superInterfaces();

-	for (int i = 0, max = superInterfaces.length; i < max; i++){

-		if (this.matchesType(this.superSimpleName, this.superQualification, superInterfaces[i])){

-			return true;

-		}

-	}

-	return false;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -38,24 +24,24 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("SuperInterfaceReferencePattern: <"/*nonNLS*/);

+	buffer.append("SuperInterfaceReferencePattern: <"); //$NON-NLS-1$

 	if (superSimpleName != null) buffer.append(superSimpleName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

 

@@ -78,4 +64,30 @@
 	}

 	return false;

 }

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof ReferenceBinding)) return IMPOSSIBLE_MATCH;

+

+	// super interfaces

+	int level = IMPOSSIBLE_MATCH;

+	ReferenceBinding type = (ReferenceBinding) binding;

+	ReferenceBinding[] superInterfaces = type.superInterfaces();

+	for (int i = 0, max = superInterfaces.length; i < max; i++){

+		int newLevel = this.matchLevelForType(this.superSimpleName, this.superQualification, superInterfaces[i]);

+		switch (newLevel) {

+			case IMPOSSIBLE_MATCH:

+				break;

+			case ACCURATE_MATCH:

+				return ACCURATE_MATCH;

+			default: // ie. INACCURATE_MATCH

+				level = newLevel;

+				break;

+		}

+	}

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
index ef066c1..6af78e9 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java
@@ -109,51 +109,6 @@
 	return CLASS;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof TypeReference)) return false;

-

-	TypeReference typeRef = (TypeReference)node;

-	if (!resolve) {

-		if (this.superSimpleName != null) {

-			char[] typeRefSimpleName = null;

-			if (typeRef instanceof SingleTypeReference) {

-				typeRefSimpleName = ((SingleTypeReference)typeRef).token;

-			} else { // QualifiedTypeReference

-				char[][] tokens = ((QualifiedTypeReference)typeRef).tokens;

-				typeRefSimpleName = tokens[tokens.length-1];

-			}				

-			if (!this.matchesName(this.superSimpleName, typeRefSimpleName))

-				return false;

-		}

-	} else {

-		TypeBinding binding = typeRef.binding;

-		if (binding != null && !this.matchesType(this.superSimpleName, this.superQualification, binding))

-			return false;

-	}

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof ReferenceBinding)) return false;

-

-	ReferenceBinding type = (ReferenceBinding) binding;

-	if (this.matchesType(this.superSimpleName, this.superQualification, type.superclass())){

-		return true;

-	}

-	

-	ReferenceBinding[] superInterfaces = type.superInterfaces();

-	for (int i = 0, max = superInterfaces.length; i < max; i++){

-		if (this.matchesType(this.superSimpleName, this.superQualification, superInterfaces[i])){

-			return true;

-		}

-	}

-	return false;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -181,24 +136,24 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("SuperTypeReferencePattern: <"/*nonNLS*/);

+	buffer.append("SuperTypeReferencePattern: <"); //$NON-NLS-1$

 	if (superSimpleName != null) buffer.append(superSimpleName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

 

@@ -230,4 +185,73 @@
 	}

 	return false;

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof TypeReference)) return IMPOSSIBLE_MATCH;

+

+	TypeReference typeRef = (TypeReference)node;

+	if (resolve) {

+		TypeBinding binding = typeRef.binding;

+		if (binding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			return this.matchLevelForType(this.superSimpleName, this.superQualification, binding);

+		}

+	} else {

+		if (this.superSimpleName == null) {

+			return POSSIBLE_MATCH;

+		} else {

+			char[] typeRefSimpleName = null;

+			if (typeRef instanceof SingleTypeReference) {

+				typeRefSimpleName = ((SingleTypeReference)typeRef).token;

+			} else { // QualifiedTypeReference

+				char[][] tokens = ((QualifiedTypeReference)typeRef).tokens;

+				typeRefSimpleName = tokens[tokens.length-1];

+			}				

+			if (this.matchesName(this.superSimpleName, typeRefSimpleName))

+				return POSSIBLE_MATCH;

+			else

+				return IMPOSSIBLE_MATCH;

+		}

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof ReferenceBinding)) return IMPOSSIBLE_MATCH;

+

+	// super class

+	ReferenceBinding type = (ReferenceBinding) binding;

+	int level = this.matchLevelForType(this.superSimpleName, this.superQualification, type.superclass());

+	switch (level) {

+		case IMPOSSIBLE_MATCH:

+			break; // try to find match in super interfaces

+		case ACCURATE_MATCH:

+			return ACCURATE_MATCH;

+		default: // ie. INACCURATE_MATCH

+			break; // try to find accurate match in super interfaces

+	}

+

+	// super interfaces

+	ReferenceBinding[] superInterfaces = type.superInterfaces();

+	for (int i = 0, max = superInterfaces.length; i < max; i++){

+		int newLevel = this.matchLevelForType(this.superSimpleName, this.superQualification, superInterfaces[i]);

+		switch (newLevel) {

+			case IMPOSSIBLE_MATCH:

+				break;

+			case ACCURATE_MATCH:

+				return ACCURATE_MATCH;

+			default: // ie. INACCURATE_MATCH

+				level = newLevel;

+				break;

+		}

+	}

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
index 6756791..d8e7984 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
@@ -116,56 +116,6 @@
 	return COMPILATION_UNIT | CLASS;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (!(node instanceof TypeDeclaration)) return false;

-

-	TypeDeclaration type = (TypeDeclaration)node;

-

-	// type name

-	if (this.simpleName != null && !this.matchesName(this.simpleName, type.name))

-		return false;

-

-	if (resolve) {

-		// fully qualified name

-		TypeBinding binding = type.binding;

-		if (binding != null && !this.matches(binding)) {

-			return false;

-		}

-	}

-	

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof TypeBinding)) return false;

-

-	TypeBinding type = (TypeBinding)binding;

-

-	// fully qualified name

-	char[] enclosingTypeName = this.enclosingTypeNames == null ? null : CharOperation.concatWith(this.enclosingTypeNames, '.');

-	if (!this.matchesType(this.simpleName, this.qualification, enclosingTypeName, type)) {

-		return false;

-	}

-

-	// class or interface

-	switch (this.classOrInterface) {

-		case CLASS_SUFFIX:

-			if (type.isInterface())

-				return false;

-			break;

-		case INTERFACE_SUFFIX:

-			if (!type.isInterface())

-				return false;

-			break;

-	}

-	

-	return true;

-}

-/**

  * @see SearchPattern#matchesBinary(Object, Object)

  */

 public boolean matchesBinary(Object binaryInfo, Object enclosingBinaryInfo) {

@@ -213,26 +163,6 @@
 	}

 }

 /**

- * Returns whether the given type binding matches the given simple name pattern 

- * qualification pattern and enclosing type name pattern.

- */

-protected boolean matchesType(char[] simpleNamePattern, char[] qualificationPattern, char[] enclosingNamePattern, TypeBinding type) {

-	if (enclosingNamePattern == null) {

-		return this.matchesType(simpleNamePattern, qualificationPattern, type);

-	} else {

-		char[] pattern;

-		if (qualificationPattern == null) {

-			return matchesType(simpleNamePattern, enclosingNamePattern, type);

-		} else {

-			// pattern was created from a Java element: qualification is the package name.

-			char[] fullQualificationPattern = CharOperation.concat(qualificationPattern, enclosingNamePattern, '.');

-			return 

-				this.matchesType(simpleNamePattern, fullQualificationPattern, type)

-				&& CharOperation.equals(qualification, CharOperation.concatWith(type.getPackage().compoundName, '.'));

-		}

-	}

-}

-/**

  * see SearchPattern.matchIndexEntry

  */

 protected boolean matchIndexEntry(){

@@ -282,17 +212,17 @@
 	StringBuffer buffer = new StringBuffer(20);

 	switch (classOrInterface){

 		case CLASS_SUFFIX :

-			buffer.append("ClassDeclarationPattern: pkg<"/*nonNLS*/);

+			buffer.append("ClassDeclarationPattern: pkg<"); //$NON-NLS-1$

 			break;

 		case INTERFACE_SUFFIX :

-			buffer.append("InterfaceDeclarationPattern: pkg<"/*nonNLS*/);

+			buffer.append("InterfaceDeclarationPattern: pkg<"); //$NON-NLS-1$

 			break;

 		default :

-			buffer.append("TypeDeclarationPattern: pkg<"/*nonNLS*/);

+			buffer.append("TypeDeclarationPattern: pkg<"); //$NON-NLS-1$

 			break;

 	}

 	if (qualification != null) buffer.append(qualification);

-	buffer.append(">, enclosing<"/*nonNLS*/);

+	buffer.append(">, enclosing<"); //$NON-NLS-1$

 	if (enclosingTypeNames != null) {

 		for (int i = 0; i < enclosingTypeNames.length; i++){

 			buffer.append(enclosingTypeNames[i]);

@@ -300,24 +230,92 @@
 				buffer.append('.');

 		}

 	}

-	buffer.append(">, type<"/*nonNLS*/);

+	buffer.append(">, type<"); //$NON-NLS-1$

 	if (simpleName != null) buffer.append(simpleName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (!(node instanceof TypeDeclaration)) return IMPOSSIBLE_MATCH;

+

+	TypeDeclaration type = (TypeDeclaration)node;

+

+	if (resolve) {

+		return this.matchLevel(type.binding);

+	} else {

+		// type name

+		if (this.simpleName != null && !this.matchesName(this.simpleName, type.name))

+			return IMPOSSIBLE_MATCH;

+		else

+			return POSSIBLE_MATCH;

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof TypeBinding)) return IMPOSSIBLE_MATCH;

+

+	TypeBinding type = (TypeBinding)binding;

+

+	// class or interface

+	switch (this.classOrInterface) {

+		case CLASS_SUFFIX:

+			if (type.isInterface())

+				return IMPOSSIBLE_MATCH;

+			break;

+		case INTERFACE_SUFFIX:

+			if (!type.isInterface())

+				return IMPOSSIBLE_MATCH;

+			break;

+	}

+

+	// fully qualified name

+	char[] enclosingTypeName = this.enclosingTypeNames == null ? null : CharOperation.concatWith(this.enclosingTypeNames, '.');

+	return this.matchLevelForType(this.simpleName, this.qualification, enclosingTypeName, type);

+}

+

+/**

+ * Returns whether the given type binding matches the given simple name pattern 

+ * qualification pattern and enclosing type name pattern.

+ */

+protected int matchLevelForType(char[] simpleNamePattern, char[] qualificationPattern, char[] enclosingNamePattern, TypeBinding type) {

+	if (enclosingNamePattern == null) {

+		return this.matchLevelForType(simpleNamePattern, qualificationPattern, type);

+	} else {

+		char[] pattern;

+		if (qualificationPattern == null) {

+			return matchLevelForType(simpleNamePattern, enclosingNamePattern, type);

+		} else {

+			// pattern was created from a Java element: qualification is the package name.

+			char[] fullQualificationPattern = CharOperation.concat(qualificationPattern, enclosingNamePattern, '.');

+			if ( CharOperation.equals(qualification, CharOperation.concatWith(type.getPackage().compoundName, '.'))) {

+				return this.matchLevelForType(simpleNamePattern, fullQualificationPattern, type);

+			} else {

+				return IMPOSSIBLE_MATCH;

+			}

+		}

+	}

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java b/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
index 687ab12..ea7708b 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java
@@ -135,183 +135,6 @@
 	return COMPILATION_UNIT | CLASS | METHOD | FIELD;

 }

 /**

- * @see SearchPattern#matches(AstNode, boolean)

- */

-protected boolean matches(AstNode node, boolean resolve) {

-	if (node instanceof TypeReference) {

-		return this.matches((TypeReference)node, resolve);

-	} else if (node instanceof NameReference) {

-		return this.matches((NameReference)node, resolve);

-	} else if (node instanceof ImportReference) {

-		return this.matches((ImportReference)node, resolve);

-	}

-	return false;

-}

-/**

- * Returns whether this type pattern matches the given import reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(ImportReference importRef, boolean resolve) {

-

-	if (importRef.onDemand) return false;

-

-	char[][] tokens = importRef.tokens;

-	int importLength = tokens.length;

-	

-	if (this.qualification != null){

-		char[][] qualificationTokens = CharOperation.splitOn('.', this.qualification);

-		int qualificationLength = qualificationTokens.length;

-		if (qualificationLength+1 > importLength) return false;

-		for (int i = 0; i < qualificationLength; i++){

-			if (!this.matchesName(qualificationTokens[i], tokens[i])) {

-				return false;

-			}

-		}

-		if (this.simpleName != null 

-			&& !this.matchesName(this.simpleName, tokens[qualificationLength])) {

-			return false;

-		}

-	} else {

-		if (this.simpleName != null) {

-			for (int i = 0; i < importLength; i++){

-				if (this.matchesName(this.simpleName, tokens[i])){

-					return true;

-				}

-			}

-			return false;

-		}

-	}

-	return true;

-}

-/**

- * Returns whether this type pattern matches the given name reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(NameReference nameRef, boolean resolve) {

-	Binding binding = nameRef.binding;

-	if (!resolve || binding == null || !binding.isValidBinding()) {

-		if (this.simpleName != null) {

-			if (nameRef instanceof SingleNameReference) {

-				return this.matchesName(this.simpleName, ((SingleNameReference)nameRef).token);

-			} else { // QualifiedNameReference

-				char[][] tokens = ((QualifiedNameReference)nameRef).tokens;

-				for (int i = 0, max = tokens.length; i < max; i++){

-					if (this.matchesName(this.simpleName, tokens[i])) return true;

-				}

-				return false;

-			}				

-		}

-	} else {

-		if (nameRef instanceof SingleNameReference){

-			if (binding instanceof TypeBinding){

-				if (!this.matchesType(this.simpleName, this.qualification, (TypeBinding) binding)){

-					return false;

-				}

-			} else {

-				return false; // must be a type binding

-			}

-		} else { // QualifiedNameReference

-			TypeBinding typeBinding = null;

-			QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

-			char[][] tokens = qNameRef.tokens;

-			int lastIndex = tokens.length-1;

-			switch (qNameRef.bits & Statement.RestrictiveFlagMASK) {

-				case BindingIds.FIELD : // reading a field

-					typeBinding = ((FieldBinding)binding).declaringClass;

-					// no valid match amongst fields

-					int otherBindingsCount = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;			

-					lastIndex -= otherBindingsCount + 1;

-					if (lastIndex < 0) return false;

-					break;

-				case BindingIds.LOCAL : // reading a local variable

-					return false; // no type match in it

-				case BindingIds.TYPE : //=============only type ==============

-					typeBinding = (TypeBinding)binding;

-			}

-			// try to match all enclosing types for which the token matches as well.

-			while (typeBinding != null && lastIndex >= 0){

-				if (matchesName(this.simpleName, tokens[lastIndex--])

-					&& matchesType(this.simpleName, this.qualification, typeBinding)) return true;

-					//&& matchesAsSubtype(this.simpleName, this.qualification, typeBinding)) return true;

-				if (typeBinding instanceof ReferenceBinding){

-					typeBinding = ((ReferenceBinding)typeBinding).enclosingType();

-				} else {

-					typeBinding = null;

-				}

-			}

-			return false;

-		} 

-	}

-	return true;

-}

-/**

- * Returns whether this type pattern matches the given type reference.

- * Look at resolved information only if specified.

- */

-private boolean matches(TypeReference typeRef, boolean resolve) {

-	if (!resolve) {

-		if (this.simpleName != null) {

-			if (typeRef instanceof SingleTypeReference) {

-				return this.matchesName(this.simpleName, ((SingleTypeReference)typeRef).token);

-			} else { // QualifiedTypeReference

-				char[][] tokens = ((QualifiedTypeReference)typeRef).tokens;

-				for (int i = 0, max = tokens.length; i < max; i++){

-					if (this.matchesName(this.simpleName, tokens[i])) return true;

-				}

-				return false;

-			}				

-		}

-	} else {

-

-		TypeBinding typeBinding = typeRef.binding;

-		if (typeBinding != null){

-			if (typeBinding instanceof ArrayBinding) typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

-			if (typeRef instanceof SingleTypeReference){

-				if (!this.matchesType(this.simpleName, this.qualification, typeBinding)){

-					return false;

-				}

-			} else { // QualifiedTypeReference

-				QualifiedTypeReference qNameRef = (QualifiedTypeReference)typeRef;

-				char[][] tokens = qNameRef.tokens;

-				int lastIndex = tokens.length-1;

-				// try to match all enclosing types for which the token matches as well.

-				while (typeBinding != null && lastIndex >= 0){

-					if (matchesName(this.simpleName, tokens[lastIndex--])

-						&& matchesType(this.simpleName, this.qualification, typeBinding)) return true;

-						//&& matchesAsSubtype(this.simpleName, this.qualification, typeBinding)) return true;

-					if (typeBinding instanceof ReferenceBinding){

-						typeBinding = ((ReferenceBinding)typeBinding).enclosingType();

-					} else {

-						typeBinding = null;

-					}

-				}

-				return false;

-			} 

-		}

-			

-	}

-	return true;

-}

-/**

- * @see SearchPattern#matches(Binding)

- */

-public boolean matches(Binding binding) {

-	if (!(binding instanceof ReferenceBinding)) return false;

-

-	ReferenceBinding type = (ReferenceBinding) binding;

-	if (this.matchesType(this.simpleName, this.qualification, type.superclass())){

-		return true;

-	}

-	

-	ReferenceBinding[] superInterfaces = type.superInterfaces();

-	for (int i = 0, max = superInterfaces.length; i < max; i++){

-		if (this.matchesType(this.simpleName, this.qualification, superInterfaces[i])){

-			return true;

-		}

-	}

-	return false;

-}

-/**

  * @see SearchPattern#matchIndexEntry

  */

 protected boolean matchIndexEntry() {

@@ -356,26 +179,6 @@
 	return true;

 }

 /**

- * @see SearchPattern#matchLevel

- */

-public int matchLevel(AstNode node) {

-	if (node instanceof NameReference) {

-		if (this.matches((NameReference)node, false)) {

-			return POSSIBLE_MATCH; // always need to resolve name reference

-		} else {

-			return IMPOSSIBLE_MATCH;

-		}

-	} else if (node instanceof ImportReference) {

-		if (this.matches((ImportReference)node, false)) {

-			return POSSIBLE_MATCH;

-		} else {

-			return IMPOSSIBLE_MATCH;

-		}

-	} else {

-		return super.matchLevel(node);

-	}

-}

-/**

  * @see SearchPattern#matchReportReference

  */

 protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException {

@@ -415,26 +218,239 @@
 }

 public String toString(){

 	StringBuffer buffer = new StringBuffer(20);

-	buffer.append("TypeReferencePattern: pkg<"/*nonNLS*/);

+	buffer.append("TypeReferencePattern: pkg<"); //$NON-NLS-1$

 	if (qualification != null) buffer.append(qualification);

-	buffer.append(">, type<"/*nonNLS*/);

+	buffer.append(">, type<"); //$NON-NLS-1$

 	if (simpleName != null) buffer.append(simpleName);

-	buffer.append(">, "/*nonNLS*/);

+	buffer.append(">, "); //$NON-NLS-1$

 	switch(matchMode){

 		case EXACT_MATCH : 

-			buffer.append("exact match, "/*nonNLS*/);

+			buffer.append("exact match, "); //$NON-NLS-1$

 			break;

 		case PREFIX_MATCH :

-			buffer.append("prefix match, "/*nonNLS*/);

+			buffer.append("prefix match, "); //$NON-NLS-1$

 			break;

 		case PATTERN_MATCH :

-			buffer.append("pattern match, "/*nonNLS*/);

+			buffer.append("pattern match, "); //$NON-NLS-1$

 			break;

 	}

 	if (isCaseSensitive)

-		buffer.append("case sensitive"/*nonNLS*/);

+		buffer.append("case sensitive"); //$NON-NLS-1$

 	else

-		buffer.append("case insensitive"/*nonNLS*/);

+		buffer.append("case insensitive"); //$NON-NLS-1$

 	return buffer.toString();

 }

+

+/**

+ * @see SearchPattern#matchLevel(AstNode, boolean)

+ */

+public int matchLevel(AstNode node, boolean resolve) {

+	if (node instanceof TypeReference) {

+		return this.matchLevel((TypeReference)node, resolve);

+	} else if (node instanceof NameReference) {

+		return this.matchLevel((NameReference)node, resolve);

+	} else if (node instanceof ImportReference) {

+		return this.matchLevel((ImportReference)node, resolve);

+	}

+	return IMPOSSIBLE_MATCH;

+}

+

+/**

+ * Returns whether this type pattern matches the given import reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(ImportReference importRef, boolean resolve) {

+

+	if (importRef.onDemand) return IMPOSSIBLE_MATCH;

+

+	char[][] tokens = importRef.tokens;

+	int importLength = tokens.length;

+	

+	if (this.qualification != null){

+		char[][] qualificationTokens = CharOperation.splitOn('.', this.qualification);

+		int qualificationLength = qualificationTokens.length;

+		if (qualificationLength+1 > importLength) return IMPOSSIBLE_MATCH;

+		for (int i = 0; i < qualificationLength; i++){

+			if (!this.matchesName(qualificationTokens[i], tokens[i])) {

+				return IMPOSSIBLE_MATCH;

+			}

+		}

+		if (this.simpleName == null || this.matchesName(this.simpleName, tokens[qualificationLength])) {

+			return ACCURATE_MATCH;

+		} else {

+			return IMPOSSIBLE_MATCH;

+		}

+	} else {

+		if (this.simpleName == null) {

+			return ACCURATE_MATCH;

+		} else {

+			for (int i = 0; i < importLength; i++){

+				if (this.matchesName(this.simpleName, tokens[i])){

+					return ACCURATE_MATCH;

+				}

+			}

+			return IMPOSSIBLE_MATCH;

+		}

+	}

+}

+

+/**

+ * Returns whether this type pattern matches the given name reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(NameReference nameRef, boolean resolve) {

+	if (!resolve) {

+		if (this.simpleName == null) {

+			return POSSIBLE_MATCH;

+		} else {

+			if (nameRef instanceof SingleNameReference) {

+				if (this.matchesName(this.simpleName, ((SingleNameReference)nameRef).token)) {

+					return POSSIBLE_MATCH;

+				} else {

+					return IMPOSSIBLE_MATCH;

+				}

+			} else { // QualifiedNameReference

+				char[][] tokens = ((QualifiedNameReference)nameRef).tokens;

+				for (int i = 0, max = tokens.length; i < max; i++){

+					if (this.matchesName(this.simpleName, tokens[i])) 

+						return POSSIBLE_MATCH;

+				}

+				return IMPOSSIBLE_MATCH;

+			}				

+		}

+	} else {

+		Binding binding = nameRef.binding;

+		if (binding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			if (nameRef instanceof SingleNameReference) {

+				if (binding instanceof TypeBinding) {

+					return this.matchLevelForType(this.simpleName, this.qualification, (TypeBinding) binding);

+				} else {

+					return IMPOSSIBLE_MATCH; // must be a type binding

+				}

+			} else { // QualifiedNameReference

+				TypeBinding typeBinding = null;

+				QualifiedNameReference qNameRef = (QualifiedNameReference)nameRef;

+				char[][] tokens = qNameRef.tokens;

+				int lastIndex = tokens.length-1;

+				switch (qNameRef.bits & Statement.RestrictiveFlagMASK) {

+					case BindingIds.FIELD : // reading a field

+						typeBinding = ((FieldBinding)binding).declaringClass;

+						// no valid match amongst fields

+						int otherBindingsCount = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length;			

+						lastIndex -= otherBindingsCount + 1;

+						if (lastIndex < 0) return IMPOSSIBLE_MATCH;

+						break;

+					case BindingIds.LOCAL : // reading a local variable

+						return IMPOSSIBLE_MATCH; // no type match in it

+					case BindingIds.TYPE : //=============only type ==============

+						typeBinding = (TypeBinding)binding;

+				}

+				// try to match all enclosing types for which the token matches as well.

+				while (typeBinding != null && lastIndex >= 0){

+					if (this.matchesName(this.simpleName, tokens[lastIndex--])) {

+						int level = this.matchLevelForType(this.simpleName, this.qualification, typeBinding);

+						if (level != IMPOSSIBLE_MATCH) {

+							return level;

+						}

+					}

+					if (typeBinding instanceof ReferenceBinding){

+						typeBinding = ((ReferenceBinding)typeBinding).enclosingType();

+					} else {

+						typeBinding = null;

+					}

+				}

+				return IMPOSSIBLE_MATCH;

+			}

+		}

+	}

+}

+

+/**

+ * Returns whether this type pattern matches the given type reference.

+ * Look at resolved information only if specified.

+ */

+private int matchLevel(TypeReference typeRef, boolean resolve) {

+	if (!resolve) {

+		if (this.simpleName == null) {

+			return POSSIBLE_MATCH;

+		} else {

+			if (typeRef instanceof SingleTypeReference) {

+				if (this.matchesName(this.simpleName, ((SingleTypeReference)typeRef).token)) {

+					return POSSIBLE_MATCH;

+				} else {

+					return IMPOSSIBLE_MATCH;

+				}

+			} else { // QualifiedTypeReference

+				char[][] tokens = ((QualifiedTypeReference)typeRef).tokens;

+				for (int i = 0, max = tokens.length; i < max; i++){

+					if (this.matchesName(this.simpleName, tokens[i])) {

+						return POSSIBLE_MATCH;

+					}

+				}

+				return IMPOSSIBLE_MATCH;

+			}				

+		} 

+	} else {

+		TypeBinding typeBinding = typeRef.binding;

+		if (typeBinding == null) {

+			return INACCURATE_MATCH;

+		} else {

+			if (typeBinding instanceof ArrayBinding) typeBinding = ((ArrayBinding)typeBinding).leafComponentType;

+			if (typeRef instanceof SingleTypeReference){

+				return this.matchLevelForType(this.simpleName, this.qualification, typeBinding);

+			} else { // QualifiedTypeReference

+				QualifiedTypeReference qNameRef = (QualifiedTypeReference)typeRef;

+				char[][] tokens = qNameRef.tokens;

+				int lastIndex = tokens.length-1;

+				// try to match all enclosing types for which the token matches as well.

+				while (typeBinding != null && lastIndex >= 0){

+					if (matchesName(this.simpleName, tokens[lastIndex--])) {

+						int level = this.matchLevelForType(this.simpleName, this.qualification, typeBinding);

+						if (level != IMPOSSIBLE_MATCH) {

+							return level;

+						}

+					}

+					if (typeBinding instanceof ReferenceBinding){

+						typeBinding = ((ReferenceBinding)typeBinding).enclosingType();

+					} else {

+						typeBinding = null;

+					}

+				}

+				return IMPOSSIBLE_MATCH;

+			} 

+		}

+			

+	}

+}

+

+/**

+ * @see SearchPattern#matchLevel(Binding)

+ */

+public int matchLevel(Binding binding) {

+	if (binding == null) return INACCURATE_MATCH;

+	if (!(binding instanceof ReferenceBinding)) return IMPOSSIBLE_MATCH;

+

+	ReferenceBinding type = (ReferenceBinding) binding;

+	int level = this.matchLevelForType(this.simpleName, this.qualification, type.superclass());

+	if (level != IMPOSSIBLE_MATCH) {

+		return level;

+	}

+	

+	ReferenceBinding[] superInterfaces = type.superInterfaces();

+	for (int i = 0, max = superInterfaces.length; i < max; i++){

+		int newLevel = this.matchLevelForType(this.simpleName, this.qualification, superInterfaces[i]);

+		switch (newLevel) {

+			case IMPOSSIBLE_MATCH:

+				return IMPOSSIBLE_MATCH;

+			case ACCURATE_MATCH: // keep previous level

+				break;

+			default: // ie. INACCURATE_MATCH

+				level = newLevel;

+				break;

+		}

+	}

+	return level;

+}

 }

diff --git a/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java b/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java
index c6d4dd3..e6cd647 100644
--- a/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java
+++ b/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java
@@ -137,24 +137,24 @@
  */

 public boolean performConcurrentJob(IJob searchJob, int waitingPolicy, IProgressMonitor progress) {

 

-	if (VERBOSE) System.out.println("-> performing concurrent job : START - "/*nonNLS*/ + searchJob);

+	if (VERBOSE) System.out.println("-> performing concurrent job : START - " + searchJob); //$NON-NLS-1$

 	boolean status = FAILED;

 	if (awaitingJobsCount() > 0){

 		switch(waitingPolicy){

 			

 			case ForceImmediate :

-				if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - ForceImmediate - "/*nonNLS*/ + searchJob);

+				if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - ForceImmediate - " + searchJob); //$NON-NLS-1$

 				boolean wasEnabled = isEnabled();

 				try {

 					disable(); // pause indexing

 					status = searchJob.execute();

-				if (VERBOSE) System.out.println("-> performing concurrent job : END - "/*nonNLS*/ + searchJob);

+				if (VERBOSE) System.out.println("-> performing concurrent job : END - " + searchJob); //$NON-NLS-1$

 				} finally {

 					if (wasEnabled) enable();

 				}

 				return status;

 			case CancelIfNotReady :

-				if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - CancelIfNotReady - "/*nonNLS*/ + searchJob);

+				if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - CancelIfNotReady - " + searchJob); //$NON-NLS-1$

 				progress.setCanceled(true);

 				break; 

 

@@ -166,9 +166,9 @@
 						if (progress != null && progress.isCanceled()) throw new OperationCanceledException();

 						currentJob = currentJob(); // currentJob can be null when jobs have been added to the queue but job manager is not enabled

 						if (currentJob != null && currentJob != previousJob){

-							if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - WaitUntilReady - "/*nonNLS*/ + searchJob);

+							if (VERBOSE) System.out.println("-> performing concurrent job : NOT READY - WaitUntilReady - " + searchJob); //$NON-NLS-1$

 							if (progress != null){

-								progress.subTask(Util.bind("manager.filesToIndex"/*nonNLS*/, Integer.toString(awaitingWork)));

+								progress.subTask(Util.bind("manager.filesToIndex", Integer.toString(awaitingWork))); //$NON-NLS-1$

 							}

 							previousJob = currentJob;

 						}

@@ -180,7 +180,7 @@
 		}

 	}

 	status = searchJob.execute();

-	if (VERBOSE) System.out.println("-> performing concurrent job : END - "/*nonNLS*/ + searchJob);

+	if (VERBOSE) System.out.println("-> performing concurrent job : END - " + searchJob); //$NON-NLS-1$

 	return status;

 }

 public abstract String processName();

@@ -194,7 +194,7 @@
 		jobStart = 0;

 	}

 	awaitingJobs[jobEnd] = job;

-	if (VERBOSE) System.out.println("-> requesting job: "/*nonNLS*/ + job);

+	if (VERBOSE) System.out.println("-> requesting job: " + job); //$NON-NLS-1$

 	

 }

 /**

@@ -230,8 +230,8 @@
 				idlingStart = -1;

 			}

 			if (VERBOSE){

-				System.out.println("-> executing: "/*nonNLS*/ + job);

-				System.out.println("\t"/*nonNLS*/ + awaitingJobsCount() + " awaiting jobs."/*nonNLS*/);

+				System.out.println("-> executing: " + job); //$NON-NLS-1$

+				System.out.println("\t" + awaitingJobsCount() + " awaiting jobs."); //$NON-NLS-1$ //$NON-NLS-2$

 			}

 			try {

 				executing = true;