problem reading complex property from @file
-------------------------------------------

                 Key: TUSCANY-2377
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2377
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Core Runtime
            Reporter: Scott Kurz


I'm having trouble reading a complex property from a file pointed to via the 
<property> @file attr. 

I'm using a JAXB to hold the prop value in my Java impl, but in looking at this 
briefly in the debugger I think the problem might be in the DOM object before 
it is ever transformed into a JAXB (in my case).

I think the problem is in the code:

public class JavaPropertyValueObjectFactory

    public ObjectFactory createValueFactory(Property property, Object 
propertyValue, Class javaType) {
        ... 
        } else {
            if (isSimpleType) {
              ....
            } else {
                List<Node> nodes = getComplexPropertyValues(doc);
                Object value = null;
                if (!nodes.isEmpty()) {
                    value = nodes.get(0);
                }
                return new ObjectFactoryImpl(property, value, isSimpleType, 
javaType);
            }

I'm not skilled with DOM... but I think this code is expecting a wrapper around 
the real property value, which is why we do a 
nodes.get(0) to get the first child.   

I think this wrapper must be there in the case that the property value is set 
inline in the SCDL or via a Composite property definition, but I think there's 
a wrapper missing in the case that we use @file, in which case we get a "raw" 
document.

I'll attach a patch of an existing itest adding a couple tests to to show an 
example.



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

Reply via email to