Bug 65068

Summary: project preferences should be forgotten when file is deleted
Product: [Eclipse Project] Platform Reporter: Rafael Chaves <eclipse>
Component: ResourcesAssignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.