Polish contribution
See gh-31531
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -269,7 +269,7 @@ public class DateFormatter implements Formatter<Date> {
|
||||
if (timeStyle != -1) {
|
||||
return DateFormat.getTimeInstance(timeStyle, locale);
|
||||
}
|
||||
throw new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'");
|
||||
throw unsupportedStylePatternException();
|
||||
|
||||
}
|
||||
return DateFormat.getDateInstance(this.style, locale);
|
||||
@@ -284,10 +284,14 @@ public class DateFormatter implements Formatter<Date> {
|
||||
case 'L' -> DateFormat.LONG;
|
||||
case 'F' -> DateFormat.FULL;
|
||||
case '-' -> -1;
|
||||
default -> throw new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'");
|
||||
default -> throw unsupportedStylePatternException();
|
||||
};
|
||||
}
|
||||
throw new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'");
|
||||
throw unsupportedStylePatternException();
|
||||
}
|
||||
|
||||
private IllegalStateException unsupportedStylePatternException() {
|
||||
return new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user