Polish contribution

See gh-31531
This commit is contained in:
Sam Brannen
2023-12-04 16:42:06 +01:00
parent 490b5c77fc
commit d71853f105
18 changed files with 55 additions and 51 deletions

View File

@@ -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.

View File

@@ -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 + "'");
}
}