You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Simon Laws (JIRA)" <de...@tuscany.apache.org> on 2011/09/14 10:30:09 UTC

[jira] [Closed] (TUSCANY-3791) Concurrent access to a DOM Node can result in and NPE

     [ https://issues.apache.org/jira/browse/TUSCANY-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Laws closed TUSCANY-3791.
-------------------------------

    Resolution: Fixed

Changes were made a while back but I neglected to close the issue

> 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
>            Assignee: Simon Laws
>             Fix For: Java-SCA-2.0
>
>
> There are some cases where a DOM node is accessed without synchronization, 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira