mbien commented on code in PR #2544:
URL: https://github.com/apache/netbeans/pull/2544#discussion_r852480675


##########
java/java.editor/src/org/netbeans/modules/java/editor/javadoc/TagRegistery.java:
##########
@@ -99,24 +100,31 @@ private TagRegistery() {
         addTag("@provides", false, EnumSet.of(ElementKind.MODULE));
         addTag("@uses", false, EnumSet.of(ElementKind.MODULE));
         
-        addTag("@code", true, ALL_KINDS);
+        addTag("@code", true, ALL_KINDS,5,Integer.MAX_VALUE);
         addTag("@docRoot", true, ALL_KINDS);
         // just in empty tag description
-        addTag("@inheritDoc", true, EnumSet.of(ElementKind.METHOD));
+        addTag("@inheritDoc", true, 
EnumSet.of(ElementKind.METHOD),4,Integer.MAX_VALUE);
         addTag("@link", true, ALL_KINDS);
         addTag("@linkplain", true, ALL_KINDS);
-        addTag("@literal", true, ALL_KINDS);
-        addTag("@value", true, EnumSet.of(ElementKind.FIELD));
+        addTag("@literal", true, ALL_KINDS,5,Integer.MAX_VALUE);
+        addTag("@value", true, 
EnumSet.of(ElementKind.FIELD),4,Integer.MAX_VALUE);
+        
addTag("@summary",true,EnumSet.of(ElementKind.METHOD),10,Integer.MAX_VALUE);

Review Comment:
   sorry that i wasn't clearer before, but i hoped you would add spaces to all 
parameter lists you changed - not only the one occurrence I marked :)
   



##########
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java:
##########
@@ -1280,6 +1282,24 @@ 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
+                    switch(tag.getKind().name()) {
+                        case "SUMMARY" : 
+                            try {
+                                Method getSummaryMethod = 
tag.getClass().getDeclaredMethod("getSummary");
+                                List<? extends DocTree> summaryList = (List<? 
extends DocTree>)getSummaryMethod.invoke(tag);
+                                sb.append(inlineTags(summaryList, docPath, 
doc, trees, null));
+                            } catch(ReflectiveOperationException ex) {
+                                // IGNORE
+                            }
+                            break;
+                        default : 
+                            break;
+                    }
+                    break;
+                }

Review Comment:
   Since NetBeans 14 will require javac 18 at compile and runtime, I don't 
think we have to invoke this via reflection anymore.
   
   ```java
                   case SUMMARY:
                       SummaryTree sumTag = (SummaryTree)tag;
                       sb.append(inlineTags(sumTag.getSummary(), docPath, doc, 
trees, null));
   ```
   should do the job as far as I can tell.



##########
java/java.editor/test/unit/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionQueryTest.java:
##########
@@ -326,6 +327,27 @@ public void testThrows2() throws Exception {
         performCompletionTest(code, "ClassCircularityError", 
"ClassFormatError", "ClassCastException", "ClassNotFoundException");
     }
     
+    public void testSummaryCompletionForMethod() throws Exception {
+        try {
+            SourceVersion.valueOf("RELEASE_10"); //NOI18N
+        } catch (IllegalArgumentException ex) {
+            //OK, no RELEASE_10, skip tests
+            return;
+        }        

Review Comment:
   same here. Could you try to remove this? Tests should hopefully all pass 
without this check. There shouldn't be a scenario anymore where a lower javac 
version is used.



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

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