[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-users] Subclipse 1.0.1 bug: "Entry already exists" error when renaming a package that has a subpackage and more than one class

From: Peter Agar <peter.agar_at_reveal.co.nz>
Date: 2006-05-23 06:00:27 CEST

Hi,
 
I get a problem if I try to rename any versioned package that contains a
subpackage and more than one class. I don't believe I am trying to do
anything out of the ordinary and would appreciate any assistance anyone
can offer.
 
I am using Subclipse 1.0.1 installed via the instructions on
http://subclipse.tigris.org/install.html and I am using Eclipse 3.2M6
running on Windows XP Professional Version 2002 Service Pack 2.
 
Reproduction instructions:
 
Create a repository.
Check out the repository to a new folder in your eclipse workspace.
Create an eclipse java project in this new folder.
Create a package called "packagea".
In "packagea" create 2 classes: "ClassA1" and "ClassA2".
In "packagea" create a subpackage" "packageb" (its is not necessary to
create a class in packageb).
You should have 2 packages: "packagea" and "packagea.packageb"; and 2
classes: "packagea.ClassA1" and "packagea.ClassA2".
Commit all of this to the repository.
Right click "packagea" in the package explorer. Choose refactor, then
rename.
In the pop-up dialog enter "packagec" in the "New name" field.
Ensure "Rename subpackages" is NOT checked.
Click OK.
 
At this point I get a pop up dialog box titled "Refactoring" informing
me that "An exception has been caught while processing refactoring...".
In the console i get the following:
 
add-N C:\workspace\test\src\packagec
    A C:/workspace/test/src/packagec
move C:/workspace/test/src/packagea/ClassA2.java
C:/workspace/test/src/packagec/ClassA2.java
    A C:/workspace/test/src/packagec/ClassA2.java
    D C:/workspace/test/src/packagea/ClassA2.java
add-N C:\workspace\test\src\packagec
    Entry already exists
svn: 'C:\workspace\test\src\packagec' is already under version control
 
ClassA2 successfully moves into packagec, but during the attempt to move
ClassA1, it appears to attempt to add packagec despite the fact that it
has already been added, and therefore fails. If you have only a single
class in packagea, this will succeed, but if you check the "Rename
subpackages" tickbox, it will fail in a similar fashion.
 
Interestingly enough, I have found a way of getting around this problem,
though it can be a little tedious if you have many packages: First
refactor "packagea.packageb" to "packagec.packageb", then refactor
"packagea" to "packagec" ("Rename subpackages" must NOT be ticked). This
seems to get around the subpackage problem somehow.
 
I believe this is a bug, I am not sure if it is subclipse or the version
of Eclipse i am running. If anyone can help, it would be greatly
appreciated.
 
Thanks,
Peter Agar
Received on Tue May 23 06:03:51 2006

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.