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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to