Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 65191 invoked by uid 500); 22 Nov 2002 15:20:44 -0000 Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 65180 invoked from network); 22 Nov 2002 15:20:44 -0000 Date: 22 Nov 2002 15:20:44 -0000 Message-ID: <20021122152044.52479.qmail@icarus.apache.org> From: ilene@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/java/src/org/apache/xalan/processor StylesheetHandler.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ilene 2002/11/22 07:20:44 Modified: java/src/org/apache/xalan/processor StylesheetHandler.java Log: In response to Simon Kitching's (simon@ecnetwork.co.nz) 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: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org