| Summary: | [resources] Non-local folders do not become local when directory is created. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jim des Rivieres <jeem> | ||||
| Component: | Resources | Assignee: | Rafael Chaves <eclipse> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dj.houghton | ||||
| Version: | 2.0 | Keywords: | helpwanted | ||||
| Target Milestone: | 2.1 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Jim des Rivieres
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.
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. Created attachment 2499 [details]
patch to RefreshLocalVisitor.java
Sets folder local sync info when it has none set yet.
DJ: Please verify and release.
Released into HEAD. Created regression test and released into HEAD. Closing. |