Community
Participate
Working Groups
Build Identifier: CVS Head of 2010-12-06 The current EmfHelper implementation fails with an NPE if the QueryContext doesn't provide a valid ResourceSet. Finding Ecore resources through the package registry may, however, still be possible if a new ResourceSetImpl were created in this case. This may be solved using the following patch: org.eclipse.emf.query2/src/org/eclipse/emf/query2/internal/shared/EmfHelper.java --- org.eclipse.emf.query2/src/org/eclipse/emf/query2/internal/shared/EmfHelper.java 2010-11-17 11:12:24.686748700 +0100 +++ org.eclipse.emf.query2/src/org/eclipse/emf/query2/internal/shared/EmfHelper .java 2010-12-06 15:32:55.362157900 +0100 @@ -69,6 +69,8 @@ if (rsImpl.getURIResourceMap() == null) { rsImpl.setURIResourceMap(new HashMap<URI, Resource>()); } + } else if (this.rs == null) { + this.rs = new ResourceSetImpl(); // allows at least for retrieving metamodel URIs } // this.createDirtyIndex(); this.index = index; Reproducible: Always
Hi Axel, Thanks for raising it. I have provided the fix as you mentioned. I have submitted TestQueryBugs class which provides a test for the above scenario. Cheers, Saurav