You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/07/08 10:41:11 UTC

[groovy] branch master updated: GROOVY-10684: Support opening the Object browser from within the AST browser fix (streamline AST Browser interface now we have Object browser launching, there is less need to have as much noise in the hierarchy)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new e0f37a2bb4 GROOVY-10684: Support opening the Object browser from within the AST browser fix (streamline AST Browser interface now we have Object browser launching, there is less need to have as much noise in the hierarchy)
e0f37a2bb4 is described below

commit e0f37a2bb43111342a5328dd620560167be03e31
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jul 8 20:40:57 2022 +1000

    GROOVY-10684: Support opening the Object browser from within the AST browser fix (streamline AST Browser interface now we have Object browser launching, there is less need to have as much noise in the hierarchy)
---
 .../groovy/groovy/console/ui/AstBrowser.groovy     |  16 ++-
 .../console/ui/ScriptToTreeNodeAdapter.groovy      | 114 +++++-------------
 .../groovy/console/ui/AstBrowserProperties.groovy  |  50 ++++----
 .../console/ui/ScriptToTreeNodeAdapterTest.groovy  | 128 ++++++++-------------
 4 files changed, 114 insertions(+), 194 deletions(-)

diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
index 7f9a9a4055..685ddb026a 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
@@ -202,10 +202,18 @@ class AstBrowser {
                                     propertyColumn(header: 'Raw', propertyName: 'raw')
                                 }
                             }
