jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r666848 - in /incubator/jspwiki/trunk: ./ src/com/ecyrd/jspwiki/ src/com/ecyrd/jspwiki/attachment/ src/com/ecyrd/jspwiki/auth/login/ src/com/ecyrd/jspwiki/auth/permissions/ src/com/ecyrd/jspwiki/providers/ src/com/ecyrd/jspwiki/ui/ src/com/...
Date Wed, 11 Jun 2008 21:22:51 GMT
Author: jalkanen
Date: Wed Jun 11 14:22:50 2008
New Revision: 666848

URL: http://svn.apache.org/viewvc?rev=666848&view=rev
Log:
Fixed a number of random FindBugs issues.

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/VariableManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAssertionLoginModule.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/CachingProvider.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Wed Jun 11 14:22:50 2008
@@ -4,6 +4,8 @@
         
         * JSPWIKI-290: ReferenceManager was not updating the page
         references correctly after a rename.  Fix by Harry Metske.
+        
+        * Fixed also a number of miscallaneous FindBugs issues.
 
 2008-06-09  Janne Jalkanen <jalkanen@apache.org>
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java Wed Jun 11 14:22:50
2008
@@ -342,11 +342,7 @@
         }
         finally
         {
-            try
-            {
-                if( in != null ) in.close();
-            }
-            catch( IOException ex ) {}
+            if( in != null ) in.close();
         }
 
         return saved;
@@ -483,11 +479,7 @@
         }
         finally
         {
-            try
-            {
-                if( in != null ) in.close();
-            }
-            catch( IOException ex ) {}
+            if( in != null ) in.close();
         }
 
         return saved;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/VariableManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/VariableManager.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/VariableManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/VariableManager.java Wed Jun 11 14:22:50
2008
@@ -365,7 +365,7 @@
      *  @since 2.7.0
      *
      */
-    private class SystemVariables
+    private static class SystemVariables
     {
         private WikiContext m_context;
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java Wed Jun
11 14:22:50 2008
@@ -820,7 +820,7 @@
      *  
      *  @author Janne Jalkanen
      */
-    private class UploadListener
+    private static class UploadListener
        extends    ProgressItem
        implements ProgressListener
     {

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAssertionLoginModule.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAssertionLoginModule.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAssertionLoginModule.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAssertionLoginModule.java
Wed Jun 11 14:22:50 2008
@@ -93,7 +93,7 @@
             HttpServletRequest request = hcb.getRequest();
             HttpSession session = ( request == null ) ? null : request.getSession( false
);
             String sid = ( session == null ) ? NULL : session.getId();
-            String name = getUserCookie( request );
+            String name = (request != null) ? getUserCookie( request ) : null;
             if ( name == null )
             {
                 if ( log.isDebugEnabled() )

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
Wed Jun 11 14:22:50 2008
@@ -329,7 +329,7 @@
 
         File[] files = cookieDir.listFiles();
 
-        long obsoleteDateLimit = System.currentTimeMillis() - (days+1) * 24 * 60 * 60 * 1000L;
+        long obsoleteDateLimit = System.currentTimeMillis() - ((long)days+1) * 24 * 60 *
60 * 1000L;
 
         int  deleteCount = 0;
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
Wed Jun 11 14:22:50 2008
@@ -88,7 +88,7 @@
         // Alternative implementation below, but it does create an extra StringBuffer.
         //String         key = wiki+":"+page+":"+actions;
         
-        Integer key = new Integer( wiki.hashCode() ^ page.hashCode() ^ actions.hashCode()
);
+        Integer key = wiki.hashCode() ^ page.hashCode() ^ actions.hashCode();
    
         //
         //  It's fine if two threads update the cache, since the objects mean the same

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/CachingProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/CachingProvider.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/CachingProvider.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/CachingProvider.java Wed Jun 11
14:22:50 2008
@@ -892,7 +892,7 @@
         /**
          * Returns a clone of the set - you cannot manipulate this.
          *
-         * @return
+         * @return A Set of WikiPage objects.
          */
         public Set getAllItems()
         {
@@ -930,7 +930,7 @@
 
             if( item != null )
             {
-                m_allItems.remove( item );
+                m_allItems.remove( item.getName() );
             }
         }
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java Wed Jun 11 14:22:50
2008
@@ -424,12 +424,13 @@
         LinkedHashMap resultMap = new LinkedHashMap();
 
         String clientLanguage = ((HttpServletRequest) pageContext.getRequest()).getLocale().toString();
+        JarInputStream jarStream = null;
         
         try
         {
             JarEntry entry;
             InputStream inputStream = pageContext.getServletContext().getResourceAsStream(I18NRESOURCE_PATH);
-            JarInputStream jarStream = new JarInputStream(inputStream);
+            jarStream = new JarInputStream(inputStream);
 
             while ((entry = jarStream.getNextJarEntry()) != null)
             {
@@ -458,7 +459,18 @@
                 log.debug("Could not search jar file '" + I18NRESOURCE_PATH + 
                           "'for properties files due to an IOException: \n" + ioe.getMessage());
         }
-
+        finally
+        {
+            if( jarStream != null ) 
+            {
+                try 
+                { 
+                    jarStream.close(); 
+                } 
+                catch(IOException e) {}
+            }
+        }
+        
         return resultMap;
     }
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java Wed Jun 11 14:22:50
2008
@@ -258,7 +258,7 @@
             return new MyServletOutputStream( m_output );
         }
 
-        class MyServletOutputStream extends ServletOutputStream
+        static class MyServletOutputStream extends ServletOutputStream
         {
             CharArrayWriter m_buffer;
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java Wed
Jun 11 14:22:50 2008
@@ -44,7 +44,7 @@
 {
     private static final String PROGRESS_ID = "searchmanagerbean.reindexer";
 
-    public static final String[] METHODS = { "reload" };
+    private static final String[] METHODS = { "reload" };
 
     // private static Logger log = Logger.getLogger( SearchManagerBean.class );
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java?rev=666848&r1=666847&r2=666848&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java Wed Jun 11 14:22:50
2008
@@ -175,7 +175,7 @@
         }
     }
 
-    private class LocalHandler
+    private static class LocalHandler
         implements ContextXmlRpcHandler
     {
         private Class m_clazz;



Mime
View raw message