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


##########
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:
   >  Surely we can get a slightly better name here? 
   
   done. While trying to rename I also found a bug, in javac and NB. 
https://github.com/apache/netbeans/issues/9056 (both were fixed by now)
   
   > Be good to document the line end method while you're at it. Change should 
probably go in apichanges.xml.
   
   javadoc is now updated. Not sure about the apichanges.xml, deprecation is 
self explanatory and links to the new methods. I wouldn't know what useful 
information to put into that xml.
   
   >  git commits by AuthorDate not CommitDate
   
   started with the git file history issues too. Might open a PR at some point 
with some improvements.



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