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 31884 Details for
Bug 42253
[plan][dom/ast] Make AST more robust against syntax errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
statements recovery
patch006.txt (text/plain), 199.31 KB, created by
David Audel
on 2005-12-16 12:15:10 EST
(
hide
)
Description:
statements recovery
Filename:
MIME Type:
Creator:
David Audel
Created:
2005-12-16 12:15:10 EST
Size:
199.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.75 >diff -u -r1.75 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 5 Dec 2005 15:52:04 -0000 1.75 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 16 Dec 2005 17:08:40 -0000 >@@ -1897,6 +1897,7 @@ > "import p2.*;\n" + > "public class X {\n" + > " public void bar(){\n" + >+ " System.out.println();\n" + > " }\n" + > "}\n", > participant.ast >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.73 >diff -u -r1.73 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 3 Dec 2005 04:10:40 -0000 1.73 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 16 Dec 2005 17:08:29 -0000 >@@ -105,7 +105,7 @@ > } > > static { >-// TESTS_NAMES = new String[] {"test0602"}; >+// TESTS_NAMES = new String[] {"test0577"}; > // TESTS_NUMBERS = new int[] { 624 }; > } > public static Test suite() { >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v >retrieving revision 1.163 >diff -u -r1.163 ASTConverterTest2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 7 Dec 2005 15:41:54 -0000 1.163 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 16 Dec 2005 17:08:23 -0000 >@@ -42,7 +42,7 @@ > } > > static { >-// TESTS_NAMES = new String[] {"test0577"}; >+// TESTS_NAMES = new String[] {"test0472"}; > // TESTS_NUMBERS = new int[] { 606 }; > } > public static Test suite() { >Index: src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java,v >retrieving revision 1.14 >diff -u -r1.14 RunConverterTests.java >--- src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java 23 Feb 2005 02:58:37 -0000 1.14 >+++ src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java 16 Dec 2005 17:08:29 -0000 >@@ -31,7 +31,8 @@ > ASTConverter15Test.class, > ASTConverterAST3Test.class, > ASTConverterTestAST3_2.class, >- ASTConverterBindingsTest.class >+ ASTConverterBindingsTest.class, >+ ASTConverterRecoveryTest.class > }; > } > public static Test suite() { >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java,v >retrieving revision 1.17 >diff -u -r1.17 ASTConverterAST3Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java 25 Nov 2005 16:45:12 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java 16 Dec 2005 17:08:09 -0000 >@@ -8109,7 +8109,7 @@ > assertNotNull("No compilation unit", result); //$NON-NLS-1$ > assertTrue("result is not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ > CompilationUnit compilationUnit = (CompilationUnit) result; >- assertEquals("No errors found", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ >+ assertEquals("No errors found", 4, compilationUnit.getMessages().length); //$NON-NLS-1$ > ASTNode node = getASTNode(compilationUnit, 0, 0); > assertNotNull("not null", node); //$NON-NLS-1$ > assertTrue("not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$ >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java,v >retrieving revision 1.73 >diff -u -r1.73 ASTConverterTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java 25 Nov 2005 16:45:12 -0000 1.73 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java 16 Dec 2005 17:08:18 -0000 >@@ -8277,7 +8277,7 @@ > assertNotNull("No compilation unit", result); //$NON-NLS-1$ > assertTrue("result is not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ > CompilationUnit compilationUnit = (CompilationUnit) result; >- assertEquals("No errors found", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ >+ assertEquals("No errors found", 4, compilationUnit.getMessages().length); //$NON-NLS-1$ > ASTNode node = getASTNode(compilationUnit, 0, 0); > assertNotNull("not null", node); //$NON-NLS-1$ > assertTrue("not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$ >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java,v >retrieving revision 1.179 >diff -u -r1.179 FormatterRegressionTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 23 Nov 2005 20:40:31 -0000 1.179 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 16 Dec 2005 17:08:38 -0000 >@@ -54,6 +54,7 @@ > > static { > // TESTS_NUMBERS = new int[] { 609 } ; >+// TESTS_NAMES = new String[]{ "test123"}; > } > public static Test suite() { > return buildTestSuite(FormatterRegressionTests.class); >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java >=================================================================== >RCS file: src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java >diff -N src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,251 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.core.tests.dom; >+ >+import java.util.List; >+ >+import junit.framework.Test; >+ >+import org.eclipse.jdt.core.ICompilationUnit; >+import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.dom.AST; >+import org.eclipse.jdt.core.dom.ASTNode; >+import org.eclipse.jdt.core.dom.Block; >+import org.eclipse.jdt.core.dom.CompilationUnit; >+import org.eclipse.jdt.core.dom.Expression; >+import org.eclipse.jdt.core.dom.ExpressionStatement; >+import org.eclipse.jdt.core.dom.ITypeBinding; >+import org.eclipse.jdt.core.dom.MethodDeclaration; >+import org.eclipse.jdt.core.dom.MethodInvocation; >+import org.eclipse.jdt.core.dom.NumberLiteral; >+import org.eclipse.jdt.core.dom.Statement; >+ >+public class ASTConverterRecoveryTest extends ConverterTestSetup { >+ >+ public void setUpSuite() throws Exception { >+ super.setUpSuite(); >+ this.ast = AST.newAST(AST.JLS3); >+ } >+ >+ public ASTConverterRecoveryTest(String name) { >+ super(name); >+ } >+ >+ static { >+ TESTS_NAMES = new String[] {"test0003"}; >+// TESTS_NUMBERS = new int[] { 624 }; >+ } >+ public static Test suite() { >+ return buildTestSuite(ASTConverterRecoveryTest.class); >+ } >+ >+ public void test0001() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Converter/src/test/X.java", >+ "package test;\n"+ >+ "\n"+ >+ "public class X {\n"+ >+ " void foo() {\n"+ >+ " bar(0)\n"+ >+ " baz(1);\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ char[] source = this.workingCopies[0].getSource().toCharArray(); >+ ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true); >+ >+ assertASTNodeEquals( >+ "package test;\n" + >+ "public class X {\n" + >+ " void foo(){\n" + >+ " bar(0);\n" + >+ " baz(1);\n" + >+ " }\n" + >+ "}\n", >+ result); >+ >+ ASTNode node = getASTNode((CompilationUnit) result, 0, 0); >+ assertNotNull(node); >+ assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ Block block = methodDeclaration.getBody(); >+ List statements = block.statements(); >+ assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$ >+ Statement statement = (Statement) statements.get(0); >+ assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement = (ExpressionStatement) statement; >+ checkSourceRange(expressionStatement, "bar(0)", source); //$NON-NLS-1$ >+ Expression expression = expressionStatement.getExpression(); >+ assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation = (MethodInvocation) expression; >+ checkSourceRange(methodInvocation, "bar(0)", source); //$NON-NLS-1$ >+ List list = methodInvocation.arguments(); >+ assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$ >+ Expression parameter = (Expression) list.get(0); >+ assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$ >+ ITypeBinding typeBinding = parameter.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding); //$NON-NLS-1$ >+ assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$ >+ checkSourceRange(parameter, "0", source); //$NON-NLS-1$ >+ Statement statement2 = (Statement) statements.get(1); >+ assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2; >+ checkSourceRange(expressionStatement2, "baz(1);", source); //$NON-NLS-1$ >+ Expression expression2 = expressionStatement2.getExpression(); >+ assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation2 = (MethodInvocation) expression2; >+ checkSourceRange(methodInvocation2, "baz(1)", source); //$NON-NLS-1$ >+ List list2 = methodInvocation2.arguments(); >+ assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$ >+ Expression parameter2 = (Expression) list2.get(0); >+ assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$ >+ ITypeBinding typeBinding2 = parameter2.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding2); //$NON-NLS-1$ >+ assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$ >+ checkSourceRange(parameter2, "1", source); //$NON-NLS-1$ >+ } >+ >+ public void test0002() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Converter/src/test/X.java", >+ "package test;\n"+ >+ "\n"+ >+ "public class X {\n"+ >+ " void foo() {\n"+ >+ " baz(0);\n"+ >+ " bar(1,\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ char[] source = this.workingCopies[0].getSource().toCharArray(); >+ ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true); >+ >+ assertASTNodeEquals( >+ "package test;\n" + >+ "public class X {\n" + >+ " void foo(){\n" + >+ " baz(0);\n" + >+ " bar(1);\n" + >+ " }\n" + >+ "}\n", >+ result); >+ >+ ASTNode node = getASTNode((CompilationUnit) result, 0, 0); >+ assertNotNull(node); >+ assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ Block block = methodDeclaration.getBody(); >+ List statements = block.statements(); >+ assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$ >+ Statement statement = (Statement) statements.get(0); >+ assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement = (ExpressionStatement) statement; >+ checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$ >+ Expression expression = expressionStatement.getExpression(); >+ assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation = (MethodInvocation) expression; >+ checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$ >+ List list = methodInvocation.arguments(); >+ assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$ >+ Expression parameter = (Expression) list.get(0); >+ assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$ >+ ITypeBinding typeBinding = parameter.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding); //$NON-NLS-1$ >+ assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$ >+ checkSourceRange(parameter, "0", source); //$NON-NLS-1$ >+ Statement statement2 = (Statement) statements.get(1); >+ assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2; >+ checkSourceRange(expressionStatement2, "bar(1", source); //$NON-NLS-1$ >+ Expression expression2 = expressionStatement2.getExpression(); >+ assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation2 = (MethodInvocation) expression2; >+ checkSourceRange(methodInvocation2, "bar(1", source); //$NON-NLS-1$ >+ List list2 = methodInvocation2.arguments(); >+ assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$ >+ Expression parameter2 = (Expression) list2.get(0); >+ assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$ >+ ITypeBinding typeBinding2 = parameter2.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding2); //$NON-NLS-1$ >+ assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$ >+ checkSourceRange(parameter2, "1", source); //$NON-NLS-1$ >+ } >+ >+ public void test0003() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Converter/src/test/X.java", >+ "package test;\n"+ >+ "\n"+ >+ "public class X {\n"+ >+ " void foo() {\n"+ >+ " baz(0);\n"+ >+ " bar(1,\n"+ >+ " foo(3);\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ char[] source = this.workingCopies[0].getSource().toCharArray(); >+ ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true); >+ >+ assertASTNodeEquals( >+ "package test;\n" + >+ "public class X {\n" + >+ " void foo(){\n" + >+ " baz(0);\n" + >+ " bar(1,foo(3));\n" + >+ " }\n" + >+ "}\n", >+ result); >+ >+ ASTNode node = getASTNode((CompilationUnit) result, 0, 0); >+ assertNotNull(node); >+ assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ Block block = methodDeclaration.getBody(); >+ List statements = block.statements(); >+ assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$ >+ Statement statement = (Statement) statements.get(0); >+ assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement = (ExpressionStatement) statement; >+ checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$ >+ Expression expression = expressionStatement.getExpression(); >+ assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation = (MethodInvocation) expression; >+ checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$ >+ List list = methodInvocation.arguments(); >+ assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$ >+ Expression parameter = (Expression) list.get(0); >+ assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$ >+ ITypeBinding typeBinding = parameter.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding); //$NON-NLS-1$ >+ assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$ >+ checkSourceRange(parameter, "0", source); //$NON-NLS-1$ >+ Statement statement2 = (Statement) statements.get(1); >+ assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$ >+ ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2; >+ checkSourceRange(expressionStatement2, "bar(1,\n\t foo(3);", source); //$NON-NLS-1$ >+ Expression expression2 = expressionStatement2.getExpression(); >+ assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.METHOD_INVOCATION); //$NON-NLS-1$ >+ MethodInvocation methodInvocation2 = (MethodInvocation) expression2; >+ checkSourceRange(methodInvocation2, "bar(1,\n\t foo(3)", source); //$NON-NLS-1$ >+ List list2 = methodInvocation2.arguments(); >+ assertTrue("Parameter list is empty", list2.size() == 2); //$NON-NLS-1$ >+ Expression parameter2 = (Expression) list2.get(0); >+ assertTrue("Not a Number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$ >+ parameter2 = (Expression) list2.get(1); >+ assertTrue("Not a method invocation", parameter2 instanceof MethodInvocation); //$NON-NLS-1$ >+ MethodInvocation methodInvocation3 = (MethodInvocation) parameter2; >+ checkSourceRange(methodInvocation3, "foo(3)", source); //$NON-NLS-1$ >+ } >+} >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java,v >retrieving revision 1.6 >diff -u -r1.6 GenericDietRecoveryTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java 27 Oct 2005 13:03:09 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java 16 Dec 2005 17:08:49 -0000 >@@ -901,6 +901,7 @@ > " super();\n" + > " }\n" + > " void foo() {\n" + >+ " Object o = (Y<Z>.W<U>) e;\n" + > " }\n" + > "}\n"; > >Index: src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java,v >retrieving revision 1.23 >diff -u -r1.23 TestAll.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java 10 Oct 2005 15:30:04 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java 16 Dec 2005 17:08:50 -0000 >@@ -47,6 +47,7 @@ > testClasses.add(GenericDietRecoveryTest.class); > testClasses.add(EnumDietRecoveryTest.class); > testClasses.add(AnnotationDietRecoveryTest.class); >+ testClasses.add(StatementRecoveryTest.class); > > /* source element parser tests */ > testClasses.add(SourceElementParserTest.class); >Index: src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java,v >retrieving revision 1.21 >diff -u -r1.21 ComplianceDiagnoseTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 23 Feb 2005 17:26:17 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 16 Dec 2005 17:08:46 -0000 >@@ -20,11 +20,11 @@ > } > // Static initializer to specify tests subset using TESTS_* static variables > // All specified tests which does not belong to the class are skipped... >-// static { >-// TESTS_NAMES = new String[] { "test000" }; >+ static { >+// TESTS_NAMES = new String[] { "test0021" }; > // TESTS_NUMBERS = new int[] { 50 }; > // TESTS_RANGE = new int[] { 21, 50 }; >-// } >+ } > public static Test suite() { > return buildTestSuite(testClass()); > } >@@ -494,6 +494,11 @@ > " assert true;\n" + > " ^^^^^^\n" + > "Syntax error on token \"assert\", AssignmentOperator expected after this token\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 3)\n" + >+ " assert true;\n" + >+ " ^^^^^^\n" + >+ "assert cannot be resolved\n" + > "----------\n"; > String expected14ProblemLog = > ""; >@@ -609,7 +614,12 @@ > " ^^^^^^^^^^^\n" + > "Syntax error, \'for each\' statements are only available if source level is 5.0\n" + > "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " for(String o: c) {\n" + >+ " ^\n" + >+ "c cannot be resolved\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + > " #\n" + > " ^\n" + > "Syntax error on token \"Invalid Character\", delete this token\n" + >@@ -619,7 +629,12 @@ > > String expected15ProblemLog = > "----------\n" + >- "1. ERROR in X.java (at line 4)\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " for(String o: c) {\n" + >+ " ^\n" + >+ "c cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + > " #\n" + > " ^\n" + > "Syntax error on token \"Invalid Character\", delete this token\n" + >@@ -853,7 +868,12 @@ > " ^^^^^^\n" + > "Syntax error on token \"assert\", AssignmentOperator expected after this token\n" + > "----------\n" + >- "3. ERROR in X.java (at line 4)\n" + >+ "3. ERROR in X.java (at line 3)\n" + >+ " assert true;\n" + >+ " ^^^^^^\n" + >+ "assert cannot be resolved\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 4)\n" + > " #\n" + > " ^\n" + > "Syntax error on token \"Invalid Character\", delete this token\n" + >@@ -1118,6 +1138,11 @@ > " for(Object o ? c){\n" + > " ^\n" + > "Syntax error on token \"?\", : expected\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " for(Object o ? c){\n" + >+ " ^\n" + >+ "c cannot be resolved\n" + > "----------\n"; > > runComplianceParserTest( >Index: src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java,v >retrieving revision 1.34 >diff -u -r1.34 DietRecoveryTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java 7 Oct 2005 01:04:22 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java 16 Dec 2005 17:08:49 -0000 >@@ -33,7 +33,7 @@ > public static boolean optimizeStringLiterals = false; > public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$ > static { >-// TESTS_NUMBERS = new int[] { 113 }; >+// TESTS_NUMBERS = new int[] { 2 }; > } > public static Test suite() { > return buildTestSuite(DietRecoveryTest.class); >@@ -340,9 +340,17 @@ > " public int h;\n" + > " public int[] i = {0, 1};\n" + > " public X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " class L {\n" + >+ " L() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void baz() {\n" + >+ " }\n" + >+ " }\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -599,6 +607,9 @@ > " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " new baz() {\n" + >+ " };\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -1274,9 +1285,10 @@ > String expectedDietPlusBodyUnitToString = > "public class X extends Thread {\n" + > " public X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " ;\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -1643,9 +1655,18 @@ > "public class X {\n" + > " public int h;\n" + > " public X() {\n" + >- " super();\n"+ >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " class L {\n" + >+ " public int l;\n" + >+ " L() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void baz() {\n" + >+ " }\n" + >+ " }\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -1715,9 +1736,18 @@ > "public class X {\n" + > " public int h;\n" + > " public X() {\n" + >- " super();\n"+ >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " class L {\n" + >+ " public int l;\n" + >+ " L() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void baz() {\n" + >+ " }\n" + >+ " }\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -1855,9 +1885,22 @@ > "import java.util.*;\n" + > "public class X {\n" + > " public X() {\n" + >- " super();\n"+ >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " new X() {\n" + >+ " public int h;\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void baz() {\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " }\n" + >+ " void truc() {\n" + >+ " }\n" + >+ " };\n" + > " }\n" + > "}\n"; > >@@ -1922,9 +1965,10 @@ > "public class X {\n" + > " public int h;\n" + > " public X() {\n" + >- " super();\n"+ >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -1992,9 +2036,19 @@ > "import java.util.*;\n" + > "public class X {\n" + > " public X() {\n" + >- " super();\n"+ >+ " super();\n" + > " }\n" + > " void foo() {\n" + >+ " System.out.println();\n" + >+ " class L {\n" + >+ " public int l;\n" + >+ " L() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void baz() {\n" + >+ " }\n" + >+ " }\n" + >+ " int h;\n" + > " }\n" + > " void bar() {\n" + > " }\n" + >@@ -3119,6 +3173,10 @@ > " super();\n" + > " }\n" + > " int foo() {\n" + >+ " if (true)\n" + >+ " {\n" + >+ " int x;\n" + >+ " }\n" + > " }\n" + > "}\n"; > >@@ -3162,6 +3220,9 @@ > " super();\n" + > " }\n" + > " int foo() {\n" + >+ " {\n" + >+ " int x;\n" + >+ " }\n" + > " }\n" + > "}\n"; > >@@ -4247,6 +4308,7 @@ > " super();\n" + > " }\n" + > " int foo() {\n" + >+ " new X();\n" + > " }\n" + > "}\n"; > String expectedFullUnitToString = expectedDietUnitToString; >@@ -4361,6 +4423,19 @@ > " return this;\n" + > " }\n" + > " int bar() {\n" + >+ " class Local {\n" + >+ " Local() {\n" + >+ " super();\n" + >+ " }\n" + >+ " int hello() {\n" + >+ " fo = ;\n" + >+ " }\n" + >+ " int world() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " int hello;\n" + > " }\n" + > "}\n"; > >@@ -4439,6 +4514,7 @@ > " super();\n" + > " }\n" + > " public static void main(String[] argv) {\n" + >+ " new Member().f = ;\n" + > " }\n" + > "}\n"; > >@@ -4506,11 +4582,18 @@ > " private Post[] posts;\n" + > " private int numberOfDisks;\n" + > " IncompleteHanoi() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " public Hanoi(int numberOfDisks) {\n" + > " }\n" + > " private void solve(int depth, Post start, Post free, Post end) {\n" + >+ " if ((depth == 1))\n" + >+ " moveDisk(start, end);\n" + >+ " else\n" + >+ " if ((depth > 1))\n" + >+ " {\n" + >+ " sol = ;\n" + >+ " }\n" + > " }\n" + > "}\n"; > >@@ -4552,9 +4635,12 @@ > String expectedDietPlusBodyUnitToString = > "class X {\n" + > " X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " int foo() {\n" + >+ " Vector v = new Vector();\n" + >+ " s v;\n" + >+ " addElement();\n" + > " }\n" + > "}\n"; > >@@ -4595,9 +4681,12 @@ > String expectedDietPlusBodyUnitToString = > "class X {\n" + > " X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " int foo() {\n" + >+ " Vector v = new Vector();\n" + >+ " public s v;\n" + >+ " addElement();\n" + > " }\n" + > "}\n"; > >@@ -4640,9 +4729,11 @@ > String expectedDietPlusBodyUnitToString = > "class X {\n" + > " X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " int test() {\n" + >+ " int[] i;\n" + >+ " i bar = 1;\n" + > " }\n" + > "}\n"; > >@@ -4684,6 +4775,7 @@ > " super();\n" + > " }\n" + > " int foo() {\n" + >+ " X(12);\n" + > " }\n" + > "}\n"; > >@@ -5297,6 +5389,7 @@ > " super();\n" + > " }\n" + > " void foo() {\n" + >+ " bar(this.array.length, 10, fred());\n" + > " }\n" + > " int fred() {\n" + > " }\n" + >@@ -5583,13 +5676,28 @@ > " {\n" + > " }\n" + > " X() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " public void addThreadFilter(IJavaThread thread) {\n" + >+ " restricts breakpoint;\n" + >+ " given thread;\n" + >+ " any other;\n" + >+ " specified = ;\n" + > " }\n" + > " public void removeThreadFilter(IJavaThread thread) {\n" + >+ " removes the;\n" + >+ " thread restriction;\n" + >+ " will need = (re - create);\n" + >+ " request as;\n" + >+ " does not;\n" + >+ " the removal;\n" + >+ " thread = ;\n" + > " }\n" + > " public IJavaThread[] getThreadFilters() {\n" + >+ " return the;\n" + >+ " of threads;\n" + >+ " breakpoint is;\n" + >+ " restricted to;\n" + > " }\n" + > "}\n"; > >@@ -5647,9 +5755,31 @@ > " <clinit>() {\n" + > " }\n" + > " public Bug() {\n" + >- " super();\n" + >+ " super();\n" + > " }\n" + > " public static void main(String[] arguments) {\n" + >+ " Shell shell = new Shell((((SWT.MENU | SWT.RESIZE) | SWT.TITLE) | SWT.H_SCROLL));\n" + >+ " StyledText text = new StyledText(shell, SWT.WRAP);\n" + >+ " shell.addListener(SWT.Resize, new Listener() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " public void handleEvent(Event e) {\n" + >+ " text.setBounds(shell.getClientArea());\n" + >+ " }\n" + >+ "});\n" + >+ " shell.addListener(SWT.KeyDown, new Listener() {\n" + >+ " public void handleEvent(Event e) {\n" + >+ " bold = (! bold);\n" + >+ " }\n" + >+ "});\n" + >+ " text.addLineStyleListener(new LineStyleListener() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " public void lineGetStyle(LineStyleEvent event) {\n" + >+ " }\n" + >+ "});\n" + > " }\n" + > "}\n"; > >@@ -6158,6 +6288,18 @@ > " super();\n" + > " }\n" + > " void bar() {\n" + >+ " class Inner {\n" + >+ " Inner() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " try \n" + >+ " {\n" + >+ " }\n" + >+ " catch (Exception e) {\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + > " }\n" + > "}\n"; > >@@ -6256,6 +6398,13 @@ > " super();\n" + > " }\n" + > " public void foo() {\n" + >+ " try \n" + >+ " {\n" + >+ " }\n" + >+ " catch (Exception e) {\n" + >+ " bar(\"blabla\");\n" + >+ " throw new Exception(prefix);\n" + >+ " }\n" + > " }\n" + > "}\n"; > >Index: src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java,v >retrieving revision 1.14 >diff -u -r1.14 ParserTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 23 Feb 2005 02:52:37 -0000 1.14 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 16 Dec 2005 17:08:50 -0000 >@@ -219,6 +219,11 @@ > " throws e;\n" + > " ^^^^^^\n" + > "Syntax error on token \"throws\", throw expected\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " throws e;\n" + >+ " ^\n" + >+ "e cannot be resolved\n" + > "----------\n" > ); > } >@@ -235,6 +240,11 @@ > "----------\n" + > "1. ERROR in X.java (at line 2)\n" + > " public void foo(X, Object o, String s) {\n" + >+ " ^^^^^^^^^\n" + >+ "X.Object cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " public void foo(X, Object o, String s) {\n" + > " ^\n" + > "Syntax error on token \",\", . expected\n" + > "----------\n" >@@ -461,15 +471,36 @@ > "}" > }, > "----------\n" + >- "1. ERROR in X.java (at line 6)\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " if (sourceAttachmentPath != null) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "sourceAttachmentPath cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " if (sourceAttachmentPath.isEmpty()) { && !\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "sourceAttachmentPath cannot be resolved\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + > " if (sourceAttachmentPath.isEmpty()) { && !\n" + > " ^^\n" + > "Syntax error on token \"&&\", invalid (\n" + > "----------\n" + >- "2. ERROR in X.java (at line 7)\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " if (sourceAttachmentPath.isEmpty()) { && !\n" + >+ "sourceAttachmentPath.isAbsolute()) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 7)\n" + > " sourceAttachmentPath.isAbsolute()) {\n" + > " ^\n" + > "Syntax error on token \"{\", invalid AssignmentOperator\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 10)\n" + >+ " return null;\n" + >+ " ^^^^\n" + >+ "Type mismatch: cannot convert from null to int\n" + > "----------\n" > ); > } >Index: src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java,v >retrieving revision 1.35 >diff -u -r1.35 LookupTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 14 Nov 2005 21:31:23 -0000 1.35 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 16 Dec 2005 17:08:53 -0000 >@@ -454,10 +454,20 @@ > "----------\n" + > "2. ERROR in p1\\A.java (at line 11)\n" + > " public void anotherMethod(int A) {}; \n" + >+ " ^^^^^^^^^^^^^\n" + >+ "void is an invalid type for the variable anotherMethod\n" + >+ "----------\n" + >+ "3. ERROR in p1\\A.java (at line 11)\n" + >+ " public void anotherMethod(int A) {}; \n" + > " ^\n" + > "Syntax error on token \"(\", ; expected\n" + > "----------\n" + >- "3. ERROR in p1\\A.java (at line 11)\n" + >+ "4. ERROR in p1\\A.java (at line 11)\n" + >+ " public void anotherMethod(int A) {}; \n" + >+ " ^\n" + >+ "Duplicate local variable A\n" + >+ "----------\n" + >+ "5. ERROR in p1\\A.java (at line 11)\n" + > " public void anotherMethod(int A) {}; \n" + > " ^\n" + > "Syntax error on token \")\", ; expected\n" + >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java,v >retrieving revision 1.21 >diff -u -r1.21 JavadocTest_1_5.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 4 Nov 2005 15:06:07 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 16 Dec 2005 17:08:52 -0000 >@@ -617,16 +617,16 @@ > " public class X<T, U, V extend Exception> {}" > }, > "----------\n" + >- "1. ERROR in X.java (at line 7)\n" + >- " public class X<T, U, V extend Exception> {}\n" + >- " ^^^^^^\n" + >- "Syntax error on token \"extend\", extends expected\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 7)\n" + >- " public class X<T, U, V extend Exception> {}\n" + >- " ^^^^^^\n" + >- "extend cannot be resolved to a type\n" + >- "----------\n" >+ "1. ERROR in X.java (at line 7)\n" + >+ " public class X<T, U, V extend Exception> {}\n" + >+ " ^^^^^^\n" + >+ "Syntax error on token \"extend\", extends expected\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 7)\n" + >+ " public class X<T, U, V extend Exception> {}\n" + >+ " ^^^^^^\n" + >+ "extend cannot be resolved to a type\n" + >+ "----------\n" > ); > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java,v >retrieving revision 1.46 >diff -u -r1.46 Compliance_1_5.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 21 Nov 2005 23:31:30 -0000 1.46 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 16 Dec 2005 17:08:51 -0000 >@@ -2958,6 +2958,11 @@ > "----------\n" + > "1. ERROR in X.java (at line 3)\n" + > " Object enum = null;\n" + >+ " ^^^^^^\n" + >+ "Object cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Object enum = null;\n" + > " ^^^^\n" + > "Syntax error on token \"enum\", delete this token\n" + > "----------\n"); >Index: src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java >=================================================================== >RCS file: src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java >diff -N src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,5455 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.core.tests.compiler.parser; >+ >+import java.util.Locale; >+ >+import junit.framework.Test; >+ >+import org.eclipse.jdt.core.tests.util.AbstractCompilerTest; >+import org.eclipse.jdt.core.tests.util.Util; >+import org.eclipse.jdt.internal.compiler.CompilationResult; >+import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; >+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; >+import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; >+import org.eclipse.jdt.internal.compiler.parser.Parser; >+import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; >+import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; >+ >+public class StatementRecoveryTest extends AbstractCompilerTest { >+ public static final boolean ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY = true; >+ >+ public static boolean optimizeStringLiterals = false; >+ public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$ >+ >+static { >+// TESTS_NAMES = new String[] { "test0037"}; >+// TESTS_RANGE = new int[] {10, 20}; >+} >+public static Test suite() { >+ return buildTestSuite(StatementRecoveryTest.class); >+} >+public StatementRecoveryTest(String testName){ >+ super(testName); >+} >+ >+public void checkParse( >+ char[] source, >+ String expectedDietUnitToString, >+ String expectedDietWithStatementRecoveryUnitToString, >+ String expectedDietPlusBodyUnitToString, >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ String expectedFullUnitToString, >+ String expectedFullWithStatementRecoveryUnitToString, >+ String testName) { >+ >+ /* using regular parser in DIET mode */ >+ if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){ >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ parser.statementRecoveryEnabled = false; >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedDietUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit diet structure" + testName, >+ expectedDietUnitToString, >+ computedUnitToString); >+ } >+ /* using regular parser in DIET mode and statementRecoveryEnabled */ >+ if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){ >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedDietWithStatementRecoveryUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit diet structure with statement recovery enabled" + testName, >+ expectedDietWithStatementRecoveryUnitToString, >+ computedUnitToString); >+ } >+ /* using regular parser in DIET mode + getMethodBodies */ >+ if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){ >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ parser.statementRecoveryEnabled = false; >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedDietUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit diet structure" + testName, >+ expectedDietUnitToString, >+ computedUnitToString); >+ if (computedUnit.types != null) { >+ for (int i = computedUnit.types.length; --i >= 0;){ >+ computedUnit.types[i].parseMethod(parser, computedUnit); >+ } >+ } >+ computedUnitToString = computedUnit.toString(); >+ if (!expectedDietPlusBodyUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ >+ assertEquals( >+ "Invalid unit diet+body structure" + testName, >+ expectedDietPlusBodyUnitToString, >+ computedUnitToString); >+ } >+ /* using regular parser in DIET mode + getMethodBodies and statementRecoveryEnabled */ >+ { >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedDietWithStatementRecoveryUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit diet structure" + testName, >+ expectedDietWithStatementRecoveryUnitToString, >+ computedUnitToString); >+ if (computedUnit.types != null) { >+ for (int i = computedUnit.types.length; --i >= 0;){ >+ computedUnit.types[i].parseMethod(parser, computedUnit); >+ } >+ } >+ computedUnitToString = computedUnit.toString(); >+ if (!expectedDietPlusBodyWithStatementRecoveryUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ >+ assertEquals( >+ "Invalid unit diet+body structure with statement recovery enabled" + testName, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ computedUnitToString); >+ } >+ /* using regular parser in FULL mode */ >+ if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){ >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ parser.statementRecoveryEnabled = false; >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedFullUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit full structure" + testName, >+ expectedFullUnitToString, >+ computedUnitToString); >+ >+ } >+ /* using regular parser in FULL mode and statementRecoveryEnabled */ >+ if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){ >+ Parser parser = >+ new Parser( >+ new ProblemReporter( >+ DefaultErrorHandlingPolicies.proceedWithAllProblems(), >+ new CompilerOptions(getCompilerOptions()), >+ new DefaultProblemFactory(Locale.getDefault())), >+ optimizeStringLiterals); >+ >+ ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null); >+ CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); >+ >+ CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult); >+ String computedUnitToString = computedUnit.toString(); >+ if (!expectedFullWithStatementRecoveryUnitToString.equals(computedUnitToString)){ >+ System.out.println(Util.displayString(computedUnitToString)); >+ } >+ assertEquals( >+ "Invalid unit full structure with statement recovery enabled" + testName, >+ expectedFullWithStatementRecoveryUnitToString, >+ computedUnitToString); >+ >+ } >+} >+ >+public void test0001() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String expectedFullUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedFullUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0002() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0003() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0004() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0005() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0006() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0007() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0008() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0009() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0010() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() {} \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0011() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() {} \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0012() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() {} \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0013() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() {} \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " class Y { \n" >+ + " void foo() {} \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " class Y {\n" + >+ " Y() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0014() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0015() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0016() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0017() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0018() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0019() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0020() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0021() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() {} \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietPlusBodyUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0022() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() {} \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0023() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void bar() {} \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0024() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void bar() {} \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void bar() {} \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0025() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0026() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0027() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0028() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0029() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0030() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0031() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0032() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " bar(new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " # \n" >+ + " System.out.println(); \n" >+ + " if(true) { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }); \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " bar(new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " System.out.println();\n" + >+ " if (true)\n" + >+ " {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "});\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0033() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " class Z { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " } \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " class Z {\n" + >+ " Z() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0034() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " # \n" >+ + " new Object() { \n" >+ + " void foo() { \n" >+ + " System.out.println(); \n" >+ + " } \n" >+ + " }; \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " new Object() {\n" + >+ " () {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " };\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0035() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " bar(\\u0029 \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " bar();\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0036() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " if(true) { \n" >+ + " foo(); \n" >+ + " } \n" >+ + " for(; \n" >+ + " if(true) { \n" >+ + " foo(); \n" >+ + " } \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " if (true)\n" + >+ " {\n" + >+ " foo();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0037() { >+ >+ String s = >+ "package a; \n" >+ + "public class X { \n" >+ + " void foo() { \n" >+ + " if() { \n" >+ + " foo(); \n" >+ + " } \n" >+ + " } \n" >+ + "} \n"; >+ >+ String expectedDietUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " if ()\n" + >+ " {\n" + >+ " foo();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+public void test0038() { >+ String s = >+ "package p1; \n"+ >+ "public class A { \n"+ >+ " public interface B { \n"+ >+ " public abstract void aMethod (int A); \n"+ >+ " public interface C { \n"+ >+ " public abstract void anotherMethod(int A);\n"+ >+ " } \n"+ >+ " } \n"+ >+ " public class aClass implements B, B.C { \n"+ >+ " public void aMethod (int A) { \n"+ >+ " public void anotherMethod(int A) {}; \n"+ >+ " } \n"+ >+ " } \n"+ >+ " public static void main (String argv[]) { \n"+ >+ " System.out.println(\"SUCCESS\"); \n"+ >+ " } \n"+ >+ "}"; >+ >+ String expectedDietUnitToString = >+ "package p1;\n" + >+ "public class A {\n" + >+ " public interface B {\n" + >+ " public interface C {\n" + >+ " public abstract void anotherMethod(int A);\n" + >+ " }\n" + >+ " public abstract void aMethod(int A);\n" + >+ " }\n" + >+ " public class aClass implements B, B.C {\n" + >+ " public aClass() {\n" + >+ " }\n" + >+ " public void aMethod(int A) {\n" + >+ " }\n" + >+ " }\n" + >+ " public A() {\n" + >+ " }\n" + >+ " public static void main(String[] argv) {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedDietPlusBodyUnitToString = >+ "package a;\n" + >+ "public class X {\n" + >+ " public X() {\n" + >+ " super();\n" + >+ " }\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+ "package p1;\n" + >+ "public class A {\n" + >+ " public interface B {\n" + >+ " public interface C {\n" + >+ " public abstract void anotherMethod(int A);\n" + >+ " }\n" + >+ " public abstract void aMethod(int A);\n" + >+ " }\n" + >+ " public class aClass implements B, B.C {\n" + >+ " public aClass() {\n" + >+ " super();\n" + >+ " }\n" + >+ " public void aMethod(int A) {\n" + >+ " public void anotherMethod;\n" + >+ " int A;\n" + >+ " ;\n" + >+ " }\n" + >+ " }\n" + >+ " public A() {\n" + >+ " super();\n" + >+ " }\n" + >+ " public static void main(String[] argv) {\n" + >+ " System.out.println(\"SUCCESS\");\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedFullUnitToString = >+ expectedDietUnitToString; >+ >+ String expectedFullWithStatementRecoveryUnitToString = >+ expectedDietUnitToString; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedDietUnitToString, >+ expectedDietWithStatementRecoveryUnitToString, >+ expectedDietPlusBodyUnitToString, >+ expectedDietPlusBodyWithStatementRecoveryUnitToString, >+ expectedFullUnitToString, >+ expectedFullWithStatementRecoveryUnitToString, >+ testName); >+} >+//// incorrect statement >+//public void test0002() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// try statement with incorrect statements >+//public void test0003() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " try { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } catch(Exception e) { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " try \n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " catch (Exception e)\n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// try statement with incorrect statements >+//public void test0004() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " try { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } finally { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " try \n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " finally\n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect try statement with incorrect statements >+//public void test0005() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " try { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } finally \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " try \n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " finally\n" + >+// " {\n" + >+// " }\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect try statement with incorrect statements >+//public void test0006() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " try { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } catch (Exception e) \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " try \n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " finally\n" + >+// " {\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect try statement with incorrect statements >+//public void test0007() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " try { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " # \n" >+// + " catch (Exception e) { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " try \n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " finally\n" + >+// " {\n" + >+// " }\n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous type statement with incorrect statements >+//public void test0008() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){}; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous type statement with incorrect statements >+//public void test0009() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " void foo() {} \n" >+// + " }; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect anonymous type statement with incorrect statements >+//public void test0010() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " void foo() {} \n" >+// + " } \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous type statement with incorrect statements >+//public void test0011() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo() {} \n" >+// + " }; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// method with incorrect statements >+//public void test0012() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " }; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// method with incorrect statements >+//public void test0013() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " }; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect statement at first position >+//public void test0014() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect method with incorrect statements >+//public void test0015() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo( { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " }; \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect method with incorrect statements >+//public void test0016() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo( { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// incorrect method with incorrect statements >+//public void test0017() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " # \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// method without right brace and with incorrect statements >+//public void test0018() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " new Object(){ \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " void bar() { \n" >+// + " System.out.println(); \n" >+// + " foo( \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " System.out.println();\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " };\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// local type inside block statements >+//public void test0019() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " { \n" >+// + " class Y { \n" >+// + " } \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " {\n" + >+// " class Y {\n" + >+// " Y() {\n" + >+// " super();\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// expectedDietPlusBodyUnitToString; >+// >+// String expectedFullUnitToString = >+// expectedDietPlusBodyUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// local type inside block statements >+//public void test0020() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " { \n" >+// + " class Y { \n" >+// + " } \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " {\n" + >+// " class Y {\n" + >+// " Y() {\n" + >+// " super();\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// local type inside block statements >+//public void test0021() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " { \n" >+// + " System.out.println(); \n" >+// + " class Y { \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " {\n" + >+// " System.out.println();\n" + >+// " class Y {\n" + >+// " Y() {\n" + >+// " super();\n" + >+// " }\n" + >+// " }\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous types inside message send >+//public void test0022() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " bar( \n" >+// + " new Object(){}, \n" >+// + " var, \n" >+// + " new Object(){} \n" >+// + " ); \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " bar(new Object() {\n" + >+// "}, var, new Object() {\n" + >+// "});\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// expectedDietPlusBodyUnitToString; >+// >+// String expectedFullUnitToString = >+// expectedDietPlusBodyUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous types inside message send >+//public void test0023() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " bar( \n" >+// + " new Object(){}, \n" >+// + " var, \n" >+// + " new Object(){} \n" >+// + " ); \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " bar(new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// "}, var, new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// "});\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//// anonymous types inside message send >+//public void test0024() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " # \n" >+// + " System.out.println(); \n" >+// + " bar( \n" >+// + " new Object(){}, \n" >+// + " var, \n" >+// + " new Object(){} \n" >+// + " ) \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n";; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " };\n" + >+// " new Object() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// " };\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0025() { >+// >+// String s = >+// "package a; \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " bar(new Object1(){ \n" >+// + " new Object2(){}, \n" >+// + " var, \n" >+// + " new Object3(){} \n" >+// + " ); \n" >+// + " System.out.println(); \n" >+// + " } \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " bar(new Object1() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// "}, var, new Object3() {\n" + >+// " () {\n" + >+// " super();\n" + >+// " }\n" + >+// "});\n" + >+// " System.out.println();\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// "package a;\n" + >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0026() { >+// >+// String s = >+// "package a; \n" >+// + "import java.lang.*; \n" >+// + "import java.util.*; \n" >+// + " \n" >+// + "public class X { \n" >+// + " void foo() { \n" >+// + " System.out.println(); \n" >+// + " \n" >+// + " class L { \n" >+// + " void baz(){} \n" >+// + " } \n" >+// + " \n" >+// + " public int h; \n" >+// + " public int[] i = { 0, 1 }; \n" >+// + " \n" >+// + " void bar(){ \n" >+// + " void truc(){ \n" >+// + "} \n"; >+// >+// String expectedDietUnitToString = >+// "package a;\n" + >+// "import java.lang.*;\n" + >+// "import java.util.*;\n" + >+// "public class X {\n" + >+// " public int h;\n" + >+// " public int[] i = {0, 1};\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " }\n" + >+// " void truc() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package a;\n" + >+// "import java.lang.*;\n" + >+// "import java.util.*;\n" + >+// "public class X {\n" + >+// " public int h;\n" + >+// " public int[] i = {0, 1};\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " }\n" + >+// " void truc() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "package a;\n" + >+// "import java.lang.*;\n" + >+// "import java.util.*;\n" + >+// "public class X {\n" + >+// " public int h;\n" + >+// " public int[] i = {0, 1};\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " System.out.println();\n" + >+// " class L {\n" + >+// " L() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void baz() {\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " }\n" + >+// " void truc() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0027() { >+// >+// String s = >+// "public class X { \n"+ >+// " int foo(){ \n"+ >+// " if(true){ \n"+ >+// " int x; \n"+ >+// " \n"; >+// >+// String expectedDietUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " int foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " int foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " int foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0028() { >+// >+// String s = >+// "import ;\n"+ >+// "class X {\n"+ >+// "}\n"+ >+// "- public void addThreadFilter(IJavaThread thread) - restricts breakpoint to \n"+ >+// "given thread and any other previously specified threads\n"+ >+// "- public void removeThreadFilter(IJavaThread thread)- removes the given thread \n"+ >+// "restriction (will need to re-create breakpoint request as JDI does not support \n"+ >+// "the removal of thread filters)\n"+ >+// "- public IJavaThread[] getThreadFilters() - return the set of threads this \n"+ >+// "breakpoint is currently restricted to\n"; >+// >+// String expectedDietUnitToString = >+// "class X {\n" + >+// " {\n" + >+// " }\n" + >+// " X() {\n" + >+// " }\n" + >+// " public void addThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public void removeThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public IJavaThread[] getThreadFilters() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "class X {\n" + >+// " {\n" + >+// " }\n" + >+// " X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " public void addThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public void removeThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public IJavaThread[] getThreadFilters() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "class X {\n" + >+// " {\n" + >+// " }\n" + >+// " X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " public void addThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public void removeThreadFilter(IJavaThread thread) {\n" + >+// " }\n" + >+// " public IJavaThread[] getThreadFilters() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0029() { >+// >+// String s = >+// "public class X {\n" + >+// " void bar(){\n" + >+// " #\n" + >+// " class Inner {\n" + >+// " void foo() {\n" + >+// " try {\n" + >+// " } catch(Exception e) {\n" + >+// " e.\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// "}"; >+// >+// String expectedDietUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " class Inner {\n" + >+// " Inner() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " try \n" + >+// " {\n" + >+// " }\n" + >+// " catch (Exception e)\n" + >+// " {\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+//public void test0030() { >+// >+// String s = >+// "package p; \n" + >+// "/** \n" + >+// " * 1FLHNKX \n" + >+// " */ \n" + >+// "public class ATB { \n" + >+// " void foo() { \n" + >+// " if(true) \n" + >+// " System.out.println(\"true\"); \n" + >+// " else \n" + >+// " (System.out.println(\"true\")); \n" + >+// " } \n" + >+// "} "; >+// >+// String expectedDietUnitToString = >+// "package p;\n" + >+// "public class ATB {\n" + >+// " public ATB() {\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietWithStatementRecoveryUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedDietPlusBodyUnitToString = >+// "package p;\n" + >+// "public class ATB {\n" + >+// " public ATB() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedDietPlusBodyWithStatementRecoveryUnitToString = >+// "public class X {\n" + >+// " public X() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void bar() {\n" + >+// " class Inner {\n" + >+// " Inner() {\n" + >+// " super();\n" + >+// " }\n" + >+// " void foo() {\n" + >+// " try \n" + >+// " {\n" + >+// " }\n" + >+// " catch (Exception e)\n" + >+// " {\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// " }\n" + >+// "}\n"; >+// >+// String expectedFullUnitToString = >+// expectedDietUnitToString; >+// >+// String expectedFullWithStatementRecoveryUnitToString = >+// expectedFullUnitToString; >+// >+// String testName = "<test>"; >+// checkParse( >+// s.toCharArray(), >+// expectedDietUnitToString, >+// expectedDietWithStatementRecoveryUnitToString, >+// expectedDietPlusBodyUnitToString, >+// expectedDietPlusBodyWithStatementRecoveryUnitToString, >+// expectedFullUnitToString, >+// expectedFullWithStatementRecoveryUnitToString, >+// testName); >+//} >+} >#P org.eclipse.jdt.core.tests >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java,v >retrieving revision 1.20 >diff -u -r1.20 FromJikesPRs.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java 30 May 2005 15:53:50 -0000 1.20 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java 16 Dec 2005 17:08:55 -0000 >@@ -240,6 +240,11 @@ > "----------\n" + > "1. ERROR in Test.java (at line 4)\n" + > " 3+4; \n" + >+ " ^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "2. ERROR in Test.java (at line 4)\n" + >+ " 3+4; \n" + > " ^\n" + > "Syntax error on token \"+\", invalid AssignmentOperator\n" + > "----------\n"); >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v >retrieving revision 1.278 >diff -u -r1.278 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 10 Nov 2005 15:43:43 -0000 1.278 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 16 Dec 2005 17:08:55 -0000 >@@ -1035,9 +1035,10 @@ > } > // Use this static initializer to specify subset for tests > // All specified tests which does not belong to the class are skipped... >-//static { >+static { > // TESTS_NUMBERS = new int[] { 437 }; >-//} >+// TESTS_NAMES = new String[]{ "test123" }; >+} > public static Test suite() { > return buildTestSuite(testClass()); > } >@@ -1646,6 +1647,16 @@ > " --a %= 4; \n" + > " ^^\n" + > "Syntax error on token \"--\", delete this token\n" + >+ "----------\n" + >+ "8. ERROR in p\\X.java (at line 28)\n" + >+ " a-- %= 4; \n" + >+ " ^^^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "9. ERROR in p\\X.java (at line 31)\n" + >+ " return 0;\n" + >+ " ^^^^^^^^\n" + >+ "Void methods cannot return a value\n" + > "----------\n" > ); > } >@@ -2576,10 +2587,20 @@ > "----------\n" + > "1. ERROR in p\\X.java (at line 4)\n" + > " if (args.length == 0) (System.out.println(\"if is true\"));\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "2. ERROR in p\\X.java (at line 4)\n" + >+ " if (args.length == 0) (System.out.println(\"if is true\"));\n" + > " ^\n" + > "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + > "----------\n" + >- "2. ERROR in p\\X.java (at line 5)\n" + >+ "3. ERROR in p\\X.java (at line 5)\n" + >+ " else (System.out.println(\"if is false\"));\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "4. ERROR in p\\X.java (at line 5)\n" + > " else (System.out.println(\"if is false\"));\n" + > " ^\n" + > "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + >@@ -3708,14 +3729,29 @@ > "3. ERROR in p\\Test.java (at line 8)\n" + > " void bar() { 1; }\n" + > " ^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "4. ERROR in p\\Test.java (at line 8)\n" + >+ " void bar() { 1; }\n" + >+ " ^\n" + > "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + > "----------\n" + >- "4. ERROR in p\\Test.java (at line 13)\n" + >+ "5. ERROR in p\\Test.java (at line 13)\n" + > " int foo();\n" + > " ^^^^^\n" + > "This method requires a body instead of a semicolon\n" + > "----------\n" + >- "5. ERROR in p\\Test.java (at line 18)\n" + >+ "6. ERROR in p\\Test.java (at line 16)\n" + >+ " void foo();\n" + >+ " ^^^^^\n" + >+ "This method requires a body instead of a semicolon\n" + >+ "----------\n" + >+ "7. ERROR in p\\Test.java (at line 18)\n" + >+ " return new Object(){ public void run() { 1; };};}\n" + >+ " ^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "8. ERROR in p\\Test.java (at line 18)\n" + > " return new Object(){ public void run() { 1; };};}\n" + > " ^\n" + > "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + >@@ -4599,6 +4635,11 @@ > "----------\n" + > "1. ERROR in p\\Example3.java (at line 10)\n" + > " int myVal = condition ? x = 7 : x = 3;\n" + >+ " ^^^^^^^^^\n" + >+ "condition cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in p\\Example3.java (at line 10)\n" + >+ " int myVal = condition ? x = 7 : x = 3;\n" + > " ^\n" + > "Syntax error on token \"=\", != expected\n" + > "----------\n" >@@ -4731,15 +4772,30 @@ > "----------\n" + > "1. ERROR in p\\NA.java (at line 7)\n" + > " (new Class1).run();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Class1 cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in p\\NA.java (at line 7)\n" + >+ " (new Class1).run();\n" + > " ^^^\n" + > "Syntax error on token \"new\", delete this token\n" + > "----------\n" + >- "2. ERROR in p\\NA.java (at line 8)\n" + >+ "3. ERROR in p\\NA.java (at line 8)\n" + >+ " (new Class2).run();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Class2 cannot be resolved\n" + >+ "----------\n" + >+ "4. ERROR in p\\NA.java (at line 8)\n" + > " (new Class2).run();\n" + > " ^^^\n" + > "Syntax error on token \"new\", delete this token\n" + > "----------\n" + >- "3. ERROR in p\\NA.java (at line 9)\n" + >+ "5. ERROR in p\\NA.java (at line 9)\n" + >+ " (new Class3).run();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Class3 cannot be resolved\n" + >+ "----------\n" + >+ "6. ERROR in p\\NA.java (at line 9)\n" + > " (new Class3).run();\n" + > " ^^^\n" + > "Syntax error on token \"new\", delete this token\n" + >@@ -4932,12 +4988,22 @@ > "}", > }, > "----------\n" + >- "1. ERROR in p\\AJA.java (at line 11)\n" + >+ "1. ERROR in p\\AJA.java (at line 7)\n" + >+ " Object item = new String() {\n" + >+ " ^^^^^^\n" + >+ "An anonymous class cannot subclass the final class String\n" + >+ "----------\n" + >+ "2. ERROR in p\\AJA.java (at line 11)\n" + > " }.;\n" + > " ^\n" + > "Syntax error on token \";\", delete this token\n" + > "----------\n" + >- "2. ERROR in p\\AJA.java (at line 12)\n" + >+ "3. ERROR in p\\AJA.java (at line 12)\n" + >+ " item.\n" + >+ " ^^^^\n" + >+ "item cannot be resolved or is not a field\n" + >+ "----------\n" + >+ "4. ERROR in p\\AJA.java (at line 12)\n" + > " item.\n" + > " ^\n" + > "Syntax error on token \".\", ; expected\n" + >@@ -5114,6 +5180,11 @@ > "----------\n" + > "1. ERROR in p\\AEA.java (at line 37)\n" + > " a TopLevelLocal.;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in p\\AEA.java (at line 37)\n" + >+ " a TopLevelLocal.;\n" + > " ^\n" + > "Syntax error on token \".\", delete this token\n" + > "----------\n" >@@ -6514,6 +6585,11 @@ > "----------\n" + > "1. ERROR in p\\ATB.java (at line 10)\n" + > " (System.out.println(\"true\"));\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "The left-hand side of an assignment must be a variable\n" + >+ "----------\n" + >+ "2. ERROR in p\\ATB.java (at line 10)\n" + >+ " (System.out.println(\"true\"));\n" + > " ^\n" + > "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + > "----------\n" >@@ -12937,10 +13013,20 @@ > "----------\n" + > "1. ERROR in X.java (at line 4)\n" + > " Object o2 = ((Object)) new X(); \n" + >+ " ^^^^^^^^^^\n" + >+ "Object cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " Object o2 = ((Object)) new X(); \n" + > " ^\n" + > "Syntax error, insert \";\" to complete LocalVariableDeclarationStatement\n" + > "----------\n" + >- "2. ERROR in X.java (at line 5)\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " Object o3 = (((Object))) new X(); \n" + >+ " ^^^^^^^^^^^^\n" + >+ "Object cannot be resolved\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + > " Object o3 = (((Object))) new X(); \n" + > " ^\n" + > "Syntax error, insert \";\" to complete LocalVariableDeclarationStatement\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 42253
: 31884 |
33154
|
34338