jdk/src/java.base/share/classes/sun/util/locale/BaseLocale.java
changeset 34774 03b4e6dc367b
parent 27067 0e748d185207
equal deleted inserted replaced
34764:f9bcdce2df26 34774:03b4e6dc367b
    44     private final String language;
    44     private final String language;
    45     private final String script;
    45     private final String script;
    46     private final String region;
    46     private final String region;
    47     private final String variant;
    47     private final String variant;
    48 
    48 
    49     private volatile int hash = 0;
    49     private volatile int hash;
    50 
    50 
    51     // This method must be called only when creating the Locale.* constants.
    51     // This method must be called only when creating the Locale.* constants.
    52     private BaseLocale(String language, String region) {
    52     private BaseLocale(String language, String region) {
    53         this.language = language;
    53         this.language = language;
    54         this.script = "";
    54         this.script = "";
   145             // Generating a hash value from language, script, region and variant
   145             // Generating a hash value from language, script, region and variant
   146             h = language.hashCode();
   146             h = language.hashCode();
   147             h = 31 * h + script.hashCode();
   147             h = 31 * h + script.hashCode();
   148             h = 31 * h + region.hashCode();
   148             h = 31 * h + region.hashCode();
   149             h = 31 * h + variant.hashCode();
   149             h = 31 * h + variant.hashCode();
   150             hash = h;
   150             if (h != 0) {
       
   151                 hash = h;
       
   152             }
   151         }
   153         }
   152         return h;
   154         return h;
   153     }
   155     }
   154 
   156 
   155     private static final class Key {
   157     private static final class Key {