Victor created XALANJ-2605:
------------------------------

             Summary: xsltc trax TransformerImpl does not correctly reset 
output properties!
                 Key: XALANJ-2605
                 URL: https://issues.apache.org/jira/browse/XALANJ-2605
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in 
Xalan projects.  Anybody can view the issue.)
          Components: transformation, XSLTC
    Affects Versions: 2.7.2, 2.7.1
         Environment: Oracle Java 7, 8
            Reporter: Victor
            Assignee: Steven J. Hathaway
            Priority: Critical


There seems to be a bug in 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.reset().

Basically, calling reset() will call setOutputProperties(null), which will in 
turn set the value of _properties to _propertiesClone but without cloning the 
later, which results on both _properties and _propertiesClone being reference 
to the SAME object.

So after reset() is called once on a TransformerImpl, the next time 
setOutputProperties(String, String) is called on it, _propertiesClone is 
modified, and thus all the future calls to reset() won't work with respect to 
output properties!

The solution would be to change the following line:
_properties = _propertiesClone;
to:
_properties = _propertiesClone.clone();

Note that this bug affects Java 7 and Java 8 (xalan 2.7.0), and it seems this 
is the default implementation of Transformer returned by the default 
TransformerFactory, so it is quite surprising it wasn't discovered before! Did 
I misunderstood the contract or reset() maybe?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to