painless-changes.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. [discrete]
  2. [[breaking_80_painless_changes]]
  3. ==== Painless changes
  4. //NOTE: The notable-breaking-changes tagged regions are re-used in the
  5. //Installation and Upgrade Guide
  6. //tag::notable-breaking-changes[]
  7. .The `JodaCompatibleZonedDateTime` class has been removed.
  8. [%collapsible]
  9. ====
  10. *Details* +
  11. As a transition from Joda datetime to Java datetime, scripting used
  12. an intermediate class called `JodaCompatibleZonedDateTime`. This class
  13. has been removed and is replaced by `ZonedDateTime`. Any use of casting
  14. to a `JodaCompatibleZonedDateTime` or use of method calls only available
  15. in `JodaCompatibleZonedDateTime` in a script will result in a compilation
  16. error, and may not allow the upgraded node to start.
  17. *Impact* +
  18. Before upgrading, replace `getDayOfWeek` with `getDayOfWeekEnum().value` in any
  19. scripts. Any use of `getDayOfWeek` expecting a return value of `int` will result
  20. in a compilation error or runtime error and may not allow the upgraded node to
  21. start.
  22. The following `JodaCompatibleZonedDateTime` methods must be replaced using
  23. `ZonedDateTime` methods prior to upgrade:
  24. * `getMillis()` -> `toInstant().toEpochMilli()`
  25. * `getCenturyOfEra()` -> `get(ChronoField.YEAR_OF_ERA) / 100`
  26. * `getEra()` -> `get(ChronoField.ERA)`
  27. * `getHourOfDay()` -> `getHour()`
  28. * `getMillisOfDay()` -> `get(ChronoField.MILLI_OF_DAY)`
  29. * `getMillisOfSecond()` -> `get(ChronoField.MILLI_OF_SECOND)`
  30. * `getMinuteOfDay()` -> `get(ChronoField.MINUTE_OF_DAY)`
  31. * `getMinuteOfHour()` -> `getMinute()`
  32. * `getMonthOfYear()` -> `getMonthValue()`
  33. * `getSecondOfDay()` -> `get(ChronoField.SECOND_OF_DAY)`
  34. * `getSecondOfMinute()` -> `getSecond()`
  35. * `getWeekOfWeekyear()` -> `get(IsoFields.WEEK_OF_WEEK_BASED_YEAR)`
  36. * `getWeekyear()` -> `get(IsoFields.WEEK_BASED_YEAR)`
  37. * `getYearOfCentury()` -> `get(ChronoField.YEAR_OF_ERA) % 100`
  38. * `getYearOfEra()` -> `get(ChronoField.YEAR_OF_ERA)`
  39. * `toString(String)` -> a DateTimeFormatter
  40. * `toString(String, Locale)` -> a DateTimeFormatter
  41. ====
  42. //end::notable-breaking-changes[]