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 8385 - [Refactoring] Renaming a package is not updating source files properly.
Summary: [Refactoring] Renaming a package is not updating source files properly.
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 3.x
Hardware: Other Linux
: P2 enhancement (vote)
Assignee: issues@java
URL:
Keywords:
: 11229 (view as bug list)
Depends on: 17825
Blocks:
  Show dependency tree
 
Reported: 2000-11-13 02:41 UTC by pcmreddy
Modified: 2007-04-03 18:02 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pcmreddy 2000-11-13 02:41:56 UTC
Build 1152 IE version, Redhat Linux 6.2 with JDK 1.3

Create and select a package.
Capture a db schema from a database.
Generate java files from dbschema.
Compile all, See that compilation is OK.
Select the above package and rename it.
Compile all, Observe there are some compilation errors.

Renaming the package should update all contents in the package
Comment 1 Svata Dedic 2000-11-13 06:34:59 UTC
What compilation errors ? Would you please attach the output from the compiler
or at least post error messages ? Simply stating that thing does not work does
not help at all in getting to the root cause.
What are the kinds of files inside the package subtree rooted at the renamed one
?

Remember: Updating package statements does _not_ update fully qualified
referencies to that package neither does update imports; there is not a project-
or system-wide registry of such dependencies and scanning whole Fileystems is
not feasible.
Comment 2 Svata Dedic 2000-11-23 10:43:59 UTC
It's java module-specific, changing product
Comment 3 Jesse Glick 2000-11-23 14:54:59 UTC
Svata, please click "Reassign bug to owner of selected component" when changing
Product, to switch the assignee mail address.

Is there any reason why Severity is set to Critical? This looks like Normal to
me, assuming the sources were simply not updated (and not corrupted). The
present behavior of changing the package automatically was added fairly recently
and there were not bitter complaints about it before that time.
Comment 4 Svata Dedic 2000-11-23 15:35:59 UTC
The severity was unchanged from creation of the report. I have no
response/confirmation about what exactly is not updated.
Comment 5 Jan Chalupa 2000-11-28 08:48:59 UTC
The described behavior is by design.

When a package is renamed in the Explorer, only the 'package' declarations of
contained files are updated. Imports and fully-qualified type declarations
within the files are not changed. As a result, both the contained files and the
files with references to them may not be compilable.

Although the Java module could probably do a little better job and try to
adjust the declarations in the contained files, it cannot update the other
files that may also include reference to the old package structure.

I'm changing the priority to P5 and set the sererity to 'enhancement'.
Comment 6 Jan Chalupa 2001-05-05 23:19:48 UTC
Target milestone -> 3.3
Comment 7 Jan Chalupa 2001-11-27 12:49:16 UTC
Target milestone -> 3.3.1.
Comment 8 Svata Dedic 2002-05-21 17:50:01 UTC
Cleaning up before 4.0 planning
Comment 9 Marek Grummich 2002-07-19 17:27:00 UTC
Target milestone was changed from not determined to TBD
Comment 10 Jan Becicka 2002-08-06 10:42:41 UTC
*** Issue 11229 has been marked as a duplicate of this issue. ***
Comment 11 Jan Becicka 2004-08-10 16:39:19 UTC
Fixed by refactoring module.