roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1512325 - in /roller/trunk/app/src/main/java/org/apache/roller: planet/business/jpa/ planet/pojos/ planet/tasks/ planet/util/ weblogger/business/ weblogger/business/jpa/ weblogger/business/runnable/ weblogger/business/startup/ weblogger/bu...
Date Fri, 09 Aug 2013 14:42:47 GMT
Author: gmazza
Date: Fri Aug  9 14:42:46 2013
New Revision: 1512325

URL: http://svn.apache.org/r1512325
Log:
Various Sonar complaints fixed, removed Planet Utilities class in favor of using Roller one throughout.

Removed:
    roller/trunk/app/src/main/java/org/apache/roller/planet/util/Utilities.java
Modified:
    roller/trunk/app/src/main/java/org/apache/roller/planet/business/jpa/JPAPlanetManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/planet/tasks/GeneratePlanetTask.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MailProvider.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WebloggerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAMediaFileManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAOAuthManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/TaskScheduler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/WorkerThread.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/tasks/RefreshRollerPlanetTask.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/WeblogRequestMapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/MainMenu.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/CommentsPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/tags/XmlW.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Blacklist.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/HTMLSanitizer.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LinkbackExtractor.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/BasicAuthenticator.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/MediaCollection.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/business/jpa/JPAPlanetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/business/jpa/JPAPlanetManagerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/business/jpa/JPAPlanetManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/business/jpa/JPAPlanetManagerImpl.java Fri Aug  9 14:42:46 2013
@@ -118,7 +118,7 @@ public class JPAPlanetManagerImpl extend
         try {
             return ((List)strategy.getNamedQuery(
                     "Subscription.getAll").getResultList()).iterator();
-        } catch (Throwable e) {
+        } catch (Exception e) {
             throw new RuntimeException(
                     "ERROR fetching subscription collection", e);
         }
@@ -309,7 +309,7 @@ public class JPAPlanetManagerImpl extend
             
             log.debug("Generated aggregation of " + ret.size() + " in " + ((endTime-startTime)/1000.0) + " seconds");
             
-        } catch (Throwable e) {
+        } catch (Exception e) {
             throw new WebloggerException(e);
         }
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java Fri Aug  9 14:42:46 2013
@@ -23,7 +23,7 @@ import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import org.apache.roller.planet.util.Utilities;
+import org.apache.roller.weblogger.util.Utilities;
 import org.apache.roller.util.UUIDGenerator;
 
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/tasks/GeneratePlanetTask.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/tasks/GeneratePlanetTask.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/tasks/GeneratePlanetTask.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/tasks/GeneratePlanetTask.java Fri Aug  9 14:42:46 2013
@@ -26,10 +26,10 @@ import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.planet.business.PlanetManager;
-import org.apache.roller.planet.util.Utilities;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.config.WebloggerConfig;
+import org.apache.roller.weblogger.util.Utilities;
 //import org.apache.roller.util.UtilitiesModel;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java Fri Aug  9 14:42:46 2013
