Bug 65068 - project preferences should be forgotten when file is deleted
Summary: project preferences should be forgotten when file is deleted
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-01 13:13 EDT by Rafael Chaves CLA
Modified: 2004-06-03 11:27 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 Rafael Chaves CLA 2004-06-01 13:13:27 EDT
3.0 RC1

The project preferences should be forgotten when the corresponding file is
deleted  in the project content area. Currently, if a file is deleted, they
preferences in the corresponding node are still remembered.

A test case (written for ProjectPreferencesTest) follows (fails on assertion 2.0):

	/*
	 * When the preferences file is deleted, the corresponding preferences 
	 * should be forgotten.
	 */
	public void testPreferencesFileDeletion() {
		IWorkspace workspace = getWorkspace();
		IProject project = workspace.getRoot().getProject(getUniqueString());
		ensureExistsInWorkspace(new IResource[] {project}, true);
		Preferences node = new
ProjectScope(project).getNode(ResourcesPlugin.PI_RESOURCES);
		String key = "key";
		String value = getUniqueString();
		node.put(key, value);
		try {
			node.flush();
		} catch (BackingStoreException e) {
			fail("1.1", e);
		}
		assertTrue("1.2",
project.getFolder(".settings").getFile(ResourcesPlugin.PI_RESOURCES +
".prefs").exists());
		node = new ProjectScope(project).getNode(ResourcesPlugin.PI_RESOURCES);
		assertEquals("1.3", value, node.get(key, null));
		ensureDoesNotExistInWorkspace(project.getFolder(".settings"));
		node = new ProjectScope(project).getNode(ResourcesPlugin.PI_RESOURCES);
		assertNull("2.0", node.get(key, null));
	}
Comment 1 DJ Houghton CLA 2004-06-01 13:39:18 EDT
Good catch. Thanks for the test case.
Comment 2 DJ Houghton CLA 2004-06-01 13:39:48 EDT
Adding Jeff to CC for approval for RC2.
Comment 3 DJ Houghton CLA 2004-06-01 14:17:59 EDT
Similar to bug 60896.
Comment 4 DJ Houghton CLA 2004-06-01 14:53:24 EDT
Decided that we don't need someone else to approve for milestone.

To be fixed in RC2.
Comment 5 DJ Houghton CLA 2004-06-03 11:27:31 EDT
Fixed and released to HEAD. We had been reacting to changes in the file but not
actual deletion of the file.