Lines 1727-1736
Link Here
|
1727 |
* @param project the given java project |
1727 |
* @param project the given java project |
1728 |
* @param entry the given classpath entry |
1728 |
* @param entry the given classpath entry |
1729 |
* @param checkSourceAttachment a flag to determine if source attachment should be checked |
1729 |
* @param checkSourceAttachment a flag to determine if source attachment should be checked |
1730 |
* @param recurseInContainers flag indicating whether validation should be applied to container entries recursively |
1730 |
* @param referredByContainer flag indicating whether the given entry is referred by a classpath container |
1731 |
* @return a java model status describing the problem related to this classpath entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine |
1731 |
* @return a java model status describing the problem related to this classpath entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine |
1732 |
*/ |
1732 |
*/ |
1733 |
public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers){ |
1733 |
public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ |
1734 |
|
1734 |
|
1735 |
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); |
1735 |
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); |
1736 |
IPath path = entry.getPath(); |
1736 |
IPath path = entry.getPath(); |
Lines 1782-1792
Link Here
|
1782 |
if (description == null) description = path.makeRelative().toString(); |
1782 |
if (description == null) description = path.makeRelative().toString(); |
1783 |
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CP_CONTAINER_ENTRY, project, path); |
1783 |
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CP_CONTAINER_ENTRY, project, path); |
1784 |
} |
1784 |
} |
1785 |
if (recurseInContainers) { |
1785 |
IJavaModelStatus containerEntryStatus = validateClasspathEntry(project, containerEntry, checkSourceAttachment, true/*referred by container*/); |
1786 |
IJavaModelStatus containerEntryStatus = validateClasspathEntry(project, containerEntry, checkSourceAttachment, recurseInContainers); |
1786 |
if (!containerEntryStatus.isOK()){ |
1787 |
if (!containerEntryStatus.isOK()){ |
1787 |
return containerEntryStatus; |
1788 |
return containerEntryStatus; |
|
|
1789 |
} |
1790 |
} |
1788 |
} |
1791 |
} |
1789 |
} |
1792 |
} |
1790 |
} |
Lines 1813-1819
Link Here
|
1813 |
} |
1811 |
} |
1814 |
|
1812 |
|
1815 |
// get validation status |
1813 |
// get validation status |
1816 |
IJavaModelStatus status = validateClasspathEntry(project, entry, checkSourceAttachment, recurseInContainers); |
1814 |
IJavaModelStatus status = validateClasspathEntry(project, entry, checkSourceAttachment, false/*not referred by container*/); |
1817 |
if (!status.isOK()) return status; |
1815 |
if (!status.isOK()) return status; |
1818 |
|
1816 |
|
1819 |
// return deprecation status if any |
1817 |
// return deprecation status if any |
Lines 1836-1843
Link Here
|
1836 |
for (int i = 0, length = chainedJars.length; i < length; i++) { |
1834 |
for (int i = 0, length = chainedJars.length; i < length; i++) { |
1837 |
IPath chainedJar = chainedJars[i]; |
1835 |
IPath chainedJar = chainedJars[i]; |
1838 |
IJavaModelStatus status = validateLibraryEntry(chainedJar, project, null/*don't check source attachment*/, null/*force computing of entryPathMsg*/); |
1836 |
IJavaModelStatus status = validateLibraryEntry(chainedJar, project, null/*don't check source attachment*/, null/*force computing of entryPathMsg*/); |
1839 |
if (!status.isOK()) |
1837 |
if (!status.isOK()) { |
|
|
1838 |
if (referredByContainer && status.getCode() == IJavaModelStatusConstants.INVALID_CLASSPATH) |
1839 |
continue; // ignore this entry (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=250946 ) |
1840 |
return status; |
1840 |
return status; |
|
|
1841 |
} |
1841 |
} |
1842 |
} |
1842 |
|
1843 |
|
1843 |
IJavaModelStatus status = validateLibraryEntry(path, project, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg); |
1844 |
IJavaModelStatus status = validateLibraryEntry(path, project, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg); |