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 248358 - IllegalArgumentException: bad position: 725
Summary: IllegalArgumentException: bad position: 725
Status: RESOLVED FIXED
Alias: None
Product: third-party
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: markiewb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 09:21 UTC by sylo
Modified: 2015-03-04 11:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 213102


Attachments
stacktrace (3.97 KB, text/plain)
2014-11-03 09:21 UTC, sylo
Details
stacktrace (3.97 KB, text/plain)
2015-01-06 08:09 UTC, satory
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sylo 2014-11-03 09:21:46 UTC
Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: OpenJDK 64-Bit Server VM, 24.65-b04, OpenJDK Runtime Environment, 1.7.0_65-b32
OS: Linux

User Comments:
sylo: After saving a file netbeans crushes and i need to kill the process




Stacktrace: 
java.lang.IllegalArgumentException: bad position: 725
   at javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1678)
   at de.markiewb.netbeans.plugins.eclipse.formatter.EclipseFormatterUtilities$EclipseFormatterTask.run(EclipseFormatterUtilities.java:239)
   at de.markiewb.netbeans.plugins.eclipse.formatter.EclipseFormatterUtilities$1.run(EclipseFormatterUtilities.java:96)
   at org.netbeans.modules.progress.ui.RunOffEDTImpl.runOffEventDispatchThread(RunOffEDTImpl.java:102)
   at org.netbeans.api.progress.ProgressUtils.runOffEventDispatchThread(ProgressUtils.java:92)
   at de.markiewb.netbeans.plugins.eclipse.formatter.EclipseFormatterUtilities.reFormatWithEclipse(EclipseFormatterUtilities.java:90)
Comment 1 sylo 2014-11-03 09:21:48 UTC
Created attachment 150226 [details]
stacktrace
Comment 2 satory 2015-01-06 08:09:12 UTC
Created attachment 151379 [details]
stacktrace

Write a unit test class, but just added in 2 method signatures i.e.:
@Test
    public void testFilterSetsOrderableToTrueCorrectly() throws Exception {
    }

    @Test
    public void testFilterSetsOrderableToFalseCorrectly() throws Exception {
    }

Then did a CTRL+S and this exception happened.
Comment 3 Exceptions Reporter 2015-03-03 22:01:23 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=213102
Comment 4 Ondrej Vrabec 2015-03-04 08:23:27 UTC
Benno, you're running a background thread but accessing Swing component from there, you should always access it only from EDT.
Comment 5 markiewb 2015-03-04 10:34:57 UTC
(In reply to Ondrej Vrabec from comment #4)
> Benno, you're running a background thread but accessing Swing component from
> there, you should always access it only from EDT.

Will be fixed in https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/57
Comment 6 markiewb 2015-03-04 11:54:57 UTC
(In reply to markiewb from comment #5)
> (In reply to Ondrej Vrabec from comment #4)
> > Benno, you're running a background thread but accessing Swing component from
> > there, you should always access it only from EDT.
> 
> Will be fixed in
> https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/57

Hopefully fixed in version 1.8.0.6 of the plugin. Wait a few days until it is verified and available at the plugin center