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 57155 - Moving or Renaming code via refactoring menu, places code in wrong directory
Summary: Moving or Renaming code via refactoring menu, places code in wrong directory
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: Sun Windows XP
: P3 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords: RANDOM
: 57968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-29 21:37 UTC by 12agnarok
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot snippet of incorrect 'Move Class' dialog (51.88 KB, image/png)
2005-04-05 16:25 UTC, 12agnarok
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 12agnarok 2005-03-29 21:37:20 UTC
I have a project with two source code directories: path/Src and path/Test. Both
directory contain Java code with similar package stucture. The path/Src has
application code and path/Test has the unit tests.

Using the refactor menu, moving and renaming Java classes is fine the in
path/Src directory. The problem is with the 2nd directory, path/Test. 

If I move or rename a class in path/Test, the file is moved to path/Src with the
same directory and file name.

For example:

directory structure of path/Src
path/Src/com/exmple/ExcitingLogic.java
path/Src/com/exmple/code/LessExcitingLogic.java

directory structure of path/Test:
path/Test/com/example/ExcitingLogicTest.java
path/Test/com/exmple/code/LessExcitingLogicTest.java


If I move ExcitingLogicTest.java in the path/Test/com/example to the
path/Test/com/exmple/code directory, the ExcitingLogicTest.java would really be
moved to path/Src/com/exmple/code directory! Eeeek.


The resulting file structure would be:

directory structure of path/Src (note the LessExcitingLogicTest.java was
incorrectly moved)
path/Src/com/exmple/ExcitingLogic.java
path/Src/com/exmple/code/LessExcitingLogic.java
path/Src/com/exmple/code/LessExcitingLogicTest.java

directory structure of path/Test (note the missing ExcitingLogicTest.java):
path/Test/com/example/ExcitingLogicTest.java


Product Version: NetBeans IDE 4.0 (Build200412081800)
IDE Versioning: IDE/ spec=4.50.1 impl=20041208100
OS: Windows XP version 5.1 running on x86
Java 1.4.2_05
VML Java HotSpot client VM 1.4.2_05-b04
Comment 1 Milan Kubec 2005-04-04 13:45:10 UTC
Reassigning for eval.
Comment 2 Jan Becicka 2005-04-04 15:51:35 UTC
I saw it as well, but unfortunately only once. Do you have reproducible scenario?
Can you describe it step by step? (I mean e.g. Select ExcitingLogic.java and
drag it into "Test Sources | com.example" node)
Thanks!
Comment 3 12agnarok 2005-04-05 16:22:25 UTC
While I swear I had a problem from the right-click menu->refactor->rename, I can
not reproduce it.

The problem with right-click->refactor->move, the 'Move Class' refactor dialogue
only has the Location for one of the source directories, Java, instead of both,
Java _and_ Java-Test. 

I will attach a screen shot with the right-click->refactor->move.

In the screen shot, I have two sources directories, Devel/Src/Java and
Devel/Src/Java-Test (the Java-Test is expanded). I am trying to move the test
class SRC/Java-Test/<package directory>/RefactorTest4, but am only given the
option to move it to the SRC/Java/<package directory>/RefactorTest4 directory in
the 'Move Class' dialogue.
Comment 4 12agnarok 2005-04-05 16:25:01 UTC
Created attachment 21393 [details]
screen shot snippet of incorrect 'Move Class' dialog
Comment 5 Jan Becicka 2005-04-07 09:41:32 UTC
And if you want to create a new Java Class: right-click menu-> New -> Java Class
- do you see both source directories in Location combo?
Comment 6 Jan Becicka 2005-07-22 12:42:53 UTC
This one was probably fixed together with other issues regarding DnD. If you can
still reproduce it in latest builds, please reopen this issue.
Comment 7 Jan Becicka 2005-07-22 14:44:15 UTC
*** Issue 57968 has been marked as a duplicate of this issue. ***