Bug 142725 - F_REMOVED_FROM_CLASSPATH flag when renaming source folder
Summary: F_REMOVED_FROM_CLASSPATH flag when renaming source folder
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-19 08:12 EDT by Danail Nachev CLA
Modified: 2008-06-16 11:57 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 Danail Nachev CLA 2006-05-19 08:12:37 EDT
The JDT plugin generates IJavaElementDelta with kind of CHANGED and flag F_REMOVED_FROM_CLASSPATH for source folder upon renaming. There is no moved to element. There is also another delta with kind of ADDED and flag MOVED_FROM.

For every other rename refactoring there are two deltas: REMOVED with F_MOVED_TO and ADDED with F_MOVED_FROM.

This situation happens only on special case of source folders.

Steps to reproduce:

1) Create Java Project with source folder 'src'
2) Change the build path of the project so the output folder is the source folder itself (but still use separate source folder and output folder)
3) Refactor->rename the source folder to something else

The example delta which I receive:

Java Model[*]: {CHILDREN}
	bug[*]: {CHILDREN | CLASSPATH CHANGED}
		src2[*]: {REMOVED FROM CLASSPATH}
		src[+]: {MOVED_FROM(src2 [in bug])}
		ResourceDelta(/bug/.classpath)[*]

Here is the delta when the output folder and the source folder doesn't overlap:

Java Model[*]: {CHILDREN}
	bug[*]: {CHILDREN | CLASSPATH CHANGED}
		src[-]: {MOVED_TO(src3 [in bug])}
		src3[+]: {MOVED_FROM(src [in bug])}
		ResourceDelta(/bug/.classpath)[*]


Valid for Build id: I20060512-1600
Comment 1 Jerome Lanneluc CLA 2007-06-21 11:36:49 EDT
Reproduced with 3.3RC4
Comment 2 Jerome Lanneluc CLA 2008-05-12 05:11:27 EDT
We ran out of time. Sorry. Deferring post 3.4
Comment 3 Jerome Lanneluc CLA 2008-06-16 11:32:56 EDT
Following the steps, I believe the delta you're seeing is actually:

Java Model[*]: {CHILDREN}
        bug[*]: {CHILDREN | CLASSPATH CHANGED}
                src[*]: {REMOVED FROM CLASSPATH}
                src2[+]: {MOVED_FROM(src [in bug])}
                ResourceDelta(/bug/.classpath)[*]

You get this delta because the rename operation doesn't actually rename the folder 'src' since it is referred to as an output folder. It creates a 'src2' folder instead and it moves the classpath entry to this folder.

Marking as WONTFIX. Please reopen if you disagree.
Comment 4 Danail Nachev CLA 2008-06-16 11:57:59 EDT
You are perfectly correct and I agree.