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

Static SDO generator generates an erroneous factory class, when inheritance and different Java packages are used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java-SCA-M2
    • Java-SDO-1.0
    • Java SDO Tools
    • None
    • WinXP (tested with Java-SDO-M2 and Java-SDO-M3-RC3)

    Description

      The static SDO generator generates an erroneous factory class, when inheritance and different Java packages are used.

      The initializeMetaData() method in my generated FactoryImpl class has this piece of code:
      ...
      // Obtain other dependent packages
      SdtFactoryImpl theSdtPackageImpl_1 =
      (SdtFactoryImpl)FactoryBase.getStaticFactory(SdtFactoryImpl.NAMESPACE_URI);
      ...
      // Add supertypes to types
      addSuperType(myClassType, mySuperClassType);
      ...

      But the variable "mySuperClassType" cannot be resolved at this point, because it is defined in a different package.
      The code probably should look like this:
      addSuperType(myClassType, theSdtPackageImpl_1.getMySuperClass());

      I noticed this bug when using M3-RC3, where the -noEmf option is always turned on.
      The factory/package code is correctly generated with M2, if the -noEmf option is NOT specified, but the same error occurs when the -noEmf option is specified with M2.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dpeter Daniel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: