|
Lines 70-76
Link Here
|
| 70 |
*/ |
70 |
*/ |
| 71 |
protected static Set loadedNodes = Collections.synchronizedSet(new HashSet()); |
71 |
protected static Set loadedNodes = Collections.synchronizedSet(new HashSet()); |
| 72 |
private IFile file; |
72 |
private IFile file; |
| 73 |
private boolean initialized = false; |
|
|
| 74 |
/** |
73 |
/** |
| 75 |
* Flag indicating that this node is currently reading values from disk, |
74 |
* Flag indicating that this node is currently reading values from disk, |
| 76 |
* to avoid flushing during a read. |
75 |
* to avoid flushing during a read. |
|
Lines 341-361
Link Here
|
| 341 |
if (segmentCount > 2) |
340 |
if (segmentCount > 2) |
| 342 |
qualifier = getSegment(path, 2); |
341 |
qualifier = getSegment(path, 2); |
| 343 |
|
342 |
|
| 344 |
if (segmentCount != 2) |
343 |
initialize(); |
| 345 |
return; |
|
|
| 346 |
|
| 347 |
// else segmentCount == 2 so we initialize the children |
| 348 |
if (initialized) |
| 349 |
return; |
| 350 |
try { |
| 351 |
synchronized (this) { |
| 352 |
String[] names = computeChildren(); |
| 353 |
for (int i = 0; i < names.length; i++) |
| 354 |
addChild(names[i], null); |
| 355 |
} |
| 356 |
} finally { |
| 357 |
initialized = true; |
| 358 |
} |
| 359 |
} |
344 |
} |
| 360 |
|
345 |
|
| 361 |
/* |
346 |
/* |
|
Lines 440-445
Link Here
|
| 440 |
return new ProjectPreferences(nodeParent, nodeName); |
425 |
return new ProjectPreferences(nodeParent, nodeName); |
| 441 |
} |
426 |
} |
| 442 |
|
427 |
|
|
|
428 |
protected void initialize() { |
| 429 |
if (segmentCount == 2) { |
| 430 |
// segmentCount == 2 so we initialize the children |
| 431 |
synchronized (this) { |
| 432 |
String[] names = computeChildren(); |
| 433 |
for (int i = 0; i < names.length; i++) |
| 434 |
addChild(names[i], null); |
| 435 |
} |
| 436 |
} |
| 437 |
} |
| 438 |
|
| 443 |
protected boolean isAlreadyLoaded(IEclipsePreferences node) { |
439 |
protected boolean isAlreadyLoaded(IEclipsePreferences node) { |
| 444 |
return loadedNodes.contains(node.absolutePath()); |
440 |
return loadedNodes.contains(node.absolutePath()); |
| 445 |
} |
441 |
} |