[validation] Improved error message for invalid attempt to create a FeatureBasedDiagnostic

This commit is contained in:
Sebastian Zarnekow 2012-04-02 22:38:11 +02:00
parent 750f07ad9f
commit dfd9fa96c9

View file

@ -30,7 +30,7 @@ public class FeatureBasedDiagnostic extends AbstractValidationDiagnostic {
super(severity, message, source, checkType, issueCode, issueData);
if (feature != null && source != null) {
if (source.eClass().getEStructuralFeature(feature.getName()) != feature) {
throw new IllegalArgumentException("EClass '" + source.eClass().getName() + "' does not expose a feature '" + feature.getName() + "'");
throw new IllegalArgumentException("The sources EClass '" + source.eClass().getName() + "' does not expose the feature '" + feature.getEContainingClass().getName() + "." + feature.getName() + "'");
}
}
this.feature = feature;