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

Summary: "Assign Return Value To New Variable" generates incorrect declaration for member classes of parameterized types
Product: java Reporter: matthies <matthies>
Component: SourceAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

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.