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 254159 - IllegalArgumentException: bad position: -369
Summary: IllegalArgumentException: bad position: -369
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-05 18:27 UTC by valour47
Modified: 2015-08-07 01:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 218978


Attachments
stacktrace (3.81 KB, text/plain)
2015-08-05 18:27 UTC, valour47
Details

Note You need to log in before you can comment on or make changes to this bug.
Description valour47 2015-08-05 18:27:51 UTC
Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.71-b01, Java(TM) SE Runtime Environment, 1.7.0_71-b14
OS: Windows 7

User Comments:
valour47: it appeared silently while i was working. i experienced no noticeable problems.




Stacktrace: 
java.lang.IllegalArgumentException: bad position: -369
   at javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1678)
   at org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem$1.run(HtmlCompletionItem.java:253)
   at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:323)
   at org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem.substituteText(HtmlCompletionItem.java:242)
   at org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem.substituteText(HtmlCompletionItem.java:234)
   at org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem.substituteText(HtmlCompletionItem.java:230)
Comment 1 valour47 2015-08-05 18:27:53 UTC
Created attachment 155188 [details]
stacktrace
Comment 2 Milutin Kristofic 2015-08-06 10:43:32 UTC
Hi, I cannot reproduce this, it was invoked by html code completion when you code completed something that was already there.

I made a small change, so the code is consistent (once it is calculated caretPOsition by getSelectionEnd() and once by getCaretPosition(). 


If you have reproducible step, it will help me to fix it. http://hg.netbeans.org/web-main/rev/dde10317514e
Comment 3 Quality Engineering 2015-08-07 01:16:25 UTC
Integrated into 'main-silver', will be available in build *201508070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dde10317514e
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #254159 - IllegalArgumentException: bad position: -369