/**
* Record a new marker denoting a classpath problem
*/
public void createClasspathProblemMarker(IJavaModelStatus status) {
IMarker marker = null;
int severity;
String[] arguments = CharOperation.NO_STRINGS;
boolean isCycleProblem = false, isClasspathFileFormatProblem = false;
switch (status.getCode()) {
case IJavaModelStatusConstants.CLASSPATH_CYCLE :
isCycleProblem = true;
if (JavaCore.ERROR.equals(getOption(JavaCore.CORE_CIRCULAR_CLASSPATH, true))) {
severity = IMarker.SEVERITY_ERROR;
} else {
severity = IMarker.SEVERITY_WARNING;
}
break;
case IJavaModelStatusConstants.INVALID_CLASSPATH_FILE_FORMAT :
isClasspathFileFormatProblem = true;
severity = IMarker.SEVERITY_ERROR;
break;
case IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL :
String setting = getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true);
if (JavaCore.ERROR.equals(setting)) {
severity = IMarker.SEVERITY_ERROR;
} else if (JavaCore.WARNING.equals(setting)) {
severity = IMarker.SEVERITY_WARNING;
} else {
return; // setting == IGNORE
}
break;
default:
IPath path = status.getPath();
if (path != null) arguments = new String[] { path.toString() };
if (JavaCore.ERROR.equals(getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true)) &&
status.getSeverity() != IStatus.WARNING) {
severity = IMarker.SEVERITY_ERROR;
} else {
severity = IMarker.SEVERITY_WARNING;
}
break;
}
try {
marker = this.project.createMarker(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER);
marker.setAttributes(
new String[] {
IMarker.MESSAGE,
IMarker.SEVERITY,
IMarker.LOCATION,
IJavaModelMarker.CYCLE_DETECTED,