Lines 3530-3535
Link Here
|
3530 |
|
3530 |
|
3531 |
// initialize all containers and variables |
3531 |
// initialize all containers and variables |
3532 |
JavaModelManager manager = JavaModelManager.getJavaModelManager(); |
3532 |
JavaModelManager manager = JavaModelManager.getJavaModelManager(); |
|
|
3533 |
ExternalFoldersManager externalFoldersManager = JavaModelManager.getExternalManager(); |
3534 |
externalFoldersManager.createExternalFoldersProject(monitor); |
3533 |
SubProgressMonitor subMonitor = null; |
3535 |
SubProgressMonitor subMonitor = null; |
3534 |
try { |
3536 |
try { |
3535 |
if (monitor != null) { |
3537 |
if (monitor != null) { |
Lines 3565-3571
Link Here
|
3565 |
// and recreate links for external folders if needed |
3567 |
// and recreate links for external folders if needed |
3566 |
if (monitor != null) |
3568 |
if (monitor != null) |
3567 |
monitor.subTask(Messages.javamodel_resetting_source_attachment_properties); |
3569 |
monitor.subTask(Messages.javamodel_resetting_source_attachment_properties); |
3568 |
ExternalFoldersManager externalFoldersManager = JavaModelManager.getExternalManager(); |
|
|
3569 |
final IJavaProject[] projects = manager.getJavaModel().getJavaProjects(); |
3570 |
final IJavaProject[] projects = manager.getJavaModel().getJavaProjects(); |
3570 |
HashSet visitedPaths = new HashSet(); |
3571 |
HashSet visitedPaths = new HashSet(); |
3571 |
for (int i = 0, length = projects.length; i < length; i++) { |
3572 |
for (int i = 0, length = projects.length; i < length; i++) { |
Lines 3581-3602
Link Here
|
3581 |
boolean needExternalFolderCreation = false; |
3582 |
boolean needExternalFolderCreation = false; |
3582 |
for (int j = 0, length2 = classpath.length; j < length2; j++) { |
3583 |
for (int j = 0, length2 = classpath.length; j < length2; j++) { |
3583 |
IClasspathEntry entry = classpath[j]; |
3584 |
IClasspathEntry entry = classpath[j]; |
3584 |
if (entry.getSourceAttachmentPath() != null) { |
3585 |
IPath sourceAttachmentPath = null; |
|
|
3586 |
if ( (sourceAttachmentPath = entry.getSourceAttachmentPath()) != null) { |
3585 |
IPath entryPath = entry.getPath(); |
3587 |
IPath entryPath = entry.getPath(); |
3586 |
if (visitedPaths.add(entryPath)) { |
3588 |
if (visitedPaths.add(entryPath)) { |
3587 |
Util.setSourceAttachmentProperty(entryPath, null); |
3589 |
Util.setSourceAttachmentProperty(entryPath, null); |
3588 |
} |
3590 |
} |
|
|
3591 |
if (ExternalFoldersManager.isExternalFolderPath(sourceAttachmentPath) |
3592 |
&& (externalFoldersManager.isPendingFolder(sourceAttachmentPath) || |
3593 |
externalFoldersManager.getFolder(sourceAttachmentPath) == null)) { |
3594 |
needExternalFolderCreation = true; |
3595 |
} |
3589 |
} |
3596 |
} |
3590 |
// else source might have been attached by IPackageFragmentRoot#attachSource(...), we keep it |
3597 |
// else source might have been attached by IPackageFragmentRoot#attachSource(...), we keep it |
3591 |
if (!needExternalFolderCreation && entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { |
3598 |
if (!needExternalFolderCreation && entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { |
3592 |
IPath entryPath = entry.getPath(); |
3599 |
IPath entryPath = entry.getPath(); |
3593 |
if (ExternalFoldersManager.isExternalFolderPath(entryPath) && externalFoldersManager.getFolder(entryPath) == null) { |
3600 |
if (ExternalFoldersManager.isExternalFolderPath(entryPath) |
|
|
3601 |
&& (externalFoldersManager.isPendingFolder(entryPath) || |
3602 |
externalFoldersManager.getFolder(entryPath) == null)) { |
3594 |
needExternalFolderCreation = true; |
3603 |
needExternalFolderCreation = true; |
3595 |
} |
3604 |
} |
3596 |
} |
3605 |
} |
3597 |
} |
3606 |
} |
|
|
3607 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337415 |
3608 |
// Request for creation of external folder's link instead of relying on delta processing. |
3598 |
if (needExternalFolderCreation) |
3609 |
if (needExternalFolderCreation) |
3599 |
manager.deltaState.addExternalFolderChange(javaProject, null/*act as if all external folders were new*/); |
3610 |
new ExternalFolderChange(javaProject, classpath).updateExternalFoldersIfNecessary(false, monitor); |
3600 |
} |
3611 |
} |
3601 |
} |
3612 |
} |
3602 |
|
3613 |
|