Skip to content

Commit 9e87531

Browse files
authored
Create Compatibility.md
1 parent 9f2e84e commit 9e87531

File tree

1 file changed

+171
-0
lines changed

1 file changed

+171
-0
lines changed

Compatibility.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
Compatibility notes for v5.0 compared with previous version v4.38:
2+
------------------------------------------------------------------
3+
4+
net.time4j.Duration:
5+
signature of method "Duration.comparator(T)" changed to: "<U extends IsoUnit, T extends TimePoint<U, T>> Comparator<Duration<? extends U>> comparator(T)
6+
7+
net.time4j.Moment:
8+
localFormatter(...)- and formatter(...)-methods removed => use factory methods of desired formatter directly
9+
10+
net.time4j.PlainDate:
11+
localFormatter(...)- and formatter(...)-methods removed => use factory methods of desired formatter directly
12+
method "axis(Converter<S, PlainDate>)" removed => use either new method "threeten()" or "new BridgeChronology<>(converter, PlainDate.axis())"
13+
14+
net.time4j.PlainTime:
15+
constant "ISO_HOUR" removed => use "HOUR_FROM_0_TO_24"
16+
localFormatter(...)- and formatter(...)-methods removed => use factory methods of desired formatter directly
17+
method "axis(Converter<S, PlainTime>)" removed => use either new method "threeten()" or "new BridgeChronology<>(converter, PlainTime.axis())"
18+
19+
net.time4j.PlainTimestamp:
20+
localFormatter(...)- and formatter(...)-methods removed => use factory methods of desired formatter directly
21+
method "axis(Converter<S, PlainTimestamp>)" removed => use either new method "threeten()" or "new BridgeChronology<>(converter, PlainTimestamp.axis())"
22+
23+
net.time4j.Platform:
24+
removed without replacement (use the alternative concept of "net.time4j.format.platform.SimpleFormatter")
25+
26+
net.time4j.ZonalClock:
27+
method "currentMoment()" removed => use "now().inStdTimezone()" instead (for better readability)
28+
29+
net.time4j.ZonalDateTime:
30+
method "parse(String, TemporalFormatter<Moment>)" now throws a ChronoException instead of a ParseException
31+
method "parse(String, TemporalFormatter<Moment>, ParsePosition)" removed
32+
33+
net.time4j.calendar.EthiopianCalendar:
34+
method "getYearOfEra()" removed => use "getYear()"
35+
36+
net.time4j.calendar.HebrewMonth.Order:
37+
constant "BIBILICAL" removed => use "BIBLICAL"
38+
39+
net.time4j.calendar.astro.SolarTime:
40+
method "sunrise(TZID)" removed => use other overloaded methods and then apply a timezone-based conversion
41+
method "sunset(TZID)" removed => use other overloaded methods and then apply a timezone-based conversion
42+
method "transitAtNoon(TZID)" removed => use other overloaded methods and then apply a timezone-based conversion
43+
method "transitAtMidnight(TZID)" removed => use other overloaded methods and then apply a timezone-based conversion
44+
45+
net.time4j.calendar.astro.SolarTime.Calculator:
46+
method "declination(double)" removed => use same method in class StdSolarCalculator
47+
constant "NOAA" removed => use enum constant in StdSolarCalculator
48+
constant "SIMPLE" removed => use enum constant in StdSolarCalculator
49+
50+
net.time4j.engine.CalendarEra (and all implementations):
51+
method "getValue()" removed without replacement because the underlying concept of temporal order of eras is often wrong
52+
53+
net.time4j.engine.ChronoMerger (and all implementations):
54+
method "createFrom(ChronoEntity<?>, AttributeQuery, boolean)" removed in favour of overloaded method with extra boolean parameter
55+
method "createFrom(TemporalAccessor, AttributeQuery)" removed => use bridge chronology instead
56+
57+
net.time4j.engine.Chronology:
58+
method "lookup(Class)" now works with an unspecified generic type T without upper bound
59+
60+
net.time4j.engine.RealTime:
61+
this interface has been removed without replacement, just use the implementation MachineTime in main package
62+
63+
net.time4j.engine.StartOfDay:
64+
signature of method "getDeviation(Calendrical<?, ?>, TZID)" changed to "getDeviation(CalendarDate, TZID)" => adjust subclasses
65+
66+
net.time4j.engine.TimeLine:
67+
getMinimum() and getMaximum() are no longer default methods and must be implemented
68+
69+
net.time4j.format.CalendarText:
70+
method "getFormatPatterns()" removed => use one of methods "patternForXYZ()" instead
71+
method "getTimestampPattern(DisplayMode, DisplayMode, Locale locale)" removed => use "patternForTimestamp(...)" instead
72+
method "getMeridiems(TextWidth)" removed => use "getMeridiems(TextWidth, OutputContext.FORMAT)" instead
73+
method "getGMTPrefix(Locale)" removed => use "ZonalOffset.UTC.getStdFormatPattern(Locale)"
74+
75+
net.time4j.format.ChronoPattern:
76+
removed without replacement
77+
78+
net.time4j.format.FormatEngine:
79+
removed without replacement
80+
81+
net.time4j.format.NumericalElement:
82+
the type parameter V is now constrained to enums
83+
84+
net.time4j.format.TemporalFormatter:
85+
new method "print(T)" added where old method "format(T)" becomes a synonym for new method
86+
method "formatToBuffer(T, Appendable)" removed => use similar print()-methods in concrete implementations
87+
method "parse(CharSequence, ParsePosition)" removed => use similar methods in concrete implementations (for example in ChronoFormatter with ParseLog)
88+
method "parse(CharSequence, ParsePosition, RawValues)" changed signature such that the ParsePosition-parameter was removed
89+
90+
net.time4j.format.TextProvider:
91+
method "getControl()" removed => no replacement (does not work on module path in Java 9 or later)
92+
method "meridiems(String, Locale, TextWidth)" removed => use overloaded method with OutputContext-parameter
93+
94+
net.time4j.format.expert.ChronoFormatter:
95+
public static <T extends LocalizedPatternSupport> ChronoFormatter<T> ofStyle(...) uses DisplayMode-parameter instead of DisplayStyle
96+
method "formatThreeten(TemporalAccessor)" removed => use static factory methods and/or bridge chronology instead
97+
method "printThreeten(TemporalAccessor, Appendable)" removed => use static factory methods and/or bridge chronology instead
98+
method "print(T, Appendable, AttributeQuery, ChronoFunction<ChronoDisplay, R>)" removed in favour of simplified signature
99+
100+
net.time4j.format.expert.ChronoPrinter:
101+
method "format(T)" renamed to "print(T)"
102+
method "print(T, Appendable, AttributeQuery, ChronoFunction<ChronoDisplay, R>)" removed in favour of simplified signature
103+
104+
net.time4j.format.expert.PatternType:
105+
constant "NON_ISO_DATE" removed in favour of "CLDR_DATE"
106+
107+
net.time4j.range.ClockInterval:
108+
method "parse(CharSequence, ChronoParser<PlainTime>, BracketPolicy, ParseLog)" removed in favour of other parse-methods
109+
110+
net.time4j.range.DateInterval:
111+
method "in(Timezone)" removed => use method "inTimezone(TZID)" instead
112+
method "move(long, CalendarUnit)" removed in favour of "move(long, IsoDateUnit)"
113+
method "parse(CharSequence, ChronoParser<PlainDate>, BracketPolicy, ParseLog)" removed in favour of other parse-methods
114+
115+
net.time4j.range.DayPartitionRule:
116+
method "getPartition(PlainDate)" renamed to "getPartitions(PlainDate)"
117+
118+
net.time4j.range.IntervalCollection:
119+
inherits from java.util.AbstractCollection
120+
method "contains(T)" removed => use method "encloses(T)" instead
121+
method "plus(List<? extends ChronoInterval<T>>)" removed => use overloaded method with Collection-parameter
122+
method "minus(List<? extends ChronoInterval<T>>)" removed => use overloaded method with Collection-parameter
123+
method `onTimeLine(TimeLine)` renamed to `on(TimeLine)`
124+
125+
net.time4j.range.IntervalTree:
126+
method `onTimeLine(TimeLine, Collection)` renamed to `on(TimeLine, Collection)`
127+
128+
net.time4j.range.IsoInterval:
129+
method "print(ChronoPrinter<T>, char, ChronoPrinter<T>, BracketPolicy, Appendable)" removed => use overloaded method with InfinityStyle.SYMBOL
130+
131+
net.time4j.range.MachineTime:
132+
class moved to main package "net.time4j" => change import statement
133+
method "dividedBy(long)" removed => use overloaded method with parameter RoundingMode.HALF_UP
134+
135+
net.time4j.range.MomentInterval:
136+
method "parse(CharSequence, ChronoParser<Moment>, BracketPolicy, ParseLog)" removed in favour of other parse-methods
137+
method "surrounding(Instant, MachineTime<TimeUnit>, double)" removed in favour of other surrounding-methods
138+
139+
net.time4j.range.SimpleInterval:
140+
method `on(TimeAxis)` removed and method `onTimeLine(TimeLine)` renamed to `on(TimeLine)`
141+
method "on(CalendarFamily, String)" removed => use "CalendarPeriod.on(CalendarFamily, String)" instead
142+
143+
net.time4j.range.TimestampInterval:
144+
method "in(Timezone)" removed => use method "inTimezone(TZID)" instead
145+
method "parse(CharSequence, ChronoParser<PlainTimestamp>, BracketPolicy, ParseLog)" removed in favour of other parse-methods
146+
147+
net.time4j.tz.TransitionHistory:
148+
method "getNextTransition(UnixTime)" removed in favour of "findNextTransition(UnixTime)"
149+
150+
net.time4j.tz.ZonalOffset:
151+
method "atLongitude(OffsetSign, int, int, int)" removed in favour of overloaded method with last double-parameter
152+
153+
net.time4j.tz.ZonalTransition:
154+
method "isDaylightSaving()" removed without replacement => use Timezone.isDaylightSaving(UnixTime moment) instead
155+
156+
net.time4j.tz.ZoneProvider:
157+
no replacement, use the super interfaces ZoneNameProvider or ZoneModelProvider instead
158+
159+
net.time4j.tz.model.DaylightSavingRule:
160+
method "isSaving()" removed without replacement
161+
162+
net.time4j.tz.other.WindowsZone:
163+
resolveSmart() now uses an optional result instead of sometimes null-result
164+
165+
net.time4j.xml.AnnualDate:
166+
moved to main package "net.time4j" => change import statement
167+
168+
--- Time4A ---
169+
170+
net.time4j.android.ApplicationStarter:
171+
method "prepareResources(Application)" removed => use "prepareAssets(application, null)" instead

0 commit comments

Comments
 (0)