mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
[xbase][validation] Fixed registration of JvmTypeReferencesValidator
follow up for https://bugs.eclipse.org/bugs/show_bug.cgi?id=453286 Change-Id: Ie98542177dc4a73bd9a035cccca1a3a35f7e7125
This commit is contained in:
parent
b7a00b96b7
commit
2a76494168
2 changed files with 21 additions and 1 deletions
|
@ -75,6 +75,10 @@ public abstract class AbstractInjectableValidator implements EValidator {
|
|||
return languageName != null;
|
||||
}
|
||||
|
||||
String getLanguageName() {
|
||||
return languageName;
|
||||
}
|
||||
|
||||
protected boolean isResponsible(Map<Object, Object> context, EObject eObject) {
|
||||
return !isLanguageSpecific() || Strings.equal(languageName, getCurrentLanguage(context, eObject));
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.eclipse.emf.ecore.EValidator;
|
|||
import org.eclipse.emf.ecore.util.EObjectValidator;
|
||||
import org.eclipse.xtext.service.OperationCanceledError;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
|
@ -54,7 +55,22 @@ public class CompositeEValidator implements EValidator {
|
|||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof EValidatorEqualitySupport))
|
||||
return false;
|
||||
return ((EValidatorEqualitySupport) obj).getDelegate().getClass().equals(getDelegate().getClass());
|
||||
EValidator otherDelegate = ((EValidatorEqualitySupport) obj).getDelegate();
|
||||
if (otherDelegate.getClass().equals(getDelegate().getClass())) {
|
||||
if (delegate instanceof AbstractInjectableValidator) {
|
||||
AbstractInjectableValidator casted = (AbstractInjectableValidator) getDelegate();
|
||||
AbstractInjectableValidator otherCasted = (AbstractInjectableValidator) otherDelegate;
|
||||
if (casted.isLanguageSpecific() == otherCasted.isLanguageSpecific()) {
|
||||
if (casted.isLanguageSpecific()) {
|
||||
return Objects.equal(casted.getLanguageName(), otherCasted.getLanguageName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue