jlahoda commented on a change in pull request #2126:
URL: https://github.com/apache/netbeans/pull/2126#discussion_r419155131



##########
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'd say - simplify the code. (We will see if some tests fail.) Overall, 
touching symbols too much inside CausalDiff is not very good, although in this 
particular case it probably does not matter much.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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

Reply via email to