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

Bug 11510

Summary: [resources] Non-local folders do not become local when directory is created.
Product: [Eclipse Project] Platform Reporter: Jim des Rivieres <jeem>
Component: ResourcesAssignee: Rafael Chaves <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dj.houghton
Version: 2.0Keywords: helpwanted
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch to RefreshLocalVisitor.java none

Description Jim des Rivieres CLA 2002-03-16 16:28:25 EST
 
Comment 1 Jim des Rivieres CLA 2002-03-16 16:50:07 EST
Snippet to reproduce:

IWorkspace ws = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root= ws.getRoot();
IProject project = root.getProject("TestProject");
IFolder fold1 = project.getFolder("fold1");
IFile file1 = fold1.getFile("f1");
if (project.exists()) {
     project.delete(true, true, null);
}
project.create(null);
project.open(null);
fold1.create(true, false, null);
file1.create(null, true, null);
assert fold1.isLocal();
assert file1.isLocal();

// now create the folder and file in the local file system
fold1.toFile().mkdir();
file1.toFile().createNewFile();

// the following must be done in a separate operation
project.refreshLocal(IResource.DEPTH_INFINITE, null);
assert !file1.isLocal();
assert !fold1.isLocal();

Observe: The assertion that the file exist fails (as expected), but
the other one fails because the folder is still marked as non-local.

Expected behavior: Folders tagged as non-local should become tagged as local
when it is determined that the folder does indeed exist. This would mean
non-local files and folders behave in the same way.
Comment 2 DJ Houghton CLA 2002-09-30 18:50:53 EDT
See RefreshLocalVisitor.visit().

There is a comment which says that we don't care about the last modified time 
of a folder so we just return. That is true, but we should be checking the 
local flag here as well.
Comment 3 Rafael Chaves CLA 2002-11-22 18:36:13 EST
Created attachment 2499 [details]
patch to RefreshLocalVisitor.java

Sets folder local sync info when it has none set yet.

DJ: Please verify and release.
Comment 4 DJ Houghton CLA 2002-11-23 15:50:43 EST
Released into HEAD.
Created regression test and released into HEAD.
Closing.