Created attachment 141552 [details]
In the constructor of WeakListenersImpl.ProxyListener there is an unsynchronized access to a static WeakHashMap. WeakHashMap itself is not threadsafe and must be wrapped in a synchronized container to prevent data structure corruption. The corruption has the effect of a tight loop and thus blocks the Thread. Not a deadlock but bad nonetheless.
Multi-threaded calls to
public static <T extends EventListener> T create(Class<T> lType, Class<? super T> apiType, T l, Object source)
can lead to said corruption and block the caller Thread. The attached patch wraps the WeakHashMap in a synchronized Map and thus fixes this defect.
Integrated into 'main-silver', will be available in build *201311240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Martin Klaehn <firstname.lastname@example.org>
Log: #237657: Synchronizing access to constructors map. Reviewed by email@example.com, thanks for the patch.