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 2022/11/16 13:33:20 UTC

[GitHub] [netbeans] lbownik commented on a diff in pull request #4882: Retain SOURCE annotations inside the intenal model.

lbownik commented on code in PR #4882:
URL: https://github.com/apache/netbeans/pull/4882#discussion_r1023999499


##########
java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBClassWriter.java:
##########
@@ -55,5 +60,125 @@ protected NBClassWriter(Context context) {
         nbNames = NBNames.instance(context);
         types = Types.instance(context);
     }
-    
+
+    @Override
+    protected int writeExtraAttributes(Symbol sym) {
+        int attrs = super.writeExtraAttributes(sym);
+        if (sym.kind == Kind.MTH) {
+            attrs += writeExtraParameterAttributes((MethodSymbol) sym);
+        }
+        attrs += writeExtraJavaAnnotations(sym.getRawAttributes());
+        attrs += writeExtraTypeAnnotations(sym.getRawTypeAttributes());
+        return attrs;
+    }
+
+
+    protected int writeExtraParameterAttributes(MethodSymbol m) {
+        boolean hasSourceLevel = false;

Review Comment:
   would something below work?
   if(m.params != null) {
      hasSourceLevel = m.params.flatMap(VarSymbol::getRawAttributes).anyMaches(a -> types.getRetention(a) == RetentionPolicy.SOURCE);
   }



-- 
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: notifications-unsubscribe@netbeans.apache.org

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