Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336762

Summary: deletion of .settings/org.eclipse.core.resources.pref causes a full build
Product: [Eclipse Project] Platform Reporter: Angel Vera <arvera>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, sptaszkiewicz, Szymon.Brandys
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Angel Vera CLA 2011-02-09 16:17:35 EST
Whenever the encoding of a file is set it seems to create/modify/delete the .settings/org.eclipse.core.resources.pref file. In most cases this is not a problem but when the .settings/org.eclipse.core.resources.pref is being deleted there is a full auto build that seems to be occurring, is this really necessary?
Comment 1 Olivier Thomann CLA 2011-02-09 17:30:08 EST
Jay, please investigate. I would say we should at least rebuild the file for which the encoding has been changed and its dependents if necessary.
Comment 2 Jay Arthanareeswaran CLA 2011-02-10 03:38:22 EST
When the encoding is changed for a particular source file, the resource delta propagated to the Java builder contains only the specific source file and hence only that file is recompiled. However, when the pref file itself is deleted, the resource delta contains the entire project, which results in all source files being compiled by the Java builder. 

I don't know what JDT/Core can do here because we don't keep track of what the pref file contained before it was deleted.
Comment 3 Angel Vera CLA 2011-02-10 11:01:45 EST
(In reply to comment #2)
Why does the delta contain the entire project? it should probably only contain the .settings folder.
Comment 4 Jay Arthanareeswaran CLA 2011-02-11 00:11:26 EST
(In reply to comment #3)
> (In reply to comment #2)
> Why does the delta contain the entire project? it should probably only contain
> the .settings folder.

To be precise, it delta contains all the individual resources in the project and not the project itself as a resource. Now, I don't know if there is any difference but from JDT/Core's standpoint, all the java files are in the resource delta and hence re-compiled. 

Requesting further investigation from the Platform team.
Comment 5 Szymon Ptaszkiewicz CLA 2011-08-11 07:54:29 EDT
The .settings/org.eclipse.core.resources.pref file contains information about encoding for all resources in the project. If the file gets deleted manually, then we have no information for which resource the encoding was changed. After deletion, the only thing we can do is to assume that potentially all resources in the project have different encoding now, thus all of them appear in resource delta.

BTW, there is no need to delete or alter this file manually.
Comment 6 Szymon Brandys CLA 2011-11-04 13:53:13 EDT
(In reply to comment #5)
> After deletion, the only thing we can do is to assume that potentially all resources
> in the project have different encoding now, thus all of them appear in resource
> delta.

> BTW, there is no need to delete or alter this file manually.

Szymon is right.
Comment 7 Szymon Ptaszkiewicz CLA 2011-11-04 14:05:41 EDT
Marking as INVALID.