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 87247

Summary: Copying class does not add required import statements
Product: editor Reporter: _ sandipchitale <sandipchitale>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED FIXED    
Severity: blocker Keywords: RELNOTE
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ sandipchitale 2006-10-17 00:24:38 UTC
Steps:

1. Create a Java project
2. Create a new java package - newpackage
3. Create a new java class NewClass in newpackage
4. Create a new java class NewClass1 in newpackage
5. Add a statement new NewClass(); in NewClass1 constructor.
6. Create a new java package - newpackage.newsubpackage
7. Copy and paste newpackage.NewClass1 to newpackage.newsubpackage
8. Open newpackage.newsubpackage.NewClass1.
9. See a red sqigly underline under statement new NewClass();

This happens because the import newpackage; statement is missing in 
newpackage.newsubpackage.NewClass1.

Woraround is to invoke Fix Imports action.
Comment 1 Jan Becicka 2006-11-22 13:44:57 UTC
We need to implement copy refactoring for 6.0
Comment 2 Jan Becicka 2006-12-18 17:40:13 UTC
Copy refactoring implemented