-                            propertyTable.columnModel.getColumn(3).with {
-                                minWidth = 0
-                                maxWidth = 0
-                                width = 0
+                            propertyTable.columnModel.with {
+                                // raw column hidden
+                                getColumn(3).with {
+                                    minWidth = 0
+                                    maxWidth = 0
+                                    width = 0
+                                    preferredWidth = 0
+                                }
+                                // allow more space for value column
+                                getColumn(0).preferredWidth = 100
+                                getColumn(1).preferredWidth = 400
+                                getColumn(2).preferredWidth = 100
                             }
                             propertyTable.addMouseListener(makeClickAdapter(propertyTable, 3) { row ->
                                 'Browsing ' + jTree.lastSelectedPathComponent.userObject + ": " + propertyTable.model.getValueAt(row, 0)
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
index 17f91de468..d6eab946eb 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
@@ -320,7 +320,6 @@ class TreeNodeBuildingNodeOperation implements CompilationUnit.IPrimaryClassNode
         collectFieldData(child, 'Fields', classNode)
         collectPropertyData(child, 'Properties', classNode)
         collectRecordComponentData(child, 'Record Components', classNode)
-        collectAnnotationData(child, 'Annotations', classNode.annotations)
 
         if (showClosureClasses)  {
             makeClosureClassTreeNodes(classNode)
@@ -345,40 +344,28 @@ class TreeNodeBuildingNodeOperation implements CompilationUnit.IPrimaryClassNode
             collectFieldData(child, 'Fields', innerClassNode)
             collectPropertyData(child, 'Properties', innerClassNode)
             collectRecordComponentData(child, 'Record Components', classNode)
-            collectAnnotationData(child, 'Annotations', innerClassNode.annotations)
-        }
-    }
-
-    private void collectAnnotationData(parent, String name, List<AnnotationNode> annotations) {
-        if (annotations) {
-            def header = nodeMaker.makeNode(name)
-            parent.add(header)
-            annotations?.each { AnnotationNode annotationNode ->
-                header.add(adapter.make(annotationNode))
-            }
         }
     }
 
     private void collectPropertyData(parent, String name, ClassNode classNode) {
-        def allProperties = nodeMaker.makeNode(name)
-        if (classNode.properties) parent.add(allProperties)
-        classNode.properties?.each {PropertyNode propertyNode ->
-            def ggrandchild = adapter.make(propertyNode)
-            allProperties.add(ggrandchild)
-            collectTypeData(ggrandchild, 'Type', propertyNode.type)
-            collectInitialValueData(ggrandchild, propertyNode.field?.initialValueExpression)
-            collectAnnotationData(ggrandchild, 'Annotations', propertyNode.annotations)
+        if (classNode.properties) {
+            def allProperties = nodeMaker.makeNode(name)
+            parent.add(allProperties)
+            classNode.properties.each { PropertyNode propertyNode ->
+                def ggrandchild = adapter.make(propertyNode)
+                allProperties.add(ggrandchild)
+            }
         }
     }
 
     private void collectRecordComponentData(parent, String name, ClassNode classNode) {
-        def allProperties = nodeMaker.makeNode(name)
-        if (classNode.properties) parent.add(allProperties)
-        classNode.recordComponents?.each { RecordComponentNode recordComponentNode ->
-            def ggrandchild = adapter.make(recordComponentNode)
-            allProperties.add(ggrandchild)
-            collectTypeData(ggrandchild, 'Type', recordComponentNode.type)
-            collectAnnotationData(ggrandchild, 'Annotations', recordComponentNode.annotations)
+        if (classNode.recordComponents) {
+            def allRecords = nodeMaker.makeNode(name)
+            parent.add(allRecords)
+            classNode.recordComponents.each { RecordComponentNode recordComponentNode ->
+                def ggrandchild = adapter.make(recordComponentNode)
+                allRecords.add(ggrandchild)
+            }
         }
     }
 
@@ -386,24 +373,9 @@ class TreeNodeBuildingNodeOperation implements CompilationUnit.IPrimaryClassNode
         if (classNode.fields) {
             def allFields = nodeMaker.makeNode(name)
             parent.add(allFields)
-            classNode.fields?.each {FieldNode fieldNode ->
+            classNode.fields.each { FieldNode fieldNode ->
                 def ggrandchild = adapter.make(fieldNode)
                 allFields.add(ggrandchild)
-                collectTypeData(ggrandchild, 'Type', fieldNode.type)
-                collectInitialValueData(ggrandchild, fieldNode.initialValueExpression)
-                collectAnnotationData(ggrandchild, 'Annotations', fieldNode.annotations)
-            }
-        }
-    }
-
-    private void collectInitialValueData(parent, Expression init) {
-        if (init) {
-            TreeNodeBuildingVisitor visitor = new TreeNodeBuildingVisitor(adapter)
-            init.visit(visitor)
-            if (visitor.currentNode) {
-                def header = nodeMaker.makeNode('Initial Value')
-                header.add(visitor.currentNode)
-                parent.add(header)
             }
         }
     }
@@ -427,15 +399,8 @@ class TreeNodeBuildingNodeOperation implements CompilationUnit.IPrimaryClassNode
         methods?.each { MethodNode methodNode ->
             def ggrandchild = adapter.make(methodNode)
             allMethods.add(ggrandchild)
-            collectTypeData(ggrandchild, 'Return Type', methodNode.returnType)
-
-            // print out parameters of method
-            methodNode.parameters?.each { Parameter parameter ->
-                collectParameterData(ggrandchild, parameter)
-            }
-
+            collectParametersData(ggrandchild, methodNode)
             collectBodyData(ggrandchild, methodNode.code)
-            collectAnnotationData(ggrandchild, 'Annotations', methodNode.annotations)
         }
     }
 
@@ -451,38 +416,25 @@ class TreeNodeBuildingNodeOperation implements CompilationUnit.IPrimaryClassNode
         }
     }
 
-    private void collectParameterData(parent, Parameter parameter) {
-        def paramChild = adapter.make(parameter)
-        collectTypeData(paramChild, 'Type', parameter.type)
-        collectInitialValueData(paramChild, parameter.initialExpression)
-        collectAnnotationData(paramChild, 'Annotations', parameter.annotations)
-        parent.add(paramChild)
-    }
-
-    private void collectTypeData(parent, String name, ClassNode type) {
-        if (type) {
-            def header = nodeMaker.makeNode(name)
-            def child = adapter.make(type)
-            header.add(child)
-            collectAnnotationData(child, 'Annotations', type.annotations)
-            collectAnnotationData(child, 'Type Annotations', type.typeAnnotations)
-            parent.add(header)
+    private void collectParametersData(parent, MethodNode methodNode) {
+        if (methodNode.parameters) {
+            def allParamNodes = nodeMaker.makeNode('Parameters')
+            parent.add(allParamNodes)
+            methodNode.parameters.each { Parameter parameter ->
+                def paramNode = adapter.make(parameter)
+                allParamNodes.add(paramNode)
+            }
         }
     }
 
     private void collectConstructorData(parent, String name, ClassNode classNode) {
         def allCtors = nodeMaker.makeNode(name)
         if (classNode.declaredConstructors) parent.add(allCtors)
-        classNode.declaredConstructors?.each {ConstructorNode ctorNode ->
-
+        classNode.declaredConstructors?.each { ConstructorNode ctorNode ->
             def ggrandchild = adapter.make(ctorNode)
             allCtors.add(ggrandchild)
-            ctorNode.parameters?.each { Parameter parameter ->
-                collectParameterData(ggrandchild, parameter)
-            }
-
+            collectParametersData(ggrandchild, ctorNode)
             collectBodyData(ggrandchild, ctorNode.code)
-            collectAnnotationData(ggrandchild, 'Annotations', ctorNode.annotations)
         }
 
     }
@@ -703,19 +655,7 @@ class TreeNodeBuildingVisitor extends CodeVisitorSupport {
      * Makes walking parameters look like others in the visitor.
      */
     void visitParameter(Parameter node) {
-        addNode(node, Parameter, {
-            if (node.type) {
-                def header = adapter.nodeMaker.makeNode('Type')
-                header.add(adapter.make(node.type))
-                currentNode.add(header)
-            }
-            if (node.initialExpression) {
-                def header = adapter.nodeMaker.makeNode('Initial Value')
-                currentNode.add(header)
-                currentNode = header
-                node.initialExpression?.visit(this)
-            }
-        })
+        addNode(node, Parameter, { })
     }
 
     @Override
diff --git a/subprojects/groovy-console/src/main/resources/groovy/console/ui/AstBrowserProperties.groovy b/subprojects/groovy-console/src/main/resources/groovy/console/ui/AstBrowserProperties.groovy
index ae090f2e9b..07bb9c221d 100644
--- a/subprojects/groovy-console/src/main/resources/groovy/console/ui/AstBrowserProperties.groovy
+++ b/subprojects/groovy-console/src/main/resources/groovy/console/ui/AstBrowserProperties.groovy
@@ -24,13 +24,13 @@ org {
             ast {
                 ClassNode           = "ClassNode - \$expression.name"
                 InnerClassNode      = "InnerClassNode - \$expression.name"
-                ConstructorNode     = "ConstructorNode - \$expression.name"
-                MethodNode          = "MethodNode - \$expression.name"
-                FieldNode           = "FieldNode - \$expression.name : \$expression.type"
-                PropertyNode        = "PropertyNode - \${expression.field?.name} : \${expression.field?.type}"
-                RecordComponentNode = "RecordComponentNode - \$expression.name : \$expression.type"
+                ConstructorNode     = "ConstructorNode - \$expression.name(\${expression.parameters*.type*.toString(false).join(', ')})"
+                MethodNode          = "MethodNode - \$expression.name(\${expression.parameters*.type*.toString(false).join(', ')})"
+                FieldNode           = "FieldNode - \${expression.type.toString(false)} \$expression.name\${expression.initialValueExpression ? ' = ' + expression.initialValueExpression.text : ''}"
+                PropertyNode        = "PropertyNode - \${expression.field?.type.toString(false)} \${expression.field?.name}\${expression.field?.initialValueExpression ? ' = ' + expression.field?.initialValueExpression.text : ''}"
+                RecordComponentNode = "RecordComponentNode - \${expression.type.toString(false)} \$expression.name"
                 AnnotationNode      = "AnnotationNode - \${expression.classNode?.name}"
-                Parameter           = "Parameter - \$expression.name"
+                Parameter           = "Parameter - \${expression.type.toString(false)} \$expression.name\${expression.initialExpression ? ' = ' + expression.initialExpression.text : ''}"
                 DynamicVariable     = "DynamicVariable - \$expression.name"
 
                 stmt {
@@ -41,25 +41,25 @@ org {
                     CatchStatement      = "CatchStatement - \$expression.exceptionType]"
                 }
                 expr {
-                    ConstructorCallExpression   = "ConstructorCall - \$expression.text"
-                    SpreadExpression        = "Spread - \$expression.text"
-                    ArgumentListExpression  = "ArgumentList - \$expression.text"
-                    MethodCallExpression    = "MethodCall - \$expression.text"
-                    GStringExpression       = "GString - \$expression.text"
-                    AttributeExpression     = "Attribute - \$expression.text"
-                    DeclarationExpression   = "Declaration - \$expression.text"
-                    VariableExpression      = "Variable - \$expression.name : \$expression.type"
-                    ConstantExpression      = "Constant - \$expression.value : \$expression.type"
-                    BinaryExpression        = "Binary - \$expression.text"
-                    ClassExpression         = "Class - \$expression.text"
-                    BooleanExpression       = "Boolean - \$expression.text"
-                    ArrayExpression         = "Array - \$expression.text"
-                    ListExpression          = "List - \$expression.text"
-                    TupleExpression         = "Tuple - \$expression.text"
-                    FieldExpression         = "Field - \$expression.text"
-                    PropertyExpression      = "Property - \$expression.propertyAsString"
-                    NotExpression           = "Not - \$expression.text"
-                    CastExpression          = "Cast - \$expression.text"
+                    ConstructorCallExpression = "ConstructorCall - \$expression.text"
+                    SpreadExpression          = "Spread - \$expression.text"
+                    ArgumentListExpression    = "ArgumentList - \$expression.text"
+                    MethodCallExpression      = "MethodCall - \$expression.text"
+                    GStringExpression         = "GString - \$expression.text"
+                    AttributeExpression       = "Attribute - \$expression.text"
+                    DeclarationExpression     = "Declaration - \$expression.text"
+                    VariableExpression        = "Variable - \${expression.type.toString(false)} \$expression.name"
+                    ConstantExpression        = "Constant - \${expression.type.toString(false)} \$expression.value"
+                    BinaryExpression          = "Binary - \$expression.text"
+                    ClassExpression           = "Class - \$expression.text"
+                    BooleanExpression         = "Boolean - \$expression.text"
+                    ArrayExpression           = "Array - \$expression.text"
+                    ListExpression            = "List - \$expression.text"
+                    TupleExpression           = "Tuple - \$expression.text"
+                    FieldExpression           = "Field - \$expression.text"
+                    PropertyExpression        = "Property - \$expression.propertyAsString"
+                    NotExpression             = "Not - \$expression.text"
+                    CastExpression            = "Cast - \$expression.text"
                 }
             }
         }
diff --git a/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
index 20e3ee5b56..b63e878d08 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
@@ -133,7 +133,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         eq('BlockStatement - (1)'),
                         startsWith('ExpressionStatement'),
-                        startsWith('Constant - Hello World : java.lang.String')
+                        startsWith('Constant - java.lang.String Hello World')
                 ])
     }
 
@@ -143,7 +143,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         eq('ClassNode - Foo'),
                         eq('Fields'),
-                        startsWith('FieldNode - aField : java.lang.Object'),
+                        startsWith('FieldNode - java.lang.Object aField'),
                 ]
         )
     }
