Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 455986 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (+23 lines)
Lines 92-97 Link Here
92
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
92
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
93
import org.eclipse.jdt.core.dom.Statement;
93
import org.eclipse.jdt.core.dom.Statement;
94
import org.eclipse.jdt.core.dom.StringLiteral;
94
import org.eclipse.jdt.core.dom.StringLiteral;
95
import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
95
import org.eclipse.jdt.core.dom.SuperFieldAccess;
96
import org.eclipse.jdt.core.dom.SuperFieldAccess;
96
import org.eclipse.jdt.core.dom.SuperMethodInvocation;
97
import org.eclipse.jdt.core.dom.SuperMethodInvocation;
97
import org.eclipse.jdt.core.dom.SwitchCase;
98
import org.eclipse.jdt.core.dom.SwitchCase;
Lines 10646-10649 Link Here
10646
		Object o = resultCompilationUnit.types().get(0);
10647
		Object o = resultCompilationUnit.types().get(0);
10647
		assertEquals(o.toString(), source);
10648
		assertEquals(o.toString(), source);
10648
	}
10649
	}
10650
	/**
10651
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=455986
10652
	 */
10653
	public void test0723() {
10654
		String src = "super();";
10655
		char[] source = src.toCharArray();
10656
		ASTParser parser = ASTParser.newParser(getJLS3());
10657
		parser.setKind (ASTParser.K_STATEMENTS);
10658
		parser.setIgnoreMethodBodies(true);
10659
		parser.setSource (source);
10660
		ASTNode result = parser.createAST (null);
10661
		assertNotNull("no result", result);
10662
		assertEquals("Wrong type", ASTNode.BLOCK, result.getNodeType());
10663
		Block block = (Block) result;
10664
		List statements = block.statements();
10665
		assertNotNull("No statements", statements);
10666
		assertEquals("Wrong size", 1, statements.size());
10667
		final ASTNode node = (ASTNode) statements.get(0);
10668
		assertEquals("Not a super constructor call", ASTNode.SUPER_CONSTRUCTOR_INVOCATION, node.getNodeType());
10669
		SuperConstructorInvocation statement = (SuperConstructorInvocation) node;
10670
		checkSourceRange(statement, "super();", source);
10671
	}
10649
}
10672
}

Return to bug 455986