diff --git a/Date-and-Time-Formatting-with-JDK-20-and-higher.md b/Date-and-Time-Formatting-with-JDK-20-and-higher.md index 2adcfea..99a9fae 100644 --- a/Date-and-Time-Formatting-with-JDK-20-and-higher.md +++ b/Date-and-Time-Formatting-with-JDK-20-and-higher.md @@ -34,6 +34,11 @@ The Spring team also recommends the use of UTF encoding whenever possible – fo Within application code or tests you may need to match against an input string to determine if the provided text adheres to the format you expect; however, the input string may contain a narrow non-breaking space where you have traditionally expected a standard space. To address use cases like that, you can use the `\p{Zs}` regular expression pattern to match against any Unicode space character. For example, `12:00\\p{Zs}PM` matches against `"12:00PM"` and `"12:00PM"`, where `` is a standard space and `` is a narrow non-breaking space (`"\u202F"`). +If you are using JUnit Jupiter as your testing framework and wish to run certain tests on JDK versions before or after the CLDR changes in the JDK, you can annotate a test class or test method as follows. + +- `@EnabledForJreRange(max = JAVA_19)`: enabled on all JDKs before JDK 20. +- `@EnabledForJreRange(min = JAVA_20)`: enabled on all JDKs after and including JDK 20. + The following sections provide guidance on lenient parsing for `@DateTimeFormat`, `SimpleDateFormat`, and `DateTimeFormatter`. Note, however, that you can also consider implementing and registering a custom `java.util.spi.LocaleServiceProvider` to support more advanced use cases. See [JEP 252](https://openjdk.org/jeps/252) for an example. #### Lenient `@DateTimeFormat` Configuration