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 75076

Summary: [Move] Import not set correctly when moving class
Product: java Reporter: Jiri Prox <jiriprox>
Component: RefactoringAssignee: Max Sauer <msauer>
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 117607    
Bug Blocks: 152192    
Attachments: proposed patch

Description Jiri Prox 2006-04-14 17:18:13 UTC
NetBeans IDE Dev (Build 200604131800)
1.6.0-beta2; Java HotSpot(TM) Client VM 1.6.0-beta2-b77
Linux version 2.6.5-1.358 running on i386
en_US (nb); UTF-8

Imports are not set correctly when moving class to another package. Only
<original pack>.* is added, but if in the new package exist a class with the
same name as in original, the reference form the moved class is change -> which
can make code uncompilable.

Steps to reproduce:
1) create project structure:
     \- Main
     \- NewClass
     \- NewClass

2) add following to the class Main:
   private NewClass ccc; 
3) move class Main to packB
-> import packA.*; is added
-> but field ccc in now packB.newClass, not packA.NewClass as before
Comment 1 Jan Becicka 2007-06-27 14:37:38 UTC
*** Issue 101697 has been marked as a duplicate of this issue. ***
Comment 2 Jiri Prox 2007-09-17 21:31:14 UTC
Obsolete milestone, please reevaluate
Comment 3 Jiri Prox 2008-04-11 01:49:04 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 4 Max Sauer 2009-09-08 14:59:18 UTC
Created attachment 87281 [details]
proposed patch
Comment 6 Quality Engineering 2009-09-11 21:36:59 UTC
Integrated into 'main-golden', will be available in build *200909111401* on (upload may still be in progress)
User: Max Sauer <>
Log: #75076: [Move] Import not set correctly when moving class