This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 179230 - "Assign Return Value To New Variable" generates incorrect declaration for member classes of parameterized types
Summary: "Assign Return Value To New Variable" generates incorrect declaration for mem...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-05 12:05 UTC by matthies
Modified: 2015-09-17 11:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2010-01-05 12:05:12 UTC
Example:

    abstract class Enclosing<T>
    {
        class Member { }

        abstract List<Member> members();

        static <T> void f(Enclosing<T> foo)
        {
            foo.members();
        }
    }

"Assign Return Value To New Variable" results in

            List<Member> members = foo.members();

which doesn't compile ("non-static class my.Test.Container.Item cannot be referenced from a static context"). The correct result would be:

            List<Enclosing<T>.Member> members = foo.members();
Comment 1 rcano 2012-05-23 19:24:30 UTC
The bug is still present as of NetBeans 7.2 beta.
Comment 2 Jan Lahoda 2013-06-26 09:38:39 UTC
Hints pass the correct type to TreeMaker.Type, as far as I can tell.
Comment 3 Martin Balin 2015-09-17 11:15:51 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.