str = (constantToString(((ConstantCP) c).getClassIndex(), Constants.CONSTANT_Class) + "." + constantToString(
((ConstantCP) c).getNameAndTypeIndex(), Constants.CONSTANT_NameAndType));
break;
+
+ case Constants.CONSTANT_InvokeDynamic:
+ ConstantInvokeDynamic cid = (ConstantInvokeDynamic)c;
+ str = cid.toString();
+ break;
default: // Never reached
throw new RuntimeException("Unknown constant type " + c.tag);
import junit.framework.Test;
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.apache.bcel.classfile.Utility;
+import org.aspectj.apache.bcel.util.ByteSequence;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.weaver.tools.ContextBasedMatcher;
import org.aspectj.weaver.tools.DefaultMatchingContext;
Runnable r2 = (Runnable) fails.invoke(instance);
// r2.getClass().getName() == Application$$Lambda$1/1652149987
-// JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "Application");
PointcutParser parser = PointcutParser
.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(ucl);
FooDesignatorHandler beanHandler = new FooDesignatorHandler();
context.addContextBinding("beanName", "yourBean");
assertFalse(pc.couldMatchJoinPointsInType(r2.getClass()));
+ JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "Application");
+ System.out.println("XXXX");
+ assertNotNull(jc);
+ // 525541: Checking that we can disassemble invokedynamic:
+ boolean checkedInvokeDynamic = false;
+ for (org.aspectj.apache.bcel.classfile.Method m: jc.getMethods()) {
+ if (m.getName().equals("fromLambdaExpression")) {
+ String code = m.getCode().getCodeString();
+ assertTrue(code.contains("invokedynamic"));
+ checkedInvokeDynamic = true;
+ }
+ }
+ assertTrue(checkedInvokeDynamic);
}