@@ -154,31 +154,22 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                     startsWith('ClassNode - script'),
                     eq('Methods'),
-                    eq('MethodNode - foo'),
-                    eq('Parameter - bar'),
+                    eq('MethodNode - foo(java.lang.String)'),
+                    eq('Parameters'),
+                    eq('Parameter - java.lang.String bar'),
                 ]
             )
     }
 
     void testMethodWithParameterAndInitialValue() {
         def script = ' def foo(String bar = "some_value") { println bar } '
-        // check Type path for bar
+        // check path for bar
         assertTreeStructure(script, [
                 startsWith('ClassNode - script'),
                 eq('Methods'),
-                eq('MethodNode - foo'),
-                eq('Parameter - bar'),
-                eq('Type'),
-                startsWith('ClassNode - java.lang.String'),
-        ])
-        // check Initial Value path for bar
-        assertTreeStructure(script, [
-                startsWith('ClassNode - script'),
-                eq('Methods'),
-                eq('MethodNode - foo'),
-                eq('Parameter - bar'),
-                eq('Initial Value'),
-                eq('Constant - some_value : java.lang.String'),
+                eq('MethodNode - foo(java.lang.String)'),
+                eq('Parameters'),
+                eq('Parameter - java.lang.String bar = some_value'),
         ])
     }
 
