Lines 530-542
Link Here
|
530 |
if (projectLength != 1) |
530 |
if (projectLength != 1) |
531 |
return false; |
531 |
return false; |
532 |
final IClasspathContainer container = respectiveContainers[0]; |
532 |
final IClasspathContainer container = respectiveContainers[0]; |
533 |
if (container == null) |
|
|
534 |
return false; |
535 |
IJavaProject project = projects[0]; |
533 |
IJavaProject project = projects[0]; |
536 |
// optimize only if initializing, otherwise we are in a regular setContainer(...) call |
534 |
// optimize only if initializing, otherwise we are in a regular setContainer(...) call |
537 |
if (!containerIsInitializationInProgress(project, containerPath)) |
535 |
if (!containerIsInitializationInProgress(project, containerPath)) |
538 |
return false; |
536 |
return false; |
539 |
IClasspathContainer previousContainer = containerGetDefaultToPreviousSession(project, containerPath); |
537 |
IClasspathContainer previousContainer = containerGetDefaultToPreviousSession(project, containerPath); |
|
|
538 |
if (container == null) { |
539 |
if (previousContainer == null) { |
540 |
containerPut(project, containerPath, null); |
541 |
return true; |
542 |
} |
543 |
return false; |
544 |
} |
540 |
final IClasspathEntry[] newEntries = container.getClasspathEntries(); |
545 |
final IClasspathEntry[] newEntries = container.getClasspathEntries(); |
541 |
if (previousContainer == null) |
546 |
if (previousContainer == null) |
542 |
if (newEntries.length == 0) { |
547 |
if (newEntries.length == 0) { |
Lines 1528-1548
Link Here
|
1528 |
} else { |
1533 |
} else { |
1529 |
container = initializeContainer(project, containerPath); |
1534 |
container = initializeContainer(project, containerPath); |
1530 |
} |
1535 |
} |
1531 |
if (container == null) { // initializer failed to do its job: redirect to the failure container |
|
|
1532 |
ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0)); |
1533 |
if (initializer == null) { |
1534 |
// create a dummy initializer and get the default failure container |
1535 |
container = (new ClasspathContainerInitializer() { |
1536 |
public void initialize(IPath path, IJavaProject javaProject) throws CoreException { |
1537 |
// not used |
1538 |
} |
1539 |
}).getFailureContainer(containerPath, project); |
1540 |
} else { |
1541 |
container = initializer.getFailureContainer(containerPath, project); |
1542 |
} |
1543 |
if (container != null) |
1544 |
containerPut(project, containerPath, container); |
1545 |
} |
1546 |
} |
1536 |
} |
1547 |
return container; |
1537 |
return container; |
1548 |
} |
1538 |
} |
Lines 2206-2212
Link Here
|
2206 |
|
2196 |
|
2207 |
// retrieve value (if initialization was successful) |
2197 |
// retrieve value (if initialization was successful) |
2208 |
container = containerGet(project, containerPath); |
2198 |
container = containerGet(project, containerPath); |
2209 |
if (container == CONTAINER_INITIALIZATION_IN_PROGRESS) return null; // break cycle |
2199 |
if (container == CONTAINER_INITIALIZATION_IN_PROGRESS) { |
|
|
2200 |
// initializer failed to do its job: redirect to the failure container |
2201 |
container = initializer.getFailureContainer(containerPath, project); |
2202 |
if (container == null) |
2203 |
return null; // break cycle |
2204 |
containerPut(project, containerPath, container); |
2205 |
} |
2210 |
ok = true; |
2206 |
ok = true; |
2211 |
} catch (CoreException e) { |
2207 |
} catch (CoreException e) { |
2212 |
if (e instanceof JavaModelException) { |
2208 |
if (e instanceof JavaModelException) { |
Lines 2237-2242
Link Here
|
2237 |
if (CP_RESOLVE_VERBOSE_ADVANCED) |
2233 |
if (CP_RESOLVE_VERBOSE_ADVANCED) |
2238 |
verbose_container_value_after_initialization(project, containerPath, container); |
2234 |
verbose_container_value_after_initialization(project, containerPath, container); |
2239 |
} else { |
2235 |
} else { |
|
|
2236 |
// create a dummy initializer and get the default failure container |
2237 |
container = (new ClasspathContainerInitializer() { |
2238 |
public void initialize(IPath path, IJavaProject javaProject) throws CoreException { |
2239 |
// not used |
2240 |
} |
2241 |
}).getFailureContainer(containerPath, project); |
2240 |
if (CP_RESOLVE_VERBOSE_ADVANCED) |
2242 |
if (CP_RESOLVE_VERBOSE_ADVANCED) |
2241 |
verbose_no_container_initializer_found(project, containerPath); |
2243 |
verbose_no_container_initializer_found(project, containerPath); |
2242 |
} |
2244 |
} |