Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 31599 Details for
Bug 120473
Don't Create Separate Weaving Adaptors for Reflection Loaders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
use the parent loader's adaptor, or skip weaving if null (nothing is woven into reflection delegates from the bootstrap loader)
noWorldForReflectionLoader.txt (text/plain), 2.56 KB, created by
Ron Bodkin
on 2005-12-12 20:05:57 EST
(
hide
)
Description:
use the parent loader's adaptor, or skip weaving if null (nothing is woven into reflection delegates from the bootstrap loader)
Filename:
MIME Type:
Creator:
Ron Bodkin
Created:
2005-12-12 20:05:57 EST
Size:
2.56 KB
patch
obsolete
>Index: src/org/aspectj/weaver/loadtime/Aj.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/loadtime/src/org/aspectj/weaver/loadtime/Aj.java,v >retrieving revision 1.14 >diff -u -r1.14 Aj.java >--- src/org/aspectj/weaver/loadtime/Aj.java 12 Dec 2005 11:16:57 -0000 1.14 >+++ src/org/aspectj/weaver/loadtime/Aj.java 13 Dec 2005 01:06:29 -0000 >@@ -59,6 +59,9 @@ > > try { > WeavingAdaptor weavingAdaptor = WeaverContainer.getWeaver(loader, weavingContext); >+ if (weavingAdaptor == null) { >+ return bytes; >+ } > return weavingAdaptor.weaveClass(className, bytes); > } catch (Throwable t) { > //FIXME AV wondering if we should have the option to fail (throw runtime exception) here >@@ -81,11 +84,20 @@ > synchronized(weavingAdaptors) { > adaptor = (ExplicitlyInitializedClassLoaderWeavingAdaptor) weavingAdaptors.get(loader); > if (adaptor == null) { >- // create it and put it back in the weavingAdaptors map but avoid any kind of instantiation >- // within the synchronized block >- ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor(loader, weavingContext); >- adaptor = new ExplicitlyInitializedClassLoaderWeavingAdaptor(weavingAdaptor); >- weavingAdaptors.put(loader, adaptor); >+ // do NOT take the hit of creating a weaving container for each reflection delegating class loader! >+ // just use the originating class loader to handle everything: this can reduce overhead & start up time a lot... >+ if (loader.getClass().getName().equals("sun.reflect.DelegatingClassLoader")) { >+ if (loader.getParent()==null) { >+ return null; >+ } >+ return getWeaver(loader.getParent(), weavingContext); >+ } else { >+ // create it and put it back in the weavingAdaptors map but avoid any kind of instantiation >+ // within the synchronized block >+ ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor(loader, weavingContext); >+ adaptor = new ExplicitlyInitializedClassLoaderWeavingAdaptor(weavingAdaptor); >+ weavingAdaptors.put(loader, adaptor); >+ } > } > } > // perform the initialization
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120473
:
31599
|
31601