myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1529807 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
Date Mon, 07 Oct 2013 09:41:50 GMT
Author: lofwyr
Date: Mon Oct  7 09:41:50 2013
New Revision: 1529807

URL: http://svn.apache.org/r1529807
Log:
TOBAGO-1317: Make ClientProperties robust against locale=null

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java?rev=1529807&r1=1529806&r2=1529807&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
Mon Oct  7 09:41:50 2013
@@ -80,8 +80,14 @@ public final class ClientPropertiesKey i
     if (!contentType.equals(that.contentType)) {
       return false;
     }
-    if (!locale.equals(that.locale)) {
-      return false;
+    if (locale == null) {
+      if (that.locale != null) {
+        return false;
+      }
+    } else {
+      if (!locale.equals(that.locale)) {
+        return false;
+      }
     }
     if (!theme.equals(that.theme)) {
       return false;
@@ -97,7 +103,9 @@ public final class ClientPropertiesKey i
     int result = contentType.hashCode();
     result = 31 * result + theme.hashCode();
     result = 31 * result + userAgent.hashCode();
-    result = 31 * result + locale.hashCode();
+    if (locale != null) {
+      result = 31 * result + locale.hashCode();
+    }
     return result;
   }
 



Mime
View raw message