Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343328 - IncrementalImageBuilder sometimes removes resources that it should not
Summary: IncrementalImageBuilder sometimes removes resources that it should not
Status: CLOSED DUPLICATE of bug 335247
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-19 20:24 EDT by Slava Kabanovich CLA
Modified: 2011-04-25 10:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slava Kabanovich CLA 2011-04-19 20:24:53 EDT
Build Identifier: I20100520-1744

If web project is constructed of links to external or internal resources, builder 'org.eclipse.wst.jsdt.core.javascriptValidator' erroneously removes just modified web.xml.

Reproducible: Always

Steps to Reproduce:
1. Create a Dynamic Web Project 'Test' in Eclipse workspace
2. Make sure that the project has JavaScript facet.
3. Add folder WEB-INF to 'Test' (path /Test/WEB-INF) linked to /Test/WebContent/WEB-INF so that it conveniently displays content of WEB-INF one level higher.
4. Open web.xml in text or xml editor; modify it and save.
5. web.xml suddenly disappears; both from workspace and on disk.

Item 3 is crucial, without such a linked folder I have not got a use case that breaks projects.
Comment 1 Slava Kabanovich CLA 2011-04-19 20:40:53 EDT
On comparing files .classpath and .jsdtscope I found that 
There is entry in .classpath:
<classpathentry kind="output" path="build/classes"/>
and entry in .jsdtscope:
<classpathentry kind="output" path=""/>

That explains that resource is removed with path relative to project (which is considered as the output path) same as the path relative to WebContent. 
After I had manually set output path to "build/classes" in .jsdtscope, everything worked well. But I found no way to change that property other than manually. And why it was not equal to Java output in the beginning, since New Dynamic Web Project wizard suggested no way to select it separately, and actually I had no idea of its existence until it had appeared in such a peculiar way.
Comment 2 Nitin Dahyabhai CLA 2011-04-20 13:22:59 EDT
Sounds like it might be a duplicate of bug 335247.
Comment 3 Slava Kabanovich CLA 2011-04-20 14:00:56 EDT
That issue and others referenced in it are similar to this one. And fix applied there that stops removing files from output will help for this issue. But the question remains: why jsdt sets project itself to be its output instead of Java output when new Dynamic Web Project is created?
Comment 4 Nitin Dahyabhai CLA 2011-04-20 15:30:42 EDT
"output" in this sense is just an artifact of JSDT being a fork from JDT.  It has no really use, but it's there because our APIs still have references to it.
Comment 5 Slava Kabanovich CLA 2011-04-20 15:37:19 EDT
As soon as "output" is not used and JSDT does not modify its content when performing build, the issue is fixed.
Comment 6 Nitin Dahyabhai CLA 2011-04-25 10:14:29 EDT

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