ebarboni commented on code in PR #8940:
URL: https://github.com/apache/netbeans/pull/8940#discussion_r2582123618


##########
ide/editor.document/src/org/netbeans/api/editor/document/LineDocumentUtils.java:
##########
@@ -61,14 +61,26 @@ private LineDocumentUtils() {
      * @param doc non-null document to operate on
      * @param offset position in document where to start searching
      * @return offset of character right above newline prior the given offset 
or zero.
+     * @deprecated Use {@link #getLineStart2}
      */
+    @Deprecated
     public static int getLineStart(@NonNull LineDocument doc, int offset) {
         return doc.getParagraphElement(offset).getStartOffset();
     }
 
-    public static int getLineEnd(@NonNull LineDocument doc, int offset)
-    throws BadLocationException
-    {
+    /**
+     * Get start offset of a (newline character separated) line.
+     * @param doc non-null document to operate on
+     * @param offset position in document where to start searching
+     * @return offset of character right above newline prior the given offset 
or zero.
+     * @throws javax.swing.text.BadLocationException If offset is out of bounds
+     */
+    public static int getLineStart2(@NonNull LineDocument doc, int offset) 
throws BadLocationException {
+        checkOffsetValid(doc, offset);
+        return doc.getParagraphElement(offset).getStartOffset();
+    }

Review Comment:
   > Yes, it's ugly. Surely we can get a slightly better name here? Maybe 
`getLineStartOffset` / `getLineEndOffset` or `findLineStart` / `findLineEnd`, 
or even `lineStart` / `lineEnd`? Be good to document the line end method while 
you're at it. Change should probably go in `apichanges.xml`.
   > 
   > @ebarboni should consider changes required to get this module in Javadoc 
too?
   
   Maybe looks like there is around 20 modules not in apidoc that hava 
apichanges.xml.  Will try to list them. No findings on bz of api/spi move or so 
but AFAIK editor.document is not in apidoc since the begining.



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