neilcsmith-net commented on code in PR #4648:
URL: https://github.com/apache/netbeans/pull/4648#discussion_r976184470
##########
java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java:
##########
@@ -1151,7 +1151,7 @@ public Boolean visitVariable(VariableTree node, Void p) {
newline();
else
space();
- } else {
+ } else if (sp.getStartPosition(root, mods) !=
sp.getStartPosition(root, node.getType())) {
Review Comment:
> if implicit items have the same start and end pos
Thanks @mbien but this hits on the crux of the issue. The implicit `final`
does not have the same start and end position (zero length), or report `NOPOS`.
It reports the same start _and end_ positions as the following type element.
It has the same length and overlaps.
Were the element reported empty or at no position, it shouldn't get past the
enclosing check at
https://github.com/apache/netbeans/blob/master/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java#L1146
I assume that the reported end position changed which started causing this
issue, but haven't checked old versions to be sure.
--
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