netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Editor Utilities to LineDocumentUtils migration

Open mbien opened this issue 2 months ago • 1 comments

Switched to non-deprecated editor utilities API.

PR is split into commits which usually handle a method pair.

note to first commit:

LineDocumentUtils unfortunately broke symmetry in getLine[Start/End]:

  • getLineStart didn't declare BadLocationException to be thrown and did not have any range checks
  • getRowStart declared BadLocationException but called getLineStart which can't throw the Exception

to resolve this I had to add getLine[Start/End]Offset and deprecate getLine[Start/End]:

  • getLine[Start/End]Offset checks the range and declares BadLocationException, just like the getLineEnd sibling did.
  • this makes the API symmetrical and allows the try-catch blocks (which had to be already implemented) to function

its ugly but this was the best option I came up with.

mbien avatar Oct 20 '25 04:10 mbien

duplicated code strikes again

mbien avatar Dec 02 '25 19:12 mbien

rebasing. planning to merge this this week assuming everything is ok.

mbien avatar Dec 15 '25 15:12 mbien

fixed a few mistakes, will merge once green. then proceed with the maven update PR.

mbien avatar Dec 16 '25 23:12 mbien