This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 88159 - No way to create a Javadoc comment
Summary: No way to create a Javadoc comment
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: apireviews
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 92006
  Show dependency tree
 
Reported: 2006-10-27 15:48 UTC by Andrei Badea
Modified: 2009-04-01 12:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2006-10-27 15:48:14 UTC
Current I see no way to create a Javadoc comment. I would have to use
Comment.create(Style, int, int, int, String), but since I don't want to specify
the int parameters I would have to use the non-public Query.NOPOS value. Perhaps
a Comment.create(Style, String) constructor should be added.
Comment 1 Jiri Prox 2008-04-11 00:53:20 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 2 Jan Becicka 2008-08-11 14:42:22 UTC
public static Comment create(Style style, String s) {
  return new Comment(style, NOPOS, NOPOS, NOPOS, s);
}

Honzo, can I add it?
    
Comment 3 Jan Lahoda 2008-08-11 14:44:29 UTC
If it works, go ahead.
Comment 4 Rastislav Komara 2009-02-03 10:55:58 UTC
Overtake.
Comment 5 Rastislav Komara 2009-02-24 09:46:02 UTC
@jbecicka: is this issue still valid?
Comment 6 Rastislav Komara 2009-03-31 10:17:13 UTC
Added new method into Comment allowing creating comment of any type. Requesting api review. if there will be no negative
response within 24hours the patch will be applied.



PATCH:
diff -r 329c29766434 java.source/src/org/netbeans/api/java/source/Comment.java
--- a/java.source/src/org/netbeans/api/java/source/Comment.java Tue Mar 31 08:29:54 2009 +0200
+++ b/java.source/src/org/netbeans/api/java/source/Comment.java Tue Mar 31 11:13:01 2009 +0200
@@ -105,6 +105,17 @@
     }

     /**
+     * Define a comment, using specified style.
+     * @param style the style of comment
+     * @param indent indentation of comment
+     * @param text textual content of comment. With or without proper escaping
+     * @return new comment
+     */
+    public static Comment create(Style style, String text) {
+        return new Comment(style, NOPOS, NOPOS, NOPOS, text);
+    }
+
+    /**
      * Define a comment, using source file positions.
      * @param style the style of comment
      * @param pos start position within source file
Comment 7 Rastislav Komara 2009-04-01 12:47:15 UTC
jet-main #1e3301e14f46