roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1546773 - in /roller/trunk/app/src/main/java/org/apache/roller/weblogger: business/jpa/ business/pings/ business/runnable/ business/startup/ config/ pojos/ ui/core/ ui/rendering/model/ ui/rendering/plugins/comments/ ui/rendering/servlets/ ...
Date Sat, 30 Nov 2013 23:28:38 GMT
Author: gmazza
Date: Sat Nov 30 23:28:37 2013
New Revision: 1546773

URL: http://svn.apache.org/r1546773
Log:
Code simplifications reported by IntelliJ IDEA.

Modified:
    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/WeblogUpdatePinger.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/HitCountProcessingJob.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/PingConfig.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/BookmarkComparator.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/MathCommentAuthenticator.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/FeedServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PlanetFeedServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/PlanetRequest.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUserBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LRUCache2.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/UserEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/WeblogEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BaseAPIHandler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java

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=1546773&r1=1546772&r2=1546773&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
Sat Nov 30 23:28:37 2013
@@ -429,7 +429,7 @@ public class JPAUserManagerImpl implemen
         Query q = strategy.getNamedQuery("User.getCountEnabledDistinct");
         q.setParameter(1, Boolean.TRUE);
         List results = q.getResultList();
-        ret =((Long)results.get(0)).longValue(); 
+        ret =((Long)results.get(0));
 
         return ret;
     }

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=1546773&r1=1546772&r2=1546773&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
Sat Nov 30 23:28:37 2013
@@ -676,7 +676,7 @@ public class JPAWeblogEntryManagerImpl i
         query.setParameter(1, Boolean.TRUE);
         query.setParameter(2, WeblogEntry.PUBLISHED);
         if (max != null) {
-            query.setMaxResults(max.intValue());
+            query.setMaxResults(max);
         }
         return query.getResultList();
     }
@@ -1216,7 +1216,7 @@ public class JPAWeblogEntryManagerImpl i
                     (String)row[2],                             // entry anchor
                     (String)row[3],                             // entry title
                     "statCount.weblogEntryCommentCountType",    // stat desc
-                    ((Long)row[0]).longValue());                // count
+                    ((Long)row[0]));                            // count
             sc.setWeblogHandle((String)row[1]);
             results.add(sc);
         }
@@ -1679,7 +1679,7 @@ public class JPAWeblogEntryManagerImpl i
                 "WeblogEntryComment.getCountAllDistinctByStatus");
         q.setParameter(1, WeblogEntryComment.APPROVED);
         List results = q.getResultList();
