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 240065 - [Move] There shold be warning when mooving to same package
Summary: [Move] There shold be warning when mooving to same package
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-07 10:18 UTC by ssazonov
Modified: 2016-07-07 07:18 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 ssazonov 2014-01-07 10:18:40 UTC
1. Create simple java project with 2 classes in same package:

package test;

public class ClassA {

    public void m(){
          ClassB b = new ClassB();
    }
}

package test;

public class ClassB {
    
}

2. Right click ClassA in Projects view and from pop-up menu select Refactor > Move...

3. Select destination "test" and press Refactor

>> Refactor should not allow to move class to its package (like renaming "ClassA" to "ClassA"). Useless "import test.ClassB;" has been added to ClassA despite ClassA remains in same package.

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Martin Balin 2016-07-07 07:18:57 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss