/** * Returns a diagnostic describing the errors and warnings listed in the resource and the * specified exception (if any). * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { BasicDiagnostic basicDiagnostic = new BasicDiagnostic( Diagnostic.ERROR, "org.eclipse.buckminster.rmap.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception == null ? (Object) resource : exception}); basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); return basicDiagnostic; } else if (exception != null) { return new BasicDiagnostic( Diagnostic.ERROR, "org.eclipse.buckminster.rmap.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception}); } else { return Diagnostic.OK_INSTANCE; } }