JDK-8034048 : javac crash with method references plus lambda plus var args
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-02-09
  • Updated: 2014-07-29
  • Resolved: 2014-02-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b04Fixed
Related Reports
Relates :  
Relates :  
Description
This code provokes a javac crash:

public interface Null {
    @SafeVarargs
    public static <INPUT, OUTPUT> OUTPUT functional(INPUT... input) {
        return null;
    }

    // Uncomment to successfully compile in JDK8 b121 Win32
    // public static <INPUT, OUTPUT> OUTPUT functional(INPUT input) {
        // return null;
    // }

    public static <OBJECT> void main(String... arguments) {
      java.util.function.Supplier<java.util.function.Consumer<OBJECT>> functional = () -> Null::functional;
    }
}

reported by srborlongan@gmail.com in lambda-dev
Comments
There is a client interested on this patch to be backported to 8 (8u20). See http://mail.openjdk.java.net/pipermail/compiler-dev/2014-April/008685.html
02-04-2014

Test accidentally omitted; provided in JDK-8035972
27-02-2014

More reduced test case: public interface Null { static<T> void functional(T... input) { java.util.function.Consumer<T> c = Null::functional; } }
12-02-2014

Release team: Approved for deferral.
11-02-2014

Reduced test case: public interface Null { public static <I> Object functional(I... input) { return null; } public static <T> void main(String[] arguments) { java.util.function.Consumer<T> functional = Null::functional; } } provided by Remi Forax
09-02-2014

8-defer-request justification: Fixing this bug is not possible now as this is a P2. Please defer it to 9 to have more time to fix it.
09-02-2014