changeset 14709:95bf0932aa78

8047780: [Doc] Locale.LanguageRange() throws an undocumented IAE when range is ill-formed. Reviewed-by: okutsu, peytoia
author nishjain
date Wed, 08 Jun 2016 12:54:37 +0900
parents 4f8e07921d19
children ea35f7971115
files src/java.base/share/classes/java/util/Locale.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/util/Locale.java	Tue Jun 07 09:00:11 2016 -0700
+++ b/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) {