case 5: return POINTCUT;
case 6: return ADVICE;
case 7: return HANDLER;
+ case 8: return MONITORENTER;
+ case 9: return MONITOREXIT;
}
throw new BCException("weird kind " + key);
}
public static final Kind POINTCUT = new Kind("POINTCUT", 5);
public static final Kind ADVICE = new Kind("ADVICE", 6);
public static final Kind HANDLER = new Kind("HANDLER", 7);
+ public static final Kind MONITORENTER = new Kind("MONITORENTER", 8);
+ public static final Kind MONITOREXIT = new Kind("MONITOREXIT", 9);
+
public ResolvedMember resolve(World world);
public void setOptionalJoinpoints(String jps) {
if (jps==null) return;
if (jps.indexOf("arrayconstruction")!=-1) optionalJoinpoint_ArrayConstruction = true;
- if (jps.indexOf("trivial")!=-1) optionalJoinpoint_Trivial = true;
if (jps.indexOf("synchronization")!=-1) optionalJoinpoint_Synchronization = true;
}
private void unpackAttributes(World world) {
Attribute[] attrs = field.getAttributes();
- List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),attrs, getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+ List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),attrs, getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
as.addAll(AtAjAttributes.readAj5FieldAttributes(field, this, world.resolve(getDeclaringType()), getSourceContext(world), world.getMessageHandler()));
for (Iterator iter = as.iterator(); iter.hasNext();) {
private void unpackAjAttributes(World world) {
associatedShadowMunger = null;
- List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+ List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
processAttributes(world, as);
as = AtAjAttributes.readAj5MethodAttributes(method, this, world.resolve(getDeclaringType()), preResolvedPointcut,getSourceContext(world), world.getMessageHandler());
processAttributes(world,as);
// for testing - if we have this attribute, return it - will return null if it doesnt know anything
public AjAttribute[] getAttributes(String name) {
List results = new ArrayList();
- List l = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+ List l = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
for (Iterator iter = l.iterator(); iter.hasNext();) {
AjAttribute element = (AjAttribute) iter.next();
if (element.getNameString().equals(name)) results.add(element);
bitflag|=UNPACKED_AJATTRIBUTES;
IMessageHandler msgHandler = getResolvedTypeX().getWorld().getMessageHandler();
// Pass in empty list that can store things for readAj5 to process
- List l = BcelAttributes.readAjAttributes(className,javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),msgHandler,AjAttribute.WeaverVersionInfo.UNKNOWN);
+ List l = BcelAttributes.readAjAttributes(className,javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld(),AjAttribute.WeaverVersionInfo.UNKNOWN);
List pointcuts = new ArrayList();
typeMungers = new ArrayList();
declares = new ArrayList();
// for testing - if we have this attribute, return it - will return null if it doesnt know anything
public AjAttribute[] getAttributes(String name) {
List results = new ArrayList();
- List l = BcelAttributes.readAjAttributes(javaClass.getClassName(),javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld().getMessageHandler(),AjAttribute.WeaverVersionInfo.UNKNOWN);
+ List l = BcelAttributes.readAjAttributes(javaClass.getClassName(),javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld(),AjAttribute.WeaverVersionInfo.UNKNOWN);
for (Iterator iter = l.iterator(); iter.hasNext();) {
AjAttribute element = (AjAttribute) iter.next();
if (element.getNameString().equals(name)) results.add(element);
}
-
+
\ No newline at end of file
import org.aspectj.apache.bcel.generic.Instruction;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InvokeInstruction;
+import org.aspectj.apache.bcel.generic.MONITORENTER;
+import org.aspectj.apache.bcel.generic.MONITOREXIT;
import org.aspectj.apache.bcel.generic.MULTIANEWARRAY;
import org.aspectj.apache.bcel.generic.NEWARRAY;
import org.aspectj.apache.bcel.generic.ObjectType;
}
+ public Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg,InstructionHandle h) {
+ MONITORENTER i = (MONITORENTER)h.getInstruction();
+ return MemberImpl.monitorEnter();
+ }
+
+ public Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg,InstructionHandle h) {
+ MONITOREXIT i = (MONITOREXIT)h.getInstruction();
+ return MemberImpl.monitorExit();
+ }
public Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg, InstructionHandle handle) {
Instruction i = handle.getInstruction();
return true;
}
}
-}
+}
\ No newline at end of file