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

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page