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

Summary: IllegalArgumentException: bad position: -369
Product: web Reporter: valour47
Component: HTML EditorAssignee: Milutin Kristofic <mkristofic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 218978
Attachments: stacktrace

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