Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unresolved proxies(Unresolved proxies)
Unresolved proxies [message #1769421] Mon, 31 July 2017 12:50 Go to next message
Carsten Wrobel is currently offline Carsten WrobelFriend
Messages: 9
Registered: May 2017
Junior Member
Hi,

Sometimes we see proxies during the validation phase of our project and in that context I have some general questions:

1.
Should all proxies have been resolved by the xtext framework during validation - because validation is called after the Linking phase? (When using the derivedState functionality there is a possibility to control whether derived state installation should be done pre- or post the linking phase, but that kind of handle doesn't seem to be available in validation)

2.
If no to question 1, is there a guard/feature/config setting that can be used in validation so as to avoid validation in a 'proxy state'?

3.
Does it make sense to use EcoreUtil.resolve for proxies in validation? I have tried this in a few situations where it generated an Exception which I interpret as a more general resolve problem.

Thanks
Re: Unresolved proxies [message #1769440 is a reply to message #1769421] Mon, 31 July 2017 15:37 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

(1) depends on what you mean by "all proxies". for the files that you directly affect through the change this is true. (org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator) called from ClustringBuilderState) for the resources you traverse during validation this is not, but the validation should resolves the proxies automatically if you follow the references.
the validation is called after linking, that is correct.

(2) no you need to implement that yourself, make your validator nullsafe

(3) the question is: is the proxy not resolvable or is it not resolveable cause a flaw in your implementation


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved proxies [message #1769456 is a reply to message #1769440] Mon, 31 July 2017 19:02 Go to previous messageGo to next message
Carsten Wrobel is currently offline Carsten WrobelFriend
Messages: 9
Registered: May 2017
Junior Member
Hi Christian,

Thanks for the reply. Just a couple of clarifications to the answers.

If I understand you correct, it should not be necessary to use EcoreUtil.resolve in validation because Xtext resolves proxies for files directly affected through change, ref. your answer to question 1. Is that correct?

We can rule out timing issues in validation calls - it should not be possible to get validation calls from Xtext, before change related proxies has been resolved. Correct?

Conclusion - if an object/proxy isn't resolved in validation it's likely because there is a flaw in implementation. Correct?

Thanks.
Re: Unresolved proxies [message #1769460 is a reply to message #1769456] Mon, 31 July 2017 19:10 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Yes proxies should be resolved automatically if you access attributes etc inside them

Yes and no. It depends if the resources that contain the proxies are part of the build
Or you get to the proxy by following a reference to another file and ask
It for,yet another reference

Yes and no. See above. There is a difference between the files that were directly build and which are only traversed
During validation . And there is a differences between proxies that accept be resolved and those who can.

You would need to give some more context to investigate what exactly the problem is in your case


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:mismatched input 'test' expecting RULE_ID
Next Topic:Large grammar - "heap space" error - but ends by 'done'
Goto Forum:
  


Current Time: Tue Mar 19 10:08:15 GMT 2024

Powered by FUDForum. Page generated in 0.02111 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top