Bug 30511 - IPackageFragmentRoot:move ignores FORCE flag
Summary: IPackageFragmentRoot:move ignores FORCE flag
Status: VERIFIED FIXED
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 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-29 10:35 EST by Adam Kiezun CLA
Modified: 2003-02-11 09:50 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 Adam Kiezun CLA 2003-01-29 10:35:58 EST
20030128
i call move with FORCE
and get a NAME_COLLISION exception 
(btw. the message says 'JavaModelStatus' which is not useful)
Comment 1 Adam Kiezun CLA 2003-01-30 09:41:22 EST
(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.
Comment 2 Adam Kiezun CLA 2003-01-30 09:46:22 EST
major - makes clients have to delete the conflicting resource themselves
Comment 3 Jerome Lanneluc CLA 2003-01-30 10:48:07 EST
Right, I'm going to add a REPLACE flag.

Otherwise for the message, are you using getMessage() or getString(). The later 
is deprecated.
Comment 4 Jerome Lanneluc CLA 2003-01-31 04:02:40 EST
REPLACE flag added. Also improved message of JavaModelException.

Added regression tests on RootModificationTests:
testCopySourceFolder5()
testFailCopySourceFolder1()
testFailCopySourceFolder2()
Comment 5 Adam Kiezun CLA 2003-01-31 08:22:12 EST
was this in the code you sent to us last night?
(i still get the exception) although i pass REPLACE
Comment 6 Adam Kiezun CLA 2003-01-31 08:34:45 EST
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());
					}

Comment 7 Jerome Lanneluc CLA 2003-01-31 13:07:48 EST
Sorry about that. This is fixed in HEAD.
Comment 8 David Audel CLA 2003-02-11 09:50:50 EST
tests are on RootManipulationsTests.

Verified.