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 84603 - Racecondition in the MergedClasspathImplementation
Summary: Racecondition in the MergedClasspathImplementation
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-11 13:17 UTC by Fabiola Rios
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception build 060909 (5.00 KB, text/plain)
2006-09-11 13:20 UTC, Fabiola Rios
Details
Patch (4.19 KB, patch)
2006-09-11 16:43 UTC, Tomas Zezula
Details | Diff
Patch (5.18 KB, patch)
2006-09-13 13:47 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabiola Rios 2006-09-11 13:17:29 UTC
UndeclaredThrowableException when you D&D SVG components,
Create new project Drag&Drop SVGwait screen, the exception appear...
Comment 1 Fabiola Rios 2006-09-11 13:20:20 UTC
Created attachment 33760 [details]
Exception build 060909
Comment 2 Adam Sotona 2006-09-11 14:16:45 UTC
For me it seems like a race condition in MergedClassPathImplementation.

BTW: The message "Change in unknown classpath" does seem to be very rational.
How the classpath can be unknown by its listener ;)
Comment 3 Jan Becicka 2006-09-11 15:41:56 UTC
Tomasi, do you understand this assertion? I don't :)
Thanks
Comment 4 Tomas Zezula 2006-09-11 15:53:41 UTC
It seems as a racecondition caused by the fix of the
http://www.netbeans.org/issues/show_bug.cgi?id=75635.
1) The first thread removes the classpath from resourceMap in the sync block. 
this.resourceMap.remove (cp);
2) It leaves sync block
3) It calls addClasspathResource() outside sync block
4) Other thread enters sync block and tries to find the CP ---> assertion error
5) The first thread enters the sync block and adds CP into the resourceMap.

In my opinion replacing this.resourceMap.remove (cp); by this.resourceMap.get(cp);
should be OK, but I didn't tried tests yet.
Comment 5 Tomas Zezula 2006-09-11 15:55:03 UTC
I will try to run tests and let you know.
Comment 6 Tomas Zezula 2006-09-11 16:43:36 UTC
Created attachment 33770 [details]
Patch
Comment 7 Tomas Zezula 2006-09-11 16:45:09 UTC
The patch should like in this way. MCPImplTests are passing, but it requires
more testing.
Comment 8 Tomas Zezula 2006-09-12 09:05:13 UTC
Checking in
src/org/netbeans/modules/javacore/classpath/MergedClassPathImplementation.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/classpath/MergedClassPathImplementation.java,v
 <--  MergedClassPathImplementation.java
new revision: 1.29; previous revision: 1.28
done
Comment 9 Tomas Zezula 2006-09-13 13:47:16 UTC
Created attachment 33877 [details]
Patch
Comment 10 Tomas Zezula 2006-09-19 15:55:54 UTC
Reporter can you verify it in the release55_branch, otherwise I am not able to
integrate it into the NetBeans 5.5
Comment 11 Jan Becicka 2006-09-25 09:24:34 UTC
Fabiola, can you verify the fix? Thanks
Comment 12 Marian Mirilovic 2006-10-06 09:49:32 UTC
Is this issue integrated into NB 5.5 ? 
If not when do you want to do it ? 

Fabi, 
I think Tomas is waiting for your verification. 
Comment 13 Tomas Zezula 2006-10-06 10:08:36 UTC
No, it's not yet verified. It can be reproduced only in the ME designer.
Comment 14 Fabiola Rios 2006-10-10 14:47:34 UTC
The fix will be included in 6.0, because is not safe to integrate in MP 5.5 release
Comment 15 Quality Engineering 2007-09-20 10:15:16 UTC
Reorganization of java component