[xtext][ui] Fix: LinkingErrorFixes have to use the value converter service

see https://bugs.eclipse.org/bugs/show_bug.cgi?id=361509
This commit is contained in:
Sebastian Zarnekow 2012-04-03 23:45:28 +02:00
parent 675b31c24a
commit 3ee879ab6d

View file

@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.xtext.nodemodel.BidiIterator;
import org.eclipse.xtext.nodemodel.ICompositeNode;
@ -412,12 +413,10 @@ public class GrammarUtil {
// TODO replace me by compiled grammar model
public static EReference getReference(CrossReference ref, EClass referenceOwner) {
final List<EReference> references = referenceOwner.getEAllReferences();
final String feature = GrammarUtil.containingAssignment(ref).getFeature();
for (EReference reference : references) {
if (!reference.isContainment() && reference.getName().equals(feature))
return reference;
}
EStructuralFeature result = referenceOwner.getEStructuralFeature(feature);
if (result instanceof EReference && !((EReference) result).isContainment())
return (EReference) result;
return null;
}