jlahoda commented on a change in pull request #1079: [NETBEANS-1780]:Fixed
formatting issue in Switch Expression(JDK-12)
URL:
https://github.com/apache/incubator-netbeans/pull/1079#discussion_r252137590
##########
File path:
java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
##########
@@ -2682,6 +2779,11 @@ public Boolean visitCase(CaseTree node, Void p) {
@Override
public Boolean visitBreak(BreakTree node, Void p) {
accept(BREAK);
+ ExpressionTree exprTree = TreeShims.getValue(node) ;
+ if (exprTree != null) {
+ space();
+ scan(exprTree, p);
Review comment:
Is a return missing here? I believe the BreakTree.getValue() and getLabel()
may in some cases return non-null value, like "break a;". It is probably OK to
handle that as an expression, but presumably should not be handled as an
expression and then as a label.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
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