Bug 200441

Summary: Create XML File, New WSDL File, and Create XML Schema wizards overwrite linked files w/o confirmation
Product: [WebTools] WTP Source Editing Reporter: Cliff Chu <cdchu>
Component: wst.xmlAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: d_a_carver, itewksbu, nsand.dev, remy.suen
Version: 2.0Keywords: bugday, helpwanted
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Cliff Chu CLA 2007-08-17 20:50:18 EDT
Build IDs: 200705021353 (WST)
           M20070212-1330 (Eclipse Platform)

Steps To Reproduce:
The following steps are for the Create XML File wizard, but apply to the New WSDL File and the Create XML Schema wizards as well.

1. Create an XML file anywhere in your file system by any means available, e.g., create a document named simple.xml in c:\temp, with the contents: <simple/> using a text editor.
2. Switch to the Resource perspective: Window > Open Perspective > Other > Resource.
3. Create a Project: File > New > Project > General > Project.
4. Open the Create XML File wizard: File > New > Other > XML > XML
5. Select 'Create XML file from scratch' and click Next.
6. Select the project you created in step 3 in the project selection tree.
7. Click on the Advanced >> button.
8. Click on the 'Link to file in the file system' checkbox.
9. Enter the full path to the file you created in step 1, using the Browse button or by typing in the text field.
10. Click Finish.

Result: the file created in step 1 is overwritten with a basic XML document, without any warning.
Expected result: a dialog requesting confirmation of the overwrite should be displayed, as an overwrite may not be expected, given that creating a file link via New > File does not overwrite the target.

More information:
Web Standard Tools

Version: 1.5.4.v200704200440-X3TmzmK-W-vP-Fs
Build id: 200705021353

Eclipse Platform

Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
Build id: M20070212-1330
Comment 1 David Carver CLA 2007-08-20 09:44:08 EDT
I would suggest that instead of a dialog, their needs to be a warning that the file a file exists, and there should be an check box option to allow to overwrite.   Standard application for the eclipse wizards, seems to be to use the error portion of the wizard for this particular situation, and not to allow the wizard to proceed.
Comment 2 Remy Suen CLA 2007-08-28 06:54:54 EDT
This bug seems to be a lot more troublesome than it seems. The 'Advanced' section is created by the superclass and there is no way of knowing when a user has actually typed anything into that text field or if the linking checkbox is even marked.

I think the parent wizard from Platform needs to expose some APIs for this to be implemented.
Comment 3 Ian Tewksbury CLA 2010-03-03 10:37:28 EST
This still happens in WTP 3.2, but according to comment #2 this is a platform limitation, so possibly need to open a bug on them?
Comment 4 Nick Sandonato CLA 2012-12-04 11:17:25 EST
Changes the wizards so that they will not overwrite linked files by default.

http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=24187b4d174c704f9c9e976dc9e147f01dfaedae