/** * Creates a new {@link BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) basic diagnostic}. * If the source is {@link #DIAGNOSTIC_SOURCE "org.eclipse.emf.ecore"}, * it calls {@link #getEcoreString(String, Object[])}; * otherwise it calls {@link #getString(String, Object[])}. * @param severity an indicator of the severity of the problem. * @param source the unique identifier of the source. * @param code the source-specific identity code. * @param messageKey the key of the message. * @param messageSubstitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @param data the data associated with the diagnostic * @param context a place to cache information, if it's <code>null</code>, no cache is supported. * @return a new diagnostic. * @see BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) * @since 2.4 */ protected BasicDiagnostic createDiagnostic (int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data, Map<Object, Object> context) { String message = DIAGNOSTIC_SOURCE.equals(source) ? getEcoreString(messageKey, messageSubstitutions) : getString(messageKey, messageSubstitutions); return new BasicDiagnostic(severity, source, code, message, data); }
/** * Creates a new {@link BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) basic diagnostic}. * If the source is {@link #DIAGNOSTIC_SOURCE "org.eclipse.emf.ecore"}, * it calls {@link #getEcoreString(String, Object[])}; * otherwise it calls {@link #getString(String, Object[])}. * @param severity an indicator of the severity of the problem. * @param source the unique identifier of the source. * @param code the source-specific identity code. * @param messageKey the key of the message. * @param messageSubstitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @param data the data associated with the diagnostic * @param context a place to cache information, if it's <code>null</code>, no cache is supported. * @return a new diagnostic. * @see BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) * @since 2.4 */ protected BasicDiagnostic createDiagnostic (int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data, Map<Object, Object> context) { String message = DIAGNOSTIC_SOURCE.equals(source) ? getEcoreString(messageKey, messageSubstitutions) : getString(messageKey, messageSubstitutions); return new BasicDiagnostic(severity, source, code, message, data); }