@@ -190,32 +181,20 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                         startsWith('ExpressionStatement'),
                         startsWith('Declaration - def x ='),
                         startsWith('ClosureExpression'),
-                        startsWith('Parameter - parm1'),
+                        startsWith('Parameter - java.lang.Object parm1'),
                 ]
         )
     }
 
     void testClosureParametersWithInitialValue() {
         def script = ' def x = { parm1 = "some_value" ->  println parm1 } '
-        // check Type path for parm1
-        assertTreeStructure(script, [
-                eq('BlockStatement - (1)'),
-                startsWith('ExpressionStatement'),
-                startsWith('Declaration - def x ='),
-                eq('ClosureExpression'),
-                startsWith('Parameter - parm1'),
-                eq('Type'),
-                startsWith('ClassNode - java.lang.Object'),
-        ])
-        // check Initial Value path for parm1
+        // check path for parm1
         assertTreeStructure(script, [
                 eq('BlockStatement - (1)'),
                 startsWith('ExpressionStatement'),
                 startsWith('Declaration - def x ='),
                 eq('ClosureExpression'),
-                startsWith('Parameter - parm1'),
-                eq('Initial Value'),
-                startsWith('Constant - some_value : java.lang.String'),
+                startsWith('Parameter - java.lang.Object parm1'),
         ])
     }
 
