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 49183 - Random IndexOutOfBounds Exception that persists even after restart
Summary: Random IndexOutOfBounds Exception that persists even after restart
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-17 08:20 UTC by beoran
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description beoran 2004-09-17 08:20:01 UTC
I get the Exception below seemingly randomly when
editing my project source files using Netbeans 4.0
beta 1. This did not occur in the beginning, but
onlmy after my project grew somewhat larger. Now,
even if I restart netbeans, the exception is
thrown when I type or click in the editor windoow,
not always, but still often enough to make normal
work nearly impossible. Maybe I'm mistaken, but
perhaps soemthing is wrong with the Java parser
used for syntax coloring?

I realise that this bug may be dificult to
duplicate. One indication could be that I use a
custom-defined colour scheme, whith a blue
background and yellow characters (Borland Pascal
Style, for those who know/remember that.)



*********** Exception occurred ************ at
5:21 PM on Sep 16, 2004
Annotation: Exception occurred in Request Processor
java.lang.IndexOutOfBoundsException: Index: 27,
Size: 2
        at
java.util.ArrayList.RangeCheck(ArrayList.java:507)
        at
java.util.ArrayList.remove(ArrayList.java:392)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.LightAttrList.remove(LightAttrList.java:154)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.replaceObject(MetadataElement.java:1350)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.replaceChild(JavaClassImpl.java:758)
        at
org.netbeans.jmi.javamodel.JavaClass$Impl.replaceChild(Unknown
Source)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.removeChild(MetadataElement.java:1339)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement._delete(MetadataElement.java:138)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement._delete(SemiPersistentElement.java:750)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl._delete(JavaClassImpl.java:881)
        at
org.netbeans.mdr.handlers.InstanceHandler.refDelete(InstanceHandler.java:306)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.deleteCollection(SemiPersistentElement.java:381)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.processMembers(SemiPersistentElement.java:421)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.processPersistent(SemiPersistentElement.java:396)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.matchPersistent(JavaClassImpl.java:464)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.setElementInfo(SemiPersistentElement.java:94)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initChildren(ResourceImpl.java:281)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initChildren(ResourceImpl.java:258)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.initCheck(MetadataElement.java:129)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.getElementInfo(SemiPersistentElement.java:144)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.initChildren(JavaClassImpl.java:534)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.initASTElements(JavaClassImpl.java:913)
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getInterfaceNames(JavaClassImpl.java:905)
        at
org.netbeans.jmi.javamodel.JavaClass$Impl.getInterfaceNames(Unknown
Source)
        at
org.netbeans.modules.java.bridge.ClassElementImpl$InterfacesListener.getTypeRefs(ClassElementImpl.java:1024)
        at
org.netbeans.modules.java.bridge.CallableImpl$ExceptionsListener.initElements(CallableImpl.java:585)
        at
org.netbeans.modules.java.bridge.ClassElementImpl$ClassListener.connect(ClassElementImpl.java:874)
        at
org.netbeans.modules.java.bridge.ClassElementImpl.connectListener(ClassElementImpl.java:98)
        at
org.netbeans.modules.java.bridge.ElementImpl.attachedToElement(ElementImpl.java:439)
        at
org.openide.src.Element.<init>(Element.java:56)
        at
org.openide.src.MemberElement.<init>(MemberElement.java:36)
        at
org.openide.src.ClassElement.<init>(ClassElement.java:93)
        at
org.openide.src.ClassElement.<init>(ClassElement.java:84)
        at
org.netbeans.modules.java.bridge.DefaultWrapper.wrapClass(DefaultWrapper.java:34)
        at
org.netbeans.modules.java.bridge.DefaultLangModel.createTopClass(DefaultLangModel.java:159)
        at
org.netbeans.modules.java.bridge.TopClassesCollection.createElement(TopClassesCollection.java:60)
        at
org.netbeans.modules.java.bridge.ObjectsCollection.cachedElement(ObjectsCollection.java:74)
        at
org.netbeans.modules.java.bridge.ObjectsCollection.getElements(ObjectsCollection.java:106)
        at
org.netbeans.modules.java.bridge.ClassesCollection.getClasses(ClassesCollection.java:72)
        at
org.netbeans.modules.java.bridge.SourceElementImpl.getClasses(SourceElementImpl.java:144)
        at
org.netbeans.modules.java.bridge.SourceElementImpl.getAllClasses(SourceElementImpl.java:148)
        at
org.netbeans.modules.java.bridge.SrcElementImpl.getAllClasses(SrcElementImpl.java:186)
        at
org.netbeans.modules.java.JavaParserGlue.refireCookieChange(JavaParserGlue.java:356)
        at
org.netbeans.modules.java.JavaParserGlue$2.run(JavaParserGlue.java:536)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
Comment 1 pfelenda 2004-09-17 08:36:25 UTC
Assigning to java module. The exception come form javacore.
Comment 2 Tomas Hurka 2004-09-17 10:15:14 UTC
The bug has nothing to do with syntax coloring. We will need to find a way how to 
reproduce it. If you can, please try latest Q-build. To see if you can still reproduce it. If 
that does not help, please shutdown IDE go to your user directory, delete the  
var/cache/mdrstorage directory 
and restart the IDE.  Thanks.

Comment 3 beoran 2004-09-17 11:18:24 UTC
I moved the var/cache directory away to var/cache_old, and now
everything seems to have returned to normal. Apparently, the cached
files had become corrupted somehow. 

I tried the q-build and it also seemed to work OK with my project,
most likely because it uses a fresh, different var/cache folder under
~/.netbeans/dev in stead of under ~/.netbeans/4.0beta1 

I still think this is some kind of defect, but one of a lesser
priority: the cache system should detect coruption (if that's
possible) and handle it in some sensible way. 

Oh, and thank you very much for the quick reply. 
Comment 4 Tomas Hurka 2004-09-17 13:15:54 UTC
You are right, cached files can become corrupted. This is one explanation. There is a 
possibility that this case was fixed in recent builds. BTW: You 
don't need to move var/cache away - just delete  var/cache/mdrstorage directory and 
leave other files in var/cache intact. Lowering priority to P2 and closing as works-for-
me. If you experience it again, please reopen this issue and try explain steps how to 
reproduce it. Thanks.
Comment 5 Quality Engineering 2007-09-20 11:53:19 UTC
Reorganization of java component