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/11/24 18:51:35 UTC

[GitHub] [netbeans] jherkel commented on a change in pull request #2544: [NETBEANS-1309] add support for @summary javadoc tag

jherkel commented on a change in pull request #2544:
URL: https://github.com/apache/netbeans/pull/2544#discussion_r529804376



##########
File path: java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
##########
@@ -1280,6 +1282,22 @@ private StringBuilder inlineTags(List<? extends DocTree> tags, TreePath docPath,
                 case TEXT:
                     TextTree ttag = (TextTree)tag;
                     sb.append(ttag.getBody());
+                    break;
+                default : {
+                    // process tags that we cannot add directly because they are not accessible during compilation
+                    DocTree.Kind values[] = tag.getKind().getClass().getEnumConstants();

Review comment:
       I will change it in accordance with your proposal. But I don't know how to add unit test that is executed only with JDK 11 for example. Is there any example how to do it?

##########
File path: java/java.editor/src/org/netbeans/modules/java/editor/javadoc/TagRegistery.java
##########
@@ -48,18 +50,17 @@ public static TagRegistery getDefault() {
         return DEFAULT;
     }
 
-    public List<TagEntry> getTags(ElementKind kind, boolean inline) {
-        List<TagEntry> selection = new ArrayList<TagEntry>();
-        for (TagEntry te : tags) {
-            if (te.isInline == inline && te.whereUsed.contains(kind)) {
-                selection.add(te);
-            }
-        }
+    public List<TagEntry> getTags(ElementKind kind, boolean inline,SourceVersion sourceVersion) {
+        List<TagEntry> selection = tags.stream().filter(te -> (te.isInline == inline 
+            && te.whereUsed.contains(kind)
+            && sourceVersion.ordinal() >= te.minJavaVersion 

Review comment:
       I couldn't use SourceVersion but I think (and hope) that SourceVersion enum is constructed in a way that ordinal method equals java version. Also I found this bug (https://bugs.openjdk.java.net/browse/JDK-8253545) with comment from Joe Darcy confirming my assumption.




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