@@ -240,8 +219,8 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
         def children = namedArgList.children().toList()
         assertEquals('Wrong # named arguments', 2, children.size())
 
-        assertMapEntry(children[0], 'Constant - foo : java.lang.String', 'Constant - bar : java.lang.String')
-        assertMapEntry(children[1], 'Constant - baz : java.lang.String', 'Constant - qux : java.lang.String')
+        assertMapEntry(children[0], 'Constant - java.lang.String foo', 'Constant - java.lang.String bar')
+        assertMapEntry(children[1], 'Constant - java.lang.String baz', 'Constant - java.lang.String qux')
     }
 
     void testDynamicVariable() {
@@ -251,7 +230,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                         eq('BlockStatement - (1)'),
                         eq('ExpressionStatement - BinaryExpression'),
                         eq('Binary - (foo = bar)'),
-                        startsWith('Variable - foo : java.lang.Object'),
+                        startsWith('Variable - java.lang.Object foo'),
                         eq('DynamicVariable - foo'),
                 ]
             )
@@ -263,11 +242,11 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         startsWith('ClassNode'),
                         eq('Methods'),
-                        startsWith('MethodNode - run'),
+                        startsWith('MethodNode - run()'),
                         eq('Body'),
                         startsWith('BlockStatement'),
                         startsWith('ExpressionStatement'),
-                        startsWith('Constant - foo'),
+                        startsWith('Constant - java.lang.String foo'),
                 ]
         )
     }
@@ -293,7 +272,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         eq('ClassNode - MyEnum'),
                         eq('Fields'),
-                        startsWith('FieldNode - FOO : MyEnum'),
+                        startsWith('FieldNode - MyEnum FOO'),
                 ])
     }
 
@@ -303,7 +282,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         startsWith('ClassNode'),
                         eq('Methods'),
-                        eq('MethodNode - main'),
+                        eq('MethodNode - main(java.lang.String[])'),
                         eq('Body'),
                         startsWith('ExpressionStatement'),  //notice, there is only one ExpressionStatement
                         startsWith('StaticMethodCallExpression'),
@@ -337,7 +316,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         startsWith('InnerClassNode - Outer\$Inner'),
                         eq('Methods'),
-                        eq('MethodNode - someMethod'),
+                        eq('MethodNode - someMethod()'),
                         eq('Body'),
                         startsWith('BlockStatement'),
                 ]
@@ -354,22 +333,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         startsWith('InnerClassNode - Outer\$Inner'),
                         eq('Fields'),
-                        startsWith('FieldNode - field'),
-                ]
-        )
-    }
-
-    void testInnerClassWithAnnotations() {
-        assertTreeStructure(
-                '''class Outer {
-                    @Singleton
-                    private class Inner {
-                    }
-                }''',
-                [
-                        startsWith('InnerClassNode - Outer\$Inner'),
-                        eq('Annotations'),
-                        startsWith('AnnotationNode - groovy.lang.Singleton'),
+                        startsWith('FieldNode - java.lang.String field'),
                 ]
         )
     }
@@ -384,7 +348,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         startsWith('InnerClassNode - Outer\$Inner'),
                         eq('Properties'),
-                        startsWith('PropertyNode - property'),
+                        startsWith('PropertyNode - java.lang.Object property'),
                 ]
         )
     }
@@ -395,8 +359,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 'def foo(String bar) {}',
                 [
                     eq('Methods'),
-                    eq('MethodNode - foo'),
-                    eq('Parameter - bar'),
+                    eq('MethodNode - foo(java.lang.String)'),
+                    eq('Parameters'),
+                    eq('Parameter - java.lang.String bar'),
                 ]
             )
 
