Lines 122-128
Link Here
|
122 |
static { |
122 |
static { |
123 |
// TESTS_NAMES = new String[] {"test0602"}; |
123 |
// TESTS_NAMES = new String[] {"test0602"}; |
124 |
// TESTS_RANGE = new int[] { 721, -1 }; |
124 |
// TESTS_RANGE = new int[] { 721, -1 }; |
125 |
// TESTS_NUMBERS = new int[] { 721, 722, 723, 724, 725 }; |
125 |
// TESTS_NUMBERS = new int[] { 723, 724 }; |
126 |
} |
126 |
} |
127 |
public static Test suite() { |
127 |
public static Test suite() { |
128 |
return buildModelTestSuite(ASTConverterTestAST4_2.class); |
128 |
return buildModelTestSuite(ASTConverterTestAST4_2.class); |
Lines 10641-10644
Link Here
|
10641 |
} |
10641 |
} |
10642 |
} |
10642 |
} |
10643 |
} |
10643 |
} |
|
|
10644 |
/** |
10645 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=347396 |
10646 |
*/ |
10647 |
public void test0723() { |
10648 |
ASTParser parser = ASTParser.newParser(AST.JLS4); |
10649 |
parser.setKind (ASTParser.K_STATEMENTS); |
10650 |
String src = "int j;\nfor {};\nj=1000;"; |
10651 |
char[] source = src.toCharArray(); |
10652 |
parser.setStatementsRecovery(true); |
10653 |
parser.setSource(source); |
10654 |
ASTNode result = parser.createAST (null); |
10655 |
assertNotNull("no result", result); |
10656 |
assertEquals("Wrong type", ASTNode.BLOCK, result.getNodeType()); |
10657 |
Block block = (Block) result; |
10658 |
List statements = block.statements(); |
10659 |
assertNotNull("No statements", statements); |
10660 |
assertEquals("Wrong size", 3, statements.size()); |
10661 |
assertFalse(isRecovered((ASTNode) statements.get(0))); |
10662 |
assertFalse(isRecovered((ASTNode) statements.get(1))); |
10663 |
assertFalse(isRecovered((ASTNode) statements.get(2))); |
10664 |
} |
10665 |
|
10666 |
/** |
10667 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=347396 |
10668 |
*/ |
10669 |
public void test0724() { |
10670 |
ASTParser parser = ASTParser.newParser(AST.JLS4); |
10671 |
parser.setKind (ASTParser.K_COMPILATION_UNIT); |
10672 |
String src = "public class X { void foo() {int j;\nfor {};\nj=1000;}}"; |
10673 |
char[] source = src.toCharArray(); |
10674 |
parser.setStatementsRecovery(true); |
10675 |
parser.setSource(source); |
10676 |
ASTNode result = parser.createAST (null); |
10677 |
assertNotNull("no result", result); |
10678 |
assertEquals("Wrong type", ASTNode.COMPILATION_UNIT, result.getNodeType()); |
10679 |
Block block = ((MethodDeclaration) getASTNode((CompilationUnit) result, 0, 0)).getBody(); |
10680 |
List statements = block.statements(); |
10681 |
assertNotNull("No statements", statements); |
10682 |
assertEquals("Wrong size", 3, statements.size()); |
10683 |
assertFalse(isRecovered((ASTNode) statements.get(0))); |
10684 |
assertFalse(isRecovered((ASTNode) statements.get(1))); |
10685 |
assertFalse(isRecovered((ASTNode) statements.get(2))); |
10686 |
} |
10644 |
} |
10687 |
} |