From d7693369ab3eb69833e64d739425ed0de947cb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:51:21 -0300 Subject: [PATCH] Have the NodePrinter show collections as sequences --- .../kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt index 4d7d47fec7..608f742b21 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt @@ -93,6 +93,9 @@ open class BaseNodeAttributePrinter : TextTreeRenderer(true, -1) { is Enum<*> -> value.enumDeclaringClass.simpleName + "." + value.name is Class<*> -> value.canonicalName?.let { "$it.class" } is Number, is Boolean -> value.toString() + is Collection<*> -> value.joinToString(prefix = "(", postfix = ")", separator = ", ") { + "${valueToString(it)}" + } null -> "null" else -> null }