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


##########
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:
   new method. the old is now deprecated



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