lahodaj commented on code in PR #7339:
URL: https://github.com/apache/netbeans/pull/7339#discussion_r1591258879


##########
java/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java:
##########
@@ -303,4 +321,10 @@ private static MethodInvocationTree 
createAppendInvocation(TreeMaker make, Expre
         );
     }
 
+    private static ExpressionTree makeExpression(TreeMaker make, Element 
element) {
+        return element.getKind() == ElementKind.METHOD
+                ? make.MethodInvocation(Collections.emptyList(), 
make.MemberSelect(make.Identifier("this"), element), Collections.emptyList()) 
// NOI18N
+                : make.Identifier(element.getSimpleName());
+    }

Review Comment:
   If you mean doing `componentName()`, then 
`make.MethodInvocation(Collections.emptyList(), 
make.Identifier(element.getSimpleName()), Collections.emptyList())` should 
work, I think.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to