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/03/29 19:47:49 UTC

[GitHub] [netbeans] lbownik commented on a change in pull request #3884: Add validation for external snippets

lbownik commented on a change in pull request #3884:
URL: https://github.com/apache/netbeans/pull/3884#discussion_r837852599



##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/TreeShims.java
##########
@@ -227,6 +229,33 @@ public static ExpressionTree getGuardedExpression(Tree node) {
             throw TreeShims.<RuntimeException>throwAny(ex);
         }
     }
+	
+	public static List<DocTree> getSnippetDocTreeAttributes(DocTree node) {
+        try {
+            Class gpt = Class.forName("com.sun.source.doctree.SnippetTree"); //NOI18N
+            return isJDKVersionRelease18_Or_Above()
+                    ? (List<DocTree>)gpt.getDeclaredMethod("getAttributes").invoke(node)  //NOI18N
+                    : null;

Review comment:
       wouldn't returning empty list be more apropriate?




-- 
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