Debugging non-deterministic serialization failure [message #1746530] |
Mon, 31 October 2016 14:06  |
Eclipse User |
|
|
|
Using Xtext 2.8.4 I have a test case for a quick fix which non-deterministically alternates between passing and "Could not serialize EObject via backtracking."
Does anyone have some hints on how to debug this? What could possibly cause such non-determinism?
thanks,
Stephan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Debugging non-deterministic serialization failure [message #1746557 is a reply to message #1746555] |
Mon, 31 October 2016 17:11   |
Eclipse User |
|
|
|
youre welcome. maybe you can backport the current 2.10 code
protected Set<AbstractElement> findValidValueAssignments(EObject semanticObj,
Iterable<AbstractElement> assignedElements, Object value) {
Set<AbstractElement> result = Sets.newLinkedHashSet();
for (AbstractElement ass : assignedElements) {
if (ass instanceof Keyword && keywordSerializer.isValid(semanticObj, (Keyword) ass, value, null))
result.add(ass);
else if (ass instanceof RuleCall) {
RuleCall rc = (RuleCall) ass;
if (rc.getRule() instanceof EnumRule) {
if (enumLiteralSerializer.isValid(semanticObj, rc, value, null))
result.add(ass);
} else if (valueSerializer.isValid(semanticObj, rc, value, null))
result.add(ass);
}
}
return result;
}
|
|
|
|
Re: Debugging non-deterministic serialization failure [message #1746650 is a reply to message #1746557] |
Wed, 02 November 2016 09:39  |
Eclipse User |
|
|
|
Christian Dietrich wrote on Mon, 31 October 2016 22:11maybe you can backport the current 2.10 code ...
Thanks, that version works as well.
I was briefly worried if more locations in Xtext might work under a wrong assumption: apparently the same keyword can be represented by different Keyword instances, but the old code in findValidValueAssignments() assumed finding one Keyword per value is sufficient.
Anyway, one more indication that migrating to a newer version would have helped / will help.
Stephan
|
|
|
Powered by
FUDForum. Page generated in 0.09979 seconds