roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1582954 - in /roller/trunk/app/src/main/java/org/apache/roller/weblogger: business/jpa/ ui/core/ ui/core/tags/calendar/ util/
Date Sat, 29 Mar 2014 04:39:06 GMT
Author: gmazza
Date: Sat Mar 29 04:39:05 2014
New Revision: 1582954

URL: http://svn.apache.org/r1582954
Log:
More Sonar/IntelliJ IDEA complaints fixed.

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/ui/core/RollerContext.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/I18nMessages.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=1582954&r1=1582953&r2=1582954&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 Mar 29 04:39:05 2014
@@ -93,7 +93,7 @@ public class JPAUserManagerImpl implemen
     
     public void addUser(User newUser) throws WebloggerException {
 
-        if(newUser == null) {
+        if (newUser == null) {
             throw new WebloggerException("cannot add null user");
         }
         

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=1582954&r1=1582953&r2=1582954&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 Mar 29 04:39:05 2014
@@ -956,7 +956,7 @@ public class JPAWeblogEntryManagerImpl i
             Date startDate, Date endDate, int offset,
             int length) throws WebloggerException {
         Query query;
-        List<WeblogEntry> queryResults;
+        List queryResults;
         if (endDate == null) {
             endDate = new Date();
         }

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=1582954&r1=1582953&r2=1582954&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
Sat Mar 29 04:39:05 2014
@@ -95,7 +95,7 @@ public class RollerContext extends Conte
         // First, initialize everything that requires no database
 
         // Keep a reference to ServletContext object
-        this.servletContext = sce.getServletContext();
+        RollerContext.servletContext = sce.getServletContext();
         
         // Call Spring's context ContextLoaderListener to initialize all the
         // context files specified in web.xml. This is necessary because
@@ -332,13 +332,9 @@ public class RollerContext extends Conte
             return null;
         }
         
-        if(null == clazz) {
-            return null;
-        }
-        
         Class[] interfaces = clazz.getInterfaces();
-        for (int i = 0; i < interfaces.length; i++) {
-            if (interfaces[i].equals(AutoProvision.class)) {
+        for (Class clazz2 : interfaces) {
+            if (clazz2.equals(AutoProvision.class)) {
                 try {
                     return (AutoProvision) clazz.newInstance();
                 } catch (InstantiationException e) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java?rev=1582954&r1=1582953&r2=1582954&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
Sat Mar 29 04:39:05 2014
@@ -39,10 +39,10 @@ public class BigWeblogCalendarModel exte
     
     private static Log mLogger = LogFactory.getLog(BigWeblogCalendarModel.class);
     
-    protected static final SimpleDateFormat STAR_DATE_FORMAT =
+    protected final SimpleDateFormat starDateFormat =
             DateUtil.get8charDateFormat();
     
-    protected static final SimpleDateFormat SINGLE_DAY_FORMAT =
+    protected final SimpleDateFormat singleDayFormat =
             new SimpleDateFormat("dd");
     
     
@@ -76,10 +76,10 @@ public class BigWeblogCalendarModel exte
             
             // get the 8 char YYYYMMDD datestring for day, returns null
             // if no weblog entry on that day
-            String dateString = null;
+            String dateString;
             List entries = (List)monthMap.get(day);
             if ( entries != null ) {
-                dateString = STAR_DATE_FORMAT.format(
+                dateString = starDateFormat.format(
                         ((WeblogEntry)entries.get(0)).getPubTime());
                 
                 // append 8 char date string on end of selfurl
@@ -89,7 +89,7 @@ public class BigWeblogCalendarModel exte
                 sb.append("<a href=\"");
                 sb.append( dayUrl );
                 sb.append("\">");
-                sb.append(SINGLE_DAY_FORMAT.format(day));
+                sb.append(singleDayFormat.format(day));
                 sb.append("</a></div>");
                 
                 for ( int i=0; i<entries.size(); i++ ) {
@@ -112,7 +112,7 @@ public class BigWeblogCalendarModel exte
                 
             } else {
                 sb.append("<div class=\"hCalendarDayTitleBig\">");
-                sb.append(SINGLE_DAY_FORMAT.format(day));
+                sb.append(singleDayFormat.format(day));
                 sb.append("</div>");
                 sb.append("<div class=\"bCalendarDayContentBig\"/>");
             }
@@ -138,14 +138,14 @@ public class BigWeblogCalendarModel exte
         List entries = (List)monthMap.get( day );
         if ( entries != null && day != null ) {
             WeblogEntry entry = (WeblogEntry)entries.get(0);
-            dateString = STAR_DATE_FORMAT.format(entry.getPubTime());
+            dateString = starDateFormat.format(entry.getPubTime());
         }
         if (dateString == null && !alwaysURL) {
             return null;
         }
         else if (dateString == null && !nextPrevMonthURL) {
             dateString = DateUtil.format8chars(day);
-        } else if (dateString == null && nextPrevMonthURL) {
+        } else if (dateString == null) {
             dateString = DateUtil.format6chars(day);
         }
         try {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/I18nMessages.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/I18nMessages.java?rev=1582954&r1=1582953&r2=1582954&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/I18nMessages.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/util/I18nMessages.java Sat
Mar 29 04:39:05 2014
@@ -68,7 +68,7 @@ public class I18nMessages {
         LOG.debug("request for messages in locale = " + locale);
         
         // check if we already have a message utils created for that locale
-        I18nMessages messages = messagesMap.get(locale);
+        I18nMessages messages = messagesMap.get(I18nUtils.toLocale(locale));
         
         // if no utils for that language yet then construct
         if(messages == null) {
@@ -166,7 +166,7 @@ public class I18nMessages {
 	 * @param key
 	 *            the key
 	 */
-	public static final void reloadBundle(Locale key) {
+	public static void reloadBundle(Locale key) {
 
 		try {
 



Mime
View raw message