[jira] Commented: (TUSCANY-1397) createDataObject() throws NPE if property does not exist

2007-08-02 Thread Andy Grove (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517178
 ] 

Andy Grove commented on TUSCANY-1397:
-

We discussed this issue in last week's SDO spec. call and decided that for now 
(SDO 2.1.1) we will leave this behaviour unspecified but there seemed to be 
general concensus that the correct behaviour (to be clarified for SDO 3.0) 
would be to on-demand create the property for consistency with other set() 
methods. 



 createDataObject() throws NPE if property does not exist
 

 Key: TUSCANY-1397
 URL: https://issues.apache.org/jira/browse/TUSCANY-1397
 Project: Tuscany
  Issue Type: Bug
  Components: Java SDO Implementation
Reporter: Andy Grove

 Calling createDataObject( foo ) where the data object's type does not 
 define a property foo causes a null pointer exception in 
 DataObjectUtil.createDataObject(DataObject dataObject, Property property, 
 Type type) because it attempts to call property.isContainment without 
 checking if the property is null.
 Calling createDataObject( foo ) on an open type should create an on-demand 
 property. If the type is not open and the property does not exist then an 
 exception should be thrown.
 Thanks,
 Andy.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (TUSCANY-1397) createDataObject() throws NPE if property does not exist

2007-08-01 Thread Caroline Maynard (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516978
 ] 

Caroline Maynard commented on TUSCANY-1397:
---

The current SDO C++ implementation does create the property on demand, and does 
not throw an exception. The PHP SDO implementation makes use of this behaviour. 
Of course it would be a SMOP to change the PHP code to use an alternative 
mechanism ... but what alternative mechanism exists in the spec? 

 createDataObject() throws NPE if property does not exist
 

 Key: TUSCANY-1397
 URL: https://issues.apache.org/jira/browse/TUSCANY-1397
 Project: Tuscany
  Issue Type: Bug
  Components: Java SDO Implementation
Reporter: Andy Grove

 Calling createDataObject( foo ) where the data object's type does not 
 define a property foo causes a null pointer exception in 
 DataObjectUtil.createDataObject(DataObject dataObject, Property property, 
 Type type) because it attempts to call property.isContainment without 
 checking if the property is null.
 Calling createDataObject( foo ) on an open type should create an on-demand 
 property. If the type is not open and the property does not exist then an 
 exception should be thrown.
 Thanks,
 Andy.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (TUSCANY-1397) createDataObject() throws NPE if property does not exist

2007-07-14 Thread Andy Grove (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512698
 ] 

Andy Grove commented on TUSCANY-1397:
-

You're right, the spec doesn't currently cover this.

Perhaps the spec should be amended to state that calling createDataObject() 
with a property that does not exist should throw an IllegalArgumentException ?

Alternatively it could just demand-create the property using a vendor-specific 
open DataObject type. That seems more consistent with the behaviour of the 
setT() calls.

I'm going to raise a JIRA against the spec, cross-referencing this JIRA.



 createDataObject() throws NPE if property does not exist
 

 Key: TUSCANY-1397
 URL: https://issues.apache.org/jira/browse/TUSCANY-1397
 Project: Tuscany
  Issue Type: Bug
  Components: Java SDO Implementation
Reporter: Andy Grove

 Calling createDataObject( foo ) where the data object's type does not 
 define a property foo causes a null pointer exception in 
 DataObjectUtil.createDataObject(DataObject dataObject, Property property, 
 Type type) because it attempts to call property.isContainment without 
 checking if the property is null.
 Calling createDataObject( foo ) on an open type should create an on-demand 
 property. If the type is not open and the property does not exist then an 
 exception should be thrown.
 Thanks,
 Andy.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (TUSCANY-1397) createDataObject() throws NPE if property does not exist

2007-07-14 Thread Andy Grove (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512700
 ] 

Andy Grove commented on TUSCANY-1397:
-

Filed against the spec. as http://www.xcalia.com/support/browse/SDO-255

 createDataObject() throws NPE if property does not exist
 

 Key: TUSCANY-1397
 URL: https://issues.apache.org/jira/browse/TUSCANY-1397
 Project: Tuscany
  Issue Type: Bug
  Components: Java SDO Implementation
Reporter: Andy Grove

 Calling createDataObject( foo ) where the data object's type does not 
 define a property foo causes a null pointer exception in 
 DataObjectUtil.createDataObject(DataObject dataObject, Property property, 
 Type type) because it attempts to call property.isContainment without 
 checking if the property is null.
 Calling createDataObject( foo ) on an open type should create an on-demand 
 property. If the type is not open and the property does not exist then an 
 exception should be thrown.
 Thanks,
 Andy.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (TUSCANY-1397) createDataObject() throws NPE if property does not exist

2007-07-13 Thread Fuhwei Lwo (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512615
 ] 

Fuhwei Lwo commented on TUSCANY-1397:
-

I cannot seem to locate the spec definition of return value of 
DataObject.createDataObject(invalidProperty) method if an invalid property was 
passed in. If that's the case, the best we can do is to return null DataObject 
without throwing NPE. The only difference this solution makes is the users 
either check for NPE or null.

Current:
try {
DataObject child = parent.createDataObject(invalidProperty);
}
catch (NullPoinerException e) {
// Instance property (open type or not) doesn't exist
}

New:
DataObject child = parent.createDataObject(invalidProperty);
if (child == null) {
// Instance property (open type or not) doesn't exist
}

I also cannot find in the spec that createDataObject() needs to demand-create 
the instance property only DataObject.set() does. Beside that, I don't think we 
have enough information to determine the HelperContext (scope) of this new 
instance property.

 createDataObject() throws NPE if property does not exist
 

 Key: TUSCANY-1397
 URL: https://issues.apache.org/jira/browse/TUSCANY-1397
 Project: Tuscany
  Issue Type: Bug
  Components: Java SDO Implementation
Reporter: Andy Grove

 Calling createDataObject( foo ) where the data object's type does not 
 define a property foo causes a null pointer exception in 
 DataObjectUtil.createDataObject(DataObject dataObject, Property property, 
 Type type) because it attempts to call property.isContainment without 
 checking if the property is null.
 Calling createDataObject( foo ) on an open type should create an on-demand 
 property. If the type is not open and the property does not exist then an 
 exception should be thrown.
 Thanks,
 Andy.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]