/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
case IClasspathEntry.CPE_PROJECT : p = this.workspaceRoot.getProject(path.lastSegment()); // missing projects are considered too if (((ClasspathEntry) entry).isOptional() && !JavaProject.hasJavaNature(p)) // except if entry is optional p = null; break;
/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { JavaModelManager.getJavaModelManager().removeFromInvalidArchiveCache(entry.getPath()); } IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { JavaModelManager.getJavaModelManager().removeFromInvalidArchiveCache(entry.getPath()); } IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { JavaModelManager.getJavaModelManager().removeFromInvalidArchiveCache(entry.getPath()); } IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { JavaModelManager.getJavaModelManager().removeFromInvalidArchiveCache(entry.getPath()); } IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
/** * Returns 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 (that is, if the * given classpath entry denotes a valid element to be referenced onto a classpath). * * @param project the given java project * @param entry the given classpath entry * @param checkSourceAttachment a flag to determine if source attachment should be checked * @param referredByContainer flag indicating whether the given entry is referred by a classpath container * @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 */ public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { JavaModelManager.getJavaModelManager().removeFromInvalidArchiveCache(entry.getPath()); } IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 // Ignore class path errors from optional entries. int statusCode = status.getCode(); if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants.INVALID_PATH) && ((ClasspathEntry) entry).isOptional()) return JavaModelStatus.VERIFIED_OK; return status; }
IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg, ((ClasspathEntry) entry).isOptional()); if (!status.isOK()) return status;
IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg, ((ClasspathEntry) entry).isOptional()); if (!status.isOK()) return status;
IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg, ((ClasspathEntry) entry).isOptional()); if (!status.isOK()) return status;
IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg, ((ClasspathEntry) entry).isOptional()); if (!status.isOK()) return status;
if (status.getCode() == IJavaModelStatusConstants.INVALID_CLASSPATH && ((ClasspathEntry) entry).isOptional()) status = JavaModelStatus.VERIFIED_OK; if (!status.isOK())
IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg, ((ClasspathEntry) entry).isOptional()); if (!status.isOK()) return status;