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 111004 - Static import of inner class in same file is not adjusted upon copy class
Summary: Static import of inner class in same file is not adjusted upon copy class
Status: RESOLVED DUPLICATE of bug 90769
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 19:52 UTC by matthies
Modified: 2007-08-14 12:36 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 2007-07-25 19:52:18 UTC
Steps to reproduce:

1. Create the following Java source file:

    package testpackage;

    import static testpackage.Test.Foo.*;

    public class Test
    {
        public enum Foo { FOO };

        { Foo foo = FOO; }
    }

2. Choose Refactor->Copy... and copy the class to testpackage2. Result:

    package testpackage2;

    import testpackage.*;
    import static testpackage.Test.Foo.*;

    public class Test
    {
        public enum Foo { FOO };

        { Foo foo = FOO; }
    }

This creates a compile error on the assignment because the rhs FOO there is from testpackage and the lhs Foo is the 
local Foo from testpackage2.

Expected behavior: The static import should have been adjusted to:

    import static testpackage2.Test.Foo.*;

Move... instead of Copy... has the correct behavior.
Comment 1 Jan Becicka 2007-08-03 08:46:36 UTC

*** This issue has been marked as a duplicate of 90769 ***