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

Bug 397514

Summary: Use symbolic nsURI constant in the generated factory impl class
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: ToolsAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.9.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 397324    

Description Eike Stepper CLA 2013-01-06 03:54:06 EST
Currently the generated init() method looks like this:

  public static Model6Factory init()
  {
    try
    {
      Model6Factory theModel6Factory = (Model6Factory)EPackage.Registry.INSTANCE
          .getEFactory("http://www.eclipse.org/emf/CDO/tests/model6/1.0.0");
      if (theModel6Factory != null)
      {
        return theModel6Factory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new Model6FactoryImpl();
  }


The nsURI of the package would be easier to change if the symbolic constant from the package interface was used rather than the String literal value.
Comment 1 Ed Merks CLA 2013-01-08 01:13:18 EST
The improvement is committed to master:

http://git.eclipse.org/c/emf/org.eclipse.emf.git/commit/?id=51fe66b4e6f2e7a908f9ae27e78b9a1dd5f3b92a
Comment 2 Eike Stepper CLA 2013-01-08 02:50:48 EST
Thx!
Comment 3 Ed Merks CLA 2013-07-10 11:26:05 EDT
The changes are available in Kepler.