Concurrent access to a DOM Node can result in and NPE
-----------------------------------------------------

                 Key: TUSCANY-3791
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3791
             Project: Tuscany
          Issue Type: Bug
          Components: SCA Java Runtime
         Environment: All
            Reporter: Simon Laws
             Fix For: Java-SCA-2.0, Java-SCA-1.x


There are some cases where a DOM node is accessed without serialization, for 
example,

public class Node2JAXB extends BaseTransformer<Node, Object> implements 
PullTransformer<Node, Object> {
    private JAXBContextHelper contextHelper;
    
    public Node2JAXB(ExtensionPointRegistry registry) {
        contextHelper = JAXBContextHelper.getInstance(registry);
    }

    public Object transform(Node source, TransformationContext context) {
        if (source == null)
            return null;
        try {
            JAXBContext jaxbContext = contextHelper.createJAXBContext(context, 
false);
            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
            Object result = unmarshaller.unmarshal(source, 
JAXBContextHelper.getJavaType(context.getTargetDataType()));
            return JAXBContextHelper.createReturnValue(jaxbContext, 
context.getTargetDataType(), result);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }

This is exacerbated in the properties case because the property factories don't 
cache the results of this transformation. 

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