RFR: 8203892: Target interface added as marker interface in calls to altMetafactory (original) (raw)

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 29 09:12:01 UTC 2018


Looks good

Maurizio

On 28/05/18 21:09, Vicente Romero wrote:

Please review the fix for [1], which is a regression provoked by [2]. The fix can be find at [3]. The regression could be reproduced with this test case:

import java.util.*; import java.util.function.*; import java.io.*; class Test { public static Comparator comparingInt(ToIntFunction<? super_ _T> keyExtractor) { Objects.requireNonNull(keyExtractor); return (Comparator & Serializable) (c1, c2) -> Integer.compare(keyExtractor.applyAsInt(c1), keyExtractor.applyAsInt(c2)); } } in this case javac generates a BSM to the alternative metafactory, but after the change for [2] the target type was included as one of the marker interfaces. This patch fixes that issue. TIA, Vicente [1] https://bugs.openjdk.java.net/browse/JDK-8203892 [2] https://bugs.openjdk.java.net/browse/JDK-8148354 [3] http://cr.openjdk.java.net/~vromero/8203892/webrev.00/

-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180529/ec2227bc/attachment.html>



More information about the compiler-dev mailing list