roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1516602 [1/2] - in /roller/trunk/app/src/main/java/org/apache/roller: planet/business/fetcher/ planet/business/updater/ weblogger/business/plugins/comment/ weblogger/business/referrers/ weblogger/business/search/ weblogger/business/search/...
Date Thu, 22 Aug 2013 20:50:32 GMT
Author: gmazza
Date: Thu Aug 22 20:50:31 2013
New Revision: 1516602

URL: http://svn.apache.org/r1516602
Log:
Various Sonar complaints fixed.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/planet/business/fetcher/RomeFeedFetcher.java
    roller/trunk/app/src/main/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/comment/AutoformatPlugin.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/AddEntryOperation.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/ReIndexEntryOperation.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.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/business/themes/ThemeMetadataParser.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.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/core/tags/calendar/CalendarTag.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/model/CalendarModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/OAuthAuthorize.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets.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/FolderAdd.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplatesRemove.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/util/LinkbackExtractor.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/oauth/AuthorizationServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/business/fetcher/RomeFeedFetcher.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/business/fetcher/RomeFeedFetcher.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/business/fetcher/RomeFeedFetcher.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/business/fetcher/RomeFeedFetcher.java Thu Aug 22 20:50:31 2013
@@ -264,7 +264,9 @@ public class RomeFeedFetcher implements 
         File cacheDir = null;
         try {
             cacheDir = new File(cacheDirName);
-            if (!cacheDir.exists()) cacheDir.mkdirs();
+            if (!cacheDir.exists()) {
+                cacheDir.mkdirs();
+            }
         } catch (Exception e) {
             log.error("Unable to create planet cache directory: " + cacheDir.getPath(), e);
             return null;

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java Thu Aug 22 20:50:31 2013
@@ -39,6 +39,8 @@ import org.apache.roller.weblogger.confi
 public class SingleThreadedFeedUpdater implements FeedUpdater {
     
     private static Log log = LogFactory.getLog(SingleThreadedFeedUpdater.class);
+
+    private static final double MS_TO_SEC_DIVISOR = 1000.0;
     
     
     public SingleThreadedFeedUpdater() {
@@ -96,30 +98,32 @@ public class SingleThreadedFeedUpdater i
         int entries = 0;
         Set<SubscriptionEntry> newEntries = updatedSub.getEntries();
         log.debug("newEntries.size() = " + newEntries.size());
-        if (newEntries.size() > 0) try {
-            PlanetManager pmgr = WebloggerFactory.getWeblogger().getPlanetManager();
-            
-            // clear out old entries
-            pmgr.deleteEntries(sub);
-            
-            // add fresh entries
-            sub.getEntries().clear();
-            sub.addEntries(newEntries);
-            
-            // save and flush
-            pmgr.saveSubscription(sub);
-            WebloggerFactory.getWeblogger().flush();
+        if (newEntries.size() > 0) {
+            try {
+                PlanetManager pmgr = WebloggerFactory.getWeblogger().getPlanetManager();
+
+                // clear out old entries
+                pmgr.deleteEntries(sub);
+
+                // add fresh entries
+                sub.getEntries().clear();
+                sub.addEntries(newEntries);
+
+                // save and flush
+                pmgr.saveSubscription(sub);
+                WebloggerFactory.getWeblogger().flush();
 
-            log.debug("Added entries");
-            entries += newEntries.size();            
+                log.debug("Added entries");
+                entries += newEntries.size();
 
-        } catch(RollerException ex) {
-            throw new UpdaterException("Error persisting updated subscription", ex);
+            } catch(RollerException ex) {
+                throw new UpdaterException("Error persisting updated subscription", ex);
+            }
         }
         
         long subEndTime = System.currentTimeMillis();
-        log.debug("updated feed -- "+sub.getFeedURL()+" -- in "+
-                ((subEndTime-subStartTime)/1000.0)+" seconds.  "+entries+
+        log.debug("updated feed -- "+sub.getFeedURL()+" -- in " +
+                ((subEndTime-subStartTime) / MS_TO_SEC_DIVISOR) + " seconds.  " + entries +
                 " entries updated.");
     }
     
@@ -145,7 +149,7 @@ public class SingleThreadedFeedUpdater i
         
         long endTime = System.currentTimeMillis();
         log.info("--- DONE --- Updated subscriptions in "
-                + ((endTime-startTime)/1000.0) + " seconds");
+                + ((endTime-startTime) / MS_TO_SEC_DIVISOR) + " seconds");
     }
     
     
@@ -168,7 +172,7 @@ public class SingleThreadedFeedUpdater i
         
         long endTime = System.currentTimeMillis();
         log.info("--- DONE --- Updated subscriptions in "
-                + ((endTime-startTime)/1000.0) + " seconds");
+                + ((endTime-startTime) / MS_TO_SEC_DIVISOR) + " seconds");
     }
     
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/comment/AutoformatPlugin.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/comment/AutoformatPlugin.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/comment/AutoformatPlugin.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/comment/AutoformatPlugin.java Thu Aug 22 20:50:31 2013
@@ -93,8 +93,9 @@ public class AutoformatPlugin implements
             
             // if the text ends without an empty line then we need to
             // terminate the last paragraph now
