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 83799 Details for
Bug 193065
Improve the extensibility of AspectJ weaver to support PointcutDoctor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
2nd Impl
CustomMunger2nd-sumbittionNov262007.txt (text/plain), 9.71 KB, created by
Linton Ye
on 2007-11-26 14:07:22 EST
(
hide
)
Description:
2nd Impl
Filename:
MIME Type:
Creator:
Linton Ye
Created:
2007-11-26 14:07:22 EST
Size:
9.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P ajde.core >Index: src/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/ajde.core/src/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java,v >retrieving revision 1.1 >diff -u -r1.1 AjdeCoreBuildManager.java >--- src/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java 11 Jan 2007 16:04:31 -0000 1.1 >+++ src/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java 26 Nov 2007 19:05:13 -0000 >@@ -40,6 +40,7 @@ > import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.aspectj.util.ConfigParser; > import org.aspectj.util.LangUtil; >+import org.aspectj.weaver.CustomMungerFactory; > > /** > * Build Manager which drives the build for a given AjCompiler. >@@ -65,6 +66,14 @@ > AsmManager.attemptIncrementalModelRepairs = true; > } > >+ public void setCustomMungerFactory(CustomMungerFactory factory) { >+ ajBuildManager.setCustomMungerFactory(factory); >+ } >+ >+ public CustomMungerFactory getCustomMungerFactory() { >+ return ajBuildManager.getCustomMungerFactory(); >+ } >+ > /** > * @param buildFresh - true if want to force a full build, false otherwise > */ >Index: src/org/aspectj/ajde/core/AjCompiler.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/ajde.core/src/org/aspectj/ajde/core/AjCompiler.java,v >retrieving revision 1.1 >diff -u -r1.1 AjCompiler.java >--- src/org/aspectj/ajde/core/AjCompiler.java 11 Jan 2007 16:04:31 -0000 1.1 >+++ src/org/aspectj/ajde/core/AjCompiler.java 26 Nov 2007 19:05:13 -0000 >@@ -15,6 +15,7 @@ > import org.aspectj.bridge.IMessage; > import org.aspectj.bridge.Message; > import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; >+import org.aspectj.weaver.CustomMungerFactory; > > /** > * The class to be used by tools to drive a build. An AjCompiler is created >@@ -59,6 +60,14 @@ > buildManager = new AjdeCoreBuildManager(this); > } > >+ public void setCustomMungerFactory(CustomMungerFactory factory) { >+ buildManager.setCustomMungerFactory(factory); >+ } >+ >+ public CustomMungerFactory getCustomMungerFactory() { >+ return buildManager.getCustomMungerFactory(); >+ } >+ > /** > * @return the id for this AjCompiler > */ >Index: .classpath >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/ajde.core/.classpath,v >retrieving revision 1.1 >diff -u -r1.1 .classpath >--- .classpath 11 Jan 2007 16:04:31 -0000 1.1 >+++ .classpath 26 Nov 2007 19:05:13 -0000 >@@ -9,5 +9,6 @@ > <classpathentry exported="true" kind="src" path="/org.aspectj.ajdt.core"/> > <classpathentry exported="true" kind="src" path="/org.eclipse.jdt.core"/> > <classpathentry kind="lib" path="/lib/junit/junit.jar" sourcepath="/lib/junit/junit-src.jar"/> >+ <classpathentry combineaccessrules="false" kind="src" path="/weaver"/> > <classpathentry kind="output" path="bin"/> > </classpath> >#P org.aspectj.ajdt.core >Index: src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java,v >retrieving revision 1.119 >diff -u -r1.119 AjBuildManager.java >--- src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java 22 Jan 2007 16:43:20 -0000 1.119 >+++ src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java 26 Nov 2007 19:05:17 -0000 >@@ -84,6 +84,7 @@ > import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; > import org.aspectj.tools.ajc.Main; > import org.aspectj.util.FileUtil; >+import org.aspectj.weaver.CustomMungerFactory; > import org.aspectj.weaver.Dump; > import org.aspectj.weaver.ResolvedType; > import org.aspectj.weaver.World; >@@ -156,6 +157,7 @@ > public BcelWorld getBcelWorld() { return state.getBcelWorld();} > > public CountingMessageHandler handler; >+ private CustomMungerFactory customMungerFactory; > > public AjBuildManager(IMessageHandler holder) { > super(); >@@ -749,6 +751,15 @@ > // } > // } > >+ //LTODO delegate to BcelWeaver? >+ public void setCustomMungerFactory(CustomMungerFactory factory) { >+ customMungerFactory = factory; >+ } >+ >+ public CustomMungerFactory getCustomMungerFactory() { >+ return customMungerFactory; >+ } >+ > /** init only on initial batch compile? no file-specific options */ > private void initBcelWorld(IMessageHandler handler) throws IOException { > List cp = >@@ -767,6 +778,7 @@ > bcelWorld.setPinpointMode(buildConfig.isXdevPinpoint()); > bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold,buildConfig.getOptions().warningThreshold); > BcelWeaver bcelWeaver = new BcelWeaver(bcelWorld); >+ bcelWeaver.setCustomMungerFactory(customMungerFactory); > state.setWorld(bcelWorld); > state.setWeaver(bcelWeaver); > state.clearBinarySourceFiles(); >@@ -1388,5 +1400,6 @@ > public boolean wasFullBuild() { > return wasFullBuild; > } >+ > } > >#P weaver >Index: src/org/aspectj/weaver/World.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/weaver/src/org/aspectj/weaver/World.java,v >retrieving revision 1.100 >diff -u -r1.100 World.java >--- src/org/aspectj/weaver/World.java 6 Nov 2006 13:53:12 -0000 1.100 >+++ src/org/aspectj/weaver/World.java 26 Nov 2007 19:05:19 -0000 >@@ -1042,6 +1042,25 @@ > public int hardSize() { > return tMap.size(); > } >+ >+ public ResolvedType[] getAllTypes() { >+ List<ResolvedType> results = new ArrayList<ResolvedType>(); >+ >+ collectTypes(expendableMap, results); >+ collectTypes(tMap, results); >+ return results.toArray(new ResolvedType[results.size()]); >+ } >+ >+ private void collectTypes(Map map, List<ResolvedType> results) { >+ for (Object key:map.keySet()) { >+ ResolvedType type = get((String)key); >+ if (type!=null) >+ results.add(type); >+ else System.err.println("null!:"+key); >+ } >+ } >+ >+ > } > > /** Reference types we don't intend to weave may be ejected from >@@ -1250,4 +1269,9 @@ > public boolean isASMAround() { > return isASMAround; > } >+ >+ public ResolvedType[] getAllTypes() { >+ return typeMap.getAllTypes(); >+ } >+ > } >\ No newline at end of file >Index: src/org/aspectj/weaver/bcel/BcelWeaver.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java,v >retrieving revision 1.99 >diff -u -r1.99 BcelWeaver.java >--- src/org/aspectj/weaver/bcel/BcelWeaver.java 6 Nov 2007 15:28:58 -0000 1.99 >+++ src/org/aspectj/weaver/bcel/BcelWeaver.java 26 Nov 2007 19:05:21 -0000 >@@ -64,6 +64,7 @@ > import org.aspectj.weaver.BCException; > import org.aspectj.weaver.ConcreteTypeMunger; > import org.aspectj.weaver.CrosscuttingMembersSet; >+import org.aspectj.weaver.CustomMungerFactory; > import org.aspectj.weaver.IClassFileProvider; > import org.aspectj.weaver.IWeaveRequestor; > import org.aspectj.weaver.IWeaver; >@@ -138,6 +139,7 @@ > private List declareParentsList = null; // setup by prepareForWeave > > private ZipOutputStream zipOutputStream; >+ private CustomMungerFactory customMungerFactory; > > // ---- > >@@ -488,6 +490,8 @@ > typeMungerList = xcutSet.getTypeMungers(); > lateTypeMungerList = xcutSet.getLateTypeMungers(); > declareParentsList = xcutSet.getDeclareParents(); >+ >+ addCustomMungers(); > > // The ordering here used to be based on a string compare on toString() for the two mungers - > // that breaks for the @AJ style where advice names aren't programmatically generated. So we >@@ -519,6 +523,31 @@ > if (trace.isTraceEnabled()) trace.exit("prepareForWeave"); > } > >+ private void addCustomMungers() { >+ if (customMungerFactory != null) { >+ for (Iterator i = addedClasses.iterator(); i.hasNext();) { >+ UnwovenClassFile jc = (UnwovenClassFile) i.next(); >+ String name = jc.getClassName(); >+ ResolvedType type = world.resolve(name); >+ if (type.isAspect()) { >+ Collection<ShadowMunger> shadowMungers = customMungerFactory >+ .createCustomShadowMungers(type); >+ if (shadowMungers != null) { >+ shadowMungerList.addAll(shadowMungers); >+ } >+ Collection<ConcreteTypeMunger> typeMungers = customMungerFactory >+ .createCustomTypeMungers(type); >+ if (typeMungers != null) >+ typeMungerList.addAll(typeMungers); >+ } >+ } >+ } >+ } >+ >+ public void setCustomMungerFactory(CustomMungerFactory factory) { >+ customMungerFactory = factory; >+ } >+ > /* > * Rewrite all of the pointcuts in the world into their most efficient > * form for subsequent matching. Also ensure that if pc1.equals(pc2) >Index: src/org/aspectj/weaver/CustomMungerFactory.java >=================================================================== >RCS file: src/org/aspectj/weaver/CustomMungerFactory.java >diff -N src/org/aspectj/weaver/CustomMungerFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/aspectj/weaver/CustomMungerFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,12 @@ >+package org.aspectj.weaver; >+ >+import java.util.Collection; >+ >+import org.aspectj.weaver.bcel.BcelWorld; >+import org.aspectj.weaver.patterns.Declare; >+ >+public interface CustomMungerFactory { >+ public Collection<ShadowMunger> createCustomShadowMungers(ResolvedType aspectType); >+ public Collection<ConcreteTypeMunger> createCustomTypeMungers(ResolvedType aspectType); >+// public Collection<Declare> createCustomDeclares(ResolvedType aspectType); >+}
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 Raw
Actions:
View
Attachments on
bug 193065
:
81273
| 83799 |
84711