private Value toSootValue(Object val) throws AssertionError { Value v; if (val instanceof Integer) v = IntConstant.v((Integer) val); else if (val instanceof Float) v = FloatConstant.v((Float) val); else if (val instanceof Long) v = LongConstant.v((Long) val); else if (val instanceof Double) v = DoubleConstant.v((Double) val); else if (val instanceof String) v = StringConstant.v(val.toString()); else if (val instanceof org.objectweb.asm.Type) v = ClassConstant.v(((org.objectweb.asm.Type) val).getInternalName()); else if (val instanceof Handle) v = MethodHandle.v(toSootMethodRef((Handle) val), ((Handle)val).getTag()); else throw new AssertionError("Unknown constant type: " + val.getClass()); return v; }
@Override public void visit(Value e) { if (e instanceof MethodHandle) { MethodHandle mh = (MethodHandle) e; add(mh, mh.getMethodRef().resolve()); } }
public void caseMethodHandle(MethodHandle handle) { throw new UnsupportedOperationException("we have not yet determined how to print Java 7 method handles"); }
public void caseMethodHandle(MethodHandle handle) { }
@Override public void caseMethodHandle(MethodHandle arg0) { throw new RuntimeException("Not implemented "+arg0); }