Skip to main content


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 08:36 Go to next message
Thomas Hergenröder is currently offline Thomas HergenröderFriend
Messages: 22
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 12:11 Go to previous message
Thomas Hergenröder is currently offline Thomas HergenröderFriend
Messages: 22
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 12:13]

Report message to a moderator

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


Current Time: Sat Apr 27 02:57:28 GMT 2024

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

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

Back to the top