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 49660

Summary: CMEs from LightAttrList
Product: java Reporter: _ tboudreau <tboudreau>
Component: UnsupportedAssignee: issues@java <issues>
Status: RESOLVED INVALID    
Severity: blocker Keywords: RANDOM, THREAD
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ tboudreau 2004-09-29 00:21:37 UTC
Happens once in a while on startup when using the Navigator/
Javagator modules - sometimes the stack trace is the Navigator 
module's code, sometimes it is editor fold computation (both 
will have threads that have requested structural information 
about whatever is open in the editor, and the classpath scanner 
is usually [always?] also running at the time this is thrown).

java.lang.RuntimeException
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.LightAttrList.s
etInnerList(LightAttrList.java:88)
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.
reinitClassifiers(ResourceImpl.java:144)
        at 
org.netbeans.modules.javacore.scanning.JavaUpdater.makeIndex
(JavaUpdater.java:243)
        at 
org.netbeans.modules.javacore.scanning.JavaUpdater.computeIn
dex(JavaUpdater.java:58)
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.
directUpdate(ResourceImpl.java:536)
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.
checkUpToDate(ResourceImpl.java:479)
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.
updateFromDataObject(ResourceImpl.java:385)
        at 
org.netbeans.modules.javacore.ExclusiveMutex.parseIfNeeded(E
xclusiveMutex.java:218)
        at 
org.netbeans.modules.javacore.ExclusiveMutex.enter(ExclusiveM
utex.java:137)
        at 
org.netbeans.mdr.NBMDRepositoryImpl.beginTrans(NBMDReposi
toryImpl.java:232)
[catch] at 
org.netbeans.modules.javacore.parser.MDRParser$1.run(MDRPar
ser.java:110)
        at org.openide.util.Task.run(Task.java:136)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.ja
va:330)
        at 
org.openide.util.RequestProcessor$Processor.run(RequestProces
sor.java:686)
*********** Exception occurred ************ at 1:08 AM on Sep 
29, 2004
Annotation: Exception occurred in Request Processor
java.util.ConcurrentModificationException
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.LightAttrList$
LightAttrListIterator.testModCount(LightAttrList.java:371)
        at 
org.netbeans.modules.javacore.jmiimpl.javamodel.LightAttrList$
LightAttrListIterator.hasNext(LightAttrList.java:422)
        at 
org.netbeans.modules.javagator.JUtils.getClassMembers(JUtils.ja
va:880)
        at 
org.netbeans.modules.javagator.ClassMemberModel.loadConten
ts(ClassMemberModel.java:230)
        at 
org.netbeans.spi.navigator.ListModelSupport2$Loader.run(ListM
odelSupport2.java:947)
        at org.openide.util.Task.run(Task.java:136)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.ja
va:330)
[catch] at 
org.openide.util.RequestProcessor$Processor.run(RequestProces
sor.java:686)
  cancelled or inactive - will not load contents - cancelled false 
active false
 ListModelSupport2.Set contents 4 items on Roots@9226151 for 
TME2 for B
State Change - Model is now ready? true
Comment 1 Martin Matula 2004-09-29 13:26:20 UTC
This seems to be a bug in the javagator - in JUtils.getClassMembers.
Make sure you do use the iterator in a locked transaction to avoid
concurrent modifications. Or you can make a local copy of the list you
want to iterate through.
Comment 2 _ tboudreau 2004-09-29 14:23:49 UTC
Okay, Jan Becicka had suggested to me that the CMEs were a bug.

Important question:  For what operations do I need to acquire the transaction lock, and 
how do I acquire it?  I put Javagator together mostly by reading the sources for whatever I 
was dealing with, and bits of SourceChildren in the Java module.

Is this documented somewhere?