Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 202384 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/resources/Project.java (-2 / +1 lines)
Lines 15-22 Link Here
15
 *******************************************************************************/
15
 *******************************************************************************/
16
package org.eclipse.core.internal.resources;
16
package org.eclipse.core.internal.resources;
17
17
18
import java.util.LinkedHashSet;
19
20
import java.net.URI;
18
import java.net.URI;
21
import java.util.*;
19
import java.util.*;
22
import org.eclipse.core.filesystem.*;
20
import org.eclipse.core.filesystem.*;
Lines 1169-1174 Link Here
1169
		} finally {
1167
		} finally {
1170
			monitor.done();
1168
			monitor.done();
1171
		}
1169
		}
1170
		((ProjectPreferences) Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE).node(getName())).initialize();
1172
	}
1171
	}
1173
1172
1174
	/* (non-Javadoc)
1173
	/* (non-Javadoc)
(-)src/org/eclipse/core/internal/resources/ProjectPreferences.java (-16 / +12 lines)
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
	}

Return to bug 202384