← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21687: Made var static

 

------------------------------------------------------------
revno: 21687
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-11 13:43:50 +0100
message:
  Made var static
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java	2016-01-11 12:43:50 +0000
@@ -60,7 +60,7 @@
 
     private Map<String, Calendar> calendarMap = Maps.newHashMap();
 
-    private List<DateFormat> dateFormats = Lists.newArrayList(
+    private static final List<DateFormat> DATE_FORMATS = Lists.newArrayList(
         new DateFormat( "yyyy-MM-dd", "yyyy-MM-dd", "yyyy-MM-dd", "yyyy-mm-dd" ),
         new DateFormat( "dd-MM-yyyy", "dd-MM-yyyy", "dd-MM-yyyy", "dd-mm-yyyy" )
     );
@@ -93,7 +93,7 @@
     @Override
     public List<DateFormat> getAllDateFormats()
     {
-        return dateFormats;
+        return DATE_FORMATS;
     }
 
     @Override
@@ -123,7 +123,7 @@
     {
         String dateFormatKey = (String) settingManager.getSystemSetting( SettingKey.DATE_FORMAT );
 
-        for ( DateFormat dateFormat : dateFormats )
+        for ( DateFormat dateFormat : DATE_FORMATS )
         {
             if ( dateFormat.name().equals( dateFormatKey ) )
             {
@@ -131,6 +131,6 @@
             }
         }
 
-        return dateFormats.get( 0 );
+        return DATE_FORMATS.get( 0 );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java	2016-01-07 15:21:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java	2016-01-11 12:43:50 +0000
@@ -155,9 +155,7 @@
 
         if ( isConfidential( name ) )
         {
-
             setting.setValue( pbeStringEncryptor.decrypt( setting.getValue().toString() ) );
-
         }
 
         return setting != null && setting.hasValue() ? setting.getValue() : null;
@@ -420,5 +418,4 @@
     {
         return NAME_KEY_MAP.containsKey( name ) && NAME_KEY_MAP.get( name ).isConfidential();
     }
-
 }