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

Bug 340086

Summary: M6 generates reference to non-existent EPackageImpl.eINSTANCE
Product: [Modeling] Acceleo Reporter: Ed Willink <ed>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: laurent.goubet, nicolas.bros, stephane.begaudeau
Version: 3.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-03-15 16:15:20 EDT
After installing M6, the rebuild gives me errors 

The old code was (in CVS at org.eclipse.mdt/org.eclipse.ocl/examples/org.eclipse.ocl.examples.build/src/org/eclipse/ocl/examples/build/acceleo/GenerateOCLstdlib.java)

	@Override
	public void registerPackages(ResourceSet resourceSet) {
    super.registerPackages(resourceSet);
    resourceSet.getPackageRegistry().put(org.eclipse.ocl.examples.pivot.PivotPackage.eINSTANCE.getNsURI(), org.eclipse.ocl.examples.pivot.PivotPackage.eINSTANCE);
    resourceSet.getPackageRegistry().put(org.eclipse.emf.ecore.EcorePackage.eINSTANCE.getNsURI(), org.eclipse.emf.ecore.EcorePackage.eINSTANCE);
    // TODO If you need additional package registrations, do them here. The following line is an example for UML.
    // resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);

The erroneous new code is

	@Override
	public void registerPackages(ResourceSet resourceSet) {
        super.registerPackages(resourceSet);
        if (!isInWorkspace(org.eclipse.emf.ecore.impl.EPackageImpl.class)) {
            resourceSet.getPackageRegistry().put(org.eclipse.emf.ecore.impl.EPackageImpl.eINSTANCE.getNsURI(), org.eclipse.emf.ecore.impl.EPackageImpl.eINSTANCE);
        }
        if (!isInWorkspace(org.eclipse.emf.ecore.impl.EcorePackageImpl.class)) {
            resourceSet.getPackageRegistry().put(org.eclipse.emf.ecore.impl.EcorePackageImpl.eINSTANCE.getNsURI(), org.eclipse.emf.ecore.impl.EcorePackageImpl.eINSTANCE);
        }
        // TODO If you need additional package registrations, do them here. The following line is an example for UML.
        // resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
    }

There is no org.eclipse.emf.ecore.impl.EPackageImpl.eINSTANCE.
Comment 1 Ed Willink CLA 2011-03-15 16:32:48 EDT
I think the problem is that EPackage is refying a dynamic package, so testing for the proxy support fails and is no substitute for installing the dynamic package.
Comment 2 Laurent Goubet CLA 2011-03-16 05:19:18 EDT
This seems to be a regression with the change of our generators (for the launcher class) from JET to Acceleo. Stéphane, could you take a look at this?
Comment 3 Stephane Begaudeau CLA 2011-03-21 05:12:00 EDT
>> I think the problem is that EPackage is refying a dynamic package

It is indeed a bug that appears with dynamic packages. After a quick glance at the code, I have checked and this bug was already here, it is not relative to the switch from JET to Acceleo for the generation of the Java launcher.

Previously with dynamic model, we didn't register anything, now we try to register "org.eclipse.emf.ecore.impl.EPackageImpl.eINSTANCE" which does not exists. I have restored the previous behavior.
Comment 4 Stephane Begaudeau CLA 2011-03-23 10:20:28 EDT
*** Bug 340753 has been marked as a duplicate of this bug. ***
Comment 5 Laurent Goubet CLA 2011-03-23 10:27:15 EDT
Acceleo 3.1.0M6a, including this fix, is now available from the milestones update site.
Comment 6 Laurent Goubet CLA 2011-03-23 11:06:31 EDT
*** Bug 340753 has been marked as a duplicate of this bug. ***