Move refactoring question

Hi...

my setup has three source folders:
src/ for the main project code
test/ for unittests
private/ for private stuff such as experimental stuff.

Today I tried to move a package in my private part (that exists in all three
source folders), but to my surprise it always wanted to refactor the
packages in all three source folders. I would understand this if I selected
the package in the new package view, but I selected the directory in the
project view, where it is clearly distinct from the others.
I had to move the package in the filesystem and manually update all the
package statements and imports :(

Is this a bug?

Ciao

...Jochen





4 comments

Jochen Riekhof wrote:

I had to move the package in the filesystem and manually update all the
package statements and imports :(

Is this a bug?


Anything that's annoying is definitely something that should be posted
on the tracker. Please post this one.

--
Regards,
Rob Harwood
Software Developer
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

0

ok, done.

Ciao

...Jochen

"Rob Harwood (JetBrains)" <rob.harwood@jetbrains.com> wrote in message
news:c0vs1n$lk4$1@is.intellij.net...

Jochen Riekhof wrote:

I had to move the package in the filesystem and manually update all the
package statements and imports :(

>

Is this a bug?

>

>

Anything that's annoying is definitely something that should be posted
on the tracker. Please post this one.

>

--
Regards,
Rob Harwood
Software Developer
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

>



0

It is not a bug but expected behaviour. The "move"refactoring here works
correctly and it really should make changes in all source roots.
"Moving" a package (for this case better said: "directory") withing some
source root is not "moving" the package but rather removing this package and
its members withing this source root and introducing another package
(after changes you made to the directory structuer at filesystem level the
qualified package name is different).

To achieve your goal you need to create the destination package (the package
you intended to move into) and move the contents of the original package
that is located under "private" source root to the new package just created.
Note the "preserve source folders" checkbox that should be checked in this
case - that way all changes will be done only within the "private" source
root. Otherwise you will be prompted about the destination source root.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"Jochen Riekhof" <jochen@riekhof.de> wrote in message
news:c0tkar$tvr$1@is.intellij.net...

Hi...

>

my setup has three source folders:
src/ for the main project code
test/ for unittests
private/ for private stuff such as experimental stuff.

>
+> Today I tried to move a package in my private part (that exists in all
three

source folders), but to my surprise it always wanted to refactor the
packages in all three source folders. I would understand this if I

selected

the package in the new package view, but I selected the directory in the
project view, where it is clearly distinct from the others.
I had to move the package in the filesystem and manually update all the
package statements and imports :(

>

Is this a bug?

>

Ciao

>

...Jochen

>
>
>
>


0

Eugene,

yep, sounds very reasonable. Thank ypu!

Ciao

...Jochen



0

Please sign in to leave a comment.