svn commit: r565859 - in /lenya/trunk/src: modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/ modules-core/workflow/java/src/org/apache/le...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Tue Aug 14 12:13:02 2007
New Revision: 565859

URL: http://svn.apache.org/viewvc?view=rev&rev=565859
Log:
Removed unused variables and redundant null checks and imports as necessary.

Modified:
    lenya/trunk/src/modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/PropertiesModule.java
    lenya/trunk/src/modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/PublicationTemplateManagerImpl.java
    lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Deactivate.java
    lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/FormsEditor.java
    lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java

Modified: lenya/trunk/src/modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/PropertiesModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/PropertiesModule.java?view=diff&rev=565859&r1=565858&r2=565859
==============================================================================
--- lenya/trunk/src/modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/PropertiesModule.java (original)
+++ lenya/trunk/src/modules-core/properties/java/src/org/apache/lenya/cms/cocoon/components/modules/input/PropertiesModule.java Tue Aug 14 12:13:02 2007
@@ -17,7 +17,6 @@
 package org.apache.lenya.cms.cocoon.components.modules.input;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.util.Enumeration;
 import java.util.Iterator;
@@ -211,7 +210,6 @@
             ParserConfigurationException, SAXException {
 
         Source source = null;
-        InputStream in = null;
         try {
 
             source = m_resolver.resolveURI(propertiesStringURI);
@@ -241,12 +239,6 @@
         } finally {
             if (source != null) {
                 m_resolver.release(source);
-            }
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                }
             }
         }
 

Modified: lenya/trunk/src/modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/PublicationTemplateManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/PublicationTemplateManagerImpl.java?view=diff&rev=565859&r1=565858&r2=565859
==============================================================================
--- lenya/trunk/src/modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/PublicationTemplateManagerImpl.java (original)
+++ lenya/trunk/src/modules-core/templating/java/src/org/apache/lenya/cms/publication/templating/PublicationTemplateManagerImpl.java Tue Aug 14 12:13:02 2007
@@ -184,7 +184,6 @@
      */
     public Object getSelectableHint(Publication publication, ServiceSelector selector,
             final String originalHint) throws ServiceException {
-        PublicationTemplateManager templateManager = null;
         Object selectableHint = null;
 
         try {
@@ -200,11 +199,7 @@
             String message = "Resolving hint [" + originalHint + "] failed: ";
             getLogger().error(message, e);
             throw new RuntimeException(message, e);
-        } finally {
-            if (templateManager != null) {
-                this.manager.release(templateManager);
-            }
-        }
+        } 
         return selectableHint;
     }
 
@@ -255,4 +250,4 @@
 
     }
 
-}
\ No newline at end of file
+}

Modified: lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Deactivate.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Deactivate.java?view=diff&rev=565859&r1=565858&r2=565859
==============================================================================
--- lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Deactivate.java (original)
+++ lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Deactivate.java Tue Aug 14 12:13:02 2007
@@ -23,8 +23,6 @@
 import java.util.Set;
 
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.cms.linking.LinkManager;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentManager;
@@ -116,8 +114,6 @@
         boolean success = false;
 
         DocumentManager documentManager = null;
-        SourceResolver resolver = null;
-        Source source = null;
         try {
             Document liveDocument = authoringDocument.getAreaVersion(Publication.LIVE_AREA);
 
@@ -128,12 +124,6 @@
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
-            if (resolver != null) {
-                if (source != null) {
-                    resolver.release(source);
-                }
-                this.manager.release(resolver);
-            }
             if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Deactivate document [" + authoringDocument + "]. Success: ["
                         + success + "]");

Modified: lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/FormsEditor.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/FormsEditor.java?view=diff&rev=565859&r1=565858&r2=565859
==============================================================================
--- lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/FormsEditor.java (original)
+++ lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/FormsEditor.java Tue Aug 14 12:13:02 2007
@@ -138,7 +138,6 @@
         String unnumberTagsXslUri = "fallback://lenya/modules/editors/usecases/forms/unnumberTags.xsl";
         String numberTagsXslUri = "fallback://lenya/modules/editors/usecases/forms/numberTags.xsl";
 
-        Source schemaSource = null;
         Source unnumberTagsXslSource = null;
         Source numberTagsXslSource = null;
 
@@ -175,9 +174,6 @@
             throw new UsecaseException(e);
         } finally {
             if (resolver != null) {
-                if (schemaSource != null) {
-                    resolver.release(schemaSource);
-                }
                 if (unnumberTagsXslSource != null) {
                     resolver.release(unnumberTagsXslSource);
                 }

Modified: lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java?view=diff&rev=565859&r1=565858&r2=565859
==============================================================================
--- lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java (original)
+++ lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java Tue Aug 14 12:13:02 2007
@@ -29,7 +29,6 @@
 import org.apache.lenya.cms.publication.DocumentManager;
 import org.apache.lenya.cms.publication.ResourceType;
 import org.apache.lenya.cms.site.usecases.Create;
-import org.apache.lenya.workflow.WorkflowManager;
 
 /**
  * Supports WebDAV PUT.
@@ -57,7 +56,6 @@
     protected void doExecute() throws Exception {
         // super.doExecute();
         SourceResolver resolver = null;
-        WorkflowManager wfManager = null;
         ResourceType resourceType = null;
 
         try {
@@ -103,9 +101,6 @@
         } finally {
             if (resolver != null) {
                 this.manager.release(resolver);
-            }
-            if (wfManager != null) {
-                this.manager.release(wfManager);
             }
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.