This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new 5f6908fa4a Fix Javadoc formatting error when using add/remove param 
hint.
     new 6272f5c470 Merge pull request #6282 from 
neilcsmith-net/fix-garbled-javadoc
5f6908fa4a is described below

commit 5f6908fa4a078e41d0821158784ff5fd8e3bc3ae
Author: Neil C Smith <neilcsm...@apache.org>
AuthorDate: Tue Aug 1 15:45:48 2023 +0100

    Fix Javadoc formatting error when using add/remove param hint.
---
 .../src/org/netbeans/api/java/source/TreeMaker.java           | 11 +++++++++++
 .../src/org/netbeans/modules/javadoc/hints/AddTagFix.java     |  2 +-
 .../src/org/netbeans/modules/javadoc/hints/RemoveTagFix.java  |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java 
b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
index e45ae80274..38d84cd3b0 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java
@@ -3534,6 +3534,17 @@ public final class TreeMaker {
         return delegate.Deprecated(text);
     }
 
+    /**Creates a new javadoc comment.
+     *
+     * @param fullBody the entire body of the comment
+     * @param tags the block tags of the comment (after the main body)
+     * @return newly created DocCommentTree
+     * @since 2.62
+     */
+    public DocCommentTree DocComment(List<? extends DocTree> fullBody, List<? 
extends DocTree> tags) {
+        return delegate.DocComment(fullBody, tags);
+    }
+
     /**Creates a new javadoc comment.
      * 
      * @param firstSentence the javadoc comment's first sentence
diff --git a/java/javadoc/src/org/netbeans/modules/javadoc/hints/AddTagFix.java 
b/java/javadoc/src/org/netbeans/modules/javadoc/hints/AddTagFix.java
index de835b49a5..fc0535f9ee 100644
--- a/java/javadoc/src/org/netbeans/modules/javadoc/hints/AddTagFix.java
+++ b/java/javadoc/src/org/netbeans/modules/javadoc/hints/AddTagFix.java
@@ -85,7 +85,7 @@ abstract class AddTagFix extends JavaFix {
             blockTags.add(newTree);
         }
         
-        DocCommentTree newDoc = make.DocComment(docComment.getFirstSentence(), 
docComment.getBody(), blockTags);
+        DocCommentTree newDoc = make.DocComment(docComment.getFullBody(), 
blockTags);
         Tree tree = ctx.getPath().getLeaf();
         javac.rewrite(tree, docComment, newDoc);
     }
diff --git 
a/java/javadoc/src/org/netbeans/modules/javadoc/hints/RemoveTagFix.java 
b/java/javadoc/src/org/netbeans/modules/javadoc/hints/RemoveTagFix.java
index 766edc77f2..16bcfab5c7 100644
--- a/java/javadoc/src/org/netbeans/modules/javadoc/hints/RemoveTagFix.java
+++ b/java/javadoc/src/org/netbeans/modules/javadoc/hints/RemoveTagFix.java
@@ -72,7 +72,7 @@ final class RemoveTagFix extends JavaFix {
                 blockTags.add(docTree);
             }
         }
-        DocCommentTree newDoc = make.DocComment(docComment.getFirstSentence(), 
docComment.getBody(), blockTags);
+        DocCommentTree newDoc = make.DocComment(docComment.getFullBody(), 
blockTags);
         Tree tree = ctx.getPath().getLeaf();
         javac.rewrite(tree, docComment, newDoc);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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

Reply via email to