@@ -134,7 +134,7 @@ public String print(Duration value) {
134
134
* Detect the style then parse the value to return a duration.
135
135
* @param value the value to parse
136
136
* @return the parsed duration
137
- * @throws IllegalStateException if the value is not a known style or cannot be parsed
137
+ * @throws IllegalArgumentException if the value is not a known style or cannot be parsed
138
138
*/
139
139
public static Duration detectAndParse (String value ) {
140
140
return detectAndParse (value , null );
@@ -146,7 +146,7 @@ public static Duration detectAndParse(String value) {
146
146
* @param unit the duration unit to use if the value doesn't specify one ({@code null}
147
147
* will default to ms)
148
148
* @return the parsed duration
149
- * @throws IllegalStateException if the value is not a known style or cannot be parsed
149
+ * @throws IllegalArgumentException if the value is not a known style or cannot be parsed
150
150
*/
151
151
public static Duration detectAndParse (String value , ChronoUnit unit ) {
152
152
return detect (value ).parse (value , unit );
@@ -156,7 +156,7 @@ public static Duration detectAndParse(String value, ChronoUnit unit) {
156
156
* Detect the style from the given source value.
157
157
* @param value the source value
158
158
* @return the duration style
159
- * @throws IllegalStateException if the value is not a known style
159
+ * @throws IllegalArgumentException if the value is not a known style
160
160
*/
161
161
public static DurationStyle detect (String value ) {
162
162
Assert .notNull (value , "Value must not be null" );
0 commit comments