if (resourceDiagnostic.getSeverity() >= Diagnostic.WARNING) {
ret.merge(resourceDiagnostic);
}
if (resourceDiagnostic.getSeverity() < Diagnostic.ERROR) {
TargetPlatform targetPlatform = null;
if (resource != null && !resource.getContents().isEmpty()) {
targetPlatform = (TargetPlatform) resource.getContents().get(0);
}
if (targetPlatform == null) {
ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "Error occured while loading the file " + uri + ".", null));
} else if (subMonitor.isCanceled()) {
ret.merge(Diagnostic.CANCEL_INSTANCE);
} else {
SubMonitor diagnosticianMonitor = subMonitor.newChild(90).setWorkRemaining(targetPlatform.getLocations().size());
Diagnostic validation = new CustomDiagnostician(diagnosticianMonitor).validate(targetPlatform);
if (validation.getSeverity() >= Diagnostic.WARNING) {
ret.merge(validation);
} else if (subMonitor.isCanceled()) {
ret.merge(Diagnostic.CANCEL_INSTANCE);