struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: rev 55697 - struts/trunk/src/share/org/apache/struts/actions
Date Wed, 27 Oct 2004 14:06:07 GMT
Author: husted
Date: Wed Oct 27 07:06:07 2004
New Revision: 55697

Modified:
   struts/trunk/src/share/org/apache/struts/actions/LocaleAction.java
Log:
Minor refactoring.

Modified: struts/trunk/src/share/org/apache/struts/actions/LocaleAction.java
==============================================================================
--- struts/trunk/src/share/org/apache/struts/actions/LocaleAction.java	(original)
+++ struts/trunk/src/share/org/apache/struts/actions/LocaleAction.java	Wed Oct 27 07:06:07
2004
@@ -99,10 +99,12 @@
            log.error(e.getMessage(), e);
         }
 
-        if ((language != null && language.length() > 0) &&
-            (country != null && country.length() > 0)) {
+        boolean isLanguage = (language != null && language.length() > 0);
+        boolean isCountry = (country != null && country.length() > 0);
+
+        if ((isLanguage) && (isCountry)) {
            locale = new java.util.Locale(language, country);
-        } else if (language != null && language.length() > 0) {
+        } else if (isLanguage) {
            locale = new java.util.Locale(language, "");
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message