private boolean returnConversionNeeded(MethodType callerType, MethodHandle target) { Class<?> needType = callerType.returnType(); if (needType == erasedCallerType.returnType()) return false; // no conversions possible, since must be primitive or Object Class<?> haveType = target.type().returnType(); if (VerifyType.isNullConversion(haveType, needType) && !needType.isInterface()) return false; return true; }
private boolean returnConversionPossible() { Class<?> needType = erasedCallerType.returnType(); return !needType.isPrimitive(); }