@@ -62,7 +62,7 @@ public class DatabaseProvider  {
     
     private static Log log = LogFactory.getLog(DatabaseProvider.class);
 
-    public enum ConfigurationType {JNDI_NAME, JDBC_PROPERTIES;}
+    public enum ConfigurationType {JNDI_NAME, JDBC_PROPERTIES}
     private ConfigurationType type = ConfigurationType.JNDI_NAME;
     private List<String> startupLog = new ArrayList<String>();
     
@@ -139,12 +139,12 @@ public class DatabaseProvider  {
         try { 
             Connection testcon = getConnection();
             testcon.close();
-        } catch (Throwable t) {
+        } catch (Exception e) {
             String errorMsg = 
                 "ERROR: unable to obtain database connection. "
                +"Likely problem: bad connection parameters or database unavailable.";
             errorMessage(errorMsg);
-            throw new StartupException(errorMsg, t, startupLog);
+            throw new StartupException(errorMsg, e, startupLog);
         }
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/FileContentManagerImpl.java Fri Aug  9 14:42:46 2013
@@ -278,7 +278,7 @@ public class FileContentManagerImpl impl
         // text/xml, etc.).
         
         // if content type is invalid, reject file
-        if (contentType == null || contentType.indexOf("/") == -1)  {
+        if (contentType == null || contentType.indexOf('/') == -1)  {
             return false;
         }
         
@@ -297,7 +297,7 @@ public class FileContentManagerImpl impl
         if (allowFiles != null && allowFiles.length > 0) {
             for (int y=0; y<allowFiles.length; y++) {
                 // oops, this allowed rule is a content-type, skip it
-                if (allowFiles[y].indexOf("/") != -1) continue;
+                if (allowFiles[y].indexOf('/') != -1) continue;
                 if (fileName.toLowerCase().endsWith(
                         allowFiles[y].toLowerCase())) {
                     allowFile = true;
@@ -310,7 +310,7 @@ public class FileContentManagerImpl impl
         if (allowFiles != null && allowFiles.length > 0) {
             for (int y=0; y<allowFiles.length; y++) {
                 // oops, this allowed rule is NOT a content-type, skip it
-                if (allowFiles[y].indexOf("/") == -1) continue;
+                if (allowFiles[y].indexOf('/') == -1) continue;
                 if (matchContentType(allowFiles[y], contentType)) {
                     allowFile = true;
                     break;
@@ -324,7 +324,7 @@ public class FileContentManagerImpl impl
         if (forbidFiles != null && forbidFiles.length > 0) {
             for (int x=0; x<forbidFiles.length; x++) {
                 // oops, this forbid rule is a content-type, skip it
-                if (forbidFiles[x].indexOf("/") != -1) continue;
+                if (forbidFiles[x].indexOf('/') != -1) continue;
                 if (fileName.toLowerCase().endsWith(
                         forbidFiles[x].toLowerCase())) {
                     allowFile = false;
@@ -338,7 +338,7 @@ public class FileContentManagerImpl impl
         if (forbidFiles != null && forbidFiles.length > 0) {
             for (int x=0; x<forbidFiles.length; x++) {
                 // oops, this forbid rule is NOT a content-type, skip it
-                if (forbidFiles[x].indexOf("/") == -1) continue;
+                if (forbidFiles[x].indexOf('/') == -1) continue;
                 if (matchContentType(forbidFiles[x], contentType)) {
                     allowFile = false;
                     break;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MailProvider.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MailProvider.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MailProvider.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MailProvider.java Fri Aug  9 14:42:46 2013
@@ -67,7 +67,7 @@ public class MailProvider {
             if (portString != null) {
                 mailPort = Integer.parseInt(portString);
             }
-        } catch (Throwable t) {
+        } catch (Exception e) {
             log.warn("mail server port not a valid integer, ignoring");
         }
         
@@ -97,8 +97,8 @@ public class MailProvider {
         try {
             Transport transport = getTransport();
             transport.close();
-        } catch (Throwable t) {
-            throw new StartupException("ERROR connecting to mail server", t);
+        } catch (Exception e) {
+            throw new StartupException("ERROR connecting to mail server", e);
         }
         
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WebloggerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WebloggerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WebloggerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WebloggerImpl.java Fri Aug  9 14:42:46 2013
@@ -342,7 +342,7 @@ public abstract class WebloggerImpl impl
             threadManager.release();
             userManager.release();
             weblogManager.release();
-        } catch(Throwable e) {
+        } catch(Exception e) {
             log.error("Error calling Roller.release()", e);
         }
     }
@@ -384,8 +384,8 @@ public abstract class WebloggerImpl impl
                 log.info("Ping usage has been disabled.  Removing any existing auto ping configurations.");
                 WebloggerFactory.getWeblogger().getAutopingManager().removeAllAutoPings();
             }
-        } catch (Throwable t) {
-            throw new InitializationException("Error initializing ping systems", t);
+        } catch (Exception e) {
+            throw new InitializationException("Error initializing ping systems", e);
         }
         
         // we always need to do a flush after initialization because it's
@@ -409,7 +409,7 @@ public abstract class WebloggerImpl impl
             if (getReferrerQueueManager() != null) getReferrerQueueManager().shutdown();
             if (indexManager != null) indexManager.shutdown();
             if (threadManager != null) threadManager.shutdown();
-        } catch(Throwable e) {
+        } catch(Exception e) {
             log.error("Error calling Roller.shutdown()", e);
         }
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAMediaFileManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAMediaFileManagerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAMediaFileManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAMediaFileManagerImpl.java Fri Aug  9 14:42:46 2013
@@ -207,7 +207,7 @@ public class JPAMediaFileManagerImpl imp
             throw new WebloggerException("Invalid path!");
         }
 
-        int lastPathIndex = path.lastIndexOf("/");
+        int lastPathIndex = path.lastIndexOf('/');
 
         MediaFileDirectory newDirectory = null;
         if (lastPathIndex == -1) {
@@ -438,7 +438,7 @@ public class JPAMediaFileManagerImpl imp
         // get directory
         String fileName = path;
         MediaFileDirectory mdir = null;
-        int slash = path.lastIndexOf("/");
+        int slash = path.lastIndexOf('/');
         if (slash > 0) {
             mdir = getMediaFileDirectoryByPath(weblog, path.substring(0, slash));
         } else {
@@ -752,8 +752,8 @@ public class JPAMediaFileManagerImpl imp
                                             new File(oldDirName + FS
                                                     + dirs[i].getName()), root);
 
-                                } catch (Throwable t) {
-                                    log.error("ERROR upgading weblog", t);
+                                } catch (Exception e) {
+                                    log.error("ERROR upgading weblog", e);
                                 }
                             }
                         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAOAuthManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAOAuthManagerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAOAuthManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAOAuthManagerImpl.java Fri Aug  9 14:42:46 2013
@@ -229,7 +229,7 @@ public class JPAOAuthManagerImpl impleme
             Query q = strategy.getNamedQuery("OAuthConsumerRecord.getSiteWideConsumer");
             record = (OAuthConsumerRecord)q.getSingleResult();
 
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.debug("ERROR fetching site-wide consumer", ex);
         }
         if (record != null) {
@@ -250,7 +250,7 @@ public class JPAOAuthManagerImpl impleme
             q.setParameter(1, username);
             record = (OAuthConsumerRecord)q.getSingleResult();
 
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.debug("ERROR fetching consumer", ex);
         }
         if (record != null) {
@@ -308,7 +308,7 @@ public class JPAOAuthManagerImpl impleme
             q.setParameter(1, consumerKey);
             record = (OAuthConsumerRecord)q.getSingleResult();
 
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.debug("ERROR fetching consumer", ex);
         }
         return consumerFromRecord(record);
@@ -354,7 +354,7 @@ public class JPAOAuthManagerImpl impleme
             q.setParameter(1, consumerKey);
             record = (OAuthAccessorRecord)q.getSingleResult();
 
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.debug("ERROR fetching accessor", ex);
         }
         return accessorFromRecord(record);
@@ -367,7 +367,7 @@ public class JPAOAuthManagerImpl impleme
             q.setParameter(1, token);
             record = (OAuthAccessorRecord)q.getSingleResult();
 
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.debug("ERROR fetching accessor", ex);
         }
         return accessorFromRecord(record);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java Fri Aug  9 14:42:46 2013
@@ -107,7 +107,7 @@ public class JPAPersistenceStrategy {
             try {
                 this.emf = Persistence.createEntityManagerFactory("RollerPU", emfProps);
 
-            } catch (Throwable pe) {
+            } catch (Exception pe) {
                 logger.error("ERROR: creating entity manager", pe);
                 throw new WebloggerException(pe);
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/TaskScheduler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/TaskScheduler.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/TaskScheduler.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/TaskScheduler.java Fri Aug  9 14:42:46 2013
@@ -183,8 +183,8 @@ public class TaskScheduler implements Ru
                     pool.submit(task);
                 }
                 
-            } catch(Throwable t) {
-                log.warn(task.getName()+": Unhandled exception caught", t);
+            } catch(Exception e) {
+                log.warn(task.getName()+": Unhandled exception caught", e);
             }
         }
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/WorkerThread.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/WorkerThread.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/WorkerThread.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/WorkerThread.java Fri Aug  9 14:42:46 2013
@@ -66,11 +66,11 @@ public class WorkerThread extends Thread
             // process job
             try {
                 this.job.execute();
-            } catch(Throwable t) {
+            } catch(Exception e) {
                 // oops
                 log.error("Error executing job. "+
                         "Worker = "+this.id+", "+
-                        "Job = "+this.job.getClass().getName(), t);
+                        "Job = "+this.job.getClass().getName(), e);
             }
             
             // since this is a thread we have to make sure that we tidy up ourselves

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java Fri Aug  9 14:42:46 2013
@@ -77,8 +77,8 @@ public class DatabaseInstaller {
                 return false;
             }
             
-        } catch (Throwable t) {
-            throw new RuntimeException("Error checking for tables", t);            
+        } catch (Exception e) {
+            throw new RuntimeException("Error checking for tables", e);
         } finally {
             try { if (con != null) con.close(); } catch (Exception ignored) {}
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java Fri Aug  9 14:42:46 2013
@@ -348,18 +348,18 @@ public class ThemeManagerImpl implements
 				String justName = null;
 				String justPath = null;
 
-				if (resourcePath.indexOf("/") == -1) {
+				if (resourcePath.indexOf('/') == -1) {
 					mdir = fileMgr.getMediaFileRootDirectory(website);
 					justPath = "";
 					justName = resourcePath;
 
 				} else {
 					justPath = resourcePath.substring(0,
-							resourcePath.lastIndexOf("/"));
+							resourcePath.lastIndexOf('/'));
 					if (!justPath.startsWith("/"))
 						justPath = "/" + justPath;
 					justName = resourcePath.substring(resourcePath
-							.lastIndexOf("/") + 1);
+							.lastIndexOf('/') + 1);
 					mdir = fileMgr.getMediaFileDirectoryByPath(website,
 							justPath);
 					if (mdir == null) {
@@ -438,7 +438,7 @@ public class ThemeManagerImpl implements
 				if (theme != null) {
 					themeMap.put(theme.getId(), theme);
 				}
-			} catch (Throwable unexpected) {
+			} catch (Exception unexpected) {
 				// shouldn't happen, so let's learn why it did
 				log.error("Problem reading theme " + themenames[i], unexpected);
 			}
@@ -473,7 +473,7 @@ public class ThemeManagerImpl implements
 
 			}
 
-		} catch (Throwable unexpected) {
+		} catch (Exception unexpected) {
 			// shouldn't happen, so let's learn why it did
 			log.error("Problem reloading theme " + reloadTheme, unexpected);
 		}

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/tasks/RefreshRollerPlanetTask.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/tasks/RefreshRollerPlanetTask.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/tasks/RefreshRollerPlanetTask.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/tasks/RefreshRollerPlanetTask.java Fri Aug  9 14:42:46 2013
@@ -131,8 +131,8 @@ public class RefreshRollerPlanetTask ext
             FeedUpdater updater = new SingleThreadedFeedUpdater();
             updater.updateSubscriptions();
             
-        } catch (Throwable t) {
-            log.error("ERROR refreshing planet", t);
+        } catch (Exception e) {
+            log.error("ERROR refreshing planet", e);
         } finally {
             // always release
             WebloggerFactory.getWeblogger().release();

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/GlobalPermission.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/GlobalPermission.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/GlobalPermission.java Fri Aug  9 14:42:46 2013
@@ -28,7 +28,7 @@ import org.apache.roller.weblogger.util.
 
 
 /**
- * Represents a permssion that applies globally to the entire web application.
+ * Represents a permission that applies globally to the entire web application.
  */
 public class GlobalPermission extends RollerPermission {
     protected String  actions;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Fri Aug  9 14:42:46 2013
@@ -1190,8 +1190,8 @@ public class WeblogEntry implements Seri
                         WeblogEntryPlugin pagePlugin = (WeblogEntryPlugin)plugins.get(key);
                         try {
                             ret = pagePlugin.render(this, ret);
-                        } catch (Throwable t) {
-                            mLogger.error("ERROR from plugin: " + pagePlugin.getName(), t);
+                        } catch (Exception e) {
+                            mLogger.error("ERROR from plugin: " + pagePlugin.getName(), e);
                         }
                     }
                 }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java Fri Aug  9 14:42:46 2013
@@ -183,7 +183,7 @@ public class RollerSession 
         HttpSession session = se.getSession();
         try {
             session.removeAttribute(ROLLER_SESSION);
-        } catch (Throwable e) {
+        } catch (Exception e) {
             if (log.isDebugEnabled()) {
                 // ignore purge exceptions
                 log.debug("EXCEPTION PURGING session attributes",e);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java Fri Aug  9 14:42:46 2013
@@ -85,7 +85,7 @@ public class InitFilter implements Filte
         }
         
         // find first "/" starting after hostname is specified
-        int index = fullUrl.indexOf("/", fullUrl.indexOf(request.getServerName()));
+        int index = fullUrl.indexOf('/', fullUrl.indexOf(request.getServerName()));
         
         // extract just the part leading up to uri
         url = fullUrl.substring(0, index);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java Fri Aug  9 14:42:46 2013
@@ -135,7 +135,7 @@ public class SchemeEnforcementFilter imp
 	 */
 	private boolean isIgnoredURL(String theUrl) {
 
-		int i = theUrl.lastIndexOf(".");
+		int i = theUrl.lastIndexOf('.');
 
 		if (i <= 0 || i == theUrl.length() - 1)
 			return true;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java Fri Aug  9 14:42:46 2013
@@ -91,7 +91,7 @@ public class ValidateSaltFilter implemen
 	 */
 	private boolean isIgnoredURL(String theUrl) {
 
-		int i = theUrl.lastIndexOf("/");
+		int i = theUrl.lastIndexOf('/');
 
 		// If its not a resource then do not ignore it
 		if (i <= 0 || i == theUrl.length() - 1)

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/WeblogRequestMapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/WeblogRequestMapper.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/WeblogRequestMapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/WeblogRequestMapper.java Fri Aug  9 14:42:46 2013
@@ -116,9 +116,9 @@ public class WeblogRequestMapper impleme
                 trailingSlash = true;
             }
             
-            if(servlet.indexOf("/") != -1) {
-                weblogHandle = servlet.substring(0, servlet.indexOf("/"));
-                pathInfo = servlet.substring(servlet.indexOf("/")+1);
+            if(servlet.indexOf('/') != -1) {
+                weblogHandle = servlet.substring(0, servlet.indexOf('/'));
+                pathInfo = servlet.substring(servlet.indexOf('/')+1);
             } else {
                 weblogHandle = servlet;
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/MediaResourceServlet.java Fri Aug  9 14:42:46 2013
@@ -147,7 +147,7 @@ public class MediaResourceServlet extend
             // close output stream
             out.close();
             
-        } catch (Throwable ex) {
+        } catch (Exception ex) {
             log.error("ERROR",ex);
             if(!response.isCommitted()) {
                 response.reset();

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java Fri Aug  9 14:42:46 2013
@@ -642,7 +642,7 @@ public class PageServlet extends HttpSer
 				// validate the referrer
 				if (referrerUrl != null) {
 					// treat editor referral as direct
-					int lastSlash = requestUrl.indexOf("/", 8);
+					int lastSlash = requestUrl.indexOf('/', 8);
 					if (lastSlash == -1) {
 						lastSlash = requestUrl.length();
 					}

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/ajax/UserDataServlet.java Fri Aug  9 14:42:46 2013
@@ -60,9 +60,9 @@ public class UserDataServlet extends Htt
         if ("true".equals(request.getParameter("enabled"))) enabledOnly = Boolean.TRUE;
         if ("false".equals(request.getParameter("enabled"))) enabledOnly = Boolean.FALSE;
         try { offset = Integer.parseInt(request.getParameter("offset"));
-        } catch (Throwable ignored) {}
+        } catch (Exception ignored) {}
         try { length = Integer.parseInt(request.getParameter("length"));
-        } catch (Throwable ignored) {}
+        } catch (Exception ignored) {}
         
         Weblogger roller = WebloggerFactory.getWeblogger();
         try {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Install.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Install.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Install.java Fri Aug  9 14:42:46 2013
@@ -161,7 +161,7 @@ public class Install extends UIAction {
                 // Now prepare the core services of planet so we can bootstrap it
                 try {
                     WebloggerStartup.prepare();
-                } catch (Throwable ex) {
+                } catch (Exception ex) {
                     log.fatal("Roller Planet startup failed during app preparation", ex);
                 }
             }
@@ -174,9 +174,9 @@ public class Install extends UIAction {
         } catch (WebloggerException ex) {
             log.error("WebloggerException", ex);
             rootCauseException = ex;
-        } catch (Throwable t) {
-            log.error("Throwable", t);
-            rootCauseException = t;
+        } catch (Exception e) {
+            log.error("Exception", e);
+            rootCauseException = e;
         }
 
         log.info("EXITING - Bootstrap failed, forwarding to error page");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/MainMenu.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/MainMenu.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/MainMenu.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/MainMenu.java Fri Aug  9 14:42:46 2013
@@ -26,7 +26,6 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.business.WeblogManager;
-import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java Fri Aug  9 14:42:46 2013
@@ -272,10 +272,10 @@ public final class EntryEdit extends Ent
                 results = trackback.send();
             } catch (TrackbackNotAllowedException ex) {
                 addError("error.trackbackNotAllowed");
-            } catch (Throwable t) {
-                log.error("Error sending trackback", t);
+            } catch (Exception e) {
+                log.error("Error sending trackback", e);
                 // TODO: error handling
-                addError("error.general", t.getMessage());
+                addError("error.general", e.getMessage());
             }
 
             if (results != null) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java Fri Aug  9 14:42:46 2013
@@ -138,16 +138,16 @@ public class MediaFileAdd extends MediaF
                         bean.copyTo(mediaFile);
 
                         String fileName = getUploadedFilesFileName()[i];
-                        int terminated = fileName.indexOf("\000");
+                        int terminated = fileName.indexOf('\000');
                         if (terminated != -1) {
                             // disallow sneaky null terminated strings
                             fileName = fileName.substring(0, terminated).trim();
                         }
 
                         // make sure fileName is valid
-                        if (fileName.indexOf("/") != -1 ||
-                                fileName.indexOf("\\") != -1 ||
-                                fileName.indexOf("..") != -1) {
+                        if (fileName.indexOf('/') != -1 ||
+                                fileName.indexOf('\\') != -1 ||
+                                fileName.contains("..")) {
                             addError("uploadFiles.error.badPath", fileName);
                             continue;
                         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java Fri Aug  9 14:42:46 2013
@@ -108,7 +108,7 @@ public class MediaFileImageChooser exten
             log.error("Error viewing media file directory ", ex);
             addError("MediaFile.error.view");
             
-        } catch (Throwable e) {
+        } catch (Exception e) {
             log.error("Error viewing media file directory ", e);
             addError("MediaFile.error.view");
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java Fri Aug  9 14:42:46 2013
@@ -195,7 +195,7 @@ public class WeblogConfig extends UIActi
             Blacklist.populateSpamRules(getBean().getBlacklist(), stringRules, regexRules, null);
             addMessage("websiteSettings.acceptedBlacklist",
                     Arrays.asList(new String[] {""+stringRules.size(), ""+regexRules.size()}));
-        } catch (Throwable e) {
+        } catch (Exception e) {
             addError("websiteSettings.error.processingBlacklist", e.getMessage());
         }
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/CommentsPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/CommentsPager.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/CommentsPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/CommentsPager.java Fri Aug  9 14:42:46 2013
@@ -80,7 +80,7 @@ public class CommentsPager {
     private String createURL(String base, Map<String, String> params) {
         String qString = URLUtilities.getQueryString(params);
         
-        if(base.indexOf("?") != -1) {
+        if(base.indexOf('?') != -1) {
             // if base url already has params them just append our query string
             return base + "&" + qString.substring(1);
         } else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java Fri Aug  9 14:42:46 2013
@@ -80,7 +80,7 @@ public class EntriesPager {
     private String createURL(String base, Map<String, String> params) {
         String qString = URLUtilities.getQueryString(params);
         
-        if(base.indexOf("?") != -1) {
+        if(base.indexOf('?') != -1) {
             // if base url already has params them just append our query string
             return base + "&" + qString.substring(1);
         } else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java Fri Aug  9 14:42:46 2013
@@ -157,7 +157,7 @@ public abstract class UIAction extends A
             value = WebloggerRuntimeConfig.getProperty(key);
         }
         
-        return (value == null) ? false : (new Boolean(value)).booleanValue();
+        return (value == null) ? false : Boolean.valueOf(value);
     }
     
     public int getIntProp(String key) {
@@ -167,7 +167,7 @@ public abstract class UIAction extends A
             value = WebloggerRuntimeConfig.getProperty(key);
         }
         
-        return (value == null) ? 0 : (new Integer(value)).intValue();
+        return (value == null) ? 0 : new Integer(value);
     }
     
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/tags/XmlW.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/tags/XmlW.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/tags/XmlW.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/tags/XmlW.java Fri Aug  9 14:42:46 2013
@@ -143,7 +143,7 @@ public final class XmlW {
     }
 
     public static String getAttribute(String attribute, String text, int idx) {
-         int close = text.indexOf(">", idx);
+         int close = text.indexOf('>', idx);
          int attrIdx = text.indexOf(attribute+"=\"", idx);
          if(attrIdx == -1) {
              return null;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Blacklist.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Blacklist.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Blacklist.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Blacklist.java Fri Aug  9 14:42:46 2013
@@ -265,13 +265,13 @@ public class Blacklist {
         
         String rule = str.trim();
         
-        if (str.indexOf("#") > 0) // line has a comment
+        if (str.indexOf('#') > 0) // line has a comment
         {
-            int commentLoc = str.indexOf("#");
+            int commentLoc = str.indexOf('#');
             rule = str.substring(0, commentLoc-1).trim(); // strip comment
         }
         
-        if (rule.indexOf( "(" ) > -1) // regex rule
+        if (rule.indexOf( '(' ) > -1) // regex rule
         {
             // pre-compile patterns since they will be frequently used
             blacklistRegex.add(Pattern.compile(rule));

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/HTMLSanitizer.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/HTMLSanitizer.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/HTMLSanitizer.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/HTMLSanitizer.java Fri Aug  9 14:42:46 2013
@@ -187,8 +187,8 @@ public class HTMLSanitizer {
 							} else {
 								// may be it is a mailto?
 								//  case <a href="mailto:pippo@pippo.com?subject=...."
-								if (val.toLowerCase().startsWith("mailto:") && val.indexOf("@") >= 0) {
-									String val1 = "http://www." + val.substring(val.indexOf("@") + 1);
+								if (val.toLowerCase().startsWith("mailto:") && val.indexOf('@') >= 0) {
+									String val1 = "http://www." + val.substring(val.indexOf('@') + 1);
 									if (new UrlValidator(customSchemes).isValid(val1)) {
 										foundURL = true;
 									} else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LinkbackExtractor.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LinkbackExtractor.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LinkbackExtractor.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LinkbackExtractor.java Fri Aug  9 14:42:46 2013
@@ -367,7 +367,7 @@ public class LinkbackExtractor
                     }
                     else if (!mRssLink.startsWith("http"))
                     {
-                        int slash = mRefererURL.lastIndexOf("/");
+                        int slash = mRefererURL.lastIndexOf('/');
                         if (slash != -1)
                         {
                             mRssLink = mRefererURL.substring(0, slash) + "/"

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java Fri Aug  9 14:42:46 2013
@@ -96,7 +96,7 @@ public class Utilities {
         // Strip off jsessionid found in referer URL
         int startPos = url.indexOf(";jsessionid=");
         if ( startPos != -1 ) {
-            int endPos = url.indexOf("?",startPos);
+            int endPos = url.indexOf('?',startPos);
             if ( endPos == -1 ) {
                 url = url.substring(0,startPos);
             } else {
@@ -140,7 +140,7 @@ public class Utilities {
     
     //------------------------------------------------------------------------
     /**
-     * Remove occurences of html, defined as any text
+     * Remove occurrences of html, defined as any text
      * between the characters "&lt;" and "&gt;".  Replace
      * any HTML tags with a space.
      */
@@ -149,7 +149,7 @@ public class Utilities {
     }
     
     /**
-     * Remove occurences of html, defined as any text
+     * Remove occurrences of html, defined as any text
      * between the characters "&lt;" and "&gt;".
      * Optionally replace HTML tags with a space.
      *
@@ -158,14 +158,17 @@ public class Utilities {
      * @return
      */
     public static String removeHTML(String str, boolean addSpace) {
-        if (str == null) return "";
+        if (str == null) {
+            return "";
+        }
         StringBuffer ret = new StringBuffer(str.length());
         int start = 0;
-        int beginTag = str.indexOf("<");
+        int beginTag = str.indexOf('<');
         int endTag = 0;
-        if (beginTag == -1)
+        if (beginTag == -1) {
             return str;
-        
+        }
+
         while (beginTag >= start) {
             if (beginTag > 0) {
                 ret.append(str.substring(start, beginTag));
@@ -173,7 +176,7 @@ public class Utilities {
                 // replace each tag with a space (looks better)
                 if (addSpace) ret.append(" ");
             }
-            endTag = str.indexOf(">", beginTag);
+            endTag = str.indexOf('>', beginTag);
             
             // if endTag found move "cursor" forward
             if (endTag > -1) {
@@ -251,7 +254,7 @@ public class Utilities {
     
     //------------------------------------------------------------------------
     /**
-     * Replaces occurences of non-alphanumeric characters with a
+     * Replaces occurrences of non-alphanumeric characters with a
      * supplied char.
      */
     public static String replaceNonAlphanumeric(String str, char subst) {
@@ -546,26 +549,24 @@ public class Utilities {
      * This is weak encoding in that anyone can use the decodeString
      * routine to reverse the encoding.
      *
-     * @param str
+     * @param str String to encode
      * @return String
      * @throws IOException
      */
     public static String encodeString(String str) throws IOException {
-        Base64 base64 = new Base64();
-        String encodedStr = new String(base64.encodeBase64(str.getBytes()));        
+        String encodedStr = new String(Base64.encodeBase64(str.getBytes()));
         return (encodedStr.trim());
     }
     
     /**
      * Decode a string using Base64 encoding.
      *
-     * @param str
-     * @return String
+     * @param str String to decode
+     * @return decoded string
      * @throws IOException
      */
     public static String decodeString(String str) throws IOException {
-        Base64 base64 = new Base64();
-        String value = new String(base64.decodeBase64(str.getBytes()));        
+        String value = new String(Base64.decodeBase64(str.getBytes()));
         return (value);
     }
     
@@ -812,13 +813,13 @@ public class Utilities {
         if (str == null) return "";
         StringBuffer ret = new StringBuffer(str.length());
         int start = 0;
-        int beginTag = str.indexOf("<");
+        int beginTag = str.indexOf('<');
         int endTag = 0;
         if (beginTag == -1)
             return str;
         
         while (beginTag >= start) {
-            endTag = str.indexOf(">", beginTag);
+            endTag = str.indexOf('>', beginTag);
             
             // if endTag found, keep tag
             if (endTag > -1) {
@@ -826,7 +827,7 @@ public class Utilities {
                 
                 // move start forward and find another tag
                 start = endTag + 1;
-                beginTag = str.indexOf("<", start);
+                beginTag = str.indexOf('<', start);
             }
             // if no endTag found, break
             else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/BasicAuthenticator.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/BasicAuthenticator.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/BasicAuthenticator.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/BasicAuthenticator.java Fri Aug  9 14:42:46 2013
@@ -44,7 +44,7 @@ class BasicAuthenticator extends Authent
             if (basic.equalsIgnoreCase("Basic")) {
                 String credentials = st.nextToken();
                 String userPass = new String(Base64.decodeBase64(credentials.getBytes()));
-                int p = userPass.indexOf(":");
+                int p = userPass.indexOf(':');
                 if (p != -1) {
                     String userName = userPass.substring(0, p);
                     String password = userPass.substring(p+1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java Fri Aug  9 14:42:46 2013
@@ -158,7 +158,7 @@ public class EntryCollection {
                 try {
                     String s = pathInfo[2].trim();
                     start = Integer.parseInt(s);
-                } catch (Throwable t) {
+                } catch (Exception e) {
                     log.warn("Unparsable range: " + pathInfo[2]);
                 }
             }        

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/MediaCollection.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/MediaCollection.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/MediaCollection.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/MediaCollection.java Fri Aug  9 14:42:46 2013
@@ -119,7 +119,7 @@ public class MediaCollection {
                     // Parse pathinfo to determine file path
                     String path = filePathFromPathInfo(pathInfo);
                     String justPath = path;
-                    int lastSlash = path.lastIndexOf("/");
+                    int lastSlash = path.lastIndexOf('/');
                     if (lastSlash > -1) {
                         justPath = path.substring(lastSlash);
                     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java Fri Aug  9 14:42:46 2013
@@ -445,7 +445,7 @@ public class RollerAtomHandler implement
                     if (basic.equalsIgnoreCase("Basic")) {
                         String credentials = st.nextToken();
                         String userPass = new String(Base64.decodeBase64(credentials.getBytes()));
-                        int p = userPass.indexOf(":");
+                        int p = userPass.indexOf(':');
                         if (p != -1) {
                             userID = userPass.substring(0, p);
                             User user = roller.getUserManager().getUserByUserName(userID);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java?rev=1512325&r1=1512324&r2=1512325&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java Fri Aug  9 14:42:46 2013
@@ -149,7 +149,7 @@ public class RollerAtomService extends A
         String allows = ((RuntimeConfigProperty)config.get("uploads.types.allowed")).getValue();
         String[] rules = StringUtils.split(StringUtils.deleteWhitespace(allows), ",");
         for (int i=0; i<rules.length; i++) {
-            if (rules[i].indexOf("/") == -1) continue;
+            if (rules[i].indexOf('/') == -1) continue;
             accepts.add(rules[i]);
         }
         return accepts;             



Mime
View raw message