-            if(insidePara)
+            if (insidePara) {
                 buf.append("</p>\n\n");
+            }
             
         } catch(Exception e) {
             log.warn("trouble rendering text.", e);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java Thu Aug 22 20:50:31 2013
@@ -89,8 +89,9 @@ public class ReferrerQueueManagerImpl im
             try {
                 this.numWorkers = Integer.parseInt(num);
                 
-                if(numWorkers < 1)
+                if(numWorkers < 1) {
                     this.numWorkers = 1;
+                }
                 
             } catch(NumberFormatException nfe) {
                 mLogger.warn("Invalid num workers ["+num+"], using default");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java Thu Aug 22 20:50:31 2013
@@ -33,6 +33,8 @@ import org.apache.lucene.index.Term;
  */
 public class IndexUtil {
 
+    private IndexUtil() {}
+
     /**
      * Create a lucene term from the first token of the input string.
      * 
@@ -45,8 +47,9 @@ public class IndexUtil {
      */
     public static final Term getTerm(String field, String input) {
 
-        if (input == null || field == null)
+        if (input == null || field == null) {
             return null;
+        }
 
         Analyzer analyzer = IndexManagerImpl.getAnalyzer();
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/AddEntryOperation.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/AddEntryOperation.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/AddEntryOperation.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/AddEntryOperation.java Thu Aug 22 20:50:31 2013
@@ -79,7 +79,9 @@ public class AddEntryOperation extends W
         } catch (IOException e) {
             mLogger.error("Problems adding doc to index", e);
         } finally {
-            if (roller != null) roller.release();
+            if (roller != null) {
+                roller.release();
+            }
             endWriting();
         }
     }   

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/ReIndexEntryOperation.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/ReIndexEntryOperation.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/ReIndexEntryOperation.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/ReIndexEntryOperation.java Thu Aug 22 20:50:31 2013
@@ -69,7 +69,7 @@ public class ReIndexEntryOperation exten
     public void doRun() {
 
         // since this operation can be run on a separate thread we must treat
-        // the weblog object passed in as a detached object which is proned to
+        // the weblog object passed in as a detached object which is prone to
         // lazy initialization problems, so requery for the object now
         try {
             WeblogEntryManager wMgr = roller.getWeblogEntryManager();
@@ -93,8 +93,9 @@ public class ReIndexEntryOperation exten
         } catch (IOException e) {
             mLogger.error("Problems adding/deleting doc to index", e);
         } finally {
-            if (roller != null)
+            if (roller != null) {
                 roller.release();
+            }
             endWriting();
         }
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java Thu Aug 22 20:50:31 2013
@@ -143,8 +143,9 @@ public class RebuildWebsiteIndexOperatio
             mLogger.error("ERROR adding/deleting doc to index", e);
         } finally {
             endWriting();
-            if (roller != null)
+            if (roller != null) {
                 roller.release();
+            }
         }
 
         Date end = new Date();

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java Thu Aug 22 20:50:31 2013
@@ -116,7 +116,9 @@ public class SQLScriptRunner {
             try {
                 Statement stmt = con.createStatement();
                 stmt.executeUpdate(command);
-                if (!con.getAutoCommit()) con.commit();
+                if (!con.getAutoCommit()) {
+                    con.commit();
+                }
                 
                 // on success, echo command to messages
                 successMessage(command);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java Thu Aug 22 20:50:31 2013
@@ -408,8 +408,9 @@ public class SharedThemeFromDir extends 
             length = reader.read(chars);
         } catch (Exception noprob) {
             log.error("Exception reading theme [" + this.getName() + "] template file ["+templateFile+"]");
-            if (log.isDebugEnabled())
+            if (log.isDebugEnabled()) {
                 log.debug(noprob);
+            }
             return null;
         }
         

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=1516602&r1=1516601&r2=1516602&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 Thu Aug 22 20:50:31 2013
@@ -129,10 +129,9 @@ public class ThemeManagerImpl implements
 	}
 
 	/**
-	 * @see org.apache.roller.weblogger.model.ThemeManager#getTheme(java.lang.String)
+	 * @see org.apache.roller.weblogger.business.themes.ThemeManager#getTheme(java.lang.String)
 	 */
-	public SharedTheme getTheme(String id) throws ThemeNotFoundException,
-			WebloggerException {
+	public SharedTheme getTheme(String id) throws WebloggerException {
 
 		// try to lookup theme from library
 		SharedTheme theme = (SharedTheme) this.themes.get(id);
@@ -146,7 +145,7 @@ public class ThemeManagerImpl implements
 	}
 
 	/**
-	 * @see org.apache.roller.weblogger.model.ThemeManager#getTheme(weblog)
+	 * @see org.apache.roller.weblogger.business.themes.ThemeManager#getTheme(Weblog)
 	 */
 	public WeblogTheme getTheme(Weblog weblog) throws WebloggerException {
 
@@ -163,7 +162,6 @@ public class ThemeManagerImpl implements
 
 			// otherwise we are returning a WeblogSharedTheme
 		} else {
-			ThemeManager themeMgr = roller.getThemeManager();
 			SharedTheme staticTheme = (SharedTheme) this.themes.get(weblog
 					.getEditorTheme());
 			if (staticTheme != null) {
@@ -180,23 +178,23 @@ public class ThemeManagerImpl implements
 	}
 
 	/**
-	 * @see org.apache.roller.weblogger.model.ThemeManager#getEnabledThemesList()
+	 * @see org.apache.roller.weblogger.business.themes.ThemeManager#getEnabledThemesList()
 	 * 
 	 *      TODO: reimplement enabled vs. disabled logic once we support it
 	 */
 	public List getEnabledThemesList() {
 
-		List all_themes = new ArrayList(this.themes.values());
+		List allThemes = new ArrayList(this.themes.values());
 
 		// sort 'em ... default ordering for themes is by name
-		Collections.sort(all_themes);
+		Collections.sort(allThemes);
 
-		return all_themes;
+		return allThemes;
 	}
 
 	/**
-	 * @see org.apache.roller.weblogger.model.ThemeManager#importTheme(website,
-	 *      theme)
+	 * @see org.apache.roller.weblogger.business.themes.ThemeManager#importTheme(Weblog,
+	 *      SharedTheme)
 	 */
 	public void importTheme(Weblog website, SharedTheme theme)
 			throws WebloggerException {
@@ -208,8 +206,10 @@ public class ThemeManagerImpl implements
 		MediaFileManager fileMgr = roller.getMediaFileManager();
 
 		MediaFileDirectory root = fileMgr.getMediaFileRootDirectory(website);
-		log.warn("Weblog " + website.getHandle()
-				+ " does not have a root MediaFile directory");
+        if (root == null) {
+            log.warn("Weblog " + website.getHandle()
+                    + " does not have a root MediaFile directory");
+        }
 
 		Set importedActionTemplates = new HashSet();
 		ThemeTemplate themeTemplate = null;
@@ -356,8 +356,9 @@ public class ThemeManagerImpl implements
 				} else {
 					justPath = resourcePath.substring(0,
 							resourcePath.lastIndexOf('/'));
-					if (!justPath.startsWith("/"))
-						justPath = "/" + justPath;
+					if (!justPath.startsWith("/")) {
+                        justPath = "/" + justPath;
+                    }
 					justName = resourcePath.substring(resourcePath
 							.lastIndexOf('/') + 1);
 					mdir = fileMgr.getMediaFileDirectoryByPath(website,
@@ -428,21 +429,19 @@ public class ThemeManagerImpl implements
 		if (themenames == null) {
 			log.warn("No themes loaded!  Perhaps you specified the wrong "
 					+ "location for your themes directory?");
-		}
-
-		// now go through each theme and load it into a Theme object
-		for (int i = 0; i < themenames.length; i++) {
-			try {
-				Theme theme = new SharedThemeFromDir(this.themeDir
-						+ File.separator + themenames[i]);
-				if (theme != null) {
-					themeMap.put(theme.getId(), theme);
-				}
-			} catch (Exception unexpected) {
-				// shouldn't happen, so let's learn why it did
-				log.error("Problem reading theme " + themenames[i], unexpected);
-			}
-		}
+		} else {
+            // now go through each theme and load it into a Theme object
+            for (String themeName : themenames) {
+                try {
+                    Theme theme = new SharedThemeFromDir(this.themeDir
+                            + File.separator + themeName);
+                    themeMap.put(theme.getId(), theme);
+                } catch (Exception unexpected) {
+                    // shouldn't happen, so let's learn why it did
+                    log.error("Problem reading theme " + themeName, unexpected);
+                }
+            }
+        }
 
 		return themeMap;
 	}

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java Thu Aug 22 20:50:31 2013
@@ -39,9 +39,7 @@ import org.apache.commons.logging.LogFac
  * This class unmarshalls a theme descriptor into a set of objects.
  */
 public class ThemeMetadataParser {
-   
-    private static Log log = LogFactory.getLog(ThemeMetadataParser.class);
-    
+
     /**
      * Unmarshall the given input stream into our defined
      * set of Java objects.
@@ -49,8 +47,9 @@ public class ThemeMetadataParser {
     public ThemeMetadata unmarshall(InputStream instream)
         throws ThemeParsingException, IOException, JDOMException {
         
-        if(instream == null)
+        if(instream == null) {
             throw new IOException("InputStream is null!");
+        }
         
         ThemeMetadata theme = new ThemeMetadata();
         
@@ -71,7 +70,7 @@ public class ThemeMetadataParser {
         
         // now grab the preview image path
         Element previewImage = root.getChild("preview-image");
-        if(previewImage != null) {
+        if (previewImage != null) {
             theme.setPreviewImage(previewImage.getAttributeValue("path"));
         } else {
             throw new ThemeParsingException("No preview image specified");
@@ -79,7 +78,7 @@ public class ThemeMetadataParser {
         
         // grab the stylesheet if it exists
         Element stylesheet = root.getChild("stylesheet");
-        if(stylesheet != null) {
+        if (stylesheet != null) {
             theme.setStylesheet(elementToStylesheet(stylesheet));
 
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java Thu Aug 22 20:50:31 2013
@@ -99,7 +99,9 @@ public class WeblogCategory implements S
     
     public boolean equals(Object other) {
         
-        if (other == null) return false;
+        if (other == null) {
+            return false;
+        }
         
         if (other instanceof WeblogCategory) {
             WeblogCategory o = (WeblogCategory)other;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/UserWrapper.java Thu Aug 22 20:50:31 2013
@@ -27,7 +27,7 @@ import org.apache.roller.weblogger.util.
 /**
  * Pojo safety wrapper for User objects.
  */
-public class UserWrapper {
+public final class UserWrapper {
     
     // keep a reference to the wrapped pojo
     private final User pojo;
@@ -36,19 +36,18 @@ public class UserWrapper {
     private UserWrapper(User toWrap) {
         this.pojo = toWrap;
     }
-    
-    
+
     // wrap the given pojo if it is not null
     public static UserWrapper wrap(User toWrap) {
-        if(toWrap != null)
+        if(toWrap != null) {
             return new UserWrapper(toWrap);
-        
+        }
         return null;
     }
     
     
     /**
-     * This is here for backwards compatability.  We no longer allow the
+     * This is here for backwards compatibility.  We no longer allow the
      * username to be displayed publicly, so screen name is returned instead.
      */
     public String getUserName() {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java Thu Aug 22 20:50:31 2013
@@ -32,7 +32,7 @@ import org.apache.roller.weblogger.pojos
 /**
  * Pojo safety wrapper for WeblogBookmarkFolder object.
  */
-public class WeblogBookmarkFolderWrapper {
+public final class WeblogBookmarkFolderWrapper {
     
     // keep a reference to the wrapped pojo
     private final WeblogBookmarkFolder pojo;
@@ -45,9 +45,9 @@ public class WeblogBookmarkFolderWrapper
     
     // wrap the given pojo if it is not null
     public static WeblogBookmarkFolderWrapper wrap(WeblogBookmarkFolder toWrap) {
-        if(toWrap != null)
+        if (toWrap != null) {
             return new WeblogBookmarkFolderWrapper(toWrap);
-        
+        }
         return null;
     }
     
@@ -71,17 +71,10 @@ public class WeblogBookmarkFolderWrapper
         return this.pojo.getPath();
     }
     
-    // NOTE: removing this for 4.0 since there is really no need for this in templates
-//    public WeblogWrapper getWebsite() {
-//        return WeblogWrapper.wrap(this.pojo.getWebsite());
-//    }
-    
-    
     public WeblogBookmarkFolderWrapper getParent() {
         return WeblogBookmarkFolderWrapper.wrap(this.pojo.getParent());
     }
     
-    
     public List getFolders() {
         Set initialCollection = this.pojo.getFolders();
         
@@ -138,7 +131,6 @@ public class WeblogBookmarkFolderWrapper
         return wrappedCollection;
     }
     
-    
     // TODO: this method won't actually work and we probably don't need it here anyways?
     public boolean descendentOf(WeblogBookmarkFolder ancestor) {
         return this.pojo.descendentOf(ancestor);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java Thu Aug 22 20:50:31 2013
@@ -24,7 +24,7 @@ import org.apache.roller.weblogger.pojos
 /**
  * Pojo safety wrapper for WeblogEntryAttribute object.
  */
-public class WeblogEntryAttributeWrapper {
+public final class WeblogEntryAttributeWrapper {
     
     // keep a reference to the wrapped pojo
     private final WeblogEntryAttribute pojo;
@@ -37,23 +37,12 @@ public class WeblogEntryAttributeWrapper
     
     // wrap the given pojo if it is not null
     public static WeblogEntryAttributeWrapper wrap(WeblogEntryAttribute toWrap) {
-        if(toWrap != null)
+        if (toWrap != null) {
             return new WeblogEntryAttributeWrapper(toWrap);
-        
+        }
         return null;
     }
     
-    // NOTD: removing this for 4.0 because there is no need for it
-//    public String getId() {
-//        return this.pojo.getId();
-//    }
-    
-    // NOTE: removing this for 4.0 because there is no need for it
-//    public WeblogEntryWrapper getEntry() {
-//        return WeblogEntryWrapper.wrap(this.pojo.getEntry());
-//    }
-    
-    
     public String getName() {
         return this.pojo.getName();
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java Thu Aug 22 20:50:31 2013
@@ -25,7 +25,7 @@ import org.apache.roller.weblogger.pojos
 /**
  * Pojo safety wrapper for WeblogEntryTag objects.
  */
-public class WeblogEntryTagWrapper {
+public final class WeblogEntryTagWrapper {
     
     // keep a reference to the wrapped pojo
     private final WeblogEntryTag pojo;
@@ -39,28 +39,13 @@ public class WeblogEntryTagWrapper {
     
     // wrap the given pojo if it is not null
     public static WeblogEntryTagWrapper wrap(WeblogEntryTag toWrap) {
-        if(toWrap != null)
+        if (toWrap != null) {
             return new WeblogEntryTagWrapper(toWrap);
+        }
         
         return null;
     }
     
-    // NOTE: removing for 4.0 because it is not necessary
-//    public String getId() {
-//        return this.pojo.getId();
-//    }
-    
-    // NOTE: removing for 4.0 because it is not necessary
-//    public WeblogWrapper getWeblog() {
-//        return WeblogWrapper.wrap(this.pojo.getWeblog());
-//    }
-    
-    // NOTE: removing for 4.0 because it is not necessary
-//    public WeblogEntryWrapper getWeblogEntry() {
-//        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
-//    }
-    
-    
     public UserWrapper getUser() {
         return UserWrapper.wrap(this.pojo.getUser());
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java Thu Aug 22 20:50:31 2013
@@ -57,9 +57,9 @@ public class WeblogEntryWrapper {
     
     // wrap the given pojo if it is not null
     public static WeblogEntryWrapper wrap(WeblogEntry toWrap, URLStrategy strat) {
-        if(toWrap != null)
+        if(toWrap != null) {
             return new WeblogEntryWrapper(toWrap, strat);
-        
+        }
         return null;
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java Thu Aug 22 20:50:31 2013
@@ -43,8 +43,9 @@ public class WeblogReferrerWrapper {
     
     // wrap the given pojo if it is not null
     public static WeblogReferrerWrapper wrap(WeblogReferrer toWrap, URLStrategy strat) {
-        if(toWrap != null)
+        if(toWrap != null) {
             return new WeblogReferrerWrapper(toWrap, strat);
+        }
         
         return null;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java Thu Aug 22 20:50:31 2013
@@ -35,7 +35,7 @@ import org.apache.roller.weblogger.pojos
 /**
  * Pojo safety wrapper for Weblog objects.
  */
-public class WeblogWrapper {
+public final class WeblogWrapper {
     
     // keep a reference to the wrapped pojo
     private final Weblog pojo;
@@ -52,9 +52,9 @@ public class WeblogWrapper {
     
     // wrap the given pojo if it is not null with detected type
     public static WeblogWrapper wrap(Weblog toWrap, URLStrategy strat) {
-        if(toWrap != null)
+        if (toWrap != null) {
             return new WeblogWrapper(toWrap, strat);
-        
+        }
         return null;
     }
 

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=1516602&r1=1516601&r2=1516602&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 Thu Aug 22 20:50:31 2013
@@ -42,7 +42,6 @@ import org.apache.roller.weblogger.ui.re
  * instance.
  */
 public class ValidateSaltFilter implements Filter {
-	private static Log log = LogFactory.getLog(ValidateSaltFilter.class);
 	private Set<String> ignored = new HashSet<String>();
 
 	// @Override
@@ -50,19 +49,17 @@ public class ValidateSaltFilter implemen
 			FilterChain chain) throws IOException, ServletException {
 		HttpServletRequest httpReq = (HttpServletRequest) request;
 
-		if (httpReq.getMethod().equals("POST")) {
+        // TODO multipart/form-data does not send parameters
+        if (httpReq.getMethod().equals("POST") &&
+                !isIgnoredURL(((HttpServletRequest) request).getServletPath())) {
+            String salt = (String) httpReq.getParameter("salt");
+            SaltCache saltCache = SaltCache.getInstance();
+            if (salt == null || saltCache.get(salt) == null
+                    || saltCache.get(salt).equals(false)) {
+                throw new ServletException("Security Violation");
+            }
+        }
 
-			// TODO multipart/form-data does not send parameters
-			if (!isIgnoredURL(((HttpServletRequest) request).getServletPath())) {
-				String salt = (String) httpReq.getParameter("salt");
-				SaltCache saltCache = SaltCache.getInstance();
-				if (salt == null || saltCache.get(salt) == null
-						|| saltCache.get(salt).equals(false)) {
-					throw new ServletException("Security Violation");
-				}
-			}
-
-		}
 		chain.doFilter(request, response);
 	}
 
@@ -72,9 +69,9 @@ public class ValidateSaltFilter implemen
 		// Construct our list of ignord urls
 		String urls = WebloggerConfig.getProperty("salt.ignored.urls");
 		String[] urlsArray = StringUtils.stripAll(StringUtils.split(urls, ","));
-		for (int i = 0; i < urlsArray.length; i++)
-			this.ignored.add(urlsArray[i]);
-
+		for (int i = 0; i < urlsArray.length; i++) {
+            this.ignored.add(urlsArray[i]);
+        }
 	}
 
 	// @Override
@@ -90,14 +87,12 @@ public class ValidateSaltFilter implemen
 	 * @return true, if is ignored resource
 	 */
 	private boolean isIgnoredURL(String theUrl) {
-
 		int i = theUrl.lastIndexOf('/');
 
-		// If its not a resource then do not ignore it
-		if (i <= 0 || i == theUrl.length() - 1)
-			return false;
-
+		// If it's not a resource then don't ignore it
+		if (i <= 0 || i == theUrl.length() - 1) {
+            return false;
+        }
 		return ignored.contains(theUrl.substring(i + 1));
-
 	}
 }
\ No newline at end of file

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java Thu Aug 22 20:50:31 2013
@@ -45,7 +45,9 @@ import javax.servlet.jsp.tagext.TagSuppo
 public class CalendarTag extends TagSupport {
     private static Log mLogger =
             LogFactory.getFactory().getInstance(CalendarTag.class);
-    
+
+    private Locale mLocale = Locale.getDefault();
+
     // JSP Attributes
     
     /** @jsp.attribute required="true" */
@@ -71,11 +73,11 @@ public class CalendarTag extends TagSupp
     
     // not a tag attribute
     public void setLocale(Locale locale) {
-        if (locale != null)
+        if (locale != null) {
             mLocale = locale;
+        }
     }
-    private Locale mLocale = Locale.getDefault();
-    
+
     // not a tag attribute
     /*
     private TimeZone mTimeZone = TimeZone.getDefault();
@@ -148,9 +150,6 @@ public class CalendarTag extends TagSupp
             // formatter Month-Year title of calendar
             SimpleDateFormat formatTitle = new SimpleDateFormat("MMMM yyyy", mLocale);
             
-            HttpServletRequest request =
-                    (HttpServletRequest)pageContext.getRequest();
-            
             // get Resource Bundle
             ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources", mLocale);
             

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=1516602&r1=1516601&r2=1516602&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 Thu Aug 22 20:50:31 2013
@@ -104,8 +104,9 @@ public class WeblogRequestMapper impleme
                 
         if(servlet != null && servlet.trim().length() > 1) {
             
-            if(request.getContextPath() != null)
+            if(request.getContextPath() != null) {
                 servlet = servlet.substring(request.getContextPath().length());
+            }
             
             // strip off the leading slash
             servlet = servlet.substring(1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/CalendarModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/CalendarModel.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/CalendarModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/CalendarModel.java Thu Aug 22 20:50:31 2013
@@ -85,7 +85,9 @@ public class CalendarModel implements Mo
     
     private String showWeblogEntryCalendar(WeblogWrapper websiteWrapper, String catArgument, boolean big) {
         
-        if ("nil".equals(catArgument)) catArgument = null;        
+        if ("nil".equals(catArgument)) {
+            catArgument = null;
+        }
         String ret = null;
         try {
             org.apache.roller.weblogger.ui.core.tags.calendar.CalendarModel model = null;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java Thu Aug 22 20:50:31 2013
@@ -64,7 +64,9 @@ public class PlanetModel implements Mode
     
     public void init(Map initData) throws WebloggerException {
 
-        if (!WebloggerConfig.getBooleanProperty("planet.aggregator.enabled")) return;
+        if (!WebloggerConfig.getBooleanProperty("planet.aggregator.enabled")) {
+            return;
+        }
         
         // we expect the init data to contain a weblogRequest object
         this.weblogRequest = (WeblogRequest) initData.get("parsedRequest");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java Thu Aug 22 20:50:31 2013
@@ -62,31 +62,30 @@ public class WeblogEntriesPreviewPager e
     
     
     public Map getEntries() {
-        if (entries == null) try {
-            Weblogger roller = WebloggerFactory.getWeblogger();
-            WeblogEntryManager wmgr = roller.getWeblogEntryManager();
-            currEntry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
-            if (currEntry != null) {
-                
-                // clone the entry since we don't want to work with the real pojo
-                WeblogEntry tmpEntry = new WeblogEntry();
-                tmpEntry.setData(currEntry);
-                
-                // set the pubtime to the current time if it is unset
-                if(tmpEntry.getPubTime() == null) {
-                    tmpEntry.setPubTime(new Timestamp(System.currentTimeMillis()));
+        if (entries == null) {
+            try {
+                Weblogger roller = WebloggerFactory.getWeblogger();
+                WeblogEntryManager wmgr = roller.getWeblogEntryManager();
+                currEntry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
+                if (currEntry != null) {
+
+                    // clone the entry since we don't want to work with the real pojo
+                    WeblogEntry tmpEntry = new WeblogEntry();
+                    tmpEntry.setData(currEntry);
+
+                    // set the pubtime to the current time if it is unset
+                    if(tmpEntry.getPubTime() == null) {
+                        tmpEntry.setPubTime(new Timestamp(System.currentTimeMillis()));
+                    }
+
+                    // store the entry in the collection
+                    entries = new TreeMap();
+                    entries.put(tmpEntry.getPubTime(),Collections.singletonList(WeblogEntryWrapper.wrap(tmpEntry, urlStrategy)));
                 }
-                
-                // store the entry in the collection
-                entries = new TreeMap();
-                entries.put(tmpEntry.getPubTime(),Collections.singletonList(WeblogEntryWrapper.wrap(tmpEntry, urlStrategy)));
+            } catch (Exception e) {
+                log.error("ERROR: fetching entry", e);
             }
-        } catch (Exception e) {
-            log.error("ERROR: fetching entry", e);
         }
-
-
-        
         return entries;
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java Thu Aug 22 20:50:31 2013
@@ -92,10 +92,12 @@ public class GlobalCommentManagementBean
     }
     
     public Date getStartDate() {
-        if(!StringUtils.isEmpty(getStartDateString())) try {
-            DateFormat df = new SimpleDateFormat("MM/dd/yy");
-            return df.parse(getStartDateString());
-        } catch(Exception e) { }
+        if(!StringUtils.isEmpty(getStartDateString())) {
+            try {
+                DateFormat df = new SimpleDateFormat("MM/dd/yy");
+                return df.parse(getStartDateString());
+            } catch(Exception e) { }
+        }
         return null;
     }
 
@@ -144,19 +146,19 @@ public class GlobalCommentManagementBean
     }
 
     public String[] getSpamComments() {
-        return spamComments;
+        return spamComments.clone();
     }
 
     public void setSpamComments(String[] spamComments) {
-        this.spamComments = spamComments;
+        this.spamComments = spamComments.clone();
     }
 
     public String[] getDeleteComments() {
-        return deleteComments;
+        return deleteComments.clone();
     }
 
     public void setDeleteComments(String[] deleteComments) {
-        this.deleteComments = deleteComments;
+        this.deleteComments = deleteComments.clone();
     }
 
     public String getApprovedString() {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java Thu Aug 22 20:50:31 2013
@@ -150,14 +150,16 @@ public class GlobalConfig extends UIActi
      * Save global properties.
      */
     public String save() {
-        if (!"POST".equals(httpMethod)) return ERROR;
+        if (!"POST".equals(httpMethod)) {
+            return ERROR;
+        }
         
         // only set values for properties that are already defined
         String propName = null;
         RuntimeConfigProperty updProp = null;
         String incomingProp = null;
         Iterator propsIT = getProperties().keySet().iterator();
-        while(propsIT.hasNext()) {
+        while (propsIT.hasNext()) {
             propName = (String) propsIT.next();
             updProp = (RuntimeConfigProperty) getProperties().get(propName);
             incomingProp = this.getParameter(updProp.getName());
@@ -172,10 +174,12 @@ public class GlobalConfig extends UIActi
             if( updProp.getValue() != null // null check needed w/Oracle
                     && (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
                 
-                if(incomingProp == null || !incomingProp.equals("on"))
+                if(incomingProp == null || !incomingProp.equals("on")) {
                     incomingProp = "false";
-                else
+                }
+                else {
                     incomingProp = "true";
+                }
             }
             
             // only work on props that were submitted with the request
@@ -218,7 +222,7 @@ public class GlobalConfig extends UIActi
     public void setParameters(Map parameters) {
         this.params = parameters;
         
-        if(log.isDebugEnabled()) {
+        if (log.isDebugEnabled()) {
             log.debug("Parameter map:");
             Set<String> keys = parameters.keySet();
             for(String key : keys) {
@@ -263,11 +267,11 @@ public class GlobalConfig extends UIActi
     }
     
     public String[] getCommentPlugins() {
-        return commentPlugins;
+        return commentPlugins.clone();
     }
 
     public void setCommentPlugins(String[] commentPlugins) {
-        this.commentPlugins = commentPlugins;
+        this.commentPlugins = commentPlugins.clone();
     }
 
     public void setServletRequest(HttpServletRequest req) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java Thu Aug 22 20:50:31 2013
@@ -58,20 +58,22 @@ public abstract class PingTargetAddBase 
         // If there are errors, go back to the target edit page.
         myValidate(pingTarget);
         
-        if(!hasActionErrors()) try {
-            // Appears to be ok.  Save it and flush.
-            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
-            pingTargetMgr.savePingTarget(pingTarget);
-            WebloggerFactory.getWeblogger().flush();
-            
-            addMessage("pingTarget.saved");
-            
-            return SUCCESS;
-            
-        } catch (WebloggerException ex) {
-            getLogger().error("Error adding ping target", ex);
-            // TODO: i18n
-            addError("Error adding ping target.");
+        if(!hasActionErrors()) {
+            try {
+                // Appears to be ok.  Save it and flush.
+                PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
+                pingTargetMgr.savePingTarget(pingTarget);
+                WebloggerFactory.getWeblogger().flush();
+
+                addMessage("pingTarget.saved");
+
+                return SUCCESS;
+
+            } catch (WebloggerException ex) {
+                getLogger().error("Error adding ping target", ex);
+                // TODO: i18n
+                addError("Error adding ping target.");
+            }
         }
         
         return INPUT;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java Thu Aug 22 20:50:31 2013
@@ -102,18 +102,19 @@ public abstract class PingTargetEditBase
         // If there are errors, go back to the target edit page.
         myValidate(getPingTarget());
         
-        if(!hasActionErrors()) try {
-            // Appears to be ok.  Save it and flush.
-            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
-            pingTargetMgr.savePingTarget(getPingTarget());
-            WebloggerFactory.getWeblogger().flush();
-            
-            addMessage("pingTarget.saved");
-            
-        } catch (WebloggerException ex) {
-            getLogger().error("Error saving ping target", ex);
-            // TODO: i18n
-            addError("Error saving ping target.");
+        if (!hasActionErrors()) {
+            try {
+                // Appears to be ok.  Save it and flush.
+                PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
+                pingTargetMgr.savePingTarget(getPingTarget());
+                WebloggerFactory.getWeblogger().flush();
+
+                addMessage("pingTarget.saved");
+            } catch (WebloggerException ex) {
+                getLogger().error("Error saving ping target", ex);
+                // TODO: i18n
+                addError("Error saving ping target.");
+            }
         }
         
         return INPUT;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java Thu Aug 22 20:50:31 2013
@@ -166,17 +166,19 @@ public class CreateWeblog extends UIActi
         // make sure theme was specified and is a valid value
         
         // make sure handle isn't already taken
-        if(!StringUtils.isEmpty(getBean().getHandle())) try {
-            if (WebloggerFactory.getWeblogger().getWeblogManager()
-                    .getWeblogByHandle(getBean().getHandle()) != null) {
-                addError("createWeblog.error.handleExists");
-                // reset handle
-                getBean().setHandle(null);
+        if(!StringUtils.isEmpty(getBean().getHandle())) {
+            try {
+                if (WebloggerFactory.getWeblogger().getWeblogManager()
+                        .getWeblogByHandle(getBean().getHandle()) != null) {
+                    addError("createWeblog.error.handleExists");
+                    // reset handle
+                    getBean().setHandle(null);
+                }
+            } catch (WebloggerException ex) {
+                log.error("error checking for weblog", ex);
+                // TODO: i18n
+                addError("unexpected error");
             }
-        } catch (WebloggerException ex) {
-            log.error("error checking for weblog", ex);
-            // TODO: i18n
-            addError("unexpected error");
         }
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/OAuthAuthorize.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/OAuthAuthorize.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/OAuthAuthorize.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/OAuthAuthorize.java Thu Aug 22 20:50:31 2013
@@ -51,8 +51,6 @@ public class OAuthAuthorize extends UIAc
     @SkipValidation
     @Override
     public String execute() {
-        boolean flush = false;
-        
         try {
             User ud = getAuthenticatedUser();
 
@@ -96,6 +94,8 @@ public class OAuthAuthorize extends UIAc
         this.appDesc = (String)request.getAttribute("CONS_DESC");
         this.token = (String)request.getAttribute("TOKEN");
         this.callback = (String)request.getAttribute("CALLBACK");
-        if (this.getCallback() == null) this.callback = "";
+        if (this.getCallback() == null) {
+            this.callback = "";
+        }
     }
 }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java Thu Aug 22 20:50:31 2013
@@ -101,30 +101,32 @@ public class BookmarkAdd extends UIActio
         // validation
         myValidate();
         
-        if(!hasActionErrors()) try {
-            
-            WeblogBookmark newBookmark = new WeblogBookmark();
-            newBookmark.setFolder(getFolder());
-            getBean().copyTo(newBookmark);
-            
-            BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
-            bmgr.saveBookmark(newBookmark);
-            WebloggerFactory.getWeblogger().flush();
-            
-            CacheManager.invalidate(newBookmark);
-            
-            // TODO: i18n
-            addMessage("bookmark added");
-            
-            // Set for next action
-            getBean().setId(newBookmark.getId());
-            
-            return SUCCESS;
-            
-        } catch(Exception ex) {
-            log.error("Error saving new bookmark", ex);
-            // TODO: i18n
-            addError("Error saving new bookmark");
+        if(!hasActionErrors()) {
+            try {
+
+                WeblogBookmark newBookmark = new WeblogBookmark();
+                newBookmark.setFolder(getFolder());
+                getBean().copyTo(newBookmark);
+
+                BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
+                bmgr.saveBookmark(newBookmark);
+                WebloggerFactory.getWeblogger().flush();
+
+                CacheManager.invalidate(newBookmark);
+
+                // TODO: i18n
+                addMessage("bookmark added");
+
+                // Set for next action
+                getBean().setId(newBookmark.getId());
+
+                return SUCCESS;
+
+            } catch(Exception ex) {
+                log.error("Error saving new bookmark", ex);
+                // TODO: i18n
+                addError("Error saving new bookmark");
+            }
         }
 
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java Thu Aug 22 20:50:31 2013
@@ -42,6 +42,10 @@ public final class BookmarksImport exten
     
     private static Log log = LogFactory.getLog(BookmarksImport.class);
     
+    // only write files out that are below this threshold
+    private static final long WRITE_THRESHOLD_IN_MB = 4;
+    private static final long WRITE_THRESHOLD = WRITE_THRESHOLD_IN_MB * 1024000;
+
     // uploaded opml file
     private File opmlFile = null;
     
@@ -81,64 +85,63 @@ public final class BookmarksImport exten
         BookmarkManager bm = WebloggerFactory.getWeblogger().getBookmarkManager();
         
         InputStream stream = null;
-        if(getOpmlFile() != null && getOpmlFile().exists()) try {
-            
-            //only write files out that are less than 4MB
-            if (getOpmlFile().length() < (4*1024000)) {
-                
-                stream = new FileInputStream(getOpmlFile());
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                
-                byte[] buffer = new byte[8192];
-                int bytesRead = 0;
-                while ((bytesRead=stream.read(buffer,0,8192)) != -1) {
-                    baos.write(buffer, 0, bytesRead);
+        if(getOpmlFile() != null && getOpmlFile().exists()) {
+            try {
+                //only write files out that are less than 4MB
+                if (getOpmlFile().length() < WRITE_THRESHOLD) {
+
+                    stream = new FileInputStream(getOpmlFile());
+                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+                    byte[] buffer = new byte[8192];
+                    int bytesRead = 0;
+                    while ((bytesRead=stream.read(buffer,0,8192)) != -1) {
+                        baos.write(buffer, 0, bytesRead);
+                    }
+                    String data = new String(baos.toByteArray());
+
+                    SimpleDateFormat formatter =
+                            new SimpleDateFormat("yyyyMMddHHmmss");
+                    Date now = new Date();
+                    String folderName = "imported-" + formatter.format(now);
+
+                    // Use Roller BookmarkManager to import bookmarks
+                    bm.importBookmarks(getActionWeblog(), folderName, data);
+                    WebloggerFactory.getWeblogger().flush();
+
+                    // notify caches
+                    CacheManager.invalidate(getActionWeblog());
+
+                    // message to user
+                    addMessage("bookmarksImport.imported", folderName);
+
+                    // destroy the temporary file created
+                    getOpmlFile().delete();
+
+                    return SUCCESS;
+
+                } else {
+                    String data = "The file is greater than " + WRITE_THRESHOLD_IN_MB
+                            +" MB, and has not been written to stream."
+                            +" File Size: "+getOpmlFile().length()+" bytes. "
+                            +" This is a limitation of this particular "
+                            +" web application";
+                    addError("bookmarksImport.error", data);
                 }
-                String data = new String(baos.toByteArray());
-                
-                SimpleDateFormat formatter =
-                        new SimpleDateFormat("yyyyMMddHHmmss");
-                Date now = new Date();
-                String folderName = "imported-" + formatter.format(now);
-                
-                // Use Roller BookmarkManager to import bookmarks
-                bm.importBookmarks(getActionWeblog(), folderName, data);
-                WebloggerFactory.getWeblogger().flush();
-                
-                // notify caches
-                CacheManager.invalidate(getActionWeblog());
-                
-                // message to user
-                addMessage("bookmarksImport.imported", folderName);
-                
-                // destroy the temporary file created
-                getOpmlFile().delete();
-                
-                return SUCCESS;
-                
-            } else {
-                String data = "The file is greater than 4MB, "
-                        +" and has not been written to stream."
-                        +" File Size: "+getOpmlFile().length()+" bytes. "
-                        +" This is a limitation of this particular "
-                        +" web application";
-                addError("bookmarksImport.error", data);
-            }
-            
-        } catch (Exception ex) {
-            log.error("ERROR: importing bookmarks", ex);
-            // TODO: i18n
-            addError("bookmarksImport.error", ex.toString());
-        } finally {
-            if (stream != null) {
-                try {
-                    stream.close();
-                } catch (Exception e) {
-                    log.error("Closing stream",e);
+            } catch (Exception ex) {
+                log.error("ERROR: importing bookmarks", ex);
+                // TODO: i18n
+                addError("bookmarksImport.error", ex.toString());
+            } finally {
+                if (stream != null) {
+                    try {
+                        stream.close();
+                    } catch (Exception e) {
+                        log.error("Closing stream",e);
+                    }
                 }
             }
         }
-        
         return INPUT;
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java Thu Aug 22 20:50:31 2013
@@ -105,35 +105,37 @@ public class CategoryAdd extends UIActio
         // validation
         myValidate();
         
-        if(!hasActionErrors()) try {
-            
-            WeblogCategory newCategory = new WeblogCategory(
-                    getActionWeblog(),
-                    getCategory(),
-                    getBean().getName(),
-                    getBean().getDescription(),
-                    getBean().getImage());
-            
-            // add new folder to parent
-            getCategory().addCategory(newCategory);
-            
-            // save changes
-            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            wmgr.saveWeblogCategory(newCategory);
-            WebloggerFactory.getWeblogger().flush();
-            
-            // notify caches
-            CacheManager.invalidate(newCategory);
-            
-            // TODO: i18n
-            addMessage("category added");
-            
-            return SUCCESS;
-            
-        } catch(Exception ex) {
-            log.error("Error saving new category", ex);
-            // TODO: i18n
-            addError("Error saving new category");
+        if(!hasActionErrors()) {
+            try {
+
+                WeblogCategory newCategory = new WeblogCategory(
+                        getActionWeblog(),
+                        getCategory(),
+                        getBean().getName(),
+                        getBean().getDescription(),
+                        getBean().getImage());
+
+                // add new folder to parent
+                getCategory().addCategory(newCategory);
+
+                // save changes
+                WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
+                wmgr.saveWeblogCategory(newCategory);
+                WebloggerFactory.getWeblogger().flush();
+
+                // notify caches
+                CacheManager.invalidate(newCategory);
+
+                // TODO: i18n
+                addMessage("category added");
+
+                return SUCCESS;
+
+            } catch(Exception ex) {
+                log.error("Error saving new category", ex);
+                // TODO: i18n
+                addError("Error saving new category");
+            }
         }
         
         return INPUT;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java Thu Aug 22 20:50:31 2013
@@ -105,26 +105,27 @@ public class CategoryEdit extends UIActi
         // validation
         myValidate();
         
-        if(!hasActionErrors()) try {
-            
-            // copy updated attributes
-            getBean().copyTo(getCategory());
-            
-            // save changes
-            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            wmgr.saveWeblogCategory(getCategory());
-            WebloggerFactory.getWeblogger().flush();
-            
-            // notify caches
-            CacheManager.invalidate(getCategory());
-            
-            // TODO: i18n
-            addMessage("category updated");
-            
-        } catch(Exception ex) {
-            log.error("Error saving category", ex);
-            // TODO: i18n
-            addError("Error saving category");
+        if(!hasActionErrors()) {
+            try {
+                // copy updated attributes
+                getBean().copyTo(getCategory());
+
+                // save changes
+                WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
+                wmgr.saveWeblogCategory(getCategory());
+                WebloggerFactory.getWeblogger().flush();
+
+                // notify caches
+                CacheManager.invalidate(getCategory());
+
+                // TODO: i18n
+                addMessage("category updated");
+
+            } catch(Exception ex) {
+                log.error("Error saving category", ex);
+                // TODO: i18n
+                addError("Error saving category");
+            }
         }
         
         return INPUT;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java Thu Aug 22 20:50:31 2013
@@ -101,10 +101,12 @@ public class CommentsBean {
     }
     
     public Date getStartDate() {
-        if(!StringUtils.isEmpty(getStartDateString())) try {
-            DateFormat df = new SimpleDateFormat("MM/dd/yy");
-            return df.parse(getStartDateString());
-        } catch(Exception e) { }
+        if(!StringUtils.isEmpty(getStartDateString())) {
+            try {
+                DateFormat df = new SimpleDateFormat("MM/dd/yy");
+                return df.parse(getStartDateString());
+            } catch(Exception e) { }
+        }
         return null;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets.java Thu Aug 22 20:50:31 2013
@@ -61,14 +61,15 @@ public class CustomPingTargets extends P
     
     
     public void loadPingTargets() {
-        
-        if(!PingConfig.getDisallowCustomTargets()) try {
-            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
-            setPingTargets(pingTargetMgr.getCustomPingTargets(getActionWeblog()));
-        } catch (WebloggerException ex) {
-            log.error("Error loading common ping targets", ex);
-            // TODO: i18n
-            addError("Error loading common ping targets");
+        if(!PingConfig.getDisallowCustomTargets()) {
+            try {
+                PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
+                setPingTargets(pingTargetMgr.getCustomPingTargets(getActionWeblog()));
+            } catch (WebloggerException ex) {
+                log.error("Error loading common ping targets", ex);
+                // TODO: i18n
+                addError("Error loading common ping targets");
+            }
         }
     }
     

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=1516602&r1=1516601&r2=1516602&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 Thu Aug 22 20:50:31 2013
@@ -50,6 +50,8 @@ import org.apache.struts2.interceptor.va
  */
 public final class EntryEdit extends EntryBase {
 
+    private static final long MINUTE_IN_MILLIS = 60000;
+
     private static Log log = LogFactory.getLog(EntryEdit.class);
 
     // bean for managing form data
@@ -123,7 +125,7 @@ public final class EntryEdit extends Ent
             return DENIED;
         }
 
-        if (!hasActionErrors())
+        if (!hasActionErrors()) {
             try {
                 WeblogEntryManager weblogMgr = WebloggerFactory.getWeblogger()
                         .getWeblogEntryManager();
@@ -156,7 +158,7 @@ public final class EntryEdit extends Ent
                     // SCHEDULED we only consider an entry future published if
                     // it is scheduled more than 1 minute into the future
                     if (entry.getPubTime().after(
-                            new Date(System.currentTimeMillis() + 60000))) {
+                            new Date(System.currentTimeMillis() + MINUTE_IN_MILLIS))) {
                         getBean().setStatus(WeblogEntry.SCHEDULED);
                     }
 
@@ -246,6 +248,7 @@ public final class EntryEdit extends Ent
                 // TODO: i18n
                 addError("Error saving new entry");
             }
+        }
 
         return INPUT;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java Thu Aug 22 20:50:31 2013
@@ -98,37 +98,38 @@ public class FolderAdd extends UIAction 
         // validation
         myValidate();
         
-        if(!hasActionErrors()) try {
-            
-            WeblogBookmarkFolder newFolder = new WeblogBookmarkFolder(
-                    getFolder(),
-                    getBean().getName(),
-                    getBean().getDescription(),
-                    getActionWeblog());
-            
-            // add new folder to parent
-            getFolder().addFolder(newFolder);
-            
-            // save changes
-            BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
-            bmgr.saveFolder(newFolder);
-            WebloggerFactory.getWeblogger().flush();
-            
-            // notify caches
-            CacheManager.invalidate(newFolder);
-            
-            // TODO: i18n
-            addMessage("folder added");
-            
-            // Set for next action
-            getBean().setId(newFolder.getId());
-            
-            return SUCCESS;
-            
-        } catch(Exception ex) {
-            log.error("Error saving new folder", ex);
-            // TODO: i18n
-            addError("Error saving new folder");
+        if(!hasActionErrors())  {
+            try {
+                WeblogBookmarkFolder newFolder = new WeblogBookmarkFolder(
+                        getFolder(),
+                        getBean().getName(),
+                        getBean().getDescription(),
+                        getActionWeblog());
+
+                // add new folder to parent
+                getFolder().addFolder(newFolder);
+
+                // save changes
+                BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
+                bmgr.saveFolder(newFolder);
+                WebloggerFactory.getWeblogger().flush();
+
+                // notify caches
+                CacheManager.invalidate(newFolder);
+
+                // TODO: i18n
+                addMessage("folder added");
+
+                // Set for next action
+                getBean().setId(newFolder.getId());
+
+                return SUCCESS;
+
+            } catch(Exception ex) {
+                log.error("Error saving new folder", ex);
+                // TODO: i18n
+                addError("Error saving new folder");
+            }
         }
 
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java?rev=1516602&r1=1516601&r2=1516602&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java Thu Aug 22 20:50:31 2013
@@ -106,26 +106,28 @@ public class FolderEdit extends UIAction
         // validation
         myValidate();
         
-        if(!hasActionErrors()) try {
-            
-            // copy updated attributes
-            getBean().copyTo(getFolder());
-            
-            // save changes
-            BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
-            bmgr.saveFolder(getFolder());
-            WebloggerFactory.getWeblogger().flush();
-            
-            // notify caches
-            CacheManager.invalidate(getFolder());
-            
-            // TODO: i18n
-            addMessage("folder updated");
-            
-        } catch(Exception ex) {
-            log.error("Error saving folder", ex);
-            // TODO: i18n
-            addError("Error saving folder");
+        if(!hasActionErrors()) {
+            try {
+
+                // copy updated attributes
+                getBean().copyTo(getFolder());
+
+                // save changes
+                BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
+                bmgr.saveFolder(getFolder());
+                WebloggerFactory.getWeblogger().flush();
+
+                // notify caches
+                CacheManager.invalidate(getFolder());
+
+                // TODO: i18n
+                addMessage("folder updated");
+
+            } catch(Exception ex) {
+                log.error("Error saving folder", ex);
+                // TODO: i18n
+                addError("Error saving folder");
+            }
         }
         
         return INPUT;



Mime
View raw message