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.
[200406021800] Copy class from one package to another package. Package declaration isn't changed (as it was before refactoring merge) It isn't possible to easily copy classes between packages...
explorer or java issue?
.. same result after rename class file .... This is very anooying, especially if you've wroked with NB3.6 or earlier, where after renaming classfile constructors within class are renamed too.
Lukasi: Why should copy/paste of files change it's contents? Try Refactoring | Move Class if you want to move class to another package. Mariane: You want to say, that you tried to rename java file and Rename Refactoring was not invoked? It is a bug, but it works for me.
It used to change package declaration after Copy&Paste in 3.6 I'd expect this behaviour even in 4.0. I don't want to 'Move' the class I want copy it... 'Rename' is different story - try rename on package, it definitely doesn't works for me
What about competitive IDEs? Do they change package declarations after copy/paste? Changing package declaration after copy paste is not implementation problem. I can do it. But it will have significant performance impact. All copy/pasted files would have to be parsed. Do you have a use case, that this functionality is needed? According to rename: please file an issue.
I don't know how it should behave - probably it should be covered be some UI spec but as longtime netbeans user I noticed that it behaves differently, well and I filled bug (and REGRESSION) I really don't know how the others IDE treat to copy&pasting. And the best solution ? From my point of view it could be a dialog (like after cut&paste=move class) asking 'Do you wanna change package declaration' after pasting of class... But probably we need HIE decision.
Honza , I filed separate issue for rename action , see issue 44999 ....
Guys, I don't think this is P1. Workaround exists and the rename issue is also a P2. Originally, not changing the package declaration was intentional, since it most likely does not make the code compilable anyway (there may be some broken references, etc.) - so it is a pseudo-refactoring and we considered it of a low value. Since this was not properly communicated with the community, we probably have to implement it so there is no regression. But I am lowering the priority to P2.
Fixed. Checking in JavaDataObject.java; /cvs/java/src/org/netbeans/modules/java/JavaDataObject.java,v <-- JavaDataObject.java new revision: 1.181; previous revision: 1.180 done
it works in 200406230100 verified