java.lang.invoke.LambdaConversionException Java Examples

The following examples show how to use java.lang.invoke.LambdaConversionException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LambdaCapture.java    From presto with Apache License 2.0 6 votes vote down vote up
public static CallSite lambdaCapture(
        MethodHandles.Lookup callerLookup,
        String name,
        MethodType type,
        MethodType samMethodType,
        MethodHandle implMethod,
        MethodType instantiatedMethodType)
{
    try {
        // delegate to metafactory, we may choose to generate code ourselves in the future.
        return LambdaMetafactory.metafactory(
                callerLookup,
                name,
                type,
                samMethodType,
                implMethod,
                instantiatedMethodType);
    }
    catch (LambdaConversionException e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #2
Source File: T8032697.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #3
Source File: T8032711.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #4
Source File: T8032697.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #5
Source File: LambdaReturn.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #6
Source File: T8032704.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #7
Source File: T8032711.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #8
Source File: T8032697.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #9
Source File: LambdaReturn.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #10
Source File: T8032704.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #11
Source File: T8032711.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #12
Source File: T8032697.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #13
Source File: LambdaReturn.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #14
Source File: T8032704.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #15
Source File: T8032711.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #16
Source File: LambdaReturn.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #17
Source File: LambdaReturn.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #18
Source File: T8032704.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #19
Source File: T8032711.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #20
Source File: T8032697.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #21
Source File: LambdaFactory.java    From lambda-factory with Apache License 2.0 5 votes vote down vote up
private static CallSite createCallSite(String signatureName, MethodHandles.Lookup lookup, MethodHandle methodHandle,
		MethodType instantiatedMethodType, MethodType signature, Class<?> interfaceClass) throws LambdaConversionException {
	return LambdaMetafactory.metafactory(
			lookup, 
			signatureName,
			MethodType.methodType(interfaceClass), 
			signature, 
			methodHandle, 
			instantiatedMethodType);
}
 
Example #22
Source File: LambdaReturn.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #23
Source File: T8032704.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #24
Source File: T8032711.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #25
Source File: T8032697.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #26
Source File: LambdaReturn.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void amf(List<String> errs, MethodHandle h, MethodType mts, MethodType mtf, MethodType mtb, boolean shouldWork) {
    MethodType mti = mt(I.class);
    try {
        LambdaMetafactory.altMetafactory(l, "m", mti, mts,h,mtf,
                                      LambdaMetafactory.FLAG_BRIDGES, 1, mtb);
    } catch(LambdaConversionException e) {
        if (shouldWork)  errs.add("Error: Should work h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb + " got: " + e);
        return;
    }
    if (!shouldWork)  errs.add("Error: Should fail h=" + h + " s=" + mts + " -- f=" + mtf + " / b=" + mtb);
}
 
Example #27
Source File: T8032704.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodHandles.Lookup l) {
    try {
        LambdaMetafactory.metafactory(l, "close",
            mt(Closeable.class),mt(void.class),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #28
Source File: T8032711.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(Class<?> k) {
    try {
        LambdaMetafactory.metafactory(l, "m",
            mt(I.class),mt(k),h,mt(void.class));
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #29
Source File: T8032697.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static boolean mf(MethodType mti, MethodType mtf) {
    try {
        LambdaMetafactory.metafactory(l, "m", mti,mtf,h,mtf);
    } catch(LambdaConversionException e) {
        return true;
    }
    return false;
}
 
Example #30
Source File: LambdaFactory.java    From AutoLoadCache with Apache License 2.0 5 votes vote down vote up
private static CallSite createCallSite(String signatureName, MethodHandles.Lookup lookup, MethodHandle methodHandle,
		MethodType instantiatedMethodType, MethodType signature, Class<?> interfaceClass) throws LambdaConversionException {
	return LambdaMetafactory.metafactory(
			lookup, 
			signatureName,
			MethodType.methodType(interfaceClass), 
			signature, 
			methodHandle, 
			instantiatedMethodType);
}