painless-changes.asciidoc 1.8 KB

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