Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 59026 Details for
Bug 173992
Duplicate local variable for exception in different catch blocks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
full_on_top_HEAD.txt (text/plain), 3.57 KB, created by
Eric Jodet
on 2007-02-15 02:56:47 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-02-15 02:56:47 EST
Size:
3.57 KB
patch
obsolete
>### 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" >+ ); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 173992
: 59026