|
Lines 56-61
Link Here
|
| 56 |
|
56 |
|
| 57 |
/** path prefixes for checking symbolic link cycles */ |
57 |
/** path prefixes for checking symbolic link cycles */ |
| 58 |
protected PrefixPool pathPrefixHistory, rootPathHistory; |
58 |
protected PrefixPool pathPrefixHistory, rootPathHistory; |
|
|
59 |
|
| 60 |
/** cache for avoiding unnecessary getCanonicalPath() calls on previous parent */ |
| 61 |
private IFileStore prevFileStore; |
| 62 |
private String prevCanonicalPath; |
| 59 |
|
63 |
|
| 60 |
/** tree's root */ |
64 |
/** tree's root */ |
| 61 |
protected IResource root; |
65 |
protected IResource root; |
|
Lines 353-358
Link Here
|
| 353 |
if (pathPrefixHistory != null) { |
357 |
if (pathPrefixHistory != null) { |
| 354 |
pathPrefixHistory.clear(); |
358 |
pathPrefixHistory.clear(); |
| 355 |
rootPathHistory.clear(); |
359 |
rootPathHistory.clear(); |
|
|
360 |
prevFileStore = null; |
| 356 |
} |
361 |
} |
| 357 |
addRootToQueue(); |
362 |
addRootToQueue(); |
| 358 |
addElementToQueue(levelMarker); |
363 |
addElementToQueue(levelMarker); |
|
Lines 439-446
Link Here
|
| 439 |
if (parentFile == null) |
444 |
if (parentFile == null) |
| 440 |
return false; |
445 |
return false; |
| 441 |
//get canonical path for both child and parent |
446 |
//get canonical path for both child and parent |
|
|
447 |
String parentPath; |
| 448 |
if (parentStore == prevFileStore) { |
| 449 |
parentPath = prevCanonicalPath; |
| 450 |
} else { |
| 451 |
parentPath = parentFile.getCanonicalPath()+'/'; |
| 452 |
prevFileStore = parentStore; |
| 453 |
prevCanonicalPath = parentPath; |
| 454 |
} |
| 442 |
java.io.File childFile = new java.io.File(parentFile, localInfo.getName()); |
455 |
java.io.File childFile = new java.io.File(parentFile, localInfo.getName()); |
| 443 |
String parentPath = parentFile.getCanonicalPath()+'/'; |
|
|
| 444 |
String childPath = childFile.getCanonicalPath()+'/'; |
456 |
String childPath = childFile.getCanonicalPath()+'/'; |
| 445 |
//get or instantiate the prefix and root path histories. |
457 |
//get or instantiate the prefix and root path histories. |
| 446 |
//Might be done earlier - for now, do it on demand. |
458 |
//Might be done earlier - for now, do it on demand. |
|
Lines 456-462
Link Here
|
| 456 |
} else if (rootPathHistory.hasPrefixOf(childPath)) { |
468 |
} else if (rootPathHistory.hasPrefixOf(childPath)) { |
| 457 |
//child points into a different portion of the tree that we visited already before, or will certainly visit. |
469 |
//child points into a different portion of the tree that we visited already before, or will certainly visit. |
| 458 |
//This does not introduce a loop yet, but introduces duplicate resources. |
470 |
//This does not introduce a loop yet, but introduces duplicate resources. |
| 459 |
//TODO Ideally, such duplicates should be modelled as linked resources. See bug 105534 |
471 |
//TODO Ideally, such duplicates should be modeled as linked resources. See bug 105554 |
| 460 |
return false; |
472 |
return false; |
| 461 |
} else { |
473 |
} else { |
| 462 |
//child neither introduces a loop nor points to a known tree. |
474 |
//child neither introduces a loop nor points to a known tree. |