vgritsenko 02/02/12 17:23:57 Modified: src/java/org/apache/cocoon/components/xslt XSLTProcessorImpl.java Log: Reformat two methods Revision Changes Path 1.13 +49 -46 xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java Index: XSLTProcessorImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- XSLTProcessorImpl.java 7 Feb 2002 13:10:41 -0000 1.12 +++ XSLTProcessorImpl.java 13 Feb 2002 01:23:57 -0000 1.13 @@ -63,6 +63,7 @@ import org.apache.avalon.framework.parameters.Parameters; import org.apache.avalon.framework.parameters.Parameterizable; import org.apache.avalon.framework.parameters.ParameterException; + import org.apache.cocoon.ResourceNotFoundException; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.components.store.Store; @@ -120,7 +121,7 @@ * (<code>TransformerFactory.newInstance()</code>). * * @author <a href="mailto:[EMAIL PROTECTED]">Ovidiu Predescu</a> - * @version CVS $Id: XSLTProcessorImpl.java,v 1.12 2002/02/07 13:10:41 cziegeler Exp $ + * @version CVS $Id: XSLTProcessorImpl.java,v 1.13 2002/02/13 01:23:57 vgritsenko Exp $ * @version 1.0 * @since July 11, 2001 */ @@ -167,7 +168,10 @@ public void dispose() { if (this.manager != null) { this.manager.release(this.store); + this.store = null; } + + this.manager = null; } /** @@ -312,57 +316,56 @@ /** * Helper for TransformerFactory. */ - private SAXTransformerFactory getTransformerFactory() throws Exception - { - if(tfactory == null) { - if (tfactoryClass == null) { - tfactory = (SAXTransformerFactory)TransformerFactory.newInstance(); - } else { - tfactory = (SAXTransformerFactory)tfactoryClass.newInstance(); - } - tfactory.setErrorListener(new TraxErrorHandler(getLogger())); - tfactory.setURIResolver(this); - // TODO: If we will support this feature with a different - // transformer than Xalan we'll have to set that corresponding - // feature - if (tfactory.getClass().getName().equals("org.apache.xalan.processor.TransformerFactoryImpl")) { - tfactory.setAttribute("http://xml.apache.org/xalan/features/incremental", - new Boolean (incrementalProcessing)); - } - } - return tfactory; + private SAXTransformerFactory getTransformerFactory() throws Exception { + if(tfactory == null) { + if (tfactoryClass == null) { + tfactory = (SAXTransformerFactory)TransformerFactory.newInstance(); + } else { + tfactory = (SAXTransformerFactory)tfactoryClass.newInstance(); + } + tfactory.setErrorListener(new TraxErrorHandler(getLogger())); + tfactory.setURIResolver(this); + // TODO: If we will support this feature with a different + // transformer than Xalan we'll have to set that corresponding + // feature + if (tfactory.getClass().getName().equals("org.apache.xalan.processor.TransformerFactoryImpl")) { + tfactory.setAttribute("http://xml.apache.org/xalan/features/incremental", + new Boolean (incrementalProcessing)); + } + } + return tfactory; } private Templates getTemplates(Source stylesheet, String id) throws IOException, ProcessingException { - if (!useStore) - return null; + if (!useStore) + return null; - getLogger().debug("XSLTProcessorImpl getTemplates: stylesheet " + id); + getLogger().debug("XSLTProcessorImpl getTemplates: stylesheet " + id); - Templates templates = null; - // only stylesheets with a last modification date are stored - if (stylesheet.getLastModified() != 0) { - - // Stored is an array of the template and the caching time - if (store.containsKey(id)) { - Object[] templateAndTime = (Object[])store.get(id); - - if(templateAndTime != null && templateAndTime[1] != null) { - long storedTime = ((Long)templateAndTime[1]).longValue(); - - if (storedTime < stylesheet.getLastModified()) { - store.remove(id); - } else { - templates = (Templates)templateAndTime[0]; - } - } - } - } else if (store.containsKey(id)) { - // remove an old template if it exists - store.remove(id); - } - return templates; + Templates templates = null; + // only stylesheets with a last modification date are stored + if (stylesheet.getLastModified() != 0) { + + // Stored is an array of the template and the caching time + if (store.containsKey(id)) { + Object[] templateAndTime = (Object[])store.get(id); + + if(templateAndTime != null && templateAndTime[1] != null) { + long storedTime = ((Long)templateAndTime[1]).longValue(); + + if (storedTime < stylesheet.getLastModified()) { + store.remove(id); + } else { + templates = (Templates)templateAndTime[0]; + } + } + } + } else if (store.containsKey(id)) { + // remove an old template if it exists + store.remove(id); + } + return templates; } private void putTemplates (Templates templates, Source stylesheet, String id)
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]