You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/05/03 05:02:50 UTC

[GitHub] [netbeans] jlahoda commented on a change in pull request #2126: [NETBEANS-4299] find endPos for synthetic annotation attribute

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



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

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