jlahoda commented on a change in pull request #2126:
URL: https://github.com/apache/netbeans/pull/2126#discussion_r419047946
##########
File path:
java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
##########
@@ -535,8 +535,18 @@ public int endPos(JCTree t) {
VariableTree vt = fgt.getVariables().get(fgt.getVariables().size()
- 1);
return TreeInfo.getEndPos((JCTree)vt, oldTopLevel.endPositions);
}
- return TreeInfo.getEndPos(t, oldTopLevel.endPositions);
+ int endPos = TreeInfo.getEndPos(t, oldTopLevel.endPositions);
+
+ // [NETBEANS-4299], catch a synthetic annotation attribute and try rhs
+ if (endPos == Position.NOPOS && t instanceof JCAssign) {
+ JCAssign assign = (JCAssign)t;
+ if (assign.lhs instanceof JCIdent
+ && ((JCIdent)assign.lhs).sym instanceof
Symbol.MethodSymbol) {
Review comment:
I think the "&& ... instanceof MethodSymbol" is probably unnecessary.
----------------------------------------------------------------
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.
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