------------------------------------------------------------
revno: 22111
committer: Lars Helge Overland <larshe...@gmail.com>
branch nick: dhis2
timestamp: Wed 2016-03-02 16:53:31 +0100
message:
  Code style
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.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/setting/DefaultTranslateSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-03-02 15:38:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-03-02 15:53:31 +0000
@@ -33,6 +33,8 @@
 
 import org.hisp.dhis.util.ObjectUtils;
 
+import static org.apache.commons.lang3.StringUtils.EMPTY;
+
 /**
  * @author James Chang
  */
@@ -60,9 +62,9 @@
         Map<String, String> translations = new Hashtable<>();
 
         translations.put( SettingKey.APPLICATION_TITLE.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_TITLE.getName(), localeStr, SettingKey.APPLICATION_TITLE.getDefaultValue().toString() ) );
-        translations.put( SettingKey.APPLICATION_INTRO.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getName(), localeStr, "" ) );
-        translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getName(), localeStr, "" ) );
-        translations.put( SettingKey.APPLICATION_FOOTER.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getName(), localeStr, "" ) );
+        translations.put( SettingKey.APPLICATION_INTRO.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getName(), localeStr, EMPTY ) );
+        translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getName(), localeStr, EMPTY ) );
+        translations.put( SettingKey.APPLICATION_FOOTER.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getName(), localeStr, EMPTY ) );
                 
         return translations;
     }
@@ -73,13 +75,13 @@
         Map<String, String> translations = new Hashtable<>();
 
         translations.put( SettingKey.APPLICATION_TITLE.getName(), ObjectUtils.firstNonNull(
-                systemSettingManager.getSystemSetting(SettingKey.APPLICATION_TITLE.getName() + localeStr), SettingKey.APPLICATION_TITLE.getDefaultValue(), "" ).toString() );
+            systemSettingManager.getSystemSetting(SettingKey.APPLICATION_TITLE.getName() + localeStr), SettingKey.APPLICATION_TITLE.getDefaultValue(), EMPTY ).toString() );
         translations.put( SettingKey.APPLICATION_INTRO.getName(), ObjectUtils.firstNonNull(
-                systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getName() + localeStr ), "" ).toString() );
+            systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getName() + localeStr ), EMPTY ).toString() );
         translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), ObjectUtils.firstNonNull(
-                systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getName() + localeStr ), "" ).toString() );
+            systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getName() + localeStr ), EMPTY ).toString() );
         translations.put( SettingKey.APPLICATION_FOOTER.getName(), ObjectUtils.firstNonNull(
-                systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getName() + localeStr ), "" ).toString() );
+            systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getName() + localeStr ), EMPTY ).toString() );
                 
         return translations;
     }
@@ -90,7 +92,7 @@
     
     private String getSystemSettingWithFallbacks( String keyName, String localeStr, String defaultValue )
     {
-        String settingValue = "";
+        String settingValue = EMPTY;
 
         String keyWithLocale = (String) ObjectUtils.firstNonNull( systemSettingManager.getSystemSetting( keyName + localeStr ), "" );
 

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to