return "makeInitializerSig";
} else if (kind == ADVICE) {
return "makeAdviceSig";
+ } else if (kind == MONITORENTER) {
+ return "makeLockSig";
+ } else if (kind == MONITOREXIT) {
+ return "makeUnlockSig";
} else {
throw new RuntimeException("unimplemented");
}
return "org.aspectj.lang.reflect.InitializerSignature";
} else if (kind == ADVICE) {
return "org.aspectj.lang.reflect.AdviceSignature";
+ } else if (kind == MONITORENTER) {
+ return "org.aspectj.lang.reflect.LockSignature";
+ } else if (kind == MONITOREXIT) {
+ return "org.aspectj.lang.reflect.UnlockSignature";
} else {
throw new RuntimeException("unimplemented");
}
return getStaticInitializationSignatureString(world);
} else if (kind == ADVICE) {
return getAdviceSignatureString(world);
+ } else if (kind == MONITORENTER || kind == MONITOREXIT) {
+ return getMonitorSignatureString(world);
} else {
throw new RuntimeException("unimplemented");
}
return buf.toString();
}
+ protected String getMonitorSignatureString(World world) {
+ StringBuffer buf = new StringBuffer();
+ buf.append(makeString(Modifier.STATIC)); // modifiers
+ buf.append('-');
+ buf.append(getName()); // name
+ buf.append('-');
+ buf.append(makeString(getDeclaringType())); // Declaring Type
+ buf.append('-');
+ buf.append(makeString(getParameterTypes()[0])); // Parameter Types
+ buf.append('-');
+ buf.append(""); // Parameter names
+ buf.append('-');
+ return buf.toString();
+ }
+
protected String getConstructorSignatureString(World world) {
package org.aspectj.weaver.bcel;
+import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
+import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AdviceKind;
}
}
+ if (shadow.getIWorld().isJoinpointSynchronizationEnabled() &&
+ shadow.getKind()==Shadow.MethodExecution &&
+ (s.getSignature().getModifiers() & Modifier.SYNCHRONIZED)!=0) {
+ Message m = new Message("advice matching the synchronized method shadow '"+shadow.toString()+
+ "' will be executed outside the lock rather than inside (compiler limitation)",shadow.getSourceLocation(),false,new ISourceLocation[]{getSourceLocation()});
+ shadow.getIWorld().getMessageHandler().handleMessage(m);
+ }
+
//FIXME AV - see #75442, this logic is not enough so for now comment it out until we fix the bug
// // callback for perObject AJC MightHaveAspect postMunge (#75442)
// if (getConcreteAspect() != null
protected void clearLintSuppressions(World inWorld,Collection toClear) {
inWorld.getLint().clearSuppressions(toClear);
}
-}
+}
\ No newline at end of file