### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.340 diff -u -r1.340 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 12 Feb 2007 02:36:05 -0000 1.340 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 15 Feb 2007 07:48:05 -0000 @@ -3292,6 +3292,16 @@ reference.sourceEnd); } public void invalidType(ASTNode location, TypeBinding type) { + if (type instanceof ReferenceBinding) { + if (isRecoveredName(((ReferenceBinding)type).compoundName)) return; + } + else if (type instanceof ArrayBinding) { + TypeBinding leafType = ((ArrayBinding)type).leafComponentType; + if (leafType instanceof ReferenceBinding) { + if (isRecoveredName(((ReferenceBinding)leafType).compoundName)) return; + } + } + int id = IProblem.UndefinedType; // default switch (type.problemId()) { case ProblemReasons.NotFound : Index: grammar/java.g =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/grammar/java.g,v retrieving revision 1.1 diff -u -r1.1 java.g --- grammar/java.g 4 Jan 2007 14:09:02 -0000 1.1 +++ grammar/java.g 15 Feb 2007 07:48:05 -0000 @@ -654,6 +654,7 @@ /.$putCase consumeFormalParameter(true); $break ./ /:$readableName FormalParameter:/ /:$compliance 1.5:/ +/:$recovery_template Identifier Identifier:/ ClassTypeList -> ClassTypeElt ClassTypeList ::= ClassTypeList ',' ClassTypeElt #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java,v retrieving revision 1.20 diff -u -r1.20 ParserTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 6 Nov 2006 17:32:11 -0000 1.20 +++ src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 15 Feb 2007 07:48:07 -0000 @@ -707,4 +707,46 @@ options // custom options ); } + +/* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=173992 + */ +public void test027() { + this.runNegativeTest( + new String[] { + "X.java", + "import java.io.EOFException;\n" + + "import java.io.FileNotFoundException;\n" + + "import java.io.IOException;\n" + + "import org.xml.sax.SAXException;\n" + + "public class X {\n" + + "public void doSomething() throws FileNotFoundException, EOFException, SAXException{\n" + + "\n" + + "}\n" + + "public void doSomethingElse() {\n" + + "try {\n" + + " doSomething();\n" + + "}\n" + + " catch ( SAXException exception) {\n" + + "\n" + + "} \n" + + "catch ( FileNotFoundException exception ) {\n" + + "\n" + + "} \n" + + "catch (\n" + + " // working before the slashes\n" + + ") {\n" + + "\n" + + "} \n" + + "} \n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 19)\n" + + " catch (\n" + + " ^\n" + + "Syntax error on token \"(\", FormalParameter expected after this token\n" + + "----------\n" + ); +} }