From d5445d7ea569102f4d26bb54958d169b0e9393ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 23 Aug 2020 20:28:09 +0200 Subject: [PATCH] Normalize captures in tree dump --- .../lang/java/types/TypesTreeDumpTest.java | 26 +- .../lang/java/types/IteratorBasedNStream.txt | 446 +++++++++--------- .../pmd/lang/ast/test/NodePrinters.kt | 2 +- .../pmd/test/BaseTextComparisonTest.kt | 11 +- 4 files changed, 255 insertions(+), 230 deletions(-) diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java index 54a31e2399..e5ed0279f8 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java @@ -14,6 +14,9 @@ import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; +import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; +import net.sourceforge.pmd.lang.java.ast.InvocationNode; import net.sourceforge.pmd.lang.java.ast.TypeNode; import net.sourceforge.pmd.lang.rule.xpath.Attribute; @@ -27,7 +30,7 @@ public class TypesTreeDumpTest extends BaseTreeDumpTest { } @Override - public BaseParsingHelper getParser() { + public @NonNull BaseParsingHelper getParser() { return JavaParsingHelper.WITH_PROCESSING.withResourceContext(getClass()); } @@ -36,6 +39,12 @@ public class TypesTreeDumpTest extends BaseTreeDumpTest { doTest("IteratorBasedNStream"); } + @Override + protected @NonNull String normalize(@NonNull String str) { + return super.normalize(str) + // capture IDs are unstable from run to run + .replaceAll("capture#\\d+", "capture#..."); + } /** * Only prints the type of type nodes @@ -47,6 +56,21 @@ public class TypesTreeDumpTest extends BaseTreeDumpTest { if (node instanceof TypeNode) { result.add(new AttributeInfo("TypeMirror", ((TypeNode) node).getTypeMirror().toString())); } + + if (node instanceof InvocationNode) { + InvocationNode invoc = (InvocationNode) node; + result.add(new AttributeInfo("MethodName", invoc.getMethodName())); + result.add(new AttributeInfo("VarargsCall", invoc.getOverloadSelectionInfo().isVarargsCall())); + result.add(new AttributeInfo("Unchecked", invoc.getOverloadSelectionInfo().needsUncheckedConversion())); + result.add(new AttributeInfo("Failed", invoc.getOverloadSelectionInfo().isFailed())); + result.add(new AttributeInfo("Function", TypePrettyPrint.prettyPrint(invoc.getMethodType(), true))); + } + if (node instanceof ASTNamedReferenceExpr) { + result.add(new AttributeInfo("Name", ((ASTNamedReferenceExpr) node).getName())); + } + if (node instanceof ASTVariableDeclaratorId) { + result.add(new AttributeInfo("Name", ((ASTVariableDeclaratorId) node).getName())); + } } @Override diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorBasedNStream.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorBasedNStream.txt index e7acfeeec8..71000cdc3b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorBasedNStream.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorBasedNStream.txt @@ -50,13 +50,13 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.Spliterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Spliterators. spliteratorUnknownSize(java.util.Iterator, int) -> java.util.Spliterator", @MethodName = "spliteratorUnknownSize", @TypeMirror = "java.util.Spliterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "java.util.Spliterators"] | | +- ClassOrInterfaceType[@TypeMirror = "java.util.Spliterators"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] - | +- FieldAccess[@TypeMirror = "int"] + | +- FieldAccess[@Name = "ORDERED", @TypeMirror = "int"] | +- TypeExpression[@TypeMirror = "java.util.Spliterator"] | +- ClassOrInterfaceType[@TypeMirror = "java.util.Spliterator"] +- MethodDeclaration[] @@ -69,11 +69,11 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.stream.Stream"] + | +- MethodCall[@Failed = false, @Function = "java.util.stream.StreamSupport. stream(java.util.Spliterator, boolean) -> java.util.stream.Stream", @MethodName = "stream", @TypeMirror = "java.util.stream.Stream", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "java.util.stream.StreamSupport"] | | +- ClassOrInterfaceType[@TypeMirror = "java.util.stream.StreamSupport"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Spliterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.spliterator() -> java.util.Spliterator", @MethodName = "spliterator", @TypeMirror = "java.util.Spliterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | +- BooleanLiteral[@TypeMirror = "boolean"] +- MethodDeclaration[] @@ -100,7 +100,7 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] + | | +- VariableDeclaratorId[@Name = "mapper", @TypeMirror = "java.util.function.Function>"] | +- Block[] | +- LocalVariableDeclaration[] | | +- ModifierList[] @@ -113,27 +113,27 @@ | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] - | | +- MethodCall[@TypeMirror = "java.util.function.Function>"] - | | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] + | | +- VariableDeclaratorId[@Name = "mapped", @TypeMirror = "java.util.function.Function>"] + | | +- MethodCall[@Failed = false, @Function = "java.util.function.Function>. andThen(java.util.function.Function, ? extends java.util.Iterator>) -> java.util.function.Function>", @MethodName = "andThen", @TypeMirror = "java.util.function.Function>", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "mapper", @TypeMirror = "java.util.function.Function>"] | | +- ArgumentList[] - | | +- MethodReference[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | +- MethodReference[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. flatMap(java.util.Iterator, java.util.function.Function>) -> java.util.Iterator", @MethodName = "flatMap", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "mapped", @TypeMirror = "java.util.function.Function>"] +- MethodDeclaration[] | +- ModifierList[] | +- TypeParameters[] @@ -154,19 +154,19 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | | +- VariableDeclaratorId[@Name = "ns", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- Block[] | +- ReturnStatement[] | +- ConditionalExpression[@TypeMirror = "java.util.Iterator"] | +- InfixExpression[@TypeMirror = "boolean"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | | +- VariableAccess[@Name = "ns", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | | +- NullLiteral[@TypeMirror = "null"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Collections. emptyIterator() -> java.util.Iterator", @MethodName = "emptyIterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- TypeExpression[@TypeMirror = "java.util.Collections"] | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.Collections"] | | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "java.lang.Iterable.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] + | +- VariableAccess[@Name = "ns", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -191,22 +191,22 @@ | | | +- ClassOrInterfaceType[@TypeMirror = "R"] | | | +- Annotation[@TypeMirror = "org.checkerframework.checker.nullness.qual.Nullable"] | | | +- ClassOrInterfaceType[@TypeMirror = "org.checkerframework.checker.nullness.qual.Nullable"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function"] + | | +- VariableDeclaratorId[@Name = "mapper", @TypeMirror = "java.util.function.Function"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. mapNotNull(java.util.Iterator, java.util.function.Function) -> java.util.Iterator", @MethodName = "mapNotNull", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "java.util.function.Function"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "mapper", @TypeMirror = "java.util.function.Function"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -223,26 +223,26 @@ | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | | +- Annotation[@TypeMirror = "org.checkerframework.checker.nullness.qual.NonNull"] | | | +- ClassOrInterfaceType[@TypeMirror = "org.checkerframework.checker.nullness.qual.NonNull"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "it", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. mapNotNull(java.util.Iterator, java.util.function.Function) -> java.util.Iterator", @MethodName = "mapNotNull", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] + | +- VariableAccess[@Name = "it", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.Filtermap. filter(java.util.function.Predicate) -> net.sourceforge.pmd.lang.ast.internal.Filtermap", @MethodName = "filter", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -260,26 +260,26 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.lang.Class"] + | | +- VariableDeclaratorId[@Name = "rClass", @TypeMirror = "java.lang.Class"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "it", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. mapNotNull(java.util.Iterator, java.util.function.Function) -> java.util.Iterator", @MethodName = "mapNotNull", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] + | +- VariableAccess[@Name = "it", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.Filtermap. isInstance(java.lang.Class) -> net.sourceforge.pmd.lang.ast.internal.Filtermap", @MethodName = "isInstance", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.Filtermap"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.lang.Class"] + | +- VariableAccess[@Name = "rClass", @TypeMirror = "java.lang.Class"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -290,7 +290,7 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. flatMapDescendants(java.util.function.Function>) -> net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "flatMapDescendants", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- MethodReference[@TypeMirror = "java.util.function.Function>"] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.Node"] @@ -305,7 +305,7 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. flatMapDescendants(java.util.function.Function>) -> net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "flatMapDescendants", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- MethodReference[@TypeMirror = "java.util.function.Function>"] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.Node"] @@ -327,20 +327,20 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.lang.Class"] + | | +- VariableDeclaratorId[@Name = "rClass", @TypeMirror = "java.lang.Class"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. flatMapDescendants(java.util.function.Function>) -> net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "flatMapDescendants", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "T"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "T"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] - | +- VariableAccess[@TypeMirror = "T"] + | | +- VariableDeclaratorId[@Name = "node", @TypeMirror = "T"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.Node. descendants(java.lang.Class) -> net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "descendants", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] + | +- VariableAccess[@Name = "node", @TypeMirror = "T"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.lang.Class"] + | +- VariableAccess[@Name = "rClass", @TypeMirror = "java.lang.Class"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "org.checkerframework.checker.nullness.qual.NonNull"] @@ -361,15 +361,15 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] + | | +- VariableDeclaratorId[@Name = "mapper", @TypeMirror = "java.util.function.Function>"] | +- Block[] | +- ReturnStatement[] - | +- ConstructorCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] + | +- ConstructorCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping.new(net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream, java.util.function.Function>) -> net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @MethodName = "new", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @Unchecked = false, @VarargsCall = false] | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] | | +- TypeArguments[] | +- ArgumentList[] | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] - | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] + | +- VariableAccess[@Name = "mapper", @TypeMirror = "java.util.function.Function>"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -382,14 +382,14 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Consumer"] + | | +- VariableDeclaratorId[@Name = "action", @TypeMirror = "java.util.function.Consumer"] | +- Block[] | +- ExpressionStatement[] - | +- MethodCall[@TypeMirror = "void"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Iterator.forEachRemaining(java.util.function.Consumer) -> void", @MethodName = "forEachRemaining", @TypeMirror = "void", @Unchecked = false, @VarargsCall = false] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Consumer"] + | +- VariableAccess[@Name = "action", @TypeMirror = "java.util.function.Consumer"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -401,24 +401,24 @@ | | +- FormalParameter[@TypeMirror = "int"] | | +- ModifierList[] | | +- PrimitiveType[@TypeMirror = "int"] - | | +- VariableDeclaratorId[@TypeMirror = "int"] + | | +- VariableDeclaratorId[@Name = "n", @TypeMirror = "int"] | +- Block[] | +- IfStatement[] | | +- InfixExpression[@TypeMirror = "boolean"] - | | | +- VariableAccess[@TypeMirror = "int"] + | | | +- VariableAccess[@Name = "n", @TypeMirror = "int"] | | | +- NumericLiteral[@TypeMirror = "int"] | | +- Block[] | | +- ReturnStatement[] - | | +- MethodCall[@TypeMirror = "T"] + | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.first() -> T extends net.sourceforge.pmd.lang.ast.Node", @MethodName = "first", @TypeMirror = "T", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "T"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. getNth(java.util.Iterator, int) -> T", @MethodName = "getNth", @TypeMirror = "T", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "int"] + | +- VariableAccess[@Name = "n", @TypeMirror = "int"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -430,34 +430,34 @@ | | +- FormalParameter[@TypeMirror = "int"] | | +- ModifierList[] | | +- PrimitiveType[@TypeMirror = "int"] - | | +- VariableDeclaratorId[@TypeMirror = "int"] + | | +- VariableDeclaratorId[@Name = "n", @TypeMirror = "int"] | +- Block[] | +- ExpressionStatement[] - | | +- MethodCall[@TypeMirror = "int"] + | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.AssertionUtil.requireNonNegative(java.lang.String, int) -> int", @MethodName = "requireNonNegative", @TypeMirror = "int", @Unchecked = false, @VarargsCall = false] | | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.AssertionUtil"] | | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.AssertionUtil"] | | +- ArgumentList[] | | +- StringLiteral[@TypeMirror = "java.lang.String"] - | | +- VariableAccess[@TypeMirror = "int"] + | | +- VariableAccess[@Name = "n", @TypeMirror = "int"] | +- ReturnStatement[] | +- ConditionalExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- InfixExpression[@TypeMirror = "boolean"] - | | +- VariableAccess[@TypeMirror = "int"] + | | +- VariableAccess[@Name = "n", @TypeMirror = "int"] | | +- NumericLiteral[@TypeMirror = "int"] | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. drop(java.util.Iterator, int) -> java.util.Iterator", @MethodName = "drop", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "int"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "n", @TypeMirror = "int"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -469,37 +469,37 @@ | | +- FormalParameter[@TypeMirror = "int"] | | +- ModifierList[] | | +- PrimitiveType[@TypeMirror = "int"] - | | +- VariableDeclaratorId[@TypeMirror = "int"] + | | +- VariableDeclaratorId[@Name = "maxSize", @TypeMirror = "int"] | +- Block[] | +- ExpressionStatement[] - | | +- MethodCall[@TypeMirror = "int"] + | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.AssertionUtil.requireNonNegative(java.lang.String, int) -> int", @MethodName = "requireNonNegative", @TypeMirror = "int", @Unchecked = false, @VarargsCall = false] | | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.AssertionUtil"] | | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.AssertionUtil"] | | +- ArgumentList[] | | +- StringLiteral[@TypeMirror = "java.lang.String"] - | | +- VariableAccess[@TypeMirror = "int"] + | | +- VariableAccess[@Name = "maxSize", @TypeMirror = "int"] | +- ReturnStatement[] | +- ConditionalExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- InfixExpression[@TypeMirror = "boolean"] - | | +- VariableAccess[@TypeMirror = "int"] + | | +- VariableAccess[@Name = "maxSize", @TypeMirror = "int"] | | +- NumericLiteral[@TypeMirror = "int"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.NodeStream. empty() -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "empty", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. take(java.util.Iterator, int) -> java.util.Iterator", @MethodName = "take", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "int"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "maxSize", @TypeMirror = "int"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -514,22 +514,22 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. takeWhile(java.util.Iterator, java.util.function.Predicate) -> java.util.Iterator", @MethodName = "takeWhile", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -547,16 +547,16 @@ | | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | | +- ClassOrInterfaceType[@TypeMirror = "A"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.stream.Collector"] + | | +- VariableDeclaratorId[@Name = "collector", @TypeMirror = "java.util.stream.Collector"] | +- Block[] | +- LocalVariableDeclaration[] | | +- ModifierList[] | | +- ClassOrInterfaceType[@TypeMirror = "A"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "A"] - | | +- MethodCall[@TypeMirror = "A"] - | | +- MethodCall[@TypeMirror = "java.util.function.Supplier"] - | | | +- VariableAccess[@TypeMirror = "java.util.stream.Collector"] + | | +- VariableDeclaratorId[@Name = "container", @TypeMirror = "A"] + | | +- MethodCall[@Failed = false, @Function = "java.util.function.Supplier.get() -> A", @MethodName = "get", @TypeMirror = "A", @Unchecked = false, @VarargsCall = false] + | | +- MethodCall[@Failed = false, @Function = "java.util.stream.Collector.supplier() -> java.util.function.Supplier", @MethodName = "supplier", @TypeMirror = "java.util.function.Supplier", @Unchecked = false, @VarargsCall = false] + | | | +- VariableAccess[@Name = "collector", @TypeMirror = "java.util.stream.Collector"] | | | +- ArgumentList[] | | +- ArgumentList[] | +- LocalVariableDeclaration[] @@ -567,30 +567,30 @@ | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.BiConsumer"] - | | +- MethodCall[@TypeMirror = "java.util.function.BiConsumer"] - | | +- VariableAccess[@TypeMirror = "java.util.stream.Collector"] + | | +- VariableDeclaratorId[@Name = "accumulator", @TypeMirror = "java.util.function.BiConsumer"] + | | +- MethodCall[@Failed = false, @Function = "java.util.stream.Collector.accumulator() -> java.util.function.BiConsumer", @MethodName = "accumulator", @TypeMirror = "java.util.function.BiConsumer", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "collector", @TypeMirror = "java.util.stream.Collector"] | | +- ArgumentList[] | +- ExpressionStatement[] - | | +- MethodCall[@TypeMirror = "void"] + | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.forEach(java.util.function.Consumer) -> void", @MethodName = "forEach", @TypeMirror = "void", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | | +- LambdaExpression[@TypeMirror = "java.util.function.Consumer"] | | +- LambdaParameterList[] | | | +- LambdaParameter[@TypeMirror = "T"] | | | +- ModifierList[] - | | | +- VariableDeclaratorId[@TypeMirror = "T"] - | | +- MethodCall[@TypeMirror = "void"] - | | +- VariableAccess[@TypeMirror = "java.util.function.BiConsumer"] + | | | +- VariableDeclaratorId[@Name = "u", @TypeMirror = "T"] + | | +- MethodCall[@Failed = false, @Function = "java.util.function.BiConsumer.accept(A, capture#... of ? super T) -> void", @MethodName = "accept", @TypeMirror = "void", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "accumulator", @TypeMirror = "java.util.function.BiConsumer"] | | +- ArgumentList[] - | | +- VariableAccess[@TypeMirror = "A"] - | | +- VariableAccess[@TypeMirror = "T"] + | | +- VariableAccess[@Name = "container", @TypeMirror = "A"] + | | +- VariableAccess[@Name = "u", @TypeMirror = "T"] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "R"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.util.CollectionUtil. finish(java.util.stream.Collector, A) -> R", @MethodName = "finish", @TypeMirror = "R", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.util.CollectionUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.util.CollectionUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.stream.Collector"] - | +- VariableAccess[@TypeMirror = "A"] + | +- VariableAccess[@Name = "collector", @TypeMirror = "java.util.stream.Collector"] + | +- VariableAccess[@Name = "container", @TypeMirror = "A"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -601,7 +601,7 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- MethodReference[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] @@ -620,22 +620,22 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Consumer"] + | | +- VariableDeclaratorId[@Name = "action", @TypeMirror = "java.util.function.Consumer"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. peek(java.util.Iterator, java.util.function.Consumer) -> java.util.Iterator", @MethodName = "peek", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "java.util.function.Consumer"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "action", @TypeMirror = "java.util.function.Consumer"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -650,23 +650,23 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | | +- VariableDeclaratorId[@Name = "right", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. concat(java.util.Iterator, java.util.Iterator) -> java.util.Iterator", @MethodName = "concat", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.lang.Iterable.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] + | +- VariableAccess[@Name = "right", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -682,24 +682,24 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | | +- VariableDeclaratorId[@Name = "right", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream. mapIter(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "mapIter", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "java.util.Iterator"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. concat(java.util.Iterator, java.util.Iterator) -> java.util.Iterator", @MethodName = "concat", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "java.lang.Iterable.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "right", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.Iterator"] + | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -712,16 +712,16 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "boolean"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. anyMatch(java.util.Iterator, java.util.function.Predicate) -> boolean", @MethodName = "anyMatch", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -734,16 +734,16 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "boolean"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. noneMatch(java.util.Iterator, java.util.function.Predicate) -> boolean", @MethodName = "noneMatch", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -756,16 +756,16 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "boolean"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. allMatch(java.util.Iterator, java.util.function.Predicate) -> boolean", @MethodName = "allMatch", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -774,11 +774,11 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "int"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil.count(java.util.Iterator) -> int", @MethodName = "count", @TypeMirror = "int", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -788,8 +788,8 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "boolean"] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Iterator.hasNext() -> boolean", @MethodName = "hasNext", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | +- ArgumentList[] +- MethodDeclaration[] @@ -807,16 +807,16 @@ | | | +- TypeArguments[] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.Iterator"] - | | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | | +- VariableDeclaratorId[@Name = "iter", @TypeMirror = "java.util.Iterator"] + | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | | +- ArgumentList[] | +- ReturnStatement[] | +- ConditionalExpression[@TypeMirror = "T"] - | +- MethodCall[@TypeMirror = "boolean"] - | | +- VariableAccess[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Iterator.hasNext() -> boolean", @MethodName = "hasNext", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] | | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "T"] - | | +- VariableAccess[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "java.util.Iterator.next() -> T", @MethodName = "next", @TypeMirror = "T", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "iter", @TypeMirror = "java.util.Iterator"] | | +- ArgumentList[] | +- NullLiteral[@TypeMirror = "null"] +- MethodDeclaration[] @@ -829,11 +829,11 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "T"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. last(java.util.Iterator) -> T", @MethodName = "last", @TypeMirror = "T", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -845,11 +845,11 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.List"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. toList(java.util.Iterator) -> java.util.List", @MethodName = "toList", @TypeMirror = "java.util.List", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -868,27 +868,27 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends R"] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.lang.Class"] + | | +- VariableDeclaratorId[@Name = "r1Class", @TypeMirror = "java.lang.Class"] | +- Block[] | +- ForeachStatement[] | | +- LocalVariableDeclaration[] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | | +- VariableDeclarator[@TypeMirror = "void"] - | | | +- VariableDeclaratorId[@TypeMirror = "T"] + | | | +- VariableDeclaratorId[@Name = "t", @TypeMirror = "T"] | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- Block[] | | +- IfStatement[] - | | +- MethodCall[@TypeMirror = "boolean"] - | | | +- VariableAccess[@TypeMirror = "java.lang.Class"] + | | +- MethodCall[@Failed = false, @Function = "java.lang.Class.isInstance(java.lang.Object) -> boolean", @MethodName = "isInstance", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] + | | | +- VariableAccess[@Name = "r1Class", @TypeMirror = "java.lang.Class"] | | | +- ArgumentList[] - | | | +- VariableAccess[@TypeMirror = "T"] + | | | +- VariableAccess[@Name = "t", @TypeMirror = "T"] | | +- Block[] | | +- ReturnStatement[] - | | +- MethodCall[@TypeMirror = "capture#159 of ? extends R"] - | | +- VariableAccess[@TypeMirror = "java.lang.Class"] + | | +- MethodCall[@Failed = false, @Function = "java.lang.Class.cast(java.lang.Object) -> capture#... of ? extends R", @MethodName = "cast", @TypeMirror = "capture#... of ? extends R", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "r1Class", @TypeMirror = "java.lang.Class"] | | +- ArgumentList[] - | | +- VariableAccess[@TypeMirror = "T"] + | | +- VariableAccess[@Name = "t", @TypeMirror = "T"] | +- ReturnStatement[] | +- NullLiteral[@TypeMirror = "null"] +- MethodDeclaration[] @@ -905,24 +905,24 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? super T"] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Predicate"] + | | +- VariableDeclaratorId[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | +- Block[] | +- ForeachStatement[] | | +- LocalVariableDeclaration[] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@TypeMirror = "T"] | | | +- VariableDeclarator[@TypeMirror = "void"] - | | | +- VariableDeclaratorId[@TypeMirror = "T"] + | | | +- VariableDeclaratorId[@Name = "t", @TypeMirror = "T"] | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- Block[] | | +- IfStatement[] - | | +- MethodCall[@TypeMirror = "boolean"] - | | | +- VariableAccess[@TypeMirror = "java.util.function.Predicate"] + | | +- MethodCall[@Failed = false, @Function = "java.util.function.Predicate.test(capture#... of ? super T) -> boolean", @MethodName = "test", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] + | | | +- VariableAccess[@Name = "predicate", @TypeMirror = "java.util.function.Predicate"] | | | +- ArgumentList[] - | | | +- VariableAccess[@TypeMirror = "T"] + | | | +- VariableAccess[@Name = "t", @TypeMirror = "T"] | | +- Block[] | | +- ReturnStatement[] - | | +- VariableAccess[@TypeMirror = "T"] + | | +- VariableAccess[@Name = "t", @TypeMirror = "T"] | +- ReturnStatement[] | +- NullLiteral[@TypeMirror = "null"] +- MethodDeclaration[] @@ -935,11 +935,11 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.StreamImpl. fromNonNullList(java.util.List) -> net.sourceforge.pmd.lang.ast.NodeStream", @MethodName = "fromNonNullList", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.StreamImpl"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.StreamImpl"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.List"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.toList() -> java.util.List", @MethodName = "toList", @TypeMirror = "java.util.List", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] +- MethodDeclaration[] | +- ModifierList[] @@ -960,14 +960,14 @@ | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.Iterator"] | | | +- TypeArguments[] | | | +- ClassOrInterfaceType[@TypeMirror = "R"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- Block[] | +- ReturnStatement[] - | +- ConstructorCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping"] + | +- ConstructorCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping.new(java.util.function.Function, java.util.Iterator>) -> net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping", @MethodName = "new", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping", @Unchecked = false, @VarargsCall = false] | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping"] | | +- TypeArguments[] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -979,21 +979,21 @@ | +- InfixExpression[@TypeMirror = "java.lang.String"] | +- InfixExpression[@TypeMirror = "java.lang.String"] | | +- InfixExpression[@TypeMirror = "java.lang.String"] - | | | +- MethodCall[@TypeMirror = "java.lang.String"] - | | | | +- MethodCall[@TypeMirror = "java.lang.Class"] + | | | +- MethodCall[@Failed = false, @Function = "java.lang.Class.getSimpleName() -> java.lang.String", @MethodName = "getSimpleName", @TypeMirror = "java.lang.String", @Unchecked = false, @VarargsCall = false] + | | | | +- MethodCall[@Failed = false, @Function = "java.lang.Object.getClass() -> java.lang.Class", @MethodName = "getClass", @TypeMirror = "java.lang.Class", @Unchecked = false, @VarargsCall = false] | | | | | +- ArgumentList[] | | | | +- ArgumentList[] | | | +- StringLiteral[@TypeMirror = "java.lang.String"] - | | +- MethodCall[@TypeMirror = "java.lang.String"] - | | +- MethodCall[@TypeMirror = "java.util.stream.Stream"] - | | | +- MethodCall[@TypeMirror = "java.util.stream.Stream"] + | | +- MethodCall[@Failed = false, @Function = "java.util.stream.Stream. collect(java.util.stream.Collector) -> java.lang.String", @MethodName = "collect", @TypeMirror = "java.lang.String", @Unchecked = false, @VarargsCall = false] + | | +- MethodCall[@Failed = false, @Function = "java.util.stream.Stream. map(java.util.function.Function) -> java.util.stream.Stream", @MethodName = "map", @TypeMirror = "java.util.stream.Stream", @Unchecked = false, @VarargsCall = false] + | | | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.toStream() -> java.util.stream.Stream", @MethodName = "toStream", @TypeMirror = "java.util.stream.Stream", @Unchecked = false, @VarargsCall = false] | | | | +- ArgumentList[] | | | +- ArgumentList[] | | | +- MethodReference[@TypeMirror = "java.util.function.Function"] | | | +- TypeExpression[@TypeMirror = "java.util.Objects"] | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.Objects"] | | +- ArgumentList[] - | | +- MethodCall[@TypeMirror = "java.util.stream.Collector"] + | | +- MethodCall[@Failed = false, @Function = "java.util.stream.Collectors.joining(java.lang.CharSequence) -> java.util.stream.Collector", @MethodName = "joining", @TypeMirror = "java.util.stream.Collector", @Unchecked = false, @VarargsCall = false] | | +- TypeExpression[@TypeMirror = "java.util.stream.Collectors"] | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.stream.Collectors"] | | +- ArgumentList[] @@ -1020,7 +1020,7 @@ | | | +- TypeArguments[] | | | +- ClassOrInterfaceType[@TypeMirror = "S"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- ConstructorDeclaration[] | | +- ModifierList[] | | +- FormalParameters[] @@ -1034,13 +1034,13 @@ | | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.Iterator"] | | | | +- TypeArguments[] | | | | +- ClassOrInterfaceType[@TypeMirror = "S"] - | | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | | +- Block[] | | +- ExpressionStatement[] | | +- AssignmentExpression[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] - | | +- FieldAccess[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | +- FieldAccess[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream#IteratorMapping"] - | | +- VariableAccess[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- MethodDeclaration[] | +- ModifierList[] | | +- Annotation[@TypeMirror = "java.lang.Override"] @@ -1051,10 +1051,10 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | +- VariableAccess[@TypeMirror = "java.util.function.Function, java.util.Iterator>"] + | +- MethodCall[@Failed = false, @Function = "java.util.function.Function, java.util.Iterator>.apply(java.util.Iterator) -> java.util.Iterator", @MethodName = "apply", @TypeMirror = "java.util.Iterator", @Unchecked = true, @VarargsCall = false] + | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function, java.util.Iterator>"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | +- ArgumentList[] @@ -1086,19 +1086,19 @@ | | +- WildcardType[@TypeMirror = "? extends S"] | | +- ClassOrInterfaceType[@TypeMirror = "S"] | +- VariableDeclarator[@TypeMirror = "void"] - | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] + | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function>"] +- FieldDeclaration[] | +- ModifierList[] | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | +- VariableDeclarator[@TypeMirror = "void"] - | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | +- VariableDeclaratorId[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] +- FieldDeclaration[] | +- ModifierList[] | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- TypeArguments[] | | +- ClassOrInterfaceType[@TypeMirror = "T"] | +- VariableDeclarator[@TypeMirror = "void"] - | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | +- VariableDeclaratorId[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] +- ConstructorDeclaration[] | +- ModifierList[] | +- FormalParameters[] @@ -1107,7 +1107,7 @@ | | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | | | +- TypeArguments[] | | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | | | +- VariableDeclaratorId[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- FormalParameter[@TypeMirror = "java.util.function.Function>"] | | | +- ModifierList[] | | | +- ClassOrInterfaceType[@TypeMirror = "java.util.function.Function>"] @@ -1119,27 +1119,27 @@ | | | | +- TypeArguments[] | | | | +- WildcardType[@TypeMirror = "? extends S"] | | | | +- ClassOrInterfaceType[@TypeMirror = "S"] - | | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] + | | | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function>"] | | +- FormalParameter[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | | +- ModifierList[] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] - | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | | +- VariableDeclaratorId[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | +- Block[] | +- ExpressionStatement[] - | | +- AssignmentExpression[@TypeMirror = "java.util.function.Function>"] - | | +- FieldAccess[@TypeMirror = "java.util.function.Function>"] + | | +- AssignmentExpression[@TypeMirror = "java.util.function.Function>"] + | | +- FieldAccess[@Name = "fun", @TypeMirror = "java.util.function.Function>"] | | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] - | | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] + | | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function>"] | +- ExpressionStatement[] | | +- AssignmentExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] - | | +- FieldAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | | +- FieldAccess[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | | +- VariableAccess[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | +- ExpressionStatement[] | +- AssignmentExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] - | +- FieldAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | +- FieldAccess[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] - | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | +- VariableAccess[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] +- ConstructorDeclaration[] | +- ModifierList[] | +- FormalParameters[] @@ -1148,7 +1148,7 @@ | | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | | | +- TypeArguments[] | | | | +- ClassOrInterfaceType[@TypeMirror = "T"] - | | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | | | +- VariableDeclaratorId[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- FormalParameter[@TypeMirror = "java.util.function.Function>"] | | +- ModifierList[] | | +- ClassOrInterfaceType[@TypeMirror = "java.util.function.Function>"] @@ -1160,13 +1160,13 @@ | | | +- TypeArguments[] | | | +- WildcardType[@TypeMirror = "? extends S"] | | | +- ClassOrInterfaceType[@TypeMirror = "S"] - | | +- VariableDeclaratorId[@TypeMirror = "java.util.function.Function>"] + | | +- VariableDeclaratorId[@Name = "fun", @TypeMirror = "java.util.function.Function>"] | +- Block[] - | +- ExplicitConstructorInvocation[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] + | +- ExplicitConstructorInvocation[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping.new(net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream, java.util.function.Function>, net.sourceforge.pmd.lang.ast.internal.TreeWalker) -> net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @MethodName = "new", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @Unchecked = false, @VarargsCall = false] | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] - | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] - | +- FieldAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | +- VariableAccess[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function>"] + | +- FieldAccess[@Name = "DEFAULT", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] +- MethodDeclaration[] @@ -1179,18 +1179,18 @@ | +- FormalParameters[] | +- Block[] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.internal.util.IteratorUtil. flatMap(java.util.Iterator, java.util.function.Function>) -> java.util.Iterator", @MethodName = "flatMap", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] | +- TypeExpression[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | | +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.internal.util.IteratorUtil"] | +- ArgumentList[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] | | +- ArgumentList[] | +- LambdaExpression[@TypeMirror = "java.util.function.Function>"] | +- LambdaParameterList[] | | +- LambdaParameter[@TypeMirror = "T"] | | +- ModifierList[] - | | +- VariableDeclaratorId[@TypeMirror = "T"] + | | +- VariableDeclaratorId[@Name = "t", @TypeMirror = "T"] | +- Block[] | +- LocalVariableDeclaration[] | | +- ModifierList[] @@ -1199,17 +1199,17 @@ | | | +- WildcardType[@TypeMirror = "? extends S"] | | | +- ClassOrInterfaceType[@TypeMirror = "S"] | | +- VariableDeclarator[@TypeMirror = "void"] - | | +- VariableDeclaratorId[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] - | | +- MethodCall[@TypeMirror = "capture#161 of ? extends net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] - | | +- VariableAccess[@TypeMirror = "java.util.function.Function>"] + | | +- VariableDeclaratorId[@Name = "app", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] + | | +- MethodCall[@Failed = false, @Function = "java.util.function.Function>.apply(capture#... of ? super T) -> capture#... of ? extends net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "apply", @TypeMirror = "capture#... of ? extends net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function>"] | | +- ArgumentList[] - | | +- VariableAccess[@TypeMirror = "T"] + | | +- VariableAccess[@Name = "t", @TypeMirror = "T"] | +- ReturnStatement[] - | +- MethodCall[@TypeMirror = "java.util.Iterator"] - | +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | +- MethodCall[@Failed = false, @Function = "java.lang.Iterable.iterator() -> java.util.Iterator", @MethodName = "iterator", @TypeMirror = "java.util.Iterator", @Unchecked = false, @VarargsCall = false] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.TreeWalker. apply(net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream) -> net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @MethodName = "apply", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | | +- ArgumentList[] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] + | | +- VariableAccess[@Name = "app", @TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] | +- ArgumentList[] +- MethodDeclaration[] +- ModifierList[] @@ -1222,23 +1222,23 @@ | +- FormalParameter[@TypeMirror = "boolean"] | +- ModifierList[] | +- PrimitiveType[@TypeMirror = "boolean"] - | +- VariableDeclaratorId[@TypeMirror = "boolean"] + | +- VariableDeclaratorId[@Name = "cross", @TypeMirror = "boolean"] +- Block[] +- ReturnStatement[] +- ConditionalExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.NodeStream$DescendantNodeStream"] +- InfixExpression[@TypeMirror = "boolean"] - | +- MethodCall[@TypeMirror = "boolean"] - | | +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + | +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.TreeWalker.isCrossFindBoundaries() -> boolean", @MethodName = "isCrossFindBoundaries", @TypeMirror = "boolean", @Unchecked = false, @VarargsCall = false] + | | +- VariableAccess[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] | | +- ArgumentList[] - | +- VariableAccess[@TypeMirror = "boolean"] + | +- VariableAccess[@Name = "cross", @TypeMirror = "boolean"] +- ThisExpression[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] - +- ConstructorCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] + +- ConstructorCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping.new(net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream, java.util.function.Function>, net.sourceforge.pmd.lang.ast.internal.TreeWalker) -> net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @MethodName = "new", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping", @Unchecked = false, @VarargsCall = false] +- ClassOrInterfaceType[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream$DescendantMapping"] | +- TypeArguments[] +- ArgumentList[] - +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] - +- VariableAccess[@TypeMirror = "java.util.function.Function>"] - +- MethodCall[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] - +- VariableAccess[@TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] + +- VariableAccess[@Name = "upstream", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream"] + +- VariableAccess[@Name = "fun", @TypeMirror = "java.util.function.Function>"] + +- MethodCall[@Failed = false, @Function = "net.sourceforge.pmd.lang.ast.internal.TreeWalker.crossFindBoundaries(boolean) -> net.sourceforge.pmd.lang.ast.internal.TreeWalker", @MethodName = "crossFindBoundaries", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker", @Unchecked = false, @VarargsCall = false] + +- VariableAccess[@Name = "walker", @TypeMirror = "net.sourceforge.pmd.lang.ast.internal.TreeWalker"] +- ArgumentList[] - +- VariableAccess[@TypeMirror = "boolean"] + +- VariableAccess[@Name = "cross", @TypeMirror = "boolean"] diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt index 7d47162c49..25ebe215a3 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/NodePrinters.kt @@ -38,7 +38,7 @@ open class RelevantAttributePrinter : BaseNodeAttributePrinter() { */ open class BaseNodeAttributePrinter : TextTreeRenderer(true, -1) { - data class AttributeInfo(val name: String, val value: String?) + data class AttributeInfo(val name: String, val value: Any?) protected open fun ignoreAttribute(node: Node, attribute: Attribute): Boolean = true diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt index bacae235ab..16063a7d67 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/test/BaseTextComparisonTest.kt @@ -67,6 +67,12 @@ abstract class BaseTextComparisonTest { return sourceText } + protected open fun String.normalize() = replace( + // \R on java 8+ + regex = Regex("\\u000D\\u000A|[\\u000A\\u000B\\u000C\\u000D\\u0085\\u2028\\u2029]"), + replacement = "\n" + ) + // Outputting a path makes for better error messages private val srcTestResources = let { // this is set from maven surefire @@ -90,11 +96,6 @@ abstract class BaseTextComparisonTest { companion object { const val ExpectedExt = ".txt" - fun String.normalize() = replace( - // \R on java 8+ - regex = Regex("\\u000D\\u000A|[\\u000A\\u000B\\u000C\\u000D\\u0085\\u2028\\u2029]"), - replacement = "\n" - ) } }