package org.aspectj.ajdt.internal.compiler.ast;
-import java.io.*;
-import java.lang.reflect.Modifier;
+import java.lang.reflect.*;
-import org.apache.bcel.classfile.AccessFlags;
import org.aspectj.ajdt.internal.compiler.lookup.*;
-import org.aspectj.ajdt.internal.compiler.lookup.EclipseWorld;
import org.aspectj.weaver.*;
-import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.patterns.*;
import org.eclipse.jdt.internal.compiler.*;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.codegen.*;
-import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.lookup.*;
-import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
// making all aspects member types avoids a nasty hierarchy pain
public boolean isPrivileged;
- public EclipseObjectType typeX;
+ public EclipseSourceType typeX;
public EclipseWorld world; //??? should use this consistently
if (ignoreFurtherInvestigation) return;
world = EclipseWorld.fromScopeLookupEnvironment(scope);
- typeX = (EclipseObjectType)world.fromEclipse(binding);
+ typeX = (EclipseSourceType)world.fromEclipse(binding);
if (isPrivileged) {
binding.privilegedHandler = new PrivilegedHandler(this);
--- /dev/null
+/* *******************************************************************
+ * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajdt.internal.compiler.lookup;
+
+import java.util.*;
+
+import org.aspectj.ajdt.internal.compiler.ast.*;
+import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
+import org.aspectj.bridge.*;
+import org.aspectj.bridge.MessageUtil;
+import org.aspectj.weaver.*;
+import org.aspectj.weaver.patterns.*;
+import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.*;
+
+public class EclipseBinaryType extends EclipseObjectType {
+ private BinaryTypeBinding binding;
+ private ResolvedTypeX delegate;
+
+ public EclipseBinaryType(ResolvedTypeX delegate, EclipseWorld world, BinaryTypeBinding binding) {
+ super(delegate.getSignature(), world, delegate.isExposedToWeaver());
+ this.delegate = delegate;
+ this.binding = binding;
+ }
+
+
+ protected void fillDeclaredMembers() {
+ this.declaredPointcuts = copyResolvedPointcutDefinitions(delegate.getDeclaredPointcuts());
+ this.declaredFields = copyResolvedMembers(delegate.getDeclaredFields());
+ this.declaredMethods = copyResolvedMembers(delegate.getDeclaredMethods());
+ }
+
+ //XXX doesn't actually copy
+ private ResolvedPointcutDefinition[] copyResolvedPointcutDefinitions(ResolvedMember[] in) {
+ //System.err.println("defs: " + this + " are " + Arrays.asList(in));
+ return (ResolvedPointcutDefinition[])in;
+ }
+
+
+
+ private ResolvedMember[] copyResolvedMembers(ResolvedMember[] in) {
+ int len = in.length;
+ ResolvedMember[] out = new ResolvedMember[len];
+ for (int i=0; i < len; i++) {
+ out[i] = copyResolvedMember(in[i]);
+ }
+
+ return out;
+ }
+
+ private ResolvedMember copyResolvedMember(ResolvedMember in) {
+ return new ResolvedMember(
+ in.getKind(), forceTypeX(in.getDeclaringType()), in.getModifiers(),
+ forceTypeX(in.getReturnType()), in.getName(),
+ forceTypeXs(in.getParameterTypes()));
+ }
+
+ private TypeX forceTypeX(TypeX typeX) {
+ return TypeX.forSignature(typeX.getSignature());
+ }
+
+ private TypeX[] forceTypeXs(TypeX[] in) {
+ int len = in.length;
+ if (len == 0) return TypeX.NONE;
+ TypeX[] ret = new TypeX[len];
+ for (int i=0; i < len; i++) {
+ ret[i] = forceTypeX(in[i]);
+ }
+ return ret;
+ }
+
+
+ public ResolvedTypeX[] getDeclaredInterfaces() {
+ return world.resolve(delegate.getDeclaredInterfaces());
+ }
+
+ public int getModifiers() {
+ return delegate.getModifiers();
+ }
+
+ public ResolvedTypeX getSuperclass() {
+ if (delegate.getSuperclass() == null) return null;
+ return world.resolve(delegate.getSuperclass());
+ }
+
+ public boolean isAspect() {
+ return delegate.isAspect();
+ }
+
+ public String toString() {
+ return "EclipseBinaryType(" + getClassName() + ")";
+ }
+
+}
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.lookup.*;
-public class EclipseObjectType extends ResolvedTypeX.Name {
- private ReferenceBinding binding;
-
- private ResolvedMember[] declaredPointcuts = null;
- private ResolvedMember[] declaredMethods = null;
- private ResolvedMember[] declaredFields = null;
+public abstract class EclipseObjectType extends ResolvedTypeX.Name {
+ protected ResolvedPointcutDefinition[] declaredPointcuts = null;
+ protected ResolvedMember[] declaredMethods = null;
+ protected ResolvedMember[] declaredFields = null;
- public EclipseObjectType(String signature, EclipseWorld world, ReferenceBinding binding) {
- super(signature, world, !(binding instanceof BinaryTypeBinding)); //XXX
- this.binding = binding;
+ public EclipseObjectType(String signature, EclipseWorld world, boolean isExposedToWeaver) {
+ super(signature, world, isExposedToWeaver);
}
- private EclipseWorld eclipseWorld() {
+ protected EclipseWorld eclipseWorld() {
return (EclipseWorld)world;
}
- public boolean isAspect() {
- if (binding instanceof BinaryTypeBinding) return false;
- if (!(binding instanceof SourceTypeBinding)) return false;
- //XXX assume SourceBinding throughout
- return ((SourceTypeBinding)binding).scope.referenceContext instanceof AspectDeclaration;
-
- }
+ public abstract boolean isAspect();
- public ResolvedTypeX getSuperclass() {
- //XXX what about java.lang.Object
- return eclipseWorld().fromEclipse(binding.superclass());
- }
+ public abstract ResolvedTypeX getSuperclass();
- public ResolvedTypeX[] getDeclaredInterfaces() {
- return eclipseWorld().fromEclipse(binding.superInterfaces());
- }
+ public abstract ResolvedTypeX[] getDeclaredInterfaces();
public ResolvedMember[] getDeclaredFields() {
if (declaredFields == null) fillDeclaredMembers();
return declaredPointcuts;
}
- private void fillDeclaredMembers() {
- List declaredPointcuts = new ArrayList();
- List declaredMethods = new ArrayList();
- List declaredFields = new ArrayList();
-
- MethodBinding[] methods = binding.methods();
- for (int i=0, len=methods.length; i < len; i++) {
- MethodBinding m = methods[i];
- AbstractMethodDeclaration amd = m.sourceMethod();
- if (amd == null) continue; //???
- if (amd instanceof PointcutDeclaration) {
- PointcutDeclaration d = (PointcutDeclaration)amd;
- ResolvedPointcutDefinition df = d.makeResolvedPointcutDefinition();
- declaredPointcuts.add(df);
- } else {
- //XXX this doesn't handle advice quite right
- declaredMethods.add(eclipseWorld().makeResolvedMember(m));
- }
- }
-
- FieldBinding[] fields = binding.fields();
- for (int i=0, len=fields.length; i < len; i++) {
- FieldBinding f = fields[i];
- declaredFields.add(eclipseWorld().makeResolvedMember(f));
- }
-
- this.declaredPointcuts = (ResolvedMember[])
- declaredPointcuts.toArray(new ResolvedMember[declaredPointcuts.size()]);
- this.declaredMethods = (ResolvedMember[])
- declaredMethods.toArray(new ResolvedMember[declaredMethods.size()]);
- this.declaredFields = (ResolvedMember[])
- declaredFields.toArray(new ResolvedMember[declaredFields.size()]);
- }
+ protected abstract void fillDeclaredMembers();
- public int getModifiers() {
- // only return the real Java modifiers, not the extra eclipse ones
- return binding.modifiers & CompilerModifiers.AccJustFlag;
- }
-
- ReferenceBinding getBinding() {
- return binding;
- }
+ public abstract int getModifiers();
- public String toString() {
- return "EclipseObjectType(" + getClassName() + ")";
- }
+
public CrosscuttingMembers collectCrosscuttingMembers() {
return crosscuttingMembers;
}
-
- //XXX make sure this is applied to classes and interfaces
- public void checkPointcutDeclarations() {
- ResolvedMember[] pointcuts = getDeclaredPointcuts();
- boolean sawError = false;
- for (int i=0, len=pointcuts.length; i < len; i++) {
- if (pointcuts[i].isAbstract()) {
- if (!this.isAspect()) {
- eclipseWorld().showMessage(IMessage.ERROR,
- "abstract pointcut only allowed in aspect" + pointcuts[i].getName(),
- pointcuts[i].getSourceLocation(), null);
- sawError = true;
- } else if (!this.isAbstract()) {
- eclipseWorld().showMessage(IMessage.ERROR,
- "abstract pointcut in concrete aspect" + pointcuts[i],
- pointcuts[i].getSourceLocation(), null);
- sawError = true;
- }
- }
-
- for (int j=i+1; j < len; j++) {
- if (pointcuts[i].getName().equals(pointcuts[j].getName())) {
- eclipseWorld().showMessage(IMessage.ERROR,
- "duplicate pointcut name: " + pointcuts[j].getName(),
- pointcuts[i].getSourceLocation(), pointcuts[j].getSourceLocation());
- sawError = true;
- }
- }
- }
-
- //now check all inherited pointcuts to be sure that they're handled reasonably
- if (sawError || !isAspect()) return;
-
-
-
- // find all pointcuts that override ones from super and check override is legal
- // i.e. same signatures and greater or equal visibility
- // find all inherited abstract pointcuts and make sure they're concretized if I'm concrete
- // find all inherited pointcuts and make sure they don't conflict
- getExposedPointcuts();
-
- }
-
- public ISourceLocation getSourceLocation() {
- if (!(binding instanceof SourceTypeBinding) || (binding instanceof BinaryTypeBinding)) return null;
- SourceTypeBinding sourceType = (SourceTypeBinding)binding;
- TypeDeclaration dec = sourceType.scope.referenceContext;
- return new EclipseSourceLocation(dec.compilationResult, dec.sourceStart, dec.sourceEnd);
- }
}
--- /dev/null
+/* *******************************************************************
+ * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajdt.internal.compiler.lookup;
+
+import java.util.*;
+
+import org.aspectj.ajdt.internal.compiler.ast.*;
+import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
+import org.aspectj.bridge.*;
+import org.aspectj.bridge.MessageUtil;
+import org.aspectj.weaver.*;
+import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.*;
+
+public class EclipseSourceType extends EclipseObjectType {
+ private SourceTypeBinding binding;
+
+
+ public EclipseSourceType(String signature, EclipseWorld world, SourceTypeBinding binding) {
+ super(signature, world, true);
+ this.binding = binding;
+ }
+
+
+ public boolean isAspect() {
+ return binding.scope.referenceContext instanceof AspectDeclaration;
+
+ }
+
+ public ResolvedTypeX getSuperclass() {
+ if (binding.isInterface()) return world.resolve(TypeX.OBJECT);
+ //XXX what about java.lang.Object
+ return eclipseWorld().fromEclipse(binding.superclass());
+ }
+
+ public ResolvedTypeX[] getDeclaredInterfaces() {
+ return eclipseWorld().fromEclipse(binding.superInterfaces());
+ }
+
+
+ protected void fillDeclaredMembers() {
+ List declaredPointcuts = new ArrayList();
+ List declaredMethods = new ArrayList();
+ List declaredFields = new ArrayList();
+
+ MethodBinding[] methods = binding.methods();
+ for (int i=0, len=methods.length; i < len; i++) {
+ MethodBinding m = methods[i];
+ AbstractMethodDeclaration amd = m.sourceMethod();
+ if (amd == null) continue; //???
+ if (amd instanceof PointcutDeclaration) {
+ PointcutDeclaration d = (PointcutDeclaration)amd;
+ ResolvedPointcutDefinition df = d.makeResolvedPointcutDefinition();
+ declaredPointcuts.add(df);
+ } else {
+ //XXX this doesn't handle advice quite right
+ declaredMethods.add(eclipseWorld().makeResolvedMember(m));
+ }
+ }
+
+ FieldBinding[] fields = binding.fields();
+ for (int i=0, len=fields.length; i < len; i++) {
+ FieldBinding f = fields[i];
+ declaredFields.add(eclipseWorld().makeResolvedMember(f));
+ }
+
+ this.declaredPointcuts = (ResolvedPointcutDefinition[])
+ declaredPointcuts.toArray(new ResolvedPointcutDefinition[declaredPointcuts.size()]);
+ this.declaredMethods = (ResolvedMember[])
+ declaredMethods.toArray(new ResolvedMember[declaredMethods.size()]);
+ this.declaredFields = (ResolvedMember[])
+ declaredFields.toArray(new ResolvedMember[declaredFields.size()]);
+ }
+
+
+ public int getModifiers() {
+ // only return the real Java modifiers, not the extra eclipse ones
+ return binding.modifiers & CompilerModifiers.AccJustFlag;
+ }
+
+ public String toString() {
+ return "EclipseSourceType(" + getClassName() + ")";
+ }
+
+
+ //XXX make sure this is applied to classes and interfaces
+ public void checkPointcutDeclarations() {
+ ResolvedMember[] pointcuts = getDeclaredPointcuts();
+ boolean sawError = false;
+ for (int i=0, len=pointcuts.length; i < len; i++) {
+ if (pointcuts[i].isAbstract()) {
+ if (!this.isAspect()) {
+ eclipseWorld().showMessage(IMessage.ERROR,
+ "abstract pointcut only allowed in aspect" + pointcuts[i].getName(),
+ pointcuts[i].getSourceLocation(), null);
+ sawError = true;
+ } else if (!this.isAbstract()) {
+ eclipseWorld().showMessage(IMessage.ERROR,
+ "abstract pointcut in concrete aspect" + pointcuts[i],
+ pointcuts[i].getSourceLocation(), null);
+ sawError = true;
+ }
+ }
+
+ for (int j=i+1; j < len; j++) {
+ if (pointcuts[i].getName().equals(pointcuts[j].getName())) {
+ eclipseWorld().showMessage(IMessage.ERROR,
+ "duplicate pointcut name: " + pointcuts[j].getName(),
+ pointcuts[i].getSourceLocation(), pointcuts[j].getSourceLocation());
+ sawError = true;
+ }
+ }
+ }
+
+ //now check all inherited pointcuts to be sure that they're handled reasonably
+ if (sawError || !isAspect()) return;
+
+
+
+ // find all pointcuts that override ones from super and check override is legal
+ // i.e. same signatures and greater or equal visibility
+ // find all inherited abstract pointcuts and make sure they're concretized if I'm concrete
+ // find all inherited pointcuts and make sure they don't conflict
+ getExposedPointcuts();
+
+ }
+
+ public ISourceLocation getSourceLocation() {
+ TypeDeclaration dec = binding.scope.referenceContext;
+ return new EclipseSourceLocation(dec.compilationResult, dec.sourceStart, dec.sourceEnd);
+ }
+}
import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.util.CharOperation;
+/**
+ * This holds unique ResolvedTypeXs for each type known to the compiler
+ * or looked up on the class path. For types which are compiled from
+ * source code, it will hold an EclipseObjectType. Types that
+ * come from bytecode will be delegated to buildManager.bcelWorld.
+ *
+ * @author Jim Hugunin
+ */
public class EclipseWorld extends World {
public static boolean DEBUG = false;
public AjBuildManager buildManager;
private LookupEnvironment lookupEnvironment;
- private Map addedTypeBindings = new HashMap();
+ private Map/*TypeX, TypeBinding*/ typexToBinding = new HashMap();
+ //XXX currently unused
+ private Map/*TypeBinding, ResolvedTypeX*/ bindingToResolvedTypeX = new HashMap();
public static EclipseWorld forLookupEnvironment(LookupEnvironment env) {
AjLookupEnvironment aenv = (AjLookupEnvironment)env;
Pointcut pointcut,
Member signature)
{
- //System.err.println("concrete advice: " + signature + " context " + sourceContext);
return new EclipseAdvice(attribute, pointcut, signature);
}
ResolvedTypeMunger munger, ResolvedTypeX aspectType)
{
return null;
- //throw new RuntimeException("unimplemented");
}
- protected ResolvedTypeX resolveObjectType(TypeX ty) {
- String n = ty.getName();
- //n = n.replace('$', '.');
- char[][] name = CharOperation.splitOn('.', n.toCharArray()); //ty.getName().toCharArray());
- ReferenceBinding ret = lookupEnvironment.getType(name);
- //System.out.println("name: " + ty.getName() + ", " + ret);
- if (ret == null || ret instanceof ProblemReferenceBinding) return ResolvedTypeX.MISSING;
- return new EclipseObjectType(ty.getSignature(), this, ret);
+ protected ResolvedTypeX resolveObjectType(TypeX typeX) {
+ TypeBinding binding = makeTypeBinding(typeX);
+
+// System.err.println("resolvedObjectType: " + typeX +
+// " found " +
+// (binding == null ? "null" : binding.getClass().getName()));
+
+ if (!(binding instanceof SourceTypeBinding)) {
+ //System.err.println("missing: " + binding);
+ return ResolvedTypeX.MISSING;
+ }
+
+ if (binding instanceof BinaryTypeBinding) {
+ //System.err.println("binary: " + typeX);
+ return new EclipseBinaryType(
+ buildManager.bcelWorld.resolve(typeX),
+ this,
+ (BinaryTypeBinding)binding);
+ }
+
+ return new EclipseSourceType(typeX.getSignature(), this,
+ (SourceTypeBinding)binding);
}
+
public ResolvedTypeX fromEclipse(ReferenceBinding binding) {
if (binding == null) return ResolvedTypeX.MISSING;
//??? this seems terribly inefficient
- //System.out.println("resolving: " + binding + ", name = " + getName(binding));
+ //System.err.println("resolving: " + binding.getClass() + ", name = " + getName(binding));
ResolvedTypeX ret = resolve(fromBinding(binding));
- //System.out.println(" got: " + ret);
+ //System.err.println(" got: " + ret);
return ret;
}
//??? going back and forth between strings and bindings is a waste of cycles
public static TypeX fromBinding(TypeBinding binding) {
-// if (binding instanceof ReferenceBinding) {
-// return fromEclipse( (ReferenceBinding)binding);
-// } else {
-
if (binding instanceof HelperInterfaceBinding) {
- return ((HelperInterfaceBinding)binding).getTypeX();
+ return ((HelperInterfaceBinding) binding).getTypeX();
+ }
+ if (binding.qualifiedSourceName() == null) {
+ return ResolvedTypeX.MISSING;
}
- if (binding.qualifiedSourceName() == null) return ResolvedTypeX.MISSING;
- return TypeX.forName(getName(binding));
-// }
+ return TypeX.forName(getName(binding));
}
public static TypeX[] fromBindings(TypeBinding[] bindings) {
}
public TypeBinding makeTypeBinding(TypeX typeX) {
- //System.out.println("in: " + typeX.getSignature() + " have: " + addedTypeBindings);
- TypeBinding ret = (TypeBinding)addedTypeBindings.get(typeX);
- if (ret != null) return ret;
-
+ TypeBinding ret = (TypeBinding)typexToBinding.get(typeX);
+ if (ret == null) {
+ ret = makeTypeBinding1(typeX);
+ typexToBinding.put(typeX, ret);
+ }
+ return ret;
+ }
+
+ private TypeBinding makeTypeBinding1(TypeX typeX) {
if (typeX.isPrimitive()) {
if (typeX == ResolvedTypeX.BOOLEAN) return BaseTypes.BooleanBinding;
if (typeX == ResolvedTypeX.BYTE) return BaseTypes.ByteBinding;
}
return lookupEnvironment.createArrayType(makeTypeBinding(typeX), dim);
} else {
- ResolvedTypeX rt = typeX.resolve(this);
- //System.out.println("typex: " + typeX + ", " + rt);
- if (rt == ResolvedTypeX.MISSING) {
- throw new RuntimeException("shouldn't be missing: " + typeX);
- }
- return ((EclipseObjectType)rt).getBinding();
+ String n = typeX.getName();
+ char[][] name = CharOperation.splitOn('.', n.toCharArray());
+ return lookupEnvironment.getType(name);
}
}
+
+
public TypeBinding[] makeTypeBindings(TypeX[] types) {
int len = types.length;
TypeBinding[] ret = new TypeBinding[len];
return ret;
}
-
+ // just like the code above except it returns an array of ReferenceBindings
private ReferenceBinding[] makeReferenceBindings(TypeX[] types) {
int len = types.length;
ReferenceBinding[] ret = new ReferenceBinding[len];
public void addTypeBinding(TypeBinding binding) {
- addedTypeBindings.put(fromBinding(binding), binding);
+ typexToBinding.put(fromBinding(binding), binding);
}
- public Shadow makeShadow(
- AstNode location,
- ReferenceContext context)
- {
+
+ public Shadow makeShadow(AstNode location, ReferenceContext context) {
return EclipseShadow.makeShadow(this, location, context);
}
- public Shadow makeShadow(
- ReferenceContext context)
- {
- return EclipseShadow.makeShadow(this, (AstNode)context, context);
+ public Shadow makeShadow(ReferenceContext context) {
+ return EclipseShadow.makeShadow(this, (AstNode) context, context);
}
-
-
-
}
public AjBuildConfig buildConfig;
private BcelWeaver bcelWeaver;
- private BcelWorld bcelWorld;
+ public BcelWorld bcelWorld;
/** temp handler for callbacks */
private IMessageHandler currentHandler; // XXX wrong lifecyle, used for callbacks
if (buildConfig.getLintSpecFile() != null) {
bcelWorld.getLint().setFromProperties(buildConfig.getLintSpecFile());
}
+
+ //??? incremental issues
+ for (Iterator i = buildConfig.getInJars().iterator(); i.hasNext(); ) {
+ File inJar = (File)i.next();
+ bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir());
+ }
}
//??? do this well
void addAspectClassFilesToWeaver() throws IOException {
//System.out.println("added or changed: " + classFileCache.getAddedOrChanged());
- for (Iterator i = buildConfig.getInJars().iterator(); i.hasNext(); ) {
- File inJar = (File)i.next();
- bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir());
- }
for (Iterator i = classFileCache.getAddedOrChanged().iterator(); i.hasNext(); ) {
UnwovenClassFile classFile = (UnwovenClassFile) i.next();
if (inherited.isAbstract()) {
if (!this.isAbstract()) {
getWorld().showMessage(IMessage.ERROR,
- "inherited abstract pointcut " + inherited.getSignature() +
+ "inherited abstract " + inherited +
" is not made concrete in " + this.getName(),
inherited.getSourceLocation(), this.getSourceLocation());
}
for (Iterator i = added.iterator(); i.hasNext();) {
ResolvedPointcutDefinition toAdd =
(ResolvedPointcutDefinition) i.next();
+ //System.err.println("adding: " + toAdd);
for (Iterator j = acc.iterator(); j.hasNext();) {
ResolvedPointcutDefinition existing =
(ResolvedPointcutDefinition) j.next();