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 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/
   ">

(original) (raw)

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 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/