Bug 30731 - Class move refactoring changes the unlinked projects in the same workplace
Summary: Class move refactoring changes the unlinked projects in the same workplace
Status: RESOLVED DUPLICATE of bug 22756
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-31 13:17 EST by Eugene Kuleshov CLA
Modified: 2003-02-06 10:24 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2003-01-31 13:17:31 EST
I have two projects in the same workspace. They are not linked to each other, 
but basically using the same classes. When I've moved class to the another 
package in first project, the second one was automatically changed. Actually 
second project have those original classes in the jar file.

PS: probably the same will happend for the other refactorings.
Comment 1 Philipe Mulet CLA 2003-02-03 05:16:38 EST
Can you please provide exact steps to reproduce ? Are you sharing files across 
those two projects ?
Comment 2 Eugene Kuleshov CLA 2003-02-05 12:59:46 EST
The projects are completely independent, no shared files. Project A is using 
class java.security.Security, which is imported from a rt.jar. Project B has 
whole source for java.security.Security and was used for plaing with the 
refactoring and remodelling. 

So, I've moved java.security.Security class to an another package of Project B 
and Eclipse is changed all the references in Project A. Even if class was from 
java.security package, it should not be an issue.
Comment 3 Philipe Mulet CLA 2003-02-05 13:35:37 EST
David - pls try to reproduce
Comment 4 David Audel CLA 2003-02-06 07:54:17 EST
Simple test case :
1) create project 'A' with source folder 'src'.
2) create a jar which contain a class 'bbb.Y'.
3) add this jar to the classpath of 'A'.
4) create the class X.java in 'A'.
package aaa;
import bbb.*;
public class X {
   bbb.Y s1;
   Y s2;
   void foo(bbb.Y s3, Y s4) {
      bbb.Y s5;
      Y s6;
   }
}
5) create the project 'B' with source folder 'src'.
6) create the class Y.java in 'B'.
package bbb;
public class Y {
}
7) create the class X.java in 'B'.
package aaa;
import bbb.*;
public class X {
   bbb.Y s1;
   Y s2;
   void foo(bbb.Y s3, Y s4) {
      bbb.Y s5;
      Y s6;
   }
}
8) create the package 'ccc' in 'B'.
9) do Refactor>Move of 'Y' from 'bbb' to 'ccc'.

References are updated in projects 'A' and 'B'.
Comment 5 David Audel CLA 2003-02-06 10:24:48 EST

*** This bug has been marked as a duplicate of 22756 ***