Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1062

DataGraph.createRootObject implementation does not match 2.1 spec and also is not helpful when given bad parameters

    XMLWordPrintableJSON

Details

    Description

      When createRootObject is called and a root object has already been created, the SDO 2.1 spec calls for an IllegalStateException but the current implementation replaces the existing root.
      Also, when either a type is not provided or when a type cannot be determined from the URI and typeName provided, a NullPointerException is thrown from org.eclipse.emf.ecore.util.EcoreUtil.create() which is not helpful to a user who is not literate in emf utilities: an exception with a helpful error message should be provided.

      Attached are:
      a) a jar containing a new test case file for DataGraph (sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataGraphTestCase.java)
      b) a patch that corrects these problems in sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java

      Attachments

        1. DataGraphImpl_patch.txt
          2 kB
          Paul Golick
        2. DataGraphTestCase.jar
          2 kB
          Paul Golick

        Activity

          People

            Unassigned Unassigned
            golick Paul Golick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: