jlahoda commented on issue #1012: [NETBEANS-1440] Fixed BadLocationException on 
triple click to select …
URL: 
https://github.com/apache/incubator-netbeans/pull/1012#issuecomment-436810217
 
 
   Please no. While it might be acceptable to do things like this in some 
cases, I think it would require a good argument on why that's the best 
solution. In this case, there appear to be at least two alternative fix 
candidates:
   -LineDocumentUtils.getWordEnd apparently returns an offset that is beyond 
the document's length, so that might be fixed/changed to not do that. Probably 
simple, and while it might need some more double-checking, probably the best 
solution/fix.
   -EditorCaret.mouseDragged could replace:
   offset = LineDocumentUtils.getWordEnd(lineDoc, offset);
   with something like:
   offset = Math.min(LineDocumentUtils.getWordEnd(lineDoc, offset), 
c.getDocument().getLength())
   but that feels somewhat hacky (i.e. why getWordEnd even returned the offset 
that is too high), but would still be better than catching the 
BadLocationException.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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