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 186321 - [69cat] IndexOutOfBoundsException: Index: 0, Size: 0
Summary: [69cat] IndexOutOfBoundsException: Index: 0, Size: 0
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 18:28 UTC by jasondonmoyer
Modified: 2010-07-08 07:12 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 169617


Attachments
stacktrace (1.86 KB, text/plain)
2010-05-18 18:28 UTC, jasondonmoyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jasondonmoyer 2010-05-18 18:28:43 UTC
Build: NetBeans IDE Dev (Build 201005132200)
VM: Java HotSpot(TM) 64-Bit Server VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Linux

User Comments:
jasondonmoyer: typing in the java editor




Stacktrace: 
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.RangeCheck(ArrayList.java:547)
   at java.util.ArrayList.get(ArrayList.java:322)
   at org.netbeans.modules.java.freeform.AnnotationProcessingQueryImpl$R.sourceOutputDirectory(AnnotationProcessingQueryImpl.java:255)
   at org.netbeans.modules.java.source.classpath.CacheSourceForBinaryQueryImpl$R.resolveAptSourceCache(CacheSourceForBinaryQueryImpl.java:154)
   at org.netbeans.modules.java.source.classpath.CacheSourceForBinaryQueryImpl$R.getRoots(CacheSourceForBinaryQueryImpl.java:133)
   at org.netbeans.api.java.source.SourceUtils.getFile(SourceUtils.java:476)
Comment 1 jasondonmoyer 2010-05-18 18:28:47 UTC
Created attachment 99156 [details]
stacktrace
Comment 2 Tomas Zezula 2010-05-19 11:30:08 UTC
Workaround is to add:
<source-output>some-folder</source-output>
inside the <annotation-processing> element.
Comment 3 Tomas Zezula 2010-05-19 12:11:45 UTC
Fixed jet-main b4f712722bb0
Comment 4 _ moser 2010-06-04 16:25:40 UTC
Will this be go into the 6.9 release. At the moment this is a total show-stopper for me and I stick with 6.8. Even the proposed workaround does not work in 6.9: with

<annotation-processing>
    <source-output>gen-src</source-output>
</annotation-processing>

in the <compilation-unit> section of my project.xml NetBeans 6.9 does not recognize the project anymore. What could I do to use the Refactor-Move packages of a Freeform project in NB 6.9?
Comment 5 Tomas Zezula 2010-06-04 16:29:56 UTC
The workaround should work fine with nb 6.9. If the project is not recognized the project.xml is not according to schema. Please attach the project.xml I will take a look.
Comment 6 _ moser 2010-06-04 16:56:34 UTC
OK, I had to update the xmlns attribute of the <java-data> tag from "http://www.netbeans.org/ns/freeform-project-java/2" to "http://www.netbeans.org/ns/freeform-project-java/3" and to add the <ANNOTATION-PROCESSING> tag to all compilation units. Now it works, many thanks.

However, should this be the procedure every user of freeform projects has to go after the release, before refactoring works again? I think this is a show-stopper for the 6.9 release.
Comment 7 Tomas Zezula 2010-06-07 17:55:49 UTC
Finally I've found a way how to reproduce this problem even without having annotation processors enabled. Originally I've thought that the method causing the problem is called only when AP are enabled, but it's also called when there are 2 or more dependent freeform projects. The fix is scheduled for the first patch release. I will also ask if it's still possible to get the fix into NB 6.9 but it's already code frozen.
Comment 8 Peter Pis 2010-06-08 14:04:45 UTC
Verified.

Product Version: NetBeans IDE Dev (Build 100608-d3de0f34d022)
Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13
System: Linux version 2.6.31-22-generic running on i386; UTF-8; en_US (nb)
Comment 9 Peter Pis 2010-06-08 15:00:04 UTC
will be integrated into 6.9.
Comment 10 Jan Lahoda 2010-06-08 16:13:31 UTC
The patch seems safe to me.

Transplanted to release69 branch:
http://hg.netbeans.org/release69/rev/9edaa5d347f4
Comment 11 Peter Pis 2010-06-09 08:58:42 UTC
Verified.

Product Version: NetBeans IDE 6.9 (Build 201006082101)
Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13
System: Linux version 2.6.31-22-generic running on i386; UTF-8; en_US (nb)
Comment 12 rbalada 2010-06-14 08:16:03 UTC
Transplanted to release691 repository as 0e60fc8c92cd
Comment 13 rbalada 2010-06-14 08:38:03 UTC
Added keyword 6.9.1_CANDIDATE to bugfixes, which were integrated in release69 repository *after* the release691 clone has been created.
Comment 14 Peter Pis 2010-07-02 13:43:48 UTC
Verified.

NetBeans IDE 6.9.1 Dev (Build 201006302301)