Bug 274160 - File#setCharset does not prompt to check out org.eclipse.core.resources.prefs
Summary: File#setCharset does not prompt to check out org.eclipse.core.resources.prefs
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 15:38 EDT by Justin Berstler CLA
Modified: 2019-09-06 15:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Berstler CLA 2009-04-28 15:38:20 EDT
Build ID: I20090202-1535

Steps To Reproduce:
The scenario is that the user has all the project metadata files under .settings checked in by a read-only source control system.  Some client code is calling File#setCharset on a file inside this project, which would like to write to org.eclipse.core.resources.prefs to store the encoding.  However, the user is never prompted to checkout this file and as a result the edit fails silently except for the following stack trace in the .log:

!MESSAGE Exception occurred while saving project preferences: /project/.settings/org.eclipse.core.resources.prefs.
!STACK 1
org.eclipse.core.runtime.CoreException: No files were checked out.
	at org.eclipse.core.internal.resources.ProjectPreferences$2.run(Unknown Source)
	at org.eclipse.core.internal.resources.ProjectPreferences.save(Unknown Source)
	at org.eclipse.core.internal.preferences.EclipsePreferences.flush(Unknown Source)
	at org.eclipse.core.internal.resources.ProjectPreferences.flush(Unknown Source)
	at org.eclipse.core.internal.preferences.EclipsePreferences.flush(Unknown Source)
	at org.eclipse.core.internal.resources.ProjectPreferences.flush(Unknown Source)
	at org.eclipse.core.internal.resources.CharsetManager.setCharsetFor(Unknown Source)
	at org.eclipse.core.internal.resources.File.setCharset(Unknown Source)

This scenario can be reproduced by checking in the .settings/org.eclipse.core.resources.prefs file with a source control system like ClearCase, or by using the Pessimistic Filesystem Provider included in the Eclipse example plugins.


More information:

Also see Bug 149190 and Bug 190268 for eerily similar scenarios.
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:32:02 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.