ilene 2002/11/22 07:20:44
Modified: java/src/org/apache/xalan/processor StylesheetHandler.java
Log:
In response to Simon Kitching's ([EMAIL PROTECTED]) bug report #14578, moved
synchronized
block from init method to static initializer to avoid race conditions.
Revision Changes Path
1.55 +13 -30
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- StylesheetHandler.java 4 Oct 2002 15:52:17 -0000 1.54
+++ StylesheetHandler.java 22 Nov 2002 15:20:44 -0000 1.55
@@ -117,6 +117,19 @@
implements TemplatesHandler, PrefixResolver, NodeConsumer
{
+
+ static {
+ Function func = new org.apache.xalan.templates.FuncDocument();
+
+ FunctionTable.installFunction("document", func);
+
+ // func = new org.apache.xalan.templates.FuncKey();
+ // FunctionTable.installFunction("key", func);
+ func = new org.apache.xalan.templates.FuncFormatNumb();
+
+ FunctionTable.installFunction("format-number", func);
+
+ }
/**
* Create a StylesheetHandler object, creating a root stylesheet
* as the target.
@@ -135,42 +148,12 @@
}
/**
- * Static flag to let us know if the XPath functions table
- * has been initialized.
- */
- private static boolean m_xpathFunctionsInited = false;
-
- /**
* Do common initialization.
*
* @param processor non-null reference to the transformer factory that
owns this handler.
*/
void init(TransformerFactoryImpl processor)
{
-
- // Not sure about double-check of this flag, but
- // it seems safe...
- if (false == m_xpathFunctionsInited)
- {
- synchronized (this)
- {
- if (false == m_xpathFunctionsInited)
- {
- m_xpathFunctionsInited = true;
-
- Function func = new org.apache.xalan.templates.FuncDocument();
-
- FunctionTable.installFunction("document", func);
-
- // func = new org.apache.xalan.templates.FuncKey();
- // FunctionTable.installFunction("key", func);
- func = new org.apache.xalan.templates.FuncFormatNumb();
-
- FunctionTable.installFunction("format-number", func);
- }
- }
- }
-
m_stylesheetProcessor = processor;
// Set the initial content handler.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]