Community
Participate
Working Groups
This patch came about from a bug I was seeing that happened because a class was loaded and woven during initializing of the ClassLoaderWeavingAdaptor. The only safe thing to do in this case is to not weave until initialization occurs.
Created attachment 40669 [details] Loadtime module patch I previously wrote and tested this logic so that the second thread would proceed without being woven. But I think that's a worse approach than the attached patch, which simply synchronizes so that initialization has to complete on the first thread before another thread can get the weaving adaptor.
This bug is related to if not a duplicate of bug 122580.
Without further information about which level of AspectJ, which level/version of JDK, which class, stack trace, verbose log or even a testcase I am very reluctant to add synchronization to the weaver. We have had deadlock problems before (Bug 99861, Bug 109344). Also all weaving for a particular class loader is single threaded and all static initialization is static a fail to understand (given the information provided) what actual problem we are trying to solve.
It's been a few months since I ran into this issue so my recollection is a bit vague on the particulars. I will test more with recent builds and reopen the problem when I have a concrete test case.
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.