Java Code Examples for spoon.reflect.code.CtStatement#getPath()

The following examples show how to use spoon.reflect.code.CtStatement#getPath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AstPathTest.java    From coming with MIT License 5 votes vote down vote up
private void retrievePathOfStmt(CtType<?> ast) {
	for (CtMethod method : ast.getAllMethods()) {

		CtPath path = method.getPath();
		assertNotNull(path);

		for (CtStatement stmt : method.getBody().getStatements()) {
			path = stmt.getPath();
			assertNotNull(path);
		}

	}
}
 
Example 2
Source File: TreeTest.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
private void pathOfStmt(CtType<?> ast) {
	for (CtMethod method : ast.getAllMethods()) {

		CtPath path = method.getPath();
		assertNotNull(path);

		for (CtStatement stmt : method.getBody().getStatements()) {
			path = stmt.getPath();
			assertNotNull(path);
		}

	}
}