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 131622 - [69cat] "Assign Return Value To New Variable" misinterprets scoping in static nested classes
Summary: [69cat] "Assign Return Value To New Variable" misinterprets scoping in static...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-31 13:57 UTC by matthies
Modified: 2011-01-11 10:53 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 2008-03-31 13:57:44 UTC
Example:

    class Test
    {
        int foo;
        
        int foo() { return foo; }
        
        static class Nested
        {
            void bar(Test test)
            {
                test.foo();
            }
        }
    }

Performing "Assign Return Value To New Variable" on "test.foo()" results in:

    int foo1 = test.foo();

Expected behavior is:

    int foo = test.foo();

I.e. without the "1". Apparently the operation thinks that the instance variable Test.foo is in scope, which it isn't.

Product Version: NetBeans IDE 6.1 Beta (Build 200803050202)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Comment 1 Jiri Prox 2008-04-01 07:54:01 UTC
This is IMO only a minor inconvenience.
Comment 2 Jan Becicka 2008-05-15 13:25:48 UTC
Max volunteered :)
Comment 3 Max Sauer 2008-11-24 14:51:40 UTC
Will be resolved LATER.
Comment 4 Quality Engineering 2009-11-02 10:57:39 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX
Comment 5 matthies 2010-05-26 20:19:52 UTC
Still happens in 6.9.
Comment 6 Jan Lahoda 2011-01-11 10:53:30 UTC
Still only a minor inconvenience, IMO.