You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "David T. Adcox (JIRA)" <tu...@ws.apache.org> on 2007/02/05 22:40:05 UTC

[jira] Created: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

"baseType" properties on DataObjects are using the wrong base EMF list class
----------------------------------------------------------------------------

                 Key: TUSCANY-1095
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
         Environment: n/a
            Reporter: David T. Adcox
             Fix For: Java-SDO-Mx


There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "David T. Adcox (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470365 ] 

David T. Adcox commented on TUSCANY-1095:
-----------------------------------------

Here's is a sample of code that demonstrates the problem...

public class DynamicTypeIssue 
{
    public static void main(String[] args) 
    {
        String namespace = "http://namespace";
        
        // type 1
        DataObject type1 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
        type1.set("uri", namespace);
        type1.set("name", "type1");
        type1.setBoolean("abstract", true);
        type1.setBoolean("sequenced", true);
        Type type1Type = TypeHelper.INSTANCE.define(type1);
        
        // type 2
        DataObject type2 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
        type2.set("uri", namespace);
        type2.set("name", "type2");
        type2.setBoolean("sequenced", true);
        
        List baseTypes = new ArrayList();
        baseTypes.add(type1Type);
        type2.setList("baseType", baseTypes);

        TypeHelper.INSTANCE.define(type2);
    }
} 

This sample will generate a null pointer exception.  That issue is caused when the Document Root can't be located, after it has been created.  Upon debugging the issue, you will see that the document root is lost, due to the removal of the 'type1' type from the ePacakge's list of eClassifiers.  This is really the root of the issue.

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Budinsky resolved TUSCANY-1095.
-------------------------------------

    Resolution: Duplicate

Moved to TUSCANY-1120.

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470378 ] 

Yang ZHONG commented on TUSCANY-1095:
-------------------------------------

The problem does exist. The model shouldn't have been containment. I'll prototype a fix.

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470372 ] 

Yang ZHONG commented on TUSCANY-1095:
-------------------------------------

Thank you for such concrete Test Case, I'm looking into it right now.

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470617 ] 

Frank Budinsky commented on TUSCANY-1095:
-----------------------------------------

This is a bug in the new generator template (SDOClass.javajet). Since we regenerated sdoModel.xsd with the new noEMF pattern, it now uses containment-type lists (EObjectContainmentEList) for all List-type properties. The "baseType" property should be using EObjectEList (actually probably EObjectResolvingEList - whatever it used to be with the old EMF-style template). Because it's erroneously generating a containment list, it's having the side effect described above.

List property generation seems to be completely broken in general. The template isn't handling bi-directional (e.g., EObjectWithInverseEList), proxy resolving, unsettable, etc. Every flavor of list other than basic containment is broken with the new template.

This part of the template should not always be calling createPropertyList with the containment list kind:

		  <%=genFeature.getSafeName()%> = createPropertyList(ListKind.CONTAINMENT, <%=genFeature.getListItemType()%>.class, ... 

It needs to pass a "correct" kind indicator, which createPropertyList() would use to create the correct kind of EMF List. It used to just new up the right kind of EList, but createPropertyList() was added as the indirect way to do it without having an EMF dependency in the generated code. The new noEMF template should have all the same logic as before, but just using "createPropertyList(<some kind>, ...)" instead of "new E<some kind>List(...)". Note that the implementation of createPropertyList() in class FactoryBase, also needs to be completed.

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1095) "baseType" properties on DataObjects are using the wrong base EMF list class

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470384 ] 

Yang ZHONG commented on TUSCANY-1095:
-------------------------------------

On second thoughts, David, you're so familiar with the mechanism that maybe you can contribute please?

> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1095
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1095
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
>         Environment: n/a
>            Reporter: David T. Adcox
>             Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.  Specifically, if a new Type is being dynamically created, when a parent type is specified in the "baseType" property, upon setting that property, the parent type is taken out of the ePackage to which it belongs.  It seems the list type being used checks for containment.  That should not be a consideration in this case.  I'll attach a sample of code demonstrate this behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org