Fix some warnings
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/bdd/steps/ParsingSteps.java b/javaparser-testing/src/test/java/com/github/javaparser/bdd/steps/ParsingSteps.java
index fe6d484..b75fedc 100644
--- a/javaparser-testing/src/test/java/com/github/javaparser/bdd/steps/ParsingSteps.java
+++ b/javaparser-testing/src/test/java/com/github/javaparser/bdd/steps/ParsingSteps.java
@@ -203,8 +203,8 @@
public void thenMethodReferenceInStatementInMethodInClassIsScope(int statementPosition, int methodPosition,
int classPosition, String expectedName) {
ExpressionStmt statementUnderTest = (ExpressionStmt) getStatementInMethodInClass(statementPosition, methodPosition, classPosition);
- assertEquals(1, statementUnderTest.getNodesByType(MethodReferenceExpr.class).size());
- MethodReferenceExpr methodReferenceUnderTest = statementUnderTest.getNodesByType(MethodReferenceExpr.class).get(0);
+ assertEquals(1, statementUnderTest.getChildNodesByType(MethodReferenceExpr.class).size());
+ MethodReferenceExpr methodReferenceUnderTest = statementUnderTest.getChildNodesByType(MethodReferenceExpr.class).get(0);
assertThat(methodReferenceUnderTest.getScope().toString(), is(expectedName));
}
@@ -212,8 +212,8 @@
public void thenMethodReferenceInStatementInMethodInClassIdentifierIsCompareByAge(int statementPosition, int methodPosition,
int classPosition, String expectedName) {
Statement statementUnderTest = getStatementInMethodInClass(statementPosition, methodPosition, classPosition);
- assertEquals(1, statementUnderTest.getNodesByType(MethodReferenceExpr.class).size());
- MethodReferenceExpr methodReferenceUnderTest = statementUnderTest.getNodesByType(MethodReferenceExpr.class).get(0);
+ assertEquals(1, statementUnderTest.getChildNodesByType(MethodReferenceExpr.class).size());
+ MethodReferenceExpr methodReferenceUnderTest = statementUnderTest.getChildNodesByType(MethodReferenceExpr.class).get(0);
assertThat(methodReferenceUnderTest.getIdentifier(), is(expectedName));
}
@@ -335,7 +335,7 @@
private void setSelectedNodeFromCompilationUnit(Class<? extends Node> nodeType) {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
- List<? extends Node> nodes = compilationUnit.getNodesByType(nodeType);
+ List<? extends Node> nodes = compilationUnit.getChildNodesByType(nodeType);
if (nodes.size() != 1) {
throw new RuntimeException(format("Exactly one %s expected", nodeType.getSimpleName()));
}
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/printer/PrettyPrinterTest.java b/javaparser-testing/src/test/java/com/github/javaparser/printer/PrettyPrinterTest.java
index cb6880e..a4e7660 100644
--- a/javaparser-testing/src/test/java/com/github/javaparser/printer/PrettyPrinterTest.java
+++ b/javaparser-testing/src/test/java/com/github/javaparser/printer/PrettyPrinterTest.java
@@ -47,12 +47,12 @@
private String prettyPrintField(String code) {
CompilationUnit cu = JavaParser.parse(code);
- return new PrettyPrinter().print(cu.getNodesByType(FieldDeclaration.class).get(0));
+ return new PrettyPrinter().print(cu.getChildNodesByType(FieldDeclaration.class).get(0));
}
private String prettyPrintVar(String code) {
CompilationUnit cu = JavaParser.parse(code);
- return new PrettyPrinter().print(cu.getNodesByType(VariableDeclarationExpr.class).get(0));
+ return new PrettyPrinter().print(cu.getChildNodesByType(VariableDeclarationExpr.class).get(0));
}
@Test
@@ -96,7 +96,7 @@
private String prettyPrintConfigurable(String code) {
CompilationUnit cu = JavaParser.parse(code);
PrettyPrinter printer = new PrettyPrinter(new PrettyPrinterConfiguration().setVisitorFactory(TestVisitor::new));
- return printer.print(cu.getNodesByType(ClassOrInterfaceDeclaration.class).get(0));
+ return printer.print(cu.getChildNodesByType(ClassOrInterfaceDeclaration.class).get(0));
}
@Test