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

[jira] Created: (TUSCANY-1093) isSet returning false when boolean set to false, or int set to 0

isSet returning false when boolean set to false, or int set to 0
----------------------------------------------------------------

                 Key: TUSCANY-1093
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
            Reporter: Robbie Minshall
            Priority: Critical


when boolean property is set to false a call to isSet returns false ( should return true ).
when an int property is set to 0 a call to isSet returns false ( should return true ).

This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 



-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

If not already being done can we commit this patch and close this JIRA. 

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky commented on TUSCANY-1093:
-----------------------------------------

This is not a bug, but instead a change in SDO 2.1 - it is working as designed in SDO 2.0.1, where Tuscany is currently at.

In SDO 2.0.1 implementations could choose between two semantics for DataObject.isSet()

1. return true if the Property has been set(), and not unset()
2. return true if the Property value is not equal to Property.getDefault()

In SDO 2.1 implementations will always implement isSet() using option #1.



> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Yang ZHONG commented on TUSCANY-1093:
-------------------------------------

What's your build?
My Test Case runs fine:

          <xsd:element name="i" type="xsd:int"/>
          <xsd:element name="b" type="xsd:boolean"/>

        assertFalse(quote.isSet("i"));
        quote.setInt("i", 0);
        assertTrue(quote.isSet("i"));

        assertFalse(quote.isSet("b"));
        quote.setBoolean("b", false);
        assertTrue(quote.isSet("b"));

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky resolved TUSCANY-1093.
-------------------------------------

    Resolution: Fixed

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch, patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

patch worked great.



> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky commented on TUSCANY-1093:
-----------------------------------------

I have my doubts about this comment from above:

> ... it seems that some changes were made to modify this behavior. Setting boolean attribute when the type is defined in an XSD is now working.

I don't know of, or see, any changes that would fix this problem in the XSD case. I don't believe the proper "general" solution to this issue (new semantics of isSet in SDO 2.1) has been implemented yet. 

Can someone investigate and/or explain why it seems to be working in the XSD case?

Thanks,
Frank.


> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

Ok.

Can Yang please include a test case which demonstrates what is currently not working with the existing patch.  That way I can include it into the CTS updates.

thanks,
Robbie


> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

I am guessing that this code path for creating the EStructuralFeature for the property does not have the attribute unsettable equal to true . . . but that is just a guess.  

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky commented on TUSCANY-1093:
-----------------------------------------

Yang doesn't have the time to create a thorough test case. What's not working is any XSD-defined property where the EMF XSDEcoreBuilder doesn't map to an unsettable property.

I think a property of type xsd:string is the first simple example.

Frank.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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] Updated: (TUSCANY-1093) isSet returning false when boolean set to false, or int set to 0

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

Yang ZHONG updated TUSCANY-1093:
--------------------------------

    Attachment: patch

Previous patch adopted setUnsettable approach:
    eStructuralFeature.setUnsettable(true);

This attachment adopts always-unsettable approach:
    public boolean isUnsettable()
    {
      return true;
    }

All build tests have passed.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch, patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

This surprised me also.  There was a definate change in behavior from my m2 shapshot and the current version of tuscany ( previously neither xsd or dynamic displayed 2.1 spec behavior ).  Also demonstrated by fuhwei and yang not being able to reproduce the behavior.  

I can probably look into this more late next week if someone else does not get to it. 

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

One possible solution is to change make EStructuralFeature.unsettable true.  This will result in more memory consumpiton as it adds an additional possible value called unset.  

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Fuhwei Lwo commented on TUSCANY-1093:
-------------------------------------

It seems the DataObject created from the type defined by the DataObject still has EMF behavior instead of SDO 2.1 spec.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky commented on TUSCANY-1093:
-----------------------------------------

Yang, 

1) We need to override isUnsettable() in class ReferenceImpl also, not just AttributeImpl.
2) If you read the SDO spec, you'll see that only single-valued properties should behave like EMF unsettable. The isMany properties should be !unsettable. Therefore, the isUnsettable() methods should look like this:

    public boolean isUnsettable()
    {
      return !isMany();
    }

I made the changes myself and committed in revision 510762.

Frank.


> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch, patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Frank Budinsky commented on TUSCANY-1093:
-----------------------------------------

No, this isn't fixed properly yet. Yang is working on a new fix.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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] Updated: (TUSCANY-1093) isSet returning false when boolean set to false, or int set to 0

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

Kelvin Goodson updated TUSCANY-1093:
------------------------------------

    Fix Version/s: Java-SDO-M3

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>             Fix For: Java-SDO-M3
>
>         Attachments: patch, patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Robbie Minshall commented on TUSCANY-1093:
------------------------------------------

I updated my tuscany version and it seems that some changes were made to modify this behavior.  Setting boolean attribute when the type is defined in an XSD is now working.  Setting dynamically defined Boolean property still seems to fail. Can you see anything wrong with the following test case ?


public void testIsSet_DynamicTypeDef_commonjSdoBoolean_false() throws Exception {

        // define a type with two properties
        DataObject typeDef = DataFactory.INSTANCE.create("commonj.sdo", "Type");
        typeDef.set("uri", "");
        typeDef.set("name", "myBooleanType");
        typeDef.set("open", true);

        DataObject propertyDef = typeDef.createDataObject("property");
        propertyDef.set("name", "b1");
        Type propertyType = TypeHelper.INSTANCE.getType("commonj.sdo", "Boolean");
        propertyDef.set("type",propertyType );
        propertyDef.set("many", false);
        propertyDef.set("containment", false);

        TypeHelper.INSTANCE.define( typeDef );

        // create a DataObject that uses this type
        DataObject testDO = DataFactory.INSTANCE.create( "", "myBooleanType" );

        Property p = testDO.getProperty("b1");

        System.out.println("testIsSet_DynamicTypeDef_Boolean_false: sdoBoolean field type : " + p.getType());
        
        testDO.unset(p);
        assertFalse("testing that property is unset after unset is called",
                    testDO.isSet(p));
                    
        testDO.set(p, false);
        System.out.println("Set booleanField via property: " + testDO.get(p) + ", isSet " + testDO.isSet(p)  + " default " + p.getDefault());
        
        assertTrue(
                  "testing that property is set after setting to false, value of property is "
                  + testDO.get(p), testDO.isSet(p));                                              
    }


> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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] Updated: (TUSCANY-1093) isSet returning false when boolean set to false, or int set to 0

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

Yang ZHONG updated TUSCANY-1093:
--------------------------------

    Attachment: patch

The attached patch has passed all build tests.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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-1093) isSet returning false when boolean set to false, or int set to 0

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

Yang ZHONG commented on TUSCANY-1093:
-------------------------------------

EMF XML Schema to Ecore Mapping (June 28, 2004) specifies int attribute(p14) and element(p19) true unsettable.
Actually, unsettable is true for many cases.

I suppose implementations since June 28, 2004 should follow that design. It might be a bug if different behavior was seen.

It seems EMF 2.2.1 currently being used, works as designed.

> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
>                 Key: TUSCANY-1093
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1093
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Robbie Minshall
>            Priority: Critical
>         Attachments: patch
>
>
> when boolean property is set to false a call to isSet returns false ( should return true ).
> when an int property is set to 0 a call to isSet returns false ( should return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws binding ) to be missing values that have been set. 

-- 
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