### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.compiler.tool Index: src/org/eclipse/jdt/internal/compiler/tool/Options.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/Options.java,v retrieving revision 1.9 diff -u -r1.9 Options.java --- src/org/eclipse/jdt/internal/compiler/tool/Options.java 2 Oct 2009 23:11:12 -0000 1.9 +++ src/org/eclipse/jdt/internal/compiler/tool/Options.java 18 Dec 2009 19:42:12 -0000 @@ -25,6 +25,7 @@ ZERO_ARGUMENT_OPTIONS = new HashSet(); Options.ZERO_ARGUMENT_OPTIONS.add("-progress");//$NON-NLS-1$ Options.ZERO_ARGUMENT_OPTIONS.add("-proceedOnError");//$NON-NLS-1$ + Options.ZERO_ARGUMENT_OPTIONS.add("-proceedOnError:Fatal");//$NON-NLS-1$ Options.ZERO_ARGUMENT_OPTIONS.add("-time");//$NON-NLS-1$ Options.ZERO_ARGUMENT_OPTIONS.add("-v");//$NON-NLS-1$ Options.ZERO_ARGUMENT_OPTIONS.add("-version");//$NON-NLS-1$ #P org.eclipse.jdt.compiler.tool.tests Index: src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java,v retrieving revision 1.19 diff -u -r1.19 CompilerToolTests.java --- src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java 29 Sep 2009 18:33:30 -0000 1.19 +++ src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java 18 Dec 2009 19:42:13 -0000 @@ -109,6 +109,7 @@ "-X", "-O", "-proceedOnError", + "-proceedOnError:Fatal", "-verbose", "-referenceInfo", "-progress", #P org.eclipse.jdt.core Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v retrieving revision 1.346 diff -u -r1.346 Main.java --- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 7 Oct 2009 14:58:11 -0000 1.346 +++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 18 Dec 2009 19:42:14 -0000 @@ -2023,8 +2023,19 @@ this.showProgress = true; continue; } - if (currentArg.equals("-proceedOnError")) { //$NON-NLS-1$ + if (currentArg.startsWith("-proceedOnError")) { //$NON-NLS-1$ mode = DEFAULT; + int length = currentArg.length(); + if (length > 15) { + if (currentArg.equals("-proceedOnError:Fatal")) { //$NON-NLS-1$ + this.options.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.ENABLED); + } else { + throw new IllegalArgumentException( + this.bind("configure.invalidWarningConfiguration", currentArg)); //$NON-NLS-1$ + } + } else { + this.options.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED); + } this.proceedOnError = true; continue; } Index: batch/org/eclipse/jdt/internal/compiler/batch/messages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties,v retrieving revision 1.867 diff -u -r1.867 messages.properties --- batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 16 Dec 2009 20:14:50 -0000 1.867 +++ batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 18 Dec 2009 19:42:14 -0000 @@ -215,8 +215,10 @@ \ default)\n\ \ -log log to a file. If the file extension is ''.xml'', then\n\ \ the log will be a xml file.\n\ -\ -proceedOnError do not stop at first error, dumping class files with\n\ +\ -proceedOnError[:Fatal]\n\ +\ do not stop at first error, dumping class files with\n\ \ problem methods\n\ +\ With ":Fatal", all optional errors are treated as fatal\n\ \ -verbose enable verbose output\n\ \ -referenceInfo compute reference info\n\ \ -progress show progress (only in -log mode)\n\ Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.174 diff -u -r1.174 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 15 Oct 2009 00:21:38 -0000 1.174 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 18 Dec 2009 19:42:15 -0000 @@ -4904,7 +4904,7 @@ if (index > 0) { // the string already exists inside the constant pool // we reuse the same index - ldcForIndex(index, constantChars); + ldcForIndex(index); } else { // the string is too big to be utf8-encoded in one pass. // we have to split it into different pieces. @@ -4949,7 +4949,7 @@ System.arraycopy(constantChars, 0, subChars, 0, i); System.arraycopy(utf8encoding, 0, utf8encoding = new byte[length], 0, length); index = this.constantPool.literalIndex(subChars, utf8encoding); - ldcForIndex(index, subChars); + ldcForIndex(index); // write the remaining part invokeStringConcatenationStringConstructor(); while (i < constantLength) { @@ -4986,7 +4986,7 @@ System.arraycopy(constantChars, startIndex, subChars, 0, newCharLength); System.arraycopy(utf8encoding, 0, utf8encoding = new byte[length], 0, length); index = this.constantPool.literalIndex(subChars, utf8encoding); - ldcForIndex(index, subChars); + ldcForIndex(index); // now on the stack it should be a StringBuffer and a string. invokeStringConcatenationAppendForType(TypeIds.T_JavaLangString); } @@ -5050,7 +5050,7 @@ writeUnsignedShort(index); } -public void ldcForIndex(int index, char[] constant) { +public void ldcForIndex(int index) { this.stackDepth++; if (this.stackDepth > this.stackMax) { this.stackMax = this.stackDepth; Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.225 diff -u -r1.225 CompilerOptions.java --- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 26 Nov 2009 16:20:04 -0000 1.225 +++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 18 Dec 2009 19:42:16 -0000 @@ -1006,8 +1006,8 @@ // suppress warning annotation this.suppressWarnings = true; - // treat optional error as fatal or just like warning? - this.treatOptionalErrorAsFatal = true; + // treat optional error as non fatal + this.treatOptionalErrorAsFatal = false; // parser perform statements recovery this.performMethodsFullRecovery = true; #P org.eclipse.jdt.core.tests Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java =================================================================== RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v retrieving revision 1.328 diff -u -r1.328 NegativeTest.java --- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 17 Aug 2009 17:45:39 -0000 1.328 +++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 18 Dec 2009 19:42:17 -0000 @@ -14247,6 +14247,7 @@ public void test382() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.IGNORE); runNegativeTest( true, new String[] { @@ -14303,6 +14304,8 @@ public void test386() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.IGNORE); + customOptions.put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.IGNORE); runNegativeTest( true, new String[] { @@ -14528,6 +14531,7 @@ public void test392() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); runNegativeTest( true, new String[] { @@ -14582,6 +14586,8 @@ public void test394() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.IGNORE); + customOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.IGNORE); runNegativeTest( true, new String[] { @@ -14811,6 +14817,7 @@ public void test401() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); runNegativeTest( true, new String[] { #P org.eclipse.jdt.core.tests.builder Index: src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java,v retrieving revision 1.55 diff -u -r1.55 MultiProjectTests.java --- src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java 27 Jun 2008 16:02:02 -0000 1.55 +++ src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java 18 Dec 2009 19:42:17 -0000 @@ -991,7 +991,7 @@ ); fullBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ } /* @@ -1042,7 +1042,7 @@ ); incrementalBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ } /* @@ -1086,7 +1086,7 @@ ); fullBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //---------------------------- // Step 2 @@ -1136,7 +1136,7 @@ ); fullBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ } /* @@ -1187,7 +1187,7 @@ ); incrementalBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ } /* @@ -1231,7 +1231,7 @@ ); fullBuild(); - expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ + expectingSpecificProblemFor(project2Path, new Problem("", "Access restriction: The type B is not accessible due to restriction on required project Project1", d, 23, 35, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //---------------------------- // Step 2 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java,v retrieving revision 1.62 diff -u -r1.62 AssignmentTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java 6 Oct 2009 13:18:00 -0000 1.62 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java 18 Dec 2009 19:42:18 -0000 @@ -1909,6 +1909,7 @@ " if ((i = 3) != i) {\n" + " System.out.println(\"The second warning is just.\");\n" + " }\n" + + " return false;\n" + " }\n" + "}" }, @@ -1939,6 +1940,7 @@ " if ((s = \"\") != s) {\n" + " System.out.println(\"The second warning is just.\");\n" + " }\n" + + " return false;\n" + " }\n" + "}" }, Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v retrieving revision 1.199 diff -u -r1.199 BatchCompilerTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 7 Oct 2009 14:58:12 -0000 1.199 +++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 18 Dec 2009 19:42:19 -0000 @@ -1584,8 +1584,10 @@ " default)\n" + " -log log to a file. If the file extension is ''.xml'', then\n" + " the log will be a xml file.\n" + - " -proceedOnError do not stop at first error, dumping class files with\n" + - " problem methods\n" + + " -proceedOnError[:Fatal]\n" + + " do not stop at first error, dumping class files with\n" + + " problem methods\n" + + " With \":Fatal\", all optional errors are treated as fatal\n" + " -verbose enable verbose output\n" + " -referenceInfo compute reference info\n" + " -progress show progress (only in -log mode)\n" + @@ -1796,7 +1798,7 @@ "