@@ -406,8 +371,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                     startsWith('ClassNode - script'),
                     eq('Methods'),
-                    eq('MethodNode - foo'),
-                    eq('Parameter - bar'),
+                    eq('MethodNode - foo(java.lang.String)'),
+                    eq('Parameters'),
+                    eq('Parameter - java.lang.String bar'),
                 ]
             )
     }
@@ -421,8 +387,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                     'def foo(String bar) {}',
                     [
                         eq('Methods'),
-                        eq('MethodNode - foo'),
-                        eq('Parameter - bar'),
+                        eq('MethodNode - foo(java.lang.String)'),
+                        eq('Parameters'),
+                        eq('Parameter - java.lang.String bar'),
                     ],
                     adapter
                 )
@@ -434,8 +401,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                     startsWith('ClassNode - script'),
                     eq('Methods'),
-                    eq('MethodNode - foo'),
-                    eq('Parameter - bar'),
+                    eq('MethodNode - foo(java.lang.String)'),
+                    eq('Parameters'),
+                    eq('Parameter - java.lang.String bar'),
                 ],
                 adapter
             )
@@ -449,8 +417,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 'def foo(String bar) {}',
                 [
                     eq('Methods'),
-                    eq('MethodNode - foo'),
-                    eq('Parameter - bar'),
+                    eq('MethodNode - foo(java.lang.String)'),
+                    eq('Parameters'),
+                    eq('Parameter - java.lang.String bar'),
                 ],
                 adapter
             )
@@ -462,8 +431,9 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                     [
                         startsWith('ClassNode - script'),
                         eq('Methods'),
-                        eq('MethodNode - foo'),
-                        eq('Parameter - bar'),
+                        eq('MethodNode - foo(java.lang.String)'),
+                        eq('Parameters'),
+                        eq('Parameter - java.lang.String bar'),
                     ],
                     adapter
                 )
@@ -479,7 +449,8 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                     'def foo(String bar) {}',
                     [
                         eq('Methods'),
-                        eq('MethodNode - foo'),
+                        eq('MethodNode - foo(String)'),
+                        eq('Parameters'),
                         eq('Parameter - bar'),
                     ],
                     adapter
@@ -493,7 +464,8 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                     [
                         startsWith('ClassNode - script'),
                         eq('Methods'),
-                        eq('MethodNode - foo'),
+                        eq('MethodNode - foo(String)'),
+                        eq('Parameters'),
                         eq('Parameter - bar'),
                     ],
                     adapter
@@ -512,7 +484,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
 
         def classNodeTest = root.children().find { it.toString() == 'ClassNode - Test' }
         def methods = classNodeTest.children().find { it.toString() == 'Methods' }
-        def methodNodeTest = methods.children().find { it.toString() == 'MethodNode - test' }
+        def methodNodeTest = methods.children().find { it.toString() == 'MethodNode - test()' }
 
         assert methodNodeTest.properties.any { name, value, type, _ -> name == 'descriptor' && value == '()V' && type == 'String' }
     }
@@ -525,7 +497,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                     contains('closure1'),
                     eq('Methods'),
-                    eq('MethodNode - doCall'),
+                    eq('MethodNode - doCall()'),
                 ],
                 adapter
             )
@@ -554,7 +526,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         contains('closure1'),
                         eq('Methods'),
-                        eq('MethodNode - doCall'),
+                        eq('MethodNode - doCall()'),
                 ],
                 adapter)
 
@@ -562,7 +534,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         contains('closure2'),
                         eq('Methods'),
-                        eq('MethodNode - doCall'),
+                        eq('MethodNode - doCall()'),
                 ],
                 adapter)
 
@@ -570,7 +542,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
                 [
                         contains('closure3'),
                         eq('Methods'),
-                        eq('MethodNode - doCall'),
+                        eq('MethodNode - doCall()'),
                 ],
                 adapter)
     }
@@ -637,7 +609,7 @@ final class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
 
         def classNodeTest = root.children().find { it.toString() == 'ClassNode - Test' }
         def methods = classNodeTest.children().find { it.toString() == 'Methods' }
-        def methodNodeTest = methods.children().find { it.toString() == 'MethodNode - test' }
+        def methodNodeTest = methods.children().find { it.toString() == 'MethodNode - test()' }
 
         assert classNodeTest
         assert methods