Java lambdas (JSR 335): Why “eliminate support for unbound inner class constructor references”?2019 Community Moderator ElectionJava 8 lambda predicate chaining?Java inner class and static nested classHow are Anonymous (inner) classes used in Java?Why doesn't Java support unsigned ints?Java: Static vs inner classWhy is Java Vector (and Stack) class considered obsolete or deprecated?Why can outer Java classes access inner class private members?Why don't Java Generics support primitive types?Why are you not able to declare a class as static in Java?has JSR-335 special support in JVM? Boost for functional JVM-based languages?Is there any difference between Objects::nonNull and x -> x != null?

Combining an idiom with a metonymy

How to deal with a cynical class?

Most cost effective thermostat setting: consistent temperature vs. lowest temperature possible

Why do passenger jet manufacturers design their planes with stall prevention systems?

Gantt Chart like rectangles with log scale

Have researchers managed to "reverse time"? If so, what does that mean for physics?

how to write formula in word in latex

How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?

How can I track script which gives me "command not found" right after the login?

SOQL: Populate a Literal List in WHERE IN Clause

How to terminate ping <dest> &

How to change two letters closest to a string and one letter immediately after a string using notepad++

A Cautionary Suggestion

Dice rolling probability game

How to explain that I do not want to visit a country due to personal safety concern?

What's the meaning of “spike” in the context of “adrenaline spike”?

Sailing the cryptic seas

Brexit - No Deal Rejection

Official degrees of earth’s rotation per day

Do I need to be arrogant to get ahead?

Why would a flight no longer considered airworthy be redirected like this?

My Graph Theory Students

Welcoming 2019 Pi day: How to draw the letter π?

Could the Saturn V actually have launched astronauts around Venus?



Java lambdas (JSR 335): Why “eliminate support for unbound inner class constructor references”?



2019 Community Moderator ElectionJava 8 lambda predicate chaining?Java inner class and static nested classHow are Anonymous (inner) classes used in Java?Why doesn't Java support unsigned ints?Java: Static vs inner classWhy is Java Vector (and Stack) class considered obsolete or deprecated?Why can outer Java classes access inner class private members?Why don't Java Generics support primitive types?Why are you not able to declare a class as static in Java?has JSR-335 special support in JVM? Boost for functional JVM-based languages?Is there any difference between Objects::nonNull and x -> x != null?










11















In the current JSR 335 draft, it's mentioned in the change log entry for 0.6.0 that it "eliminated support for unbound inner class constructor references".



To illustrate, suppose you have an outer class named A and an inner class named B, and you want a function that takes an A and creates a new B instance:



Function<A, A.B> foo = a -> a.new B();


