You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@apache.org on 2002/01/24 21:15:07 UTC
cvs commit: xml-xalan/test/java/src/org/apache/qetest/xslwrapper TraxWrapperUtils.java
curcuru 02/01/24 12:15:07
Modified: test/java/src/org/apache/qetest/xslwrapper
TraxWrapperUtils.java
Log:
Fix bug where values in setAttributes were not propertly gotten if it
was a Properties block instead of a Hashtable; this was the most common
case from running in the normal automation
Revision Changes Path
1.5 +14 -3 xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapperUtils.java
Index: TraxWrapperUtils.java
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapperUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TraxWrapperUtils.java 21 Dec 2001 22:37:21 -0000 1.4
+++ TraxWrapperUtils.java 24 Jan 2002 20:15:07 -0000 1.5
@@ -70,7 +70,7 @@
* Cheap-o utilities for Trax*Wrapper implementations.
*
* @author Shane Curcuru
- * @version $Id: TraxWrapperUtils.java,v 1.4 2001/12/21 22:37:21 curcuru Exp $
+ * @version $Id: TraxWrapperUtils.java,v 1.5 2002/01/24 20:15:07 curcuru Exp $
*/
public abstract class TraxWrapperUtils
{
@@ -149,11 +149,12 @@
Enumeration attrKeys = null;
try
{
+ // Attempt to use as a Properties block..
attrKeys = ((Properties)attrs).propertyNames();
}
catch (ClassCastException cce)
{
- // Simply get as Hashtable instead
+ // .. but fallback to get as Hashtable instead
attrKeys = attrs.keys();
}
@@ -164,9 +165,19 @@
if ((null != key)
&& (key.startsWith(TransformWrapper.SET_PROCESSOR_ATTRIBUTES)))
{
+ Object value = null;
+ try
+ {
+ // Attempt to use as a Properties block..
+ value = ((Properties)attrs).getProperty(key);
+ }
+ catch (ClassCastException cce)
+ {
+ // .. but fallback to get as Hashtable instead
+ value = attrs.get(key);
+ }
// Strip off our marker for the property name
String processorKey = key.substring(TransformWrapper.SET_PROCESSOR_ATTRIBUTES.length());
- Object value = attrs.get(key);
// Ugly, but it works -sc
if (setPropsOn instanceof TransformerFactory)
setAttribute((TransformerFactory)setPropsOn, processorKey, value);
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org