-        return ((Long)results.get(0)).longValue();
+        return ((Long)results.get(0));
     }
     
     /**
@@ -1691,7 +1691,7 @@ public class JPAWeblogEntryManagerImpl i
         q.setParameter(1, website);
         q.setParameter(2, WeblogEntryComment.APPROVED);
         List results = q.getResultList();
-        return ((Long)results.get(0)).longValue();
+        return ((Long)results.get(0));
     }
     
     /**
@@ -1702,7 +1702,7 @@ public class JPAWeblogEntryManagerImpl i
                 "WeblogEntry.getCountDistinctByStatus");
         q.setParameter(1, "PUBLISHED");
         List results = q.getResultList();
-        return ((Long)results.get(0)).longValue();
+        return ((Long)results.get(0));
     }
     
     /**
@@ -1714,7 +1714,7 @@ public class JPAWeblogEntryManagerImpl i
         q.setParameter(1, "PUBLISHED");
         q.setParameter(2, website);
         List results = q.getResultList();
-        return ((Long)results.get(0)).longValue();
+        return ((Long)results.get(0));
     }
     
     /**

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=1546773&r1=1546772&r2=1546773&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
Sat Nov 30 23:28:37 2013
@@ -539,8 +539,8 @@ public class JPAWeblogManagerImpl implem
         List<WeblogPermission> perms = roller.getUserManager().getWeblogPermissions(user);
         for (WeblogPermission perm : perms) {
             Weblog weblog = perm.getWeblog();
-            if (!enabledOnly || weblog.getEnabled().booleanValue()) {
-                if (weblog.getActive() != null && weblog.getActive().booleanValue())
{
+            if (!enabledOnly || weblog.getEnabled()) {
+                if (weblog.getActive() != null && weblog.getActive()) {
                     weblogs.add(weblog);
                 }
             }
@@ -557,7 +557,7 @@ public class JPAWeblogManagerImpl implem
                 log.error("ERROR user is null, userName:" + perm.getUserName());
                 continue;
             }
-            if (!enabledOnly || user.getEnabled().booleanValue()) {
+            if (!enabledOnly || user.getEnabled()) {
                 users.add(user);
             }
         }
@@ -745,7 +745,7 @@ public class JPAWeblogManagerImpl implem
                     (String)row[2],                     // website handle
                     (String)row[3],                     // website name
                     "statCount.weblogCommentCountType", // stat type
-                    ((Long)row[0]).longValue());        // # comments
+                    ((Long)row[0]));        // # comments
             sc.setWeblogHandle((String)row[2]);
             results.add(sc);
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/WeblogUpdatePinger.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/WeblogUpdatePinger.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/WeblogUpdatePinger.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/pings/WeblogUpdatePinger.java
Sat Nov 30 23:28:37 2013
@@ -59,7 +59,7 @@ public final class WeblogUpdatePinger {
         String message;
 
         public PingResult(Boolean error, String message) {
-            this.error = error != null ? error.booleanValue() : false;
+            this.error = error != null && error;
             this.message = message != null ? message : "";
         }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/HitCountProcessingJob.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/HitCountProcessingJob.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/HitCountProcessingJob.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/HitCountProcessingJob.java
Sat Nov 30 23:28:37 2013
@@ -73,9 +73,9 @@ public class HitCountProcessingJob imple
             
             Long count = (Long) hitsTally.get(weblogHandle);
             if(count == null) {
-                count = new Long(1);
+                count = 1L;
             } else {
-                count = new Long(count.longValue()+1);
+                count = count + 1;
             }
             hitsTally.put(weblogHandle, count);
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
Sat Nov 30 23:28:37 2013
@@ -758,19 +758,19 @@ public class DatabaseInstaller {
         
         String productName = con.getMetaData().getDatabaseProductName();
         String handle = "mysql";
-        if (       productName.toLowerCase().indexOf("mysql") != -1) {
+        if (       productName.toLowerCase().contains("mysql")) {
             handle =  "mysql";
-        } else if (productName.toLowerCase().indexOf("derby") != -1) {
+        } else if (productName.toLowerCase().contains("derby")) {
             handle =  "derby";
-        } else if (productName.toLowerCase().indexOf("hsql") != -1) {
+        } else if (productName.toLowerCase().contains("hsql")) {
             handle =  "hsqldb";
-        } else if (productName.toLowerCase().indexOf("postgres") != -1) {
+        } else if (productName.toLowerCase().contains("postgres")) {
             handle =  "postgresql";
-        } else if (productName.toLowerCase().indexOf("oracle") != -1) {
+        } else if (productName.toLowerCase().contains("oracle")) {
             handle =  "oracle";
-        } else if (productName.toLowerCase().indexOf("microsoft") != -1) {
+        } else if (productName.toLowerCase().contains("microsoft")) {
             handle =  "mssql";
-        } else if (productName.toLowerCase().indexOf("db2") != -1) {   
+        } else if (productName.toLowerCase().contains("db2")) {
             handle =  "db2";
         }
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/PingConfig.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/PingConfig.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/PingConfig.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/config/PingConfig.java Sat
Nov 30 23:28:37 2013
@@ -329,7 +329,7 @@ public class PingConfig {
             }
             return defaultValue;
         }
-        return Boolean.valueOf(configuredVal).booleanValue();
+        return Boolean.valueOf(configuredVal);
     }
 
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/BookmarkComparator.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/BookmarkComparator.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/BookmarkComparator.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/BookmarkComparator.java
Sat Nov 30 23:28:37 2013
@@ -29,8 +29,8 @@ public class BookmarkComparator implemen
     {
         WeblogBookmark bd1 = (WeblogBookmark)val1;
         WeblogBookmark bd2 = (WeblogBookmark)val2;
-        int priority1 = bd1.getPriority().intValue();
-        int priority2 = bd2.getPriority().intValue();
+        int priority1 = bd1.getPriority();
+        int priority2 = bd2.getPriority();
 
         if (priority1 > priority2)
         {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java Sat Nov 30
23:28:37 2013
@@ -616,7 +616,7 @@ public class Weblog implements Serializa
      * Returns true if comment moderation is required by website or config.
      */ 
     public boolean getCommentModerationRequired() { 
-        return (getModerateComments().booleanValue()
+        return (getModerateComments()
          || WebloggerRuntimeConfig.getBooleanProperty("users.moderation.required"));
     }
     

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=1546773&r1=1546772&r2=1546773&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 Sat
Nov 30 23:28:37 2013
@@ -664,14 +664,14 @@ public class WeblogEntry implements Seri
         if (!WebloggerRuntimeConfig.getBooleanProperty("users.comments.enabled")) {
             return false;
         }
-        if (getWebsite().getAllowComments() != null && !getWebsite().getAllowComments().booleanValue())
{
+        if (getWebsite().getAllowComments() != null && !getWebsite().getAllowComments())
{
             return false;
         }
-        if (getAllowComments() != null && !getAllowComments().booleanValue()) {
+        if (getAllowComments() != null && !getAllowComments()) {
             return false;
         }
         boolean ret = false;
-        if (getCommentDays() == null || getCommentDays().intValue() == 0) {
+        if (getCommentDays() == null || getCommentDays() == 0) {
             ret = true;
         } else {
             // we want to use pubtime for calculating when comments expire, but
@@ -684,7 +684,7 @@ public class WeblogEntry implements Seri
             Calendar expireCal = Calendar.getInstance(
                     getWebsite().getLocaleInstance());
             expireCal.setTime(inPubTime);
-            expireCal.add(Calendar.DATE, getCommentDays().intValue());
+            expireCal.add(Calendar.DATE, getCommentDays());
             Date expireDay = expireCal.getTime();
             Date today = new Date();
             if (today.before(expireDay)) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
Sat Nov 30 23:28:37 2013
@@ -110,7 +110,7 @@ public class RollerSession 
                         }
                     }
                     // only set authenticated user if user is enabled
-                    if (user != null && user.getEnabled().booleanValue()) {
+                    if (user != null && user.getEnabled()) {
                         rollerSession.setAuthenticatedUser(user);
                     }
                     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
Sat Nov 30 23:28:37 2013
@@ -522,7 +522,7 @@ public class SiteModel implements Model 
         try {            
             Weblogger roller = WebloggerFactory.getWeblogger();
             WeblogEntryManager wmgr = roller.getWeblogEntryManager();
-            List weblogs = wmgr.getWeblogEntriesPinnedToMain(new Integer(length));
+            List weblogs = wmgr.getWeblogEntriesPinnedToMain(length);
             for (Iterator it = weblogs.iterator(); it.hasNext();) {
                 WeblogEntry entry = (WeblogEntry) it.next();
                 results.add(WeblogEntryWrapper.wrap(entry, urlStrategy));

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/MathCommentAuthenticator.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/MathCommentAuthenticator.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/MathCommentAuthenticator.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/plugins/comments/MathCommentAuthenticator.java
Sat Nov 30 23:28:37 2013
@@ -46,9 +46,9 @@ public class MathCommentAuthenticator im
             int value1 = (int)(Math.random()*10.0);
             int value2 = (int)(Math.random()*100.0);
             int sum = value1 + value2;
-            session.setAttribute("mathValue1", new Integer(value1));
-            session.setAttribute("mathValue2", new Integer(value2));
-            session.setAttribute("mathAnswer", new Integer(sum));
+            session.setAttribute("mathValue1", value1);
+            session.setAttribute("mathValue2", value2);
+            session.setAttribute("mathAnswer", sum);
         } else {
             // preserve user's answer
             answer = request.getParameter("answer");
@@ -88,7 +88,7 @@ public class MathCommentAuthenticator im
                 int answer = Integer.parseInt(answerString);
                 Integer sum = (Integer) session.getAttribute("mathAnswer");
                 
-                if (sum != null && answer == sum.intValue()) {
+                if (sum != null && answer == sum) {
                     authentic = true;
                     session.removeAttribute("mathAnswer");
                     session.removeAttribute("mathValue1");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/FeedServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/FeedServlet.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/FeedServlet.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/FeedServlet.java
Sat Nov 30 23:28:37 2013
@@ -133,7 +133,7 @@ public class FeedServlet extends HttpSer
         if (WebloggerRuntimeConfig
                 .getBooleanProperty("site.newsfeeds.styledFeeds")
                 && accepts != null
-                && accepts.indexOf("*/*") != -1
+                && accepts.contains("*/*")
                 && userAgent != null && userAgent.startsWith("Mozilla"))
{
             // client is a browser and feed style is enabled so we want
             // browsers to load the page rather than popping up the download

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
Sat Nov 30 23:28:37 2013
@@ -616,7 +616,7 @@ public class PageServlet extends HttpSer
 
         // if this came from persons own blog then don't process it
         String selfSiteFragment = "/" + pageRequest.getWeblogHandle();
-        if (referrerUrl != null && referrerUrl.indexOf(selfSiteFragment) != -1) {
+        if (referrerUrl != null && referrerUrl.contains(selfSiteFragment)) {
             log.debug("skipping referrer from own blog");
             return false;
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PlanetFeedServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PlanetFeedServlet.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PlanetFeedServlet.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PlanetFeedServlet.java
Sat Nov 30 23:28:37 2013
@@ -100,7 +100,7 @@ public class PlanetFeedServlet extends H
         String accepts = request.getHeader("Accept");
         String userAgent = request.getHeader("User-Agent");
         if (accepts != null && userAgent != null
-                && accepts.indexOf("*/*") != -1
+                && accepts.contains("*/*")
                 && userAgent.startsWith("Mozilla")) {
             // client is a browser and now that we offer styled feeds we want
             // browsers to load the page rather than popping up the download
@@ -153,8 +153,8 @@ public class PlanetFeedServlet extends H
             }
             model.put(
                     "feedStyle",
-                    new Boolean(WebloggerRuntimeConfig
-                            .getBooleanProperty("site.newsfeeds.styledFeeds")));
+                    WebloggerRuntimeConfig
+                            .getBooleanProperty("site.newsfeeds.styledFeeds"));
 
             int numEntries = WebloggerRuntimeConfig
                     .getIntProperty("site.newsfeeds.defaultEntries");
@@ -173,7 +173,7 @@ public class PlanetFeedServlet extends H
                     entryCount = 0;
                 }
             }
-            model.put("entryCount", new Integer(entryCount));
+            model.put("entryCount", entryCount);
         } catch (Exception ex) {
             log.error("Error loading model objects for page", ex);
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/PlanetRequest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/PlanetRequest.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/PlanetRequest.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/PlanetRequest.java
Sat Nov 30 23:28:37 2013
@@ -82,7 +82,7 @@ public class PlanetRequest extends Parse
          *   group - specifies the aggregation group to include
          */
         if (request.getParameter("excerpts") != null) {
-            this.excerpts = Boolean.valueOf(request.getParameter("excerpts")).booleanValue();
+            this.excerpts = Boolean.valueOf(request.getParameter("excerpts"));
         }
         
         if (request.getParameter("group") != null) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
Sat Nov 30 23:28:37 2013
@@ -54,7 +54,7 @@ public class WeblogEntryCommentForm {
         this.email = comment.getEmail();
         this.url = comment.getUrl();
         this.content = comment.getContent();
-        this.notify = comment.getNotify().booleanValue();
+        this.notify = comment.getNotify();
     }
     
     public void setError(String errorMessage) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.java
Sat Nov 30 23:28:37 2013
@@ -139,7 +139,7 @@ public class WeblogFeedRequest extends W
         }        
         
         if(request.getParameter("excerpts") != null) {
-            this.excerpts = Boolean.valueOf(request.getParameter("excerpts")).booleanValue();
+            this.excerpts = Boolean.valueOf(request.getParameter("excerpts"));
         }
         
         if(request.getParameter("page") != null) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUserBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUserBean.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUserBean.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUserBean.java
Sat Nov 30 23:28:37 2013
@@ -141,7 +141,7 @@ public class CreateUserBean {
         dataHolder.setEmailAddress(this.emailAddress);
         dataHolder.setLocale(this.locale);
         dataHolder.setTimeZone(this.timeZone);
-        dataHolder.setEnabled(new Boolean(this.enabled));
+        dataHolder.setEnabled(this.enabled);
         dataHolder.setActivationCode(this.activationCode);
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.java
Sat Nov 30 23:28:37 2013
@@ -30,8 +30,8 @@ public class BookmarkBean {
     private String name = null;
     private String description = null;
     private String url = null;
-    private Integer weight = new Integer(0);
-    private Integer priority = new Integer(0);
+    private Integer weight = 0;
+    private Integer priority = 0;
     private String image = null;
     private String feedUrl = null;
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
Sat Nov 30 23:28:37 2013
@@ -126,7 +126,7 @@ public class TemplateEdit extends UIActi
                 templateToSave.setLastModified(new Date());
 
                 if (getBean().getAutoContentType() == null ||
-                        !getBean().getAutoContentType().booleanValue()) {
+                        !getBean().getAutoContentType()) {
                     templateToSave.setOutputContentType(getBean().getManualContentType());
                 } else {
                     // empty content-type indicates that template uses auto content-type
detection

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIAction.java
Sat Nov 30 23:28:37 2013
@@ -374,18 +374,18 @@ public abstract class UIAction extends A
         
         List opts = new ArrayList();
         
-        opts.add(new KeyValueObject(new Integer(0), getText("weblogEdit.unlimitedCommentDays")));
-        opts.add(new KeyValueObject(new Integer(1), getText("weblogEdit.days1")));
-        opts.add(new KeyValueObject(new Integer(2), getText("weblogEdit.days2")));
-        opts.add(new KeyValueObject(new Integer(3), getText("weblogEdit.days3")));
-        opts.add(new KeyValueObject(new Integer(4), getText("weblogEdit.days4")));
-        opts.add(new KeyValueObject(new Integer(5), getText("weblogEdit.days5")));
-        opts.add(new KeyValueObject(new Integer(7), getText("weblogEdit.days7")));
-        opts.add(new KeyValueObject(new Integer(10), getText("weblogEdit.days10")));
-        opts.add(new KeyValueObject(new Integer(20), getText("weblogEdit.days20")));
-        opts.add(new KeyValueObject(new Integer(30), getText("weblogEdit.days30")));
-        opts.add(new KeyValueObject(new Integer(60), getText("weblogEdit.days60")));
-        opts.add(new KeyValueObject(new Integer(90), getText("weblogEdit.days90")));
+        opts.add(new KeyValueObject(0, getText("weblogEdit.unlimitedCommentDays")));
+        opts.add(new KeyValueObject(1, getText("weblogEdit.days1")));
+        opts.add(new KeyValueObject(2, getText("weblogEdit.days2")));
+        opts.add(new KeyValueObject(3, getText("weblogEdit.days3")));
+        opts.add(new KeyValueObject(4, getText("weblogEdit.days4")));
+        opts.add(new KeyValueObject(5, getText("weblogEdit.days5")));
+        opts.add(new KeyValueObject(7, getText("weblogEdit.days7")));
+        opts.add(new KeyValueObject(10, getText("weblogEdit.days10")));
+        opts.add(new KeyValueObject(20, getText("weblogEdit.days20")));
+        opts.add(new KeyValueObject(30, getText("weblogEdit.days30")));
+        opts.add(new KeyValueObject(60, getText("weblogEdit.days60")));
+        opts.add(new KeyValueObject(90, getText("weblogEdit.days90")));
         
         return opts;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LRUCache2.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LRUCache2.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LRUCache2.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/LRUCache2.java Sat Nov
30 23:28:37 2013
@@ -105,7 +105,7 @@ public class LRUCache2
             String key = (String) keys.next();
             for (int i = 0; i < patterns.length; i++)
             {
-                if (key.indexOf(patterns[i]) != -1)
+                if (key.contains(patterns[i]))
                 {
                     purgeList.add(key);
                     break;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/MailUtil.java Sat Nov
30 23:28:37 2013
@@ -268,7 +268,7 @@ public class MailUtil {
         
         // Only send email if email notificaiton is enabled
         boolean notify = WebloggerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
-        if (!notify || !weblog.getEmailComments().booleanValue()) {
+        if (!notify || !weblog.getEmailComments()) {
             // notifications disabled, just bail
             return;
         }
@@ -523,7 +523,7 @@ public class MailUtil {
         
         // Only send email if email notificaiton is enabled
         boolean notify = WebloggerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
-        if (!notify || !weblog.getEmailComments().booleanValue()) {
+        if (!notify || !weblog.getEmailComments()) {
             // notifications disabled, just bail
             return;
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/Utilities.java Sat Nov
30 23:28:37 2013
@@ -235,7 +235,7 @@ public class Utilities {
             int end = m.end();
             String link = html.substring(start, end);
             buf.append(html.substring(0, start));
-            if (link.indexOf("rel=\"nofollow\"") == -1) {
+            if (link.contains("rel=\"nofollow\"")) {
                 buf.append(
                         link.substring(0, link.length() - 1) + " rel=\"nofollow\">");
             } else {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/Authenticator.java
Sat Nov 30 23:28:37 2013
@@ -71,7 +71,7 @@ abstract class Authenticator {
             if (!WebloggerFactory.getWeblogger().getUserManager().checkPermission(adminPerm,
ud)) {
                 throw new UnauthorizedException("ERROR: User must have the admin role to
use the RAP endpoint: " + userName);
             }
-            if (!ud.getEnabled().booleanValue()) {
+            if (!ud.getEnabled()) {
                 throw new UnauthorizedException("ERROR: User is disabled: " + userName);
             }
         } catch (WebloggerException ex) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/UserEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/UserEntry.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/UserEntry.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/UserEntry.java
Sat Nov 30 23:28:37 2013
@@ -129,7 +129,7 @@ public class UserEntry extends Entry {
         // created (optional)
         Element createdElement = e.getChild(Tags.DATE_CREATED, Service.NAMESPACE);
         if (createdElement != null) {
-            setDateCreated(new Date(Long.valueOf(createdElement.getText()).longValue()));
+            setDateCreated(new Date(Long.valueOf(createdElement.getText())));
         }
         
         // enabled

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/WeblogEntry.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/WeblogEntry.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/sdk/WeblogEntry.java
Sat Nov 30 23:28:37 2013
@@ -128,7 +128,7 @@ public class WeblogEntry extends Entry {
         // created
         Element createdElement = e.getChild(Tags.DATE_CREATED, Service.NAMESPACE);
         if (createdElement != null) {
-            setDateCreated(new Date(Long.valueOf(createdElement.getText()).longValue()));
+            setDateCreated(new Date(Long.valueOf(createdElement.getText())));
         }
         
         // APP entries URL

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BaseAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BaseAPIHandler.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BaseAPIHandler.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BaseAPIHandler.java
Sat Nov 30 23:28:37 2013
@@ -121,13 +121,13 @@ public class BaseAPIHandler implements S
             UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
             WeblogManager weblogMgr = WebloggerFactory.getWeblogger().getWeblogManager();
             user = userMgr.getUserByUserName(username);
-            userEnabled = user.getEnabled().booleanValue();
+            userEnabled = user.getEnabled();
             
             website = weblogMgr.getWeblogByHandle(blogid);
             if (website != null) {
                 weblogFound = true;
-                weblogEnabled = website.getEnabled().booleanValue();
-                apiEnabled = website.getEnableBloggerApi().booleanValue() 
+                weblogEnabled = website.getEnabled();
+                apiEnabled = website.getEnableBloggerApi()
                 	&& WebloggerRuntimeConfig.getBooleanProperty("webservices.enableXmlRpc");
             }
             
@@ -181,7 +181,7 @@ public class BaseAPIHandler implements S
             UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
             user = userMgr.getUserByUserName(username);
             
-            enabled = user.getEnabled().booleanValue();
+            enabled = user.getEnabled();
             if (enabled) {
                 // are passwords encrypted?
                 String encrypted =

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
Sat Nov 30 23:28:37 2013
@@ -335,7 +335,7 @@ public class BloggerAPIHandler extends B
                 WeblogEntry entry = weblogMgr.getWeblogEntry(postid);
                 entry.setText(content);
                 entry.setUpdateTime(current);
-                if (Boolean.valueOf(publish).booleanValue()) {
+                if (publish) {
                     entry.setStatus(WeblogEntry.PUBLISHED);
                 } else {
                     entry.setStatus(WeblogEntry.DRAFT);
@@ -387,7 +387,7 @@ public class BloggerAPIHandler extends B
         // extract the title from the content
         String title = "";
         
-        if (content.indexOf("<title>") != -1) {
+        if (content.contains("<title>")) {
             title =
                     content.substring(content.indexOf("<title>") + 7,
                     content.indexOf("</title>"));
@@ -413,8 +413,8 @@ public class BloggerAPIHandler extends B
             entry.setCreatorUserName(user.getUserName());
             entry.setWebsite(website);
             entry.setCategory(website.getBloggerCategory());
-            entry.setCommentDays(new Integer(website.getDefaultCommentDays()));
-            if (Boolean.valueOf(publish).booleanValue()) {
+            entry.setCommentDays(website.getDefaultCommentDays());
+            if (publish) {
                 entry.setStatus(WeblogEntry.PUBLISHED);
             } else {
                 entry.setStatus(WeblogEntry.DRAFT);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java?rev=1546773&r1=1546772&r2=1546773&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
Sat Nov 30 23:28:37 2013
@@ -164,7 +164,7 @@ public class MetaWeblogAPIHandler extend
             }
             entry.setText(description);
             entry.setUpdateTime(current);
-            if (Boolean.valueOf(publish).booleanValue()) {
+            if (publish) {
                 entry.setStatus(WeblogEntry.PUBLISHED);
             } else {
                 entry.setStatus(WeblogEntry.DRAFT);
@@ -262,7 +262,7 @@ public class MetaWeblogAPIHandler extend
             entry.setUpdateTime(current);
             entry.setWebsite(website);
             entry.setCreatorUserName(user.getUserName());
-            entry.setCommentDays(new Integer(website.getDefaultCommentDays()));
+            entry.setCommentDays(website.getDefaultCommentDays());
             entry.setAllowComments(website.getDefaultAllowComments());
         
             // apply weblog default plugins
@@ -270,7 +270,7 @@ public class MetaWeblogAPIHandler extend
                 entry.setPlugins(website.getDefaultPlugins());
             }
             
-            if (Boolean.valueOf(publish).booleanValue()) {
+            if (publish) {
                 entry.setStatus(WeblogEntry.PUBLISHED);
             } else {
                 entry.setStatus(WeblogEntry.DRAFT);



Mime
View raw message