Community
Participate
Working Groups
20030128 i call move with FORCE and get a NAME_COLLISION exception (btw. the message says 'JavaModelStatus' which is not useful)
(same problem with copy) in IResource, FORCE means that things out of synch will be copied too so it does not mean, i think, that things will be ovewritten. which, in turn, means, that NAME_COLLISION has little to do with the FORCE flag. ISourceManipulation.copy/move had something like 'replace' - and there the NAME_COLLISION made sense.
major - makes clients have to delete the conflicting resource themselves
Right, I'm going to add a REPLACE flag. Otherwise for the message, are you using getMessage() or getString(). The later is deprecated.
REPLACE flag added. Also improved message of JavaModelException. Added regression tests on RootModificationTests: testCopySourceFolder5() testFailCopySourceFolder1() testFailCopySourceFolder2()
was this in the code you sent to us last night? (i still get the exception) although i pass REPLACE
this line in CopyPackageFragmentRootOperation::verify() looks incorrect: it ignore the REPLACE flag if (foundExistingEntry && (this.updateResourceFlags & IResource.FORCE) == 0) { return new JavaModelStatus (IJavaModelStatusConstants.NAME_COLLISION, this.destination.toString()); }
Sorry about that. This is fixed in HEAD.
tests are on RootManipulationsTests. Verified.