### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v retrieving revision 1.387 diff -u -r1.387 Parser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 7 May 2008 11:36:38 -0000 1.387 +++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 3 Jul 2008 09:07:08 -0000 @@ -9219,6 +9219,7 @@ this.hasReportedError = true; } this.lastCheckPoint = this.scanner.currentPosition; + this.currentToken = 0; this.restartRecovery = true; } if(this.statementRecoveryActivated) { @@ -9247,6 +9248,7 @@ this.hasReportedError = true; } this.lastCheckPoint = this.scanner.currentPosition; + this.currentToken = 0; this.restartRecovery = true; } if(this.statementRecoveryActivated) { #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.23 diff -u -r1.23 ParserTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 10 Jun 2008 10:55:50 -0000 1.23 +++ src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 3 Jul 2008 09:07:09 -0000 @@ -742,4 +742,35 @@ "----------\n" ); } +/* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=239198 + */ +public void test028() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); + runNegativeTest( + new String[] { + "X.java", + "class X {\n" + + " public static void foo(String param) {\n" + + " String foo= param;\n" + + " Srtring bar = \"\"\"\n" + + " }\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 4)\n" + + " Srtring bar = \"\"\"\n" + + " ^^\n" + + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + + "----------\n" + + "2. ERROR in X.java (at line 4)\n" + + " Srtring bar = \"\"\"\n" + + " ^\n" + + "String literal is not properly closed by a double-quote\n" + + "----------\n", + null, + true, + options); +} }