Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » proxy-eObjects during maven update
proxy-eObjects during maven update [message #986875] Thu, 22 November 2012 03:36 Go to next message
Thomas Hergenröder is currently offline Thomas Hergenröder
Messages: 21
Registered: February 2012
Junior Member
We use Xtext in different projects which are connected by maven using the m2e plugin.

But most of the time when a maven update is run (to get updated dependencies or automatically at eclipse startup),
we only get proxy EObjects, which are of no use in this case, as the only have a name and the basic type.

Running ECoreUtil2.resolveAll(eObject) to get the real objects instead of the proxys does not help.

Currently we use the workaround to move something around in the eclipse build path, which seems to trigger a special kind of rebuild that fixes the problem.

Does anyone have an idea how to solve this or at least an idea what might cause it?
Re: proxy-eObjects during maven update [message #1004006 is a reply to message #986875] Tue, 22 January 2013 07:11 Go to previous message
Thomas Hergenröder is currently offline Thomas Hergenröder
Messages: 21
Registered: February 2012
Junior Member
As a workaround we now use the following code at all the places where such lazy resolution accours:
/**
     * Tries to get rid of the problematic null pointers because there is only a
     * lazy resolution
     * 
     * @param eObject
     *            the object that may be a lazy resource.
     */
    def void resolveEObject(EObject eObject) {
        if (eObject != null) {
            try {
                EcoreUtil2::resolveLazyCrossReferences(eObject.eResource(), null);
            } catch (NullPointerException e) {
                //                LOG.warn("a eObject could not be resolved: " + eObject, e);
            }
        }
    }

The log statement is currently commented out, because it is sometimes called during linking and there are lazy ressources expected.

[Updated on: Tue, 22 January 2013 07:13]

Report message to a moderator

Previous Topic:Debugging XBase: skip XBase function
Next Topic:Rename shifts from expectation
Goto Forum:
  


Current Time: Fri Apr 18 21:59:33 EDT 2014

Powered by FUDForum. Page generated in 0.10214 seconds