jdk/src/java.base/share/classes/java/util/Locale.java
changeset 34963 a2014a070989
parent 34774 03b4e6dc367b
child 37593 824750ada3d6
--- a/jdk/src/java.base/share/classes/java/util/Locale.java	Thu Jan 14 12:04:19 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java	Fri Jan 15 14:33:11 2016 +0900
@@ -3144,6 +3144,18 @@
                    && range.equals(other.range)
                    && weight == other.weight;
         }
+
+        /**
+         * Returns an informative string representation of this {@code LanguageRange}
+         * object, consisting of language range and weight if the range is
+         * weighted and the weight is less than the max weight.
+         *
+         * @return a string representation of this {@code LanguageRange} object.
+         */
+        @Override
+        public String toString() {
+            return (weight == MAX_WEIGHT) ? range : range + ";q=" + weight;
+        }
     }
 
     /**