Lines 3242-3247
Link Here
|
3242 |
monitor.subTask(Messages.javamodel_configuring_classpath_containers); |
3242 |
monitor.subTask(Messages.javamodel_configuring_classpath_containers); |
3243 |
manager.batchContainerInitializationsProgress.set(new SubProgressMonitor(monitor, 50)); // 50% of the time is spent in initializing containers and variables |
3243 |
manager.batchContainerInitializationsProgress.set(new SubProgressMonitor(monitor, 50)); // 50% of the time is spent in initializing containers and variables |
3244 |
} |
3244 |
} |
|
|
3245 |
|
3246 |
// all classpaths in the workspace are going to be resolved, ensure that containers are initialized in one batch |
3247 |
manager.batchContainerInitializations = true; |
3248 |
|
3249 |
// avoid leaking source attachment properties (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=183413) |
3250 |
IJavaProject[] projects = manager.getJavaModel().getJavaProjects(); |
3251 |
for (int i = 0, length = projects.length; i < length; i++) { |
3252 |
IClasspathEntry[] classpath = ((JavaProject) projects[i]).getResolvedClasspath(); |
3253 |
if (classpath != null) { |
3254 |
for (int j = 0, length2 = classpath.length; j < length2; j++) { |
3255 |
IClasspathEntry entry = classpath[j]; |
3256 |
if (entry.getSourceAttachmentPath() != null) |
3257 |
Util.setSourceAttachmentProperty(entry.getPath(), null); |
3258 |
// else source might have been attached by IPackageFragmentRoot#attachSource(...), we keep it |
3259 |
} |
3260 |
} |
3261 |
} |
3262 |
|
3263 |
// initialize delta state |
3264 |
manager.deltaState.rootsAreStale = true; // in case it was already initialized before we cleaned up the source attachment proprties |
3245 |
manager.deltaState.initializeRoots(); |
3265 |
manager.deltaState.initializeRoots(); |
3246 |
} finally { |
3266 |
} finally { |
3247 |
manager.batchContainerInitializationsProgress.set(null); |
3267 |
manager.batchContainerInitializationsProgress.set(null); |
Lines 3348-3353
Link Here
|
3348 |
} catch (JavaModelException e) { |
3368 |
} catch (JavaModelException e) { |
3349 |
// refreshing failed: ignore |
3369 |
// refreshing failed: ignore |
3350 |
} |
3370 |
} |
|
|
3371 |
|
3351 |
} finally { |
3372 |
} finally { |
3352 |
if (monitor != null) monitor.done(); |
3373 |
if (monitor != null) monitor.done(); |
3353 |
} |
3374 |
} |