Prior to 0.6.0, you can also use the constructor reference syntax to do the same thing (it's even documented in State of the Lambda):



Function<A, A.B> foo = A.B::new;


As mentioned above, that syntax is no longer supported in 0.6.0. I'm really curious to know why.



I've looked through the archives for the lambda-spec-experts and lambda-dev mailing lists, and cannot find any information about it.










share|improve this question
























  • Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

    – Tom Hawtin - tackline
    Jun 20 '13 at 1:11






  • 3





    On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

    – Chris Jester-Young
    Jun 20 '13 at 1:13
















11















In the current JSR 335 draft, it's mentioned in the change log entry for 0.6.0 that it "eliminated support for unbound inner class constructor references".



To illustrate, suppose you have an outer class named A and an inner class named B, and you want a function that takes an A and creates a new B instance:



Function<A, A.B> foo = a -> a.new B();


Prior to 0.6.0, you can also use the constructor reference syntax to do the same thing (it's even documented in State of the Lambda):



Function<A, A.B> foo = A.B::new;


As mentioned above, that syntax is no longer supported in 0.6.0. I'm really curious to know why.



I've looked through the archives for the lambda-spec-experts and lambda-dev mailing lists, and cannot find any information about it.










share|improve this question
























  • Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

    – Tom Hawtin - tackline
    Jun 20 '13 at 1:11






  • 3





    On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

    – Chris Jester-Young
    Jun 20 '13 at 1:13














11












11








11


1






In the current JSR 335 draft, it's mentioned in the change log entry for 0.6.0 that it "eliminated support for unbound inner class constructor references".



To illustrate, suppose you have an outer class named A and an inner class named B, and you want a function that takes an A and creates a new B instance:



Function<A, A.B> foo = a -> a.new B();


Prior to 0.6.0, you can also use the constructor reference syntax to do the same thing (it's even documented in State of the Lambda):



Function<A, A.B> foo = A.B::new;


As mentioned above, that syntax is no longer supported in 0.6.0. I'm really curious to know why.



I've looked through the archives for the lambda-spec-experts and lambda-dev mailing lists, and cannot find any information about it.










share|improve this question
















In the current JSR 335 draft, it's mentioned in the change log entry for 0.6.0 that it "eliminated support for unbound inner class constructor references".



To illustrate, suppose you have an outer class named A and an inner class named B, and you want a function that takes an A and creates a new B instance:



Function<A, A.B> foo = a -> a.new B();


Prior to 0.6.0, you can also use the constructor reference syntax to do the same thing (it's even documented in State of the Lambda):



Function<A, A.B> foo = A.B::new;


As mentioned above, that syntax is no longer supported in 0.6.0. I'm really curious to know why.



I've looked through the archives for the lambda-spec-experts and lambda-dev mailing lists, and cannot find any information about it.







java jsr335






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 23 '13 at 18:53







Chris Jester-Young

















asked Jun 20 '13 at 1:08









Chris Jester-YoungChris Jester-Young

184k39342399




184k39342399












  • Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

    – Tom Hawtin - tackline
    Jun 20 '13 at 1:11






  • 3





    On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

    – Chris Jester-Young
    Jun 20 '13 at 1:13


















  • Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

    – Tom Hawtin - tackline
    Jun 20 '13 at 1:11






  • 3





    On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

    – Chris Jester-Young
    Jun 20 '13 at 1:13

















Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

– Tom Hawtin - tackline
Jun 20 '13 at 1:11





Do you really want to do that? Do you think it is obvious to even experienced Java programmers what is going on from that line alone?

– Tom Hawtin - tackline
Jun 20 '13 at 1:11




3




3





On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

– Chris Jester-Young
Jun 20 '13 at 1:13






On the JVM level, inner class constructors are just constructors that additionally take a reference to the outer class. So the mental model is not surprising to me, at least. Granted, I'm not particularly trying to defend its use in a constructor reference expression, just trying to understand the rationale for its removal.

– Chris Jester-Young
Jun 20 '13 at 1:13













1 Answer
1






active

oldest

votes


















0














It's evident that the 'new' is a keyword, not a method, and that all involvment of 'new' as a method are special cases in the compiler. I can easily imagine they wanted to clean up the compiler of least likely usages which have trivial workarounds.



Speculation: there maybe also some collisions/ambiguities to resolve with upcoming JLS we don't know about yet, and this is a transition change to minimize regressions. 5-6 years after your question, do you suffer at all from this change? LOL






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17203781%2fjava-lambdas-jsr-335-why-eliminate-support-for-unbound-inner-class-construct%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It's evident that the 'new' is a keyword, not a method, and that all involvment of 'new' as a method are special cases in the compiler. I can easily imagine they wanted to clean up the compiler of least likely usages which have trivial workarounds.



    Speculation: there maybe also some collisions/ambiguities to resolve with upcoming JLS we don't know about yet, and this is a transition change to minimize regressions. 5-6 years after your question, do you suffer at all from this change? LOL






    share|improve this answer



























      0














      It's evident that the 'new' is a keyword, not a method, and that all involvment of 'new' as a method are special cases in the compiler. I can easily imagine they wanted to clean up the compiler of least likely usages which have trivial workarounds.



      Speculation: there maybe also some collisions/ambiguities to resolve with upcoming JLS we don't know about yet, and this is a transition change to minimize regressions. 5-6 years after your question, do you suffer at all from this change? LOL






      share|improve this answer

























        0












        0








        0







        It's evident that the 'new' is a keyword, not a method, and that all involvment of 'new' as a method are special cases in the compiler. I can easily imagine they wanted to clean up the compiler of least likely usages which have trivial workarounds.



        Speculation: there maybe also some collisions/ambiguities to resolve with upcoming JLS we don't know about yet, and this is a transition change to minimize regressions. 5-6 years after your question, do you suffer at all from this change? LOL






        share|improve this answer













        It's evident that the 'new' is a keyword, not a method, and that all involvment of 'new' as a method are special cases in the compiler. I can easily imagine they wanted to clean up the compiler of least likely usages which have trivial workarounds.



        Speculation: there maybe also some collisions/ambiguities to resolve with upcoming JLS we don't know about yet, and this is a transition change to minimize regressions. 5-6 years after your question, do you suffer at all from this change? LOL







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 14:18









        user2023577user2023577

        9631617




        9631617





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17203781%2fjava-lambdas-jsr-335-why-eliminate-support-for-unbound-inner-class-construct%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived