You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:29:54 UTC

[myfaces-trinidad] 13/30: Checkpoint: StableNameUtils code cleanup

This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch andys-skin-pregen
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 3f0015c7f254645edaa9e259cf7ee6913804c354
Author: Andy Schwartz <an...@apache.org>
AuthorDate: Tue Mar 13 18:16:14 2012 +0000

    Checkpoint: StableNameUtils code cleanup
---
 .../trinidadinternal/style/util/StableNameUtils.java        | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StableNameUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StableNameUtils.java
index 16935a1..97a7042 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StableNameUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StableNameUtils.java
@@ -506,6 +506,8 @@ public final class StableNameUtils
     @Override
     protected void appendNonSingleValueName(StringBuilder builder, Match match)
     {
+      // This super call will handle appending the agent name segment.
+      // However, we also need to ensure that the agent version is added.
       super.appendNonSingleValueName(builder, match);
       
       // Tack on a value for the version field.  (All stable names need to
@@ -580,15 +582,20 @@ public final class StableNameUtils
       )
     {
       assert(newLocale != null);
-
       if (oldLocale == null)
       {
         return newLocale;
       }
 
       assert(oldLocale.getLanguage().equals(newLocale.getLanguage()));
-
-      return (oldLocale.getCountry() == null ? newLocale : oldLocale);
+      String oldCountry = oldLocale.getCountry();
+      if (oldCountry == null)
+      {
+        return newLocale;
+      }
+      
+      assert(oldCountry.equals(newLocale.getCountry()));
+      return (oldLocale.getVariant() == null ? newLocale : oldLocale);
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.