roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1551670 [1/2] - in /roller/trunk/app/src: main/java/org/apache/roller/planet/pojos/ main/java/org/apache/roller/planet/tasks/ main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org...
Date Tue, 17 Dec 2013 19:50:27 GMT
Author: gmazza
Date: Tue Dec 17 19:50:26 2013
New Revision: 1551670

URL: http://svn.apache.org/r1551670
Log:
Fixed coding issues reported by IntelliJ, in particular reduction of iterators in favor of for-each loops and more parameterizing of Lists, Maps, etc.

Modified:
    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/UserManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/PluginManagerImpl.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/operations/RebuildWebsiteIndexOperation.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/ConfigDef.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/DisplayGroup.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/RuntimeConfigDefs.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.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/WeblogEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/RendererManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/filters/RequestMappingFilter.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager.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/webservices/adminprotocol/RollerMemberHandler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/tagdata/TagDataServlet.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/BookmarkTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/FolderFunctionalityTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/FolderParentDeletesTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/ui/ApplicationResourcesTest.java

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -35,7 +35,7 @@ import org.apache.roller.util.UUIDGenera
  * it should be replaced by more complete model that can fully represent all 
  * forms of RSS and Atom.
  */
-public class SubscriptionEntry implements Serializable, Comparable {
+public class SubscriptionEntry implements Serializable, Comparable<SubscriptionEntry> {
     
     // attributes
     private String id = UUIDGenerator.generateUUID();
@@ -59,8 +59,7 @@ public class SubscriptionEntry implement
     /**
      * Compare planet entries by comparing permalinks.
      */
-    public int compareTo(Object o) {
-        SubscriptionEntry other = (SubscriptionEntry)o;
+    public int compareTo(SubscriptionEntry other) {
         return getPermalink().compareTo(other.getPermalink());
     }
     

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -21,7 +21,6 @@ package org.apache.roller.planet.tasks;
 import java.io.File;
 import java.util.Collections;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -96,15 +95,14 @@ public class GeneratePlanetTask extends 
             List groups = Collections.EMPTY_LIST;
             // groups must be part of a planet now, so getGroupHandles() was removed
             //List groups = planetManager.getGroupHandles();
-            for (Iterator it = groups.iterator(); it.hasNext();) {
-                String groupHandle = (String) it.next();
+            for (Object groupHandle : groups) {
                 String groupDirName = outputDirObj + File.separator + groupHandle;
                 File groupDir = new File(groupDirName);
                 if (!groupDir.exists()) {
                     groupDir.mkdirs();
                 }
             }
-            
+
             // Generate files: execute control template
             Generator generator = Generator.getInstance();
             generator.setVelocityEngine(engine);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/UserManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/UserManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/UserManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/UserManager.java Tue Dec 17 19:50:26 2013
@@ -124,7 +124,7 @@ public interface UserManager {
      * @return List A list of UserDatUsers which match the criteria.
      * @throws WebloggerException If there is a problem.
      */
-    List getUsers(
+    List<User> getUsers(
             Boolean enabled,
             Date    startDate,
             Date    endDate,
@@ -141,7 +141,7 @@ public interface UserManager {
      * @param enabled    True for only enalbed, false for disabled, null for all
      * @return List of (up to length) users that match startsWith string
      */
-    List getUsersStartingWith(String startsWith,
+    List<User> getUsersStartingWith(String startsWith,
             Boolean enabled, int offset, int length) throws WebloggerException;
     
     
@@ -156,7 +156,7 @@ public interface UserManager {
     /** 
      * Get collection of users whose names begin with specified letter 
      */
-    List getUsersByLetter(char letter, int offset, int length)
+    List<User> getUsersByLetter(char letter, int offset, int length)
         throws WebloggerException;
     
         
@@ -338,7 +338,7 @@ public interface UserManager {
         
     /**
      * Returns true if user has role specified, should be used only for testing.
-     * @deprecated User checkPermission() instead.
+     * @deprecated Use checkPermission() instead.
      */
     boolean hasRole(String roleName, User user) throws WebloggerException;
     
@@ -346,7 +346,7 @@ public interface UserManager {
     /**
      * Get roles associated with user, should be used only for testing.
      * Get all roles associated with user.
-     * @deprecated User checkPermission() instead.
+     * @deprecated Use checkPermission() instead.
      */
     List<String> getRoles(User user) throws WebloggerException;
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java Tue Dec 17 19:50:26 2013
@@ -22,6 +22,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.pojos.TagStat;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.User;
@@ -72,11 +73,11 @@ public interface WeblogEntryManager {
      * @param sortBy     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
      * @param sortOrder  Sort order of ASCENDING or DESCENDING (null for DESCENDING)
      * @param offset     Offset into results for paging
-     * @param length     Max comments to return (or -1 for no limit)
+     * @param range
      * @return List of WeblogEntryData objects in reverse chrono order.
      * @throws WebloggerException
      */
-    List getWeblogEntries(
+    List<WeblogEntry> getWeblogEntries(
             Weblog website,
             User    user,
             Date        startDate,
@@ -102,7 +103,7 @@ public interface WeblogEntryManager {
      * @param catName    Category path or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
      * @param offset     Offset into results for paging
-     * @param length     Max comments to return (or -1 for no limit)
+     * @param range
      * @return Map of Lists, keyed by Date, and containing WeblogEntryData.
      * @throws WebloggerException
      */
@@ -128,7 +129,7 @@ public interface WeblogEntryManager {
      * @param catName    Category path or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
      * @param offset     Offset into results for paging
-     * @param length     Max comments to return (or -1 for no limit)
+     * @param range
      * @return Map of Lists, keyed by Date, and containing date strings.
      * @throws WebloggerException
      */
@@ -151,7 +152,7 @@ public interface WeblogEntryManager {
      * @param publishedOnly True to retrieve published articles only
      * @return        List of weblog entries in category
      */
-    List getWeblogEntries(WeblogCategory cat, boolean publishedOnly)
+    List<WeblogEntry> getWeblogEntries(WeblogCategory cat, boolean subcats)
             throws WebloggerException; 
     
     /** 
@@ -362,7 +363,7 @@ public interface WeblogEntryManager {
      * @return
      * @throws WebloggerException
      */
-    List getPopularTags(Weblog website, Date startDate, int offset, int limit)
+    List<TagStat> getPopularTags(Weblog website, Date startDate, int offset, int limit)
             throws WebloggerException;
     
     /**
@@ -374,7 +375,7 @@ public interface WeblogEntryManager {
      * @return
      * @throws WebloggerException
      */
-    List getTags(Weblog website, String sortBy, String startsWith, int offset, int limit)
+    List<TagStat> getTags(Weblog website, String sortBy, String startsWith, int offset, int limit)
             throws WebloggerException;    
     
     /**

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -29,7 +29,6 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.Weblog;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import javax.persistence.Query;
 import org.apache.roller.weblogger.business.Weblogger;
@@ -96,26 +95,25 @@ public class JPAAutoPingManagerImpl impl
         }
 
         PingQueueManager pingQueueMgr = roller.getPingQueueManager();
-        List applicableAutopings = getApplicableAutoPings(changedWeblogEntry);
-        for (Iterator i = applicableAutopings.iterator(); i.hasNext();) {
-            AutoPing autoPing = (AutoPing) i.next();
+        List<AutoPing> applicableAutopings = getApplicableAutoPings(changedWeblogEntry);
+        for (AutoPing autoPing : applicableAutopings) {
             pingQueueMgr.addQueueEntry(autoPing);
         }
     }
 
-    public List getAutoPingsByWebsite(Weblog website) throws WebloggerException {
+    public List<AutoPing> getAutoPingsByWebsite(Weblog website) throws WebloggerException {
         Query q = strategy.getNamedQuery("AutoPing.getByWebsite");
         q.setParameter(1, website);
         return q.getResultList();
     }
 
-    public List getAutoPingsByTarget(PingTarget pingTarget) throws WebloggerException {
+    public List<AutoPing> getAutoPingsByTarget(PingTarget pingTarget) throws WebloggerException {
         Query q = strategy.getNamedQuery("AutoPing.getByPingTarget");
         q.setParameter(1, pingTarget);
         return q.getResultList();
     }
 
-    public List getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException {
+    public List<AutoPing> getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException {
         return getAutoPingsByWebsite(changedWeblogEntry.getWebsite());
         //        return (List)strategy.newQuery(AutoPing.class, "AutoPing.getByWebsite")
         //            .execute(changedWeblogEntry.getWebsite());

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -19,7 +19,6 @@
 package org.apache.roller.weblogger.business.jpa;
 
 import java.io.StringReader;
-import java.util.Iterator;
 import java.util.List;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
@@ -167,24 +166,21 @@ public class JPABookmarkManagerImpl impl
         
         log.debug("Updating path tree for folder "+folder.getPath());
         
-        WeblogBookmarkFolder childFolder = null;
-        Iterator childFolders = folder.getFolders().iterator();
-        while(childFolders.hasNext()) {
-            childFolder = (WeblogBookmarkFolder) childFolders.next();
-            
+        //WeblogBookmarkFolder childFolder = null;
+        for (WeblogBookmarkFolder childFolder : folder.getFolders()) {
             log.debug("OLD child folder path was "+childFolder.getPath());
-            
+
             // update path and save
             if("/".equals(folder.getPath())) {
                 childFolder.setPath("/" + childFolder.getName());
             } else {
-                childFolder.setPath(folder.getPath() + "/" + 
-                    childFolder.getName());
+                childFolder.setPath(folder.getPath() + "/" +
+                        childFolder.getName());
             }
             saveFolder(childFolder);
-            
+
             log.debug("NEW child folder path is "+ childFolder.getPath());
-            
+
             // then make recursive call to update this folders children
             updatePathTree(childFolder);
         }
@@ -219,12 +215,9 @@ public class JPABookmarkManagerImpl impl
 
             // Iterate through children of OPML body, importing each
             Element body = doc.getRootElement().getChild("body");
-            Iterator iter = body.getChildren().iterator();
-            while (iter.hasNext()) {
-                Element elem = (Element)iter.next();
-                importOpmlElement( website, elem, newFolder );
+            for (Object elem : body.getChildren()) {
+                importOpmlElement(website, (Element) elem, newFolder );
             }
-
         } catch (Exception ex) {
             throw new WebloggerException(ex);
         }
@@ -296,10 +289,8 @@ public class JPABookmarkManagerImpl impl
             this.strategy.store(fd);
 
             // Import folder's children
-            Iterator iter = elem.getChildren("outline").iterator();
-            while ( iter.hasNext() ) {
-                Element subelem = (Element)iter.next();
-                importOpmlElement( website, subelem, fd  );
+            for (Object subelem : elem.getChildren("outline")) {
+                importOpmlElement( website, (Element) subelem, fd  );
             }
         }
     }
@@ -331,7 +322,7 @@ public class JPABookmarkManagerImpl impl
     }
 
     /**
-     * @see org.apache.roller.weblogger.model.BookmarkManager#retrieveBookmarks(
+     * @see org.apache.roller.weblogger.business.BookmarkManager#getBookmarks(
      *      org.apache.roller.weblogger.pojos.WeblogBookmarkFolder, boolean)
      */
     public List getBookmarks(WeblogBookmarkFolder folder, boolean subfolders) 
@@ -395,7 +386,6 @@ public class JPABookmarkManagerImpl impl
         if (null != parent) {
             return (getFolder(folder.getWebsite(), folder.getPath()) != null);
         }
-        
         return false;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -93,9 +93,9 @@ public class JPAPingQueueManagerImpl imp
         this.saveQueueEntry(pingQueueEntry);
     }
 
-    public List getAllQueueEntries() 
+    public List<PingQueueEntry> getAllQueueEntries()
             throws WebloggerException {
-        return (List)strategy.getNamedQuery(
+        return (List<PingQueueEntry>) strategy.getNamedQuery(
                 "PingQueueEntry.getAllOrderByEntryTime").getResultList();
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -23,11 +23,8 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.UnknownHostException;
 import java.util.List;
-import java.util.Iterator;
 import javax.persistence.Query;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.pings.PingTargetManager;
 import org.apache.roller.weblogger.pojos.PingTarget;
@@ -42,13 +39,8 @@ import org.apache.roller.weblogger.pojos
 @com.google.inject.Singleton
 public class JPAPingTargetManagerImpl implements PingTargetManager {
     
-    /** The logger instance for this class. */
-    private static Log log = LogFactory.getLog(
-        JPAPingTargetManagerImpl.class);
-
     private final JPAPersistenceStrategy strategy;
-    
-    
+
     @com.google.inject.Inject
     protected JPAPingTargetManagerImpl(JPAPersistenceStrategy strategy) {
         this.strategy = strategy;
@@ -107,7 +99,7 @@ public class JPAPingTargetManagerImpl im
         
         // Determine the set of "brother" targets (custom or common) 
         // among which this name should be unique.
-        List brotherTargets = null;
+        List<PingTarget> brotherTargets;
         Weblog website = pingTarget.getWebsite();
         if (website == null) {
             brotherTargets = getCommonPingTargets();
@@ -118,11 +110,9 @@ public class JPAPingTargetManagerImpl im
         // Within that set of targets, fail if there is a target 
         // with the same name and that target doesn't
         // have the same id.
-        for (Iterator i = brotherTargets.iterator(); i.hasNext();) {
-            PingTarget brother = (PingTarget) i.next();
-            // Fail if it has the same name but not the same id.
-            if (brother.getName().equals(name) && 
-                (id == null || !brother.getId().equals(id))) {
+        for (PingTarget brother : brotherTargets) {
+            if (brother.getName().equals(name) &&
+                    (id == null || !brother.getId().equals(id))) {
                 return false;
             }
         }
@@ -172,14 +162,14 @@ public class JPAPingTargetManagerImpl im
         }
     }
 
-    public List getCommonPingTargets()
+    public List<PingTarget> getCommonPingTargets()
             throws WebloggerException {
         Query q = strategy.getNamedQuery(
                 "PingTarget.getByWebsiteNullOrderByName");
         return q.getResultList();
     }
 
-    public List getCustomPingTargets(Weblog website)
+    public List<PingTarget> getCustomPingTargets(Weblog website)
             throws WebloggerException {
         Query q = strategy.getNamedQuery(
                 "PingTarget.getByWebsiteOrderByName");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -19,7 +19,6 @@
 package org.apache.roller.weblogger.business.jpa;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -69,7 +68,7 @@ public class JPAPropertiesManagerImpl im
      */
     public void initialize() throws InitializationException {
         
-        Map props = null;
+        Map<String, RuntimeConfigProperty> props;
         try {
             props = this.getProperties();
             initializeMissingProps(props);
@@ -101,23 +100,19 @@ public class JPAPropertiesManagerImpl im
      * uses the property name as the key and the RuntimeConfigProperty object
      * as the value.
      */
-    public Map getProperties() throws WebloggerException {
+    public Map<String, RuntimeConfigProperty> getProperties() throws WebloggerException {
 
-        HashMap props = new HashMap();
-        List list = (List) strategy.getNamedQuery("RuntimeConfigProperty.getAll").getResultList();
+        HashMap<String, RuntimeConfigProperty> props = new HashMap<String, RuntimeConfigProperty>();
+        List<RuntimeConfigProperty> list = strategy.getNamedQuery("RuntimeConfigProperty.getAll").getResultList();
         /*
          * for convenience sake we are going to put the list of props
          * into a map for users to access it.  The value element of the
          * hash still needs to be the RuntimeConfigProperty object so that
          * we can save the elements again after they have been updated
          */
-        RuntimeConfigProperty prop = null;
-        Iterator it = list.iterator();
-        while(it.hasNext()) {
-            prop = (RuntimeConfigProperty) it.next();
+        for (RuntimeConfigProperty prop : list) {
             props.put(prop.getName(), prop);
         }
-
         return props;
     }
 
@@ -137,9 +132,8 @@ public class JPAPropertiesManagerImpl im
     public void saveProperties(Map properties) throws WebloggerException {
 
         // just go through the list and saveProperties each property
-        Iterator props = properties.values().iterator();
-        while (props.hasNext()) {
-            this.strategy.store((RuntimeConfigProperty) props.next());
+        for (Object prop : properties.values()) {
+            this.strategy.store(prop);
         }
     }
     
@@ -151,10 +145,10 @@ public class JPAPropertiesManagerImpl im
      *
      * If the Map of props is empty/null then we will initialize all properties.
      **/
-    private Map initializeMissingProps(Map props) {
+    private Map initializeMissingProps(Map<String, RuntimeConfigProperty> props) {
 
         if(props == null) {
-            props = new HashMap();
+            props = new HashMap<String, RuntimeConfigProperty>();
         }
 
         // start by getting our runtimeConfigDefs
@@ -166,35 +160,25 @@ public class JPAPropertiesManagerImpl im
             return props;
         }
 
-        // iterator through all the definitions and add properties
+        // iterate through all the definitions and add properties
         // that are not already in our props map
-        ConfigDef configDef = null;
-        DisplayGroup dGroup = null;
-        PropertyDef propDef = null;
-        Iterator defs = runtimeConfigDefs.getConfigDefs().iterator();
-        while(defs.hasNext()) {
-            configDef = (ConfigDef) defs.next();
-
-            Iterator groups = configDef.getDisplayGroups().iterator();
-            while(groups.hasNext()) {
-                dGroup = (DisplayGroup) groups.next();
-
-                Iterator propdefs = dGroup.getPropertyDefs().iterator();
-                while(propdefs.hasNext()) {
-                    propDef = (PropertyDef) propdefs.next();
+
+        for (ConfigDef configDef : runtimeConfigDefs.getConfigDefs()) {
+            for (DisplayGroup dGroup : configDef.getDisplayGroups()) {
+                for (PropertyDef propDef : dGroup.getPropertyDefs()) {
 
                     // do we already have this prop?  if not then add it
                     if(!props.containsKey(propDef.getName())) {
                         RuntimeConfigProperty newprop =
-                            new RuntimeConfigProperty(
-                                propDef.getName(), propDef.getDefaultValue());
+                                new RuntimeConfigProperty(
+                                        propDef.getName(), propDef.getDefaultValue());
 
                         props.put(propDef.getName(), newprop);
 
                         log.info("Found uninitialized property " +
-                            propDef.getName() +
-                            " ... setting value to [" + 
-                            propDef.getDefaultValue() + "]");
+                                propDef.getName() +
+                                " ... setting value to [" +
+                                propDef.getDefaultValue() + "`]");
                     }
                 }
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -112,9 +112,8 @@ public class JPARefererManagerImpl imple
         if (blacklist.length == 0) {
             return;
         }
-        List referers = getBlackListedReferer(blacklist);
-        for (Iterator iterator = referers.iterator(); iterator.hasNext();) {
-            WeblogReferrer referer= (WeblogReferrer) iterator.next();
+        List<WeblogReferrer> referers = getBlackListedReferer(blacklist);
+        for (WeblogReferrer referer : referers) {
             this.strategy.remove(referer);
         }
     }
@@ -136,9 +135,8 @@ public class JPARefererManagerImpl imple
         if (blacklist.length == 0) {
             return;
         }
-        List referers = getBlackListedReferer(website, blacklist);
-        for (Iterator iterator = referers.iterator(); iterator.hasNext();) {
-            WeblogReferrer referer= (WeblogReferrer) iterator.next();
+        List<WeblogReferrer> referers = getBlackListedReferer(website, blacklist);
+        for (WeblogReferrer referer : referers) {
             this.strategy.remove(referer);
         }
     }
@@ -200,7 +198,7 @@ public class JPARefererManagerImpl imple
         q.setParameter(1, Boolean.TRUE);
         q.setParameter(2, Boolean.TRUE);
         q.setParameter(3, start);
-        List queryResults = (List)q.getResultList();
+        List queryResults = q.getResultList();
         for (Iterator it = queryResults.iterator(); it.hasNext(); ) {
             Object[] row = (Object[])it.next();
             long hits = ((Number)row[0]).longValue();
@@ -338,7 +336,7 @@ public class JPARefererManagerImpl imple
     /**
      * Query for collection of referers.
      */
-    protected List getReferersWithSameTitle(Weblog website,
+    protected List<WeblogReferrer> getReferersWithSameTitle(Weblog website,
                                             String requestUrl,
                                             String title,
                                             String excerpt)
@@ -578,16 +576,14 @@ public class JPARefererManagerImpl imple
 
                         // LOOP: find the referer with the highest weight
                         Boolean visible = Boolean.FALSE;
-                        List refs= getReferersWithSameTitle(
+                        List<WeblogReferrer> refs= getReferersWithSameTitle(
                                 mReferer.getWebsite(),
                                 mReferer.getRequestUrl(),
                                 lb.getTitle(),
                                 lb.getExcerpt());
                         WeblogReferrer chosen = null;
                         int maxweight = 0;
-                        for (Iterator rdItr = refs.iterator();rdItr.hasNext();) {
-                            WeblogReferrer referer = (WeblogReferrer) rdItr.next();
-
+                        for (WeblogReferrer referer : refs) {
                             int weight = referer.getRefererUrl().length();
                             if (referer.getRefererUrl().indexOf('#') != -1) {
                                 weight += 100;
@@ -603,14 +599,11 @@ public class JPARefererManagerImpl imple
                                 // replacement must be visible as well.
                                 visible = Boolean.TRUE;
                             }
-
                         }
 
                         // LOOP: to mark all of the lower weight ones
                         // as duplicates
-                        for (Iterator rdItr = refs.iterator();rdItr.hasNext();) {
-                            WeblogReferrer referer = (WeblogReferrer) rdItr.next();
-
+                        for (WeblogReferrer referer : refs) {
                             if (!referer.equals(chosen)) {
                                 referer.setDuplicate(Boolean.TRUE);
                             } else {
@@ -619,8 +612,6 @@ public class JPARefererManagerImpl imple
                             }
                             saveReferer(referer);
                         }
-
-
                     }
                 } else {
                     // It is not a linkback, but store it anyway
@@ -655,14 +646,14 @@ public class JPARefererManagerImpl imple
         query.executeUpdate();
     }
 
-    protected List getBlackListedReferer(String[] blacklist) throws
+    protected List<WeblogReferrer> getBlackListedReferer(String[] blacklist) throws
             WebloggerException {
         StringBuilder queryString = getQueryStringForBlackList(blacklist);
         Query query = strategy.getDynamicQuery(queryString.toString());
-        return (List) query.getResultList();
+        return query.getResultList();
     }
 
-    protected List getBlackListedReferer(Weblog website, String[] blacklist) 
+    protected List<WeblogReferrer> getBlackListedReferer(Weblog website, String[] blacklist)
             throws WebloggerException {
         StringBuilder queryString = getQueryStringForBlackList(blacklist);
         queryString.append(" AND r.website = ?1 ");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -29,7 +29,6 @@ import org.apache.roller.weblogger.busin
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -77,7 +76,7 @@ public class JPAUserManagerImpl implemen
         // remove permissions, maintaining both sides of relationship
         List<WeblogPermission> perms = getWeblogPermissions(user);
         for (WeblogPermission perm : perms) {
-            this.strategy.remove(perms);
+            this.strategy.remove(perm);
         }
         this.strategy.remove(user);
 
@@ -194,7 +193,7 @@ public class JPAUserManagerImpl implemen
         return user;
     }
 
-    public List getUsers(Weblog weblog, Boolean enabled, Date startDate,
+    public List<User> getUsers(Weblog weblog, Boolean enabled, Date startDate,
             Date endDate, int offset, int length)
             throws WebloggerException {
         Query query = null;
@@ -261,12 +260,12 @@ public class JPAUserManagerImpl implemen
     }
 
     
-    public List getUsers(int offset, int length) throws WebloggerException {
+    public List<User> getUsers(int offset, int length) throws WebloggerException {
         return getUsers(Boolean.TRUE, null, null, offset, length);
     }
 
     
-    public List getUsers(Boolean enabled, Date startDate, Date endDate,
+    public List<User> getUsers(Boolean enabled, Date startDate, Date endDate,
             int offset, int length)
             throws WebloggerException {
         Query query = null;
@@ -759,13 +758,11 @@ public class JPAUserManagerImpl implemen
     public List<String> getRoles(User user) throws WebloggerException {
         Query q = strategy.getNamedQuery("UserRole.getByUserName");
         q.setParameter(1, user.getUserName());
-        List roles = q.getResultList();
+        List<UserRole> roles = q.getResultList();
         List<String> roleNames = new ArrayList<String>();
-        for (Iterator it = roles.iterator(); it.hasNext();) {
-            UserRole userRole = (UserRole)it.next();
+        for (UserRole userRole : roles) {
             roleNames.add(userRole.getRole());
         }
-
         return roleNames;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -195,13 +195,9 @@ public class JPAWeblogEntryManagerImpl i
         
         log.debug("Updating path tree for category "+cat.getPath());
         
-        WeblogCategory childCat = null;
-        Iterator childCats = cat.getWeblogCategories().iterator();
-        while(childCats.hasNext()) {
-            childCat = (WeblogCategory) childCats.next();
-            
+        for (WeblogCategory childCat : cat.getWeblogCategories()) {
             log.debug("OLD child category path was "+childCat.getPath());
-            
+
             // update path and save
             if("/".equals(cat.getPath())) {
                 childCat.setPath("/" + childCat.getName());
@@ -209,9 +205,9 @@ public class JPAWeblogEntryManagerImpl i
                 childCat.setPath(cat.getPath() + "/" + childCat.getName());
             }
             saveWeblogCategory(childCat);
-            
+
             log.debug("NEW child category path is "+ childCat.getPath());
-            
+
             // then make recursive call to update this cats children
             updatePathTree(childCat);
         }
@@ -308,16 +304,14 @@ public class JPAWeblogEntryManagerImpl i
             entry.setAnchor(this.createAnchor(entry));
         }
         
-        for(Iterator it = entry.getAddedTags().iterator(); it.hasNext();) {
-            String name = (String) it.next();
-            updateTagCount(name, entry.getWebsite(), 1);
+        for (Object name : entry.getAddedTags()) {
+            updateTagCount((String) name, entry.getWebsite(), 1);
         }
-        
-        for(Iterator it = entry.getRemovedTags().iterator(); it.hasNext();) {
-            String name = (String) it.next();
-            updateTagCount(name, entry.getWebsite(), -1);
+
+        for (Object name : entry.getRemovedTags()) {
+            updateTagCount((String) name, entry.getWebsite(), -1);
         }
-        
+
         // if the entry was published to future, set status as SCHEDULED
         // we only consider an entry future published if it is scheduled
         // more than 1 minute into the future
@@ -525,7 +519,7 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    public List getWeblogEntries(
+    public List<WeblogEntry> getWeblogEntries(
             Weblog website,
             User    user,
             Date        startDate,
@@ -711,11 +705,12 @@ public class JPAWeblogEntryManagerImpl i
                 //Call back the entity to adjust its internal state
                 entry.onRemoveTag(name);
 
-                //Remove it from database
-                this.strategy.remove(tag);
-                
                 //Remove it from the collection
                 it.remove();
+
+                //Remove it from database
+                this.strategy.remove(tag);
+                this.strategy.flush();
             }
         }
     }
@@ -775,7 +770,7 @@ public class JPAWeblogEntryManagerImpl i
      * @inheritDoc
      */
     // TODO: this method should be removed and its functionality moved to getWeblogEntries()
-    public List getWeblogEntries(WeblogCategory cat, boolean publishedOnly)
+    public List<WeblogEntry> getWeblogEntries(WeblogCategory cat, boolean publishedOnly)
     throws WebloggerException {
         List results = null;
         
@@ -854,14 +849,12 @@ public class JPAWeblogEntryManagerImpl i
             return true;
         }
         
-        Iterator cats = cat.getWeblogCategories().iterator();
-        while (cats.hasNext()) {
-            WeblogCategory childCat = (WeblogCategory)cats.next();
+        for (WeblogCategory childCat : cat.getWeblogCategories()) {
             if (childCat.isInUse()) {
                 return true;
             }
         }
-        
+
         if (cat.getWebsite().getBloggerCategory().equals(cat)) {
             return true;
         }
@@ -876,7 +869,7 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    public List getComments(
+    public List<WeblogEntryComment> getComments(
             Weblog     website,
             WeblogEntry entry,
             String          searchString,
@@ -973,12 +966,11 @@ public class JPAWeblogEntryManagerImpl i
         // but MySQL says "General error, message from server: "You can't
         // specify target table 'roller_comment' for update in FROM clause"
         
-        List comments = getComments(
+        List<WeblogEntryComment> comments = getComments(
                 website, entry, searchString, startDate, endDate,
                 status, true, 0, -1);
         int count = 0;
-        for (Iterator it = comments.iterator(); it.hasNext();) {
-            WeblogEntryComment comment = (WeblogEntryComment) it.next();
+        for (WeblogEntryComment comment : comments) {
             removeComment(comment);
             count++;
         }
@@ -1277,7 +1269,7 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    public List getPopularTags(Weblog website, Date startDate, int offset, int limit)
+    public List<TagStat> getPopularTags(Weblog website, Date startDate, int offset, int limit)
     throws WebloggerException {
         Query query = null;
         List queryResults = null;
@@ -1316,7 +1308,7 @@ public class JPAWeblogEntryManagerImpl i
         double min = Integer.MAX_VALUE;
         double max = Integer.MIN_VALUE;
         
-        List results = new ArrayList(limit);
+        List<TagStat> results = new ArrayList<TagStat>(limit);
         
         for (Iterator iter = queryResults.iterator(); iter.hasNext();) {
             Object[] row = (Object[]) iter.next();
@@ -1334,11 +1326,10 @@ public class JPAWeblogEntryManagerImpl i
         
         double range = Math.max(.01, max - min) * 1.0001;
         
-        for (Iterator iter = results.iterator(); iter.hasNext(); ) {
-            TagStat t = (TagStat) iter.next();
+        for (TagStat t : results) {
             t.setIntensity((int) (1 + Math.floor(5 * (Math.log(1+t.getCount()) - min) / range)));
         }
-        
+
         // sort results by name, because query had to sort by total
         Collections.sort(results, TAG_STAT_NAME_COMPARATOR);
         
@@ -1348,7 +1339,7 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    public List getTags(Weblog website, String sortBy,
+    public List<TagStat> getTags(Weblog website, String sortBy,
             String startsWith, int offset, int limit) throws WebloggerException {
         Query query = null;
         List queryResults = null;
@@ -1390,7 +1381,7 @@ public class JPAWeblogEntryManagerImpl i
         }
         queryResults = query.getResultList();
         
-        List results = new ArrayList();
+        List<TagStat> results = new ArrayList<TagStat>();
         for (Iterator iter = queryResults.iterator(); iter.hasNext();) {
             Object[] row = (Object[]) iter.next();
             TagStat ce = new TagStat();
@@ -1399,7 +1390,7 @@ public class JPAWeblogEntryManagerImpl i
             ce.setCount(((Long) row[1]).intValue());
             results.add(ce);
         }
-        
+
         if (sortByName) {
             Collections.sort(results, TAG_STAT_NAME_COMPARATOR);
         } else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -121,10 +121,8 @@ public class JPAWeblogManagerImpl implem
 
         Query themeAssocQuery = strategy.getNamedQuery("WeblogThemeAssoc.getThemeAssocsByWeblog");
         themeAssocQuery.setParameter(1,website);
-         List assocResults = themeAssocQuery.getResultList();
-
-        for(Iterator iter = assocResults.iterator(); iter.hasNext();) {
-            WeblogThemeAssoc themeAssoc = (WeblogThemeAssoc) iter.next();
+        List<WeblogThemeAssoc> assocResults = themeAssocQuery.getResultList();
+        for(WeblogThemeAssoc themeAssoc : assocResults) {
             this.strategy.remove(themeAssoc);
         }
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java Tue Dec 17 19:50:26 2013
@@ -95,7 +95,7 @@ public interface AutoPingManager {
      * @param website
      * @return a list of auto ping configurations for the given website as <code>AuAutoPingcode> objects.
      */
-    List getAutoPingsByWebsite(Weblog website) throws WebloggerException;
+    List<AutoPing> getAutoPingsByWebsite(Weblog website) throws WebloggerException;
     
     
     /**
@@ -104,7 +104,7 @@ public interface AutoPingManager {
      * @param pingTarget
      * @return a list of auto ping configurations for the given target as <code>AuAutoPingcode> objects.
      */
-    List getAutoPingsByTarget(PingTarget pingTarget) throws WebloggerException;
+    List<AutoPing> getAutoPingsByTarget(PingTarget pingTarget) throws WebloggerException;
     
     
     /**
@@ -113,7 +113,7 @@ public interface AutoPingManager {
      * @param changedWeblogEntry the entry that has been created or changed
      * @return a list of the ping configurations that should be applied due to this change
      */
-    List getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException;
+    List<AutoPing> getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException;
     
     
     /**

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java Tue Dec 17 19:50:26 2013
@@ -75,7 +75,7 @@ public interface PingQueueManager {
      * @return the queue as a <code>List</code> of {@link PingQueueEntry objects.
      * @throws WebloggerException
      */
-    List getAllQueueEntries() throws WebloggerException;
+    List<PingQueueEntry> getAllQueueEntries() throws WebloggerException;
     
     
     /**

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java Tue Dec 17 19:50:26 2013
@@ -18,7 +18,6 @@
 
 package org.apache.roller.weblogger.business.pings;
 
-import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -99,13 +98,13 @@ public class PingQueueProcessor {
                 LOGGER.debug("Started processing ping queue.");
             }
             // Get all of the entries
-            List entries = pingQueueMgr.getAllQueueEntries();
+            List<PingQueueEntry> entries = pingQueueMgr.getAllQueueEntries();
             
             // Process each entry
-            for (Iterator i = entries.iterator(); i.hasNext();) {
-                PingQueueEntry pingQueueEntry = (PingQueueEntry) i.next();
+            for (PingQueueEntry pingQueueEntry : entries) {
                 processQueueEntry(pingQueueEntry);
             }
+
             if (LOGGER.isDebugEnabled()) {
                 LOGGER.debug("Finished processing ping queue.");
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/PluginManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/PluginManagerImpl.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/PluginManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/plugins/PluginManagerImpl.java Tue Dec 17 19:50:26 2013
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.busi
 
 import java.util.ArrayList;
 import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -43,10 +42,10 @@ public class PluginManagerImpl implement
     private static Log log = LogFactory.getLog(PluginManagerImpl.class);
     
     // Plugin classes keyed by plugin name
-    static Map mPagePlugins = new LinkedHashMap();
+    static Map<String, Class> mPagePlugins = new LinkedHashMap<String, Class>();
     
     // Comment plugins
-    private List<WeblogEntryCommentPlugin> commentPlugins = new ArrayList();
+    private List<WeblogEntryCommentPlugin> commentPlugins = new ArrayList<WeblogEntryCommentPlugin>();
     
     
     /**
@@ -71,11 +70,9 @@ public class PluginManagerImpl implement
      * Create and init plugins for processing entries in a specified website.
      */
     public Map getWeblogEntryPlugins(Weblog website) {
-        Map ret = new LinkedHashMap();
-        Iterator it = this.mPagePlugins.values().iterator();
-        while (it.hasNext()) {
+        Map<String, WeblogEntryPlugin> ret = new LinkedHashMap<String, WeblogEntryPlugin>();
+        for (Class pluginClass : PluginManagerImpl.mPagePlugins.values()) {
             try {
-                Class pluginClass = (Class)it.next();
                 WeblogEntryPlugin plugin = (WeblogEntryPlugin)pluginClass.newInstance();
                 plugin.init(website);
                 ret.put(plugin.getName(), plugin);
@@ -86,17 +83,15 @@ public class PluginManagerImpl implement
         return ret;
     }
     
-    public String applyWeblogEntryPlugins(Map pagePlugins,WeblogEntry entry, String str) {
+    public String applyWeblogEntryPlugins(Map pagePlugins, WeblogEntry entry, String str) {
 
         String ret = str;
         WeblogEntry copy = new WeblogEntry(entry);
-        List entryPlugins = copy.getPluginsList();
+        List<String> entryPlugins = copy.getPluginsList();
 
-        if (entryPlugins != null && !entryPlugins.isEmpty()) {
-            Iterator iter = entryPlugins.iterator();
-            while (iter.hasNext()) {
-                String key = (String)iter.next();
-                WeblogEntryPlugin pagePlugin = (WeblogEntryPlugin)pagePlugins.get(key);
+        if (entryPlugins != null) {
+            for (String key : entryPlugins) {
+                WeblogEntryPlugin pagePlugin = (WeblogEntryPlugin) pagePlugins.get(key);
                 if (pagePlugin != null) {
                     ret = pagePlugin.render(entry, ret);
                 } else {

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -21,7 +21,6 @@ package org.apache.roller.weblogger.busi
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -63,7 +62,7 @@ public class ReferrerQueueManagerImpl im
     private boolean asyncMode = false;
     private int numWorkers = 1;
     private int sleepTime = 10000;
-    private List workers = null;
+    private List<WorkerThread> workers = null;
     private List referrerQueue = null;
     private int referrerCount = 0;
     private int maxAsyncQueueSize = 0;
@@ -201,10 +200,7 @@ public class ReferrerQueueManagerImpl im
                 mLogger.info("Max Async Referrer queue size: " + maxAsyncQueueSize);
             }
             // kill all of our threads
-            WorkerThread worker = null;
-            Iterator it = this.workers.iterator();
-            while(it.hasNext()) {
-                worker = (WorkerThread) it.next();
+            for (WorkerThread worker : workers) {
                 worker.interrupt();
             }
         }

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.busi
 
 import java.text.MessageFormat;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -116,7 +115,7 @@ public class RebuildWebsiteIndexOperatio
                 // Add Doc
                 WeblogEntryManager weblogManager = roller
                         .getWeblogEntryManager();
-                List entries = weblogManager.getWeblogEntries(website, // website
+                List<WeblogEntry> entries = weblogManager.getWeblogEntries(website, // website
                         null, null, // startDate
                         null, // endDate
                         null, // catName
@@ -127,8 +126,7 @@ public class RebuildWebsiteIndexOperatio
 
                 mLogger.debug("Entries to index: " + entries.size());
 
-                for (Iterator wbItr = entries.iterator(); wbItr.hasNext();) {
-                    WeblogEntry entry = (WeblogEntry) wbItr.next();
+                for (WeblogEntry entry : entries) {
                     writer.addDocument(getDocument(entry));
                     mLogger.debug(MessageFormat.format(
                             "Indexed entry {0}: {1}",

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/ConfigDef.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/ConfigDef.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/ConfigDef.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/ConfigDef.java Tue Dec 17 19:50:26 2013
@@ -34,19 +34,18 @@ import java.util.List;
  */
 public class ConfigDef {
     
-    private List displayGroups = null;
+    private List<DisplayGroup> displayGroups = null;
     private String name = null;
     
     
     public ConfigDef() {
-        this.displayGroups = new ArrayList();
+        this.displayGroups = new ArrayList<DisplayGroup>();
     }
 
-    public ConfigDef(List displaygroups) {
+    public ConfigDef(List<DisplayGroup> displaygroups) {
         this.displayGroups = displaygroups;
     }
 
-    
     public boolean addDisplayGroup(DisplayGroup group) {
         return this.displayGroups.add(group);
     }
@@ -60,11 +59,11 @@ public class ConfigDef {
         return name;
     }
     
-    public List getDisplayGroups() {
+    public List<DisplayGroup> getDisplayGroups() {
         return displayGroups;
     }
 
-    public void setDisplayGroups(List displayGroups) {
+    public void setDisplayGroups(List<DisplayGroup> displayGroups) {
         this.displayGroups = displayGroups;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/DisplayGroup.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/DisplayGroup.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/DisplayGroup.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/DisplayGroup.java Tue Dec 17 19:50:26 2013
@@ -34,16 +34,16 @@ import java.util.List;
  */
 public class DisplayGroup {
     
-    private List propertyDefs = null;
+    private List<PropertyDef> propertyDefs = null;
     private String name = null;
     private String key = null;
     
     
     public DisplayGroup() {
-        this.propertyDefs = new ArrayList();
+        this.propertyDefs = new ArrayList<PropertyDef>();
     }
     
-    public DisplayGroup(List propdefs) {
+    public DisplayGroup(List<PropertyDef> propdefs) {
         this.propertyDefs = propdefs;
     }
     
@@ -61,11 +61,11 @@ public class DisplayGroup {
         return name+","+key;
     }
     
-    public List getPropertyDefs() {
+    public List<PropertyDef> getPropertyDefs() {
         return propertyDefs;
     }
 
-    public void setPropertyDefs(List propertyDefs) {
+    public void setPropertyDefs(List<PropertyDef> propertyDefs) {
         this.propertyDefs = propertyDefs;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/RuntimeConfigDefs.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/RuntimeConfigDefs.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/RuntimeConfigDefs.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/runtime/RuntimeConfigDefs.java Tue Dec 17 19:50:26 2013
@@ -34,14 +34,14 @@ import java.util.List;
  */
 public class RuntimeConfigDefs {
     
-    private List configDefs = null;
+    private List<ConfigDef> configDefs = null;
     
     
     public RuntimeConfigDefs() {
-        this.configDefs = new ArrayList();
+        this.configDefs = new ArrayList<ConfigDef>();
     }
 
-    public RuntimeConfigDefs(List configs) {
+    public RuntimeConfigDefs(List<ConfigDef> configs) {
         this.configDefs = configs;
     }
     
@@ -55,11 +55,11 @@ public class RuntimeConfigDefs {
     }
     
     
-    public List getConfigDefs() {
+    public List<ConfigDef> getConfigDefs() {
         return configDefs;
     }
 
-    public void setConfigDefs(List configDefs) {
+    public void setConfigDefs(List<ConfigDef> configDefs) {
         this.configDefs = configDefs;
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java Tue Dec 17 19:50:26 2013
@@ -40,7 +40,7 @@ import org.apache.roller.util.UUIDGenera
  * Folders or Bookmarks. Don't construct one of these yourself, instead use
  * the create method in your BookmarkManager implementation.</p>
  */
-public class WeblogBookmarkFolder implements Serializable, Comparable {
+public class WeblogBookmarkFolder implements Serializable, Comparable<WeblogBookmarkFolder> {
     
     public static final long serialVersionUID = -6272468884763861944L;
     
@@ -56,7 +56,7 @@ public class WeblogBookmarkFolder implem
     // associations
     private Weblog website = null;
     private WeblogBookmarkFolder parentFolder = null;
-    private Set childFolders = new TreeSet();
+    private Set<WeblogBookmarkFolder> childFolders = new TreeSet<WeblogBookmarkFolder>();
     private Set bookmarks = new TreeSet();
     
     
@@ -125,8 +125,7 @@ public class WeblogBookmarkFolder implem
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Object o) {
-        WeblogBookmarkFolder other = (WeblogBookmarkFolder)o;
+    public int compareTo(WeblogBookmarkFolder other) {
         return getName().compareTo(other.getName());
     }
     
@@ -212,11 +211,11 @@ public class WeblogBookmarkFolder implem
     /**
      * Get child folders of this folder.
      */
-    public Set getFolders() {
+    public Set<WeblogBookmarkFolder> getFolders() {
         return this.childFolders;
     }
     
-    private void setFolders(Set folders) {
+    private void setFolders(Set<WeblogBookmarkFolder> folders) {
         this.childFolders = folders;
     }
     

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -36,7 +36,7 @@ import org.apache.roller.util.UUIDGenera
 /**
  * Weblog Category.
  */
-public class WeblogCategory implements Serializable, Comparable {
+public class WeblogCategory implements Serializable, Comparable<WeblogCategory> {
     
     public static final long serialVersionUID = 1435782148712018954L;
     
@@ -52,9 +52,8 @@ public class WeblogCategory implements S
     // associations
     private Weblog website = null;
     private WeblogCategory parentCategory = null;
-    private Set childCategories = new HashSet();
-    
-    
+    private Set<WeblogCategory> childCategories = new HashSet<WeblogCategory>();
+
     public WeblogCategory() {
     }
     
@@ -120,12 +119,10 @@ public class WeblogCategory implements S
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Object o) {
-        WeblogCategory other = (WeblogCategory)o;
+    public int compareTo(WeblogCategory other) {
         return getName().compareTo(other.getName());
     }
-    
-    
+
     /**
      * Database surrogate key.
      */
@@ -213,11 +210,11 @@ public class WeblogCategory implements S
     /**
      * Get child categories of this category.
      */
-    public Set getWeblogCategories() {
+    public Set<WeblogCategory> getWeblogCategories() {
         return this.childCategories;
     }
     
-    private void setWeblogCategories(Set cats) {
+    private void setWeblogCategories(Set<WeblogCategory> cats) {
         this.childCategories = cats;
     }
     
@@ -267,7 +264,7 @@ public class WeblogCategory implements S
      */
     public boolean hasCategory(String name) {
         Iterator cats = this.getWeblogCategories().iterator();
-        WeblogCategory cat = null;
+        WeblogCategory cat;
         while(cats.hasNext()) {
             cat = (WeblogCategory) cats.next();
             if(name.equals(cat.getName())) {
@@ -290,6 +287,7 @@ public class WeblogCategory implements S
             // if our path starts with our parents path then we are a descendent
             return getPath().startsWith(ancestor.getPath());
         }
+
     }
     
     

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -619,9 +619,9 @@ public class WeblogEntry implements Seri
             }
         }
 
-        WeblogEntryManager weblogManager = WebloggerFactory.getWeblogger().getWeblogEntryManager();
+        WeblogEntryManager weblogEntryManager = WebloggerFactory.getWeblogger().getWeblogEntryManager();
         for (Iterator it = removeTags.iterator(); it.hasNext();) {
-            weblogManager.removeWeblogEntryTag((String) it.next(), this);
+            weblogEntryManager.removeWeblogEntryTag((String) it.next(), this);
         }
         
         for (Iterator it = newTags.iterator(); it.hasNext();) {
@@ -929,11 +929,11 @@ public class WeblogEntry implements Seri
      * Convenience method to transform mPlugins to a List
      * @return
      */
-    public List getPluginsList() {
+    public List<String> getPluginsList() {
         if (getPlugins() != null) {
             return Arrays.asList( StringUtils.split(getPlugins(), ",") );
         }
-        return new ArrayList();
+        return new ArrayList<String>();
     }    
     
     /** Convenience method for checking status */

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java Tue Dec 17 19:50:26 2013
@@ -26,7 +26,7 @@ import org.apache.roller.util.UUIDGenera
 /**
  * Weblog entry attribute.
  */
-public class WeblogEntryAttribute implements Comparable {
+public class WeblogEntryAttribute implements Comparable<WeblogEntryAttribute> {
     
     private String id = UUIDGenerator.generateUUID();
     private WeblogEntry entry;
@@ -107,8 +107,7 @@ public class WeblogEntryAttribute implem
         .toHashCode();
     }
     
-    public int compareTo(Object o) {
-        WeblogEntryAttribute att = (WeblogEntryAttribute)o;
+    public int compareTo(WeblogEntryAttribute att) {
         return getName().compareTo(att.getName());
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java Tue Dec 17 19:50:26 2013
@@ -21,7 +21,6 @@ package org.apache.roller.weblogger.ui.c
 import java.io.File;
 import java.io.InputStream;
 import java.util.Properties;
-import java.util.Iterator;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
@@ -234,8 +233,7 @@ public class RollerContext extends Conte
         
         if (!rememberMeEnabled) {
             ProviderManager provider = (ProviderManager) ctx.getBean("_authenticationManager");
-            for (Iterator it = provider.getProviders().iterator(); it.hasNext();) {
-                AuthenticationProvider authProvider = (AuthenticationProvider) it.next();
+            for (AuthenticationProvider authProvider : provider.getProviders()) {
                 if (authProvider instanceof RememberMeAuthenticationProvider) {
                     provider.getProviders().remove(authProvider);
                 }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java Tue Dec 17 19:50:26 2013
@@ -38,8 +38,8 @@ import org.apache.roller.weblogger.pojos
 /**
  * Enable Roller's User Roles to work in CMA setup without a JDBC realm.
  * 
- * If you're using Container Manager Authenticaton (CMA) and you're not using 
- * the a JDBC realm that can add the User Roles defined by Roller, then you can
+ * If you're using Container Manager Authentication (CMA) and you're not using
+ * a JDBC realm that can add the User Roles defined by Roller, then you can
  * use this class to ensure that the request Role methods operate against the
  * User Roles as defined by Roller's User Manager.
  */

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/RendererManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/RendererManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/RendererManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/RendererManager.java Tue Dec 17 19:50:26 2013
@@ -23,7 +23,6 @@ import org.apache.roller.weblogger.confi
 import org.apache.roller.weblogger.pojos.Template;
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 import org.apache.roller.weblogger.ui.rendering.mobile.MobileDeviceRepository;
 
@@ -39,7 +38,7 @@ public class RendererManager {
 
     private static Log log = LogFactory.getLog(RendererManager.class);
     // a set of all renderer factories we are consulting
-    private static Set rendererFactories = new HashSet();
+    private static Set<RendererFactory> rendererFactories = new HashSet();
 
     static {
         // lookup set of renderer factories we are going to use
@@ -111,10 +110,8 @@ public class RendererManager {
 
         // iterate over our renderer factories and see if one of them
         // wants to handle this content
-        Iterator factories = rendererFactories.iterator();
-        while (factories.hasNext()) {
-            renderer = ((RendererFactory) factories.next()).getRenderer(template, deviceType);
-
+        for (RendererFactory rendererFactory : rendererFactories) {
+            renderer = rendererFactory.getRenderer(template, deviceType);
             if (renderer != null) {
                 return renderer;
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/filters/RequestMappingFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/filters/RequestMappingFilter.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/filters/RequestMappingFilter.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/filters/RequestMappingFilter.java Tue Dec 17 19:50:26 2013
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.ui.r
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
@@ -48,8 +47,7 @@ public class RequestMappingFilter implem
     private static Log log = LogFactory.getLog(RequestMappingFilter.class);
     
     // list of RequestMappers that want to inspect the request
-    private final List requestMappers = new ArrayList();
-    
+    private final List<RequestMapper> requestMappers = new ArrayList<RequestMapper>();
     
     public void init(FilterConfig filterConfig) {
         
@@ -118,22 +116,18 @@ public class RequestMappingFilter implem
         log.debug("entering");
         
         // give each mapper a chance to handle the request
-        RequestMapper mapper = null;
-        Iterator mappersIT = this.requestMappers.iterator();
-        while(mappersIT.hasNext()) {
-            mapper = (RequestMapper) mappersIT.next();
-            
-            log.debug("trying mapper "+mapper.getClass().getName());
-            
+        for (RequestMapper mapper : requestMappers) {
+            log.debug("trying mapper " + mapper.getClass().getName());
+
             boolean wasHandled = mapper.handleRequest(request, response);
             if(wasHandled) {
                 // if mapper has handled the request then we are done
-                log.debug("request handled by "+mapper.getClass().getName());
+                log.debug("request handled by " + mapper.getClass().getName());
                 log.debug("exiting");
                 return;
             }
         }
-        
+
         log.debug("request not mapped");
         
         // nobody handled the request, so let it continue as usual

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager.java Tue Dec 17 19:50:26 2013
@@ -19,7 +19,6 @@
 package org.apache.roller.weblogger.ui.rendering.plugins.comments;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 import org.apache.commons.logging.Log;
@@ -35,7 +34,7 @@ import org.apache.roller.weblogger.util.
 public class CommentValidationManager {
     private static Log     log = LogFactory.getLog(CommentValidationManager.class);
     private ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
-    private List           validators = new ArrayList();
+    private List<CommentValidator> validators = new ArrayList<CommentValidator>();
     
     public CommentValidationManager() {
         
@@ -86,8 +85,7 @@ public class CommentValidationManager {
     public int validateComment(WeblogEntryComment comment, RollerMessages messages) {
         int total = 0;
         if (validators.size() > 0) {
-            for (Iterator it = validators.iterator(); it.hasNext();) {
-                CommentValidator val = (CommentValidator) it.next();
+            for (CommentValidator val : validators) {
                 log.debug("Invoking comment validator "+val.getName());
                 total += val.validate(comment, messages);
             }

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=1551670&r1=1551669&r2=1551670&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 Tue Dec 17 19:50:26 2013
@@ -19,7 +19,6 @@
 package org.apache.roller.weblogger.ui.struts2.ajax;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.List;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -73,11 +72,9 @@ public class UserDataServlet extends Htt
         Weblogger roller = WebloggerFactory.getWeblogger();
         try {
             UserManager umgr = roller.getUserManager();
-            List users =
+            List<User> users =
                     umgr.getUsersStartingWith(startsWith, enabledOnly, offset, length);
-            Iterator userIter = users.iterator();
-            while (userIter.hasNext()) {
-                User user = (User)userIter.next();
+            for (User user : users) {
                 response.getWriter().print(user.getUserName());
                 response.getWriter().print(",");
                 response.getWriter().println(user.getEmailAddress());

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerMemberHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerMemberHandler.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerMemberHandler.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerMemberHandler.java Tue Dec 17 19:50:26 2013
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.webs
 import java.io.Reader;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import org.jdom.Document;
@@ -137,17 +136,15 @@ class RollerMemberHandler extends Handle
     private EntrySet getCollection() throws HandlerException {
         // get all permissions: for all users, for all websites
         try {
-            List users = getRoller().getUserManager().getUsers(null, null, null, 0, -1);
+            List<User> users = getRoller().getUserManager().getUsers(null, null, null, 0, -1);
             List<WeblogPermission> perms = new ArrayList<WeblogPermission>();
-            for (Iterator i = users.iterator(); i.hasNext(); ) {
-                User user = (User)i.next();
+            for (User user : users) {
                 List<WeblogPermission> permissions = getRoller().getUserManager().getWeblogPermissions(user);
                 for (WeblogPermission perm : permissions) {
                     perms.add(perm);
                 }
             }
-            EntrySet es = toMemberEntrySet(perms);
-            return es;
+            return toMemberEntrySet(perms);
         } catch (WebloggerException re) {
             throw new InternalException("ERROR: Could not get member collection", re);
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/tagdata/TagDataServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/tagdata/TagDataServlet.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/tagdata/TagDataServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/tagdata/TagDataServlet.java Tue Dec 17 19:50:26 2013
@@ -100,7 +100,7 @@ public class TagDataServlet extends Http
         } catch (Exception ignored) {}
 
         Weblogger roller = WebloggerFactory.getWeblogger();
-        List tags = null;
+        List<TagStat> tags = null;
         Weblog weblog = null;
         try {
             WeblogManager wmgr = roller.getWeblogManager();
@@ -149,14 +149,13 @@ public class TagDataServlet extends Http
             pw.println("   xmlns:atom=\"http://www.w3.org/2005/Atom\""); 
             pw.println("   xmlns:tagdata=\"http://roller.apache.org/ns/tagdata\">");
             int count = 0;
-            for (Iterator it = tags.iterator(); it.hasNext();) {
-                TagStat stat = (TagStat) it.next();
+            for (TagStat stat : tags) {
                 String term = stat.getName();
-                String viewURI = urlstrat.getWeblogCollectionURL(weblog, 
-                        null,  // locale 
+                String viewURI = urlstrat.getWeblogCollectionURL(weblog,
+                        null,  // locale
                         null,  // category
                         null,  // date string
-                        Collections.singletonList(stat.getName()), 
+                        Collections.singletonList(stat.getName()),
                         0,     // page
                         true); // absolute
                 int frequency = stat.getCount();
@@ -180,7 +179,6 @@ public class TagDataServlet extends Http
             response.flushBuffer();
         } else {
             response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Malformed URL");
-            return;
         }
     }
 }

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/BookmarkTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/BookmarkTest.java?rev=1551670&r1=1551669&r2=1551670&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/BookmarkTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/BookmarkTest.java Tue Dec 17 19:50:26 2013
@@ -101,8 +101,8 @@ public class BookmarkTest extends TestCa
                 "created by testBookmarkCRUD()",
                 "http://www.example.com",
                 "http://www.example.com/rss.xml",
-                new Integer(1),
-                new Integer(12),
+                1,
+                12,
                 "test.jpg");
         bookmark1.setFolder(folder);
         folder.addBookmark(bookmark1);
@@ -114,8 +114,8 @@ public class BookmarkTest extends TestCa
                 "created by testBookmarkCRUD()",
                 "http://www.example.com",
                 "http://www.example.com/rss.xml",
-                new Integer(1),
-                new Integer(12),
+                1,
+                12,
                 "test.jpf");
         bookmark2.setFolder(folder);
         folder.addBookmark(bookmark2);
@@ -181,17 +181,17 @@ public class BookmarkTest extends TestCa
         WeblogBookmark b1 = new WeblogBookmark(
                 f1, "b1", "testbookmark",
                 "http://example.com", "http://example.com/rss",
-                new Integer(1), new Integer(1), "image.gif");
+                1, 1, "image.gif");
         bmgr.saveBookmark(b1);
         WeblogBookmark b2 = new WeblogBookmark(
                 f1, "b2", "testbookmark",
                 "http://example.com", "http://example.com/rss",
-                new Integer(1), new Integer(1), "image.gif");
+                1, 1, "image.gif");
         bmgr.saveBookmark(b2);
         WeblogBookmark b3 = new WeblogBookmark(
                 f2, "b3", "testbookmark",
                 "http://example.com", "http://example.com/rss",
-                new Integer(1), new Integer(1), "image.gif");
+                1, 1, "image.gif");
         bmgr.saveBookmark(b3);
         
         TestUtils.endSession(true);
@@ -251,7 +251,7 @@ public class BookmarkTest extends TestCa
             WeblogBookmark b1 = new WeblogBookmark(
                     f1, "b1", "testbookmark",
                     "http://example.com", "http://example.com/rss",
-                    new Integer(1), new Integer(1), "image.gif");
+                    1, 1, "image.gif");
             f1.addBookmark(b1);
 
             // create folder f2 inside f1
@@ -262,7 +262,7 @@ public class BookmarkTest extends TestCa
             WeblogBookmark b2 = new WeblogBookmark(
                     f2, "b2", "testbookmark",
                     "http://example.com", "http://example.com/rss",
-                    new Integer(1), new Integer(1), "image.gif");
+                    1, 1, "image.gif");
             f2.addBookmark(b2);
 
             // create folder f3 inside folder f2
@@ -273,7 +273,7 @@ public class BookmarkTest extends TestCa
             WeblogBookmark b3 = new WeblogBookmark(
                     f3, "b3", "testbookmark",
                     "http://example.com", "http://example.com/rss",
-                    new Integer(1), new Integer(1), "image.gif");
+                    1, 1, "image.gif");
             f3.addBookmark(b3);
 
             TestUtils.endSession(true);



Mime
View raw message