Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 430495

Summary: XTextResourceSetFactory shouldn't return new XtextResourceSet(); but set variable it constructed
Product: [Modeling] Sirius Reporter: Michael Vorburger <mike>
Component: CoreAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact: Pierre-Charles David <pierre-charles.david>
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david
Version: 1.0.0M7Keywords: triaged
Target Milestone: 1.0.0M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Michael Vorburger CLA 2014-03-17 01:26:45 EDT
In http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius.common.xtext/src/org/eclipse/sirius/common/xtext/internal/XTextResourceSetFactory.java, in this:

  @Override
    public ResourceSet createResourceSet(URI resourceURI) {
        XtextResourceSet set = new XtextResourceSet();
        IProject prj = findProjectFromURI(resourceURI);
        if (prj != null) {
            configure(set, prj);
        }
        return new XtextResourceSet();
    }

unless I totally misunderstand that code, you probably meant to do:

  @Override
    public ResourceSet createResourceSet(URI resourceURI) {
        XtextResourceSet set = new XtextResourceSet();
        IProject prj = findProjectFromURI(resourceURI);
        if (prj != null) {
            configure(set, prj);
        }
        return set;
    }

did you? ;-) Note the return set vs. return new XtextResourceSet();
Comment 1 Maxime Porhel CLA 2014-03-24 09:33:59 EDT
See https://git.eclipse.org/r/23801 for the corresponding correction.
Comment 2 Pierre-Charles David CLA 2014-04-28 06:35:24 EDT
Fixed by 83afd4209432e4032c65da7298903245f18ed987.
Comment 3 Pierre-Charles David CLA 2014-05-05 09:40:36 EDT
Verified on 1.0.0M7rc1 (1.0.0.20405030833).

With the sample project created to validate bug 432931, I can see hundreds of Java types represented as EMF models inside my session's semantic model, which means the integration with Java, and thus the XTextResourceSet's configuration, are now correct.
Comment 4 Pierre-Charles David CLA 2014-05-12 03:45:58 EDT
Available in Sirius 1.0.0M7 (see https://wiki.eclipse.org/Sirius/1.0.0M7 & http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tag/?id=v1.0.0M7).