Move refactoring does not add imports when moving class to another package

Move refactoring: when moving class to another package imports are not added to other classes that reference the moved one.

I am using IDEA 5.0 3417 build and I am new to IDEA, so I do not konw if this feature worked in previous versions.
For example, JBuilder's move refactoring adds imports correctly.

4 comments
Comment actions Permalink

Mileta Cekovic wrote:

Move refactoring: when moving class to another package imports are
not added to other classes that reference the moved one.


That works fine for me. Is the class you are trying to move contained in
a "Source Folder"? Did you import your project from JBuilder?

Bas

0
Comment actions Permalink

This hapened after I created new module in the project, then moved some filed form existing module to the new one (production and test classes). All this went OK. Then I tried to move some of the classes from new module to the new package and then this happened.
The classes I moved to another package were referenced by other classes in the new module, but IDEA did not add imports to them. Although ALT+ENTER quickly fixed this, I expected this to be done automaticaly.

The classes that were moved to new module were not dependent on the classes that remained in the old module.

0
Comment actions Permalink

Was the move operation that caused problems done with "preserve source
folders" option on, or you moved classes between modules?
The behaviour you describe could have happened in the latter case when
classes would become inaccessible from old module; we've added warnings for
that in 3419.

Eugene.
"Mileta Cekovic" <no_mail@jetbrains.com> wrote in message
news:9464715.1122029598343.JavaMail.javamailuser@localhost...

This hapened after I created new module in the project, then moved some
filed form existing module to the new one (production and test classes).
All this went OK. Then I tried to move some of the classes from new module
to the new package and then this happened.
The classes I moved to another package were referenced by other classes in
the new module, but IDEA did not add imports to them. Although ALT+ENTER
quickly fixed this, I expected this to be done automaticaly.

>

The classes that were moved to new module were not dependent on the
classes that remained in the old module.



0
Comment actions Permalink

I suppose that was the case. Thanks for explanation.

0

Please sign in to leave a comment.