This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 203817 - IllegalArgumentException: bad position: 118
Summary: IllegalArgumentException: bad position: 118
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: UlrichCech
URL:
Keywords:
Depends on:
Blocks: 51924
  Show dependency tree
 
Reported: 2011-10-17 10:51 UTC by Jan Lahoda
Modified: 2011-10-20 12:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 182049


Attachments
stacktrace (4.71 KB, text/plain)
2011-10-17 10:51 UTC, Jan Lahoda
Details
Corrected the BadLocationException for the Cut-Action (2.29 KB, patch)
2011-10-18 15:06 UTC, UlrichCech
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2011-10-17 10:51:01 UTC
Build: NetBeans IDE Dev (Build 20111016-9758c971c169)
VM: OpenJDK 64-Bit Server VM, 20.0-b11, OpenJDK Runtime Environment, 1.6.0_22-b22
OS: Linux

User Comments:
jlahoda: Running with the patch attached to http://netbeans.org/bugzilla/show_bug.cgi?id=51924:
http://netbeans.org/bugzilla/show_bug.cgi?id=51924

Doing "Cut" on the very last line of the document.




Stacktrace: 
java.lang.IllegalArgumentException: bad position: 118
   at javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1664)
   at org.netbeans.editor.BaseKit$CutAction$1.run(BaseKit.java:1973)
   at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:344)
   at org.netbeans.editor.BaseKit$CutAction.actionPerformed(BaseKit.java:1934)
   at org.netbeans.modules.java.editor.imports.ClipboardHandler$JavaCutAction.access$1001(ClipboardHandler.java:539)
   at org.netbeans.modules.java.editor.imports.ClipboardHandler$JavaCutAction$1.run(ClipboardHandler.java:554)
Comment 1 Jan Lahoda 2011-10-17 10:51:06 UTC
Created attachment 112122 [details]
stacktrace
Comment 2 UlrichCech 2011-10-18 15:06:10 UTC
Created attachment 112183 [details]
Corrected the BadLocationException for the Cut-Action

The cut-action now behaves like in IntelliJ, that the cursor jumps to the first position of the line following the line cutted off (no more BadLocationExceptions possible ;-))
Comment 3 Milutin Kristofic 2011-10-20 12:59:53 UTC
Already Fixed in https://netbeans.org/bugzilla/show_bug.cgi?id=51924