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 52017 Details for
Bug 80339
Wrong error message "; expected" when writing an interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug80339_001.txt (text/plain), 9.28 KB, created by
David Audel
on 2006-10-16 04:29:41 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-10-16 04:29:41 EDT
Size:
9.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java,v >retrieving revision 1.9 >diff -u -r1.9 LexStream.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java 10 May 2006 18:03:49 -0000 1.9 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java 16 Oct 2006 08:32:09 -0000 >@@ -223,7 +223,21 @@ > > String source = new String(scanner.source); > if(currentIndex < 0) { >- res.append(source); >+ int previousEnd = -1; >+ for (int i = 0; i < intervalStartToSkip.length; i++) { >+ int intervalStart = intervalStartToSkip[i]; >+ int intervalEnd = intervalEndToSkip[i]; >+ >+ res.append(source.substring(previousEnd + 1, intervalStart)); >+ res.append('<'); >+ res.append('@'); >+ res.append(source.substring(intervalStart, intervalEnd + 1)); >+ res.append('@'); >+ res.append('>'); >+ >+ previousEnd = intervalEnd; >+ } >+ res.append(source.substring(previousEnd + 1)); > } else { > Token token = token(currentIndex); > int curtokKind = token.kind; >Index: compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java,v >retrieving revision 1.56 >diff -u -r1.56 RecoveredMethod.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java 29 Mar 2006 02:47:34 -0000 1.56 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java 16 Oct 2006 08:32:09 -0000 >@@ -445,6 +445,15 @@ > } > return this; > } >+ if(this.parent != null && this.parent instanceof RecoveredType) { >+ int modifiers = ((RecoveredType)this.parent).typeDeclaration.modifiers; >+ if (TypeDeclaration.kind(modifiers) == TypeDeclaration.INTERFACE_DECL) { >+ if (!this.foundOpeningBrace) { >+ this.updateSourceEndIfNecessary(braceStart - 1, braceStart - 1); >+ return this.parent.updateOnClosingBrace(braceStart, braceEnd); >+ } >+ } >+ } > return super.updateOnClosingBrace(braceStart, braceEnd); > } > /* >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java,v >retrieving revision 1.8 >diff -u -r1.8 StatementRecoveryTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java 17 Jul 2006 11:39:34 -0000 1.8 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java 16 Oct 2006 08:32:13 -0000 >@@ -3537,4 +3537,54 @@ > expectedFullWithStatementRecoveryUnitToString, > testName); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339 >+public void test0043() { >+ >+ String s = >+ "package a; \n" >+ + "public interface Test { \n" >+ + " public void myMethod() \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} > } >Index: src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java,v >retrieving revision 1.23 >diff -u -r1.23 SyntaxErrorTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java 29 Mar 2006 03:50:24 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java 16 Oct 2006 08:32:14 -0000 >@@ -374,4 +374,56 @@ > expectedSyntaxErrorDiagnosis, > testName); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339 >+public void test11() { >+ >+ String s = >+ "package a; \n"+ >+ "public interface Test { \n"+ >+ " public void myMethod() \n"+ >+ "} \n"; >+ >+ String expectedSyntaxErrorDiagnosis = >+ "----------\n"+ >+ "1. ERROR in <test> (at line 3)\n"+ >+ " public void myMethod() \n"+ >+ " ^\n"+ >+ "Syntax error, insert \";\" to complete MethodDeclaration\n"+ >+ "----------\n"; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedSyntaxErrorDiagnosis, >+ testName); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339 >+public void test12() { >+ >+ String s = >+ "package a; \n"+ >+ "public interface Test { \n"+ >+ " public void myMethod() \n"+ >+ " System.out.println(); \n"+ >+ "} \n"; >+ >+ String expectedSyntaxErrorDiagnosis = >+ "----------\n"+ >+ "1. ERROR in <test> (at line 3)\n"+ >+ " public void myMethod() \n"+ >+ " ^\n"+ >+ "Syntax error on token \")\", { expected after this token\n"+ >+ "----------\n"+ >+ "2. ERROR in <test> (at line 5)\n"+ >+ " } \n"+ >+ " ^\n"+ >+ "Syntax error, insert \"}\" to complete InterfaceBody\n"+ >+ "----------\n"; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedSyntaxErrorDiagnosis, >+ testName); >+} > } >Index: src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java,v >retrieving revision 1.44 >diff -u -r1.44 DietRecoveryTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java 14 Sep 2006 15:10:39 -0000 1.44 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java 16 Oct 2006 08:32:12 -0000 >@@ -6869,4 +6869,85 @@ > expectedFullUnitToString, > expectedCompletionDietUnitToString, testName); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339 >+public void test115() { >+ String s = >+ "public interface Test {\n"+ >+ " public void myMethod()\n"+ >+ "}\n"; >+ >+ String expectedDietUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = expectedDietUnitToString; >+ >+ String expectedCompletionDietUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "test foreach toString"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyPlusStatementsRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedCompletionDietUnitToString, testName); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339 >+public void test116() { >+ String s = >+ "public interface Test {\n"+ >+ " public void myMethod()\n"+ >+ " System.out.println();\n"+ >+ "}\n"; >+ >+ String expectedDietUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = >+ "public interface Test {\n" + >+ " public void myMethod() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = expectedDietUnitToString; >+ >+ String expectedCompletionDietUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "test foreach toString"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyPlusStatementsRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedCompletionDietUnitToString, testName); >+} > }
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 80339
: 52017