8047780: [Doc] Locale.LanguageRange() throws an undocumented IAE when range is ill-formed.
authornishjain
Wed, 08 Jun 2016 12:54:37 +0900
changeset 38860 3d557a5713eb
parent 38859 76eee114a175
child 38861 e567cc17866d
8047780: [Doc] Locale.LanguageRange() throws an undocumented IAE when range is ill-formed. Reviewed-by: okutsu, peytoia
jdk/src/java.base/share/classes/java/util/Locale.java
--- a/jdk/src/java.base/share/classes/java/util/Locale.java	Tue Jun 07 09:00:11 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java	Wed Jun 08 12:54:37 2016 +0900
@@ -2858,6 +2858,8 @@
          * @param range a language range
          * @throws NullPointerException if the given {@code range} is
          *     {@code null}
+         * @throws IllegalArgumentException if the given {@code range} does not
+         * comply with the syntax of the language range mentioned in RFC 4647
          */
         public LanguageRange(String range) {
             this(range, MAX_WEIGHT);
@@ -2873,8 +2875,10 @@
          *     {@code MAX_WEIGHT}
          * @throws NullPointerException if the given {@code range} is
          *     {@code null}
-         * @throws IllegalArgumentException if the given {@code weight} is less
-         *     than {@code MIN_WEIGHT} or greater than {@code MAX_WEIGHT}
+         * @throws IllegalArgumentException if the given {@code range} does not
+         * comply with the syntax of the language range mentioned in RFC 4647
+         * or if the given {@code weight} is less than {@code MIN_WEIGHT}
+         * or greater than {@code MAX_WEIGHT}
          */
         public LanguageRange(String range, double weight) {
             if (range == null) {