You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Downgrade accidental use of Java 1.7 APIs [SPR-11319] #15943
Fixed along with a general revision of StandardTypeComparator.
As a reminder for casual readers: For some reason, Integer.compare and Long.compare have been introduced as late as JDK 1.7, even if their Float and Double counterparts have been available for much longer.
Since all that those compare methods do is to calculate a comparison result based on primitive values, it's straightforward to implement equivalent behavior:
private static int compare(int x, int y) {
return (x < y ? -1 : (x > y ? 1 : 0));
}
private static int compare(long x, long y) {
return (x < y ? -1 : (x > y ? 1 : 0));
}
Activity
spring-projects-issues commentedon Jan 16, 2014
Stéphane Nicoll commented
StandardTypeComparator(due to #13802)spring-projects-issues commentedon Jan 16, 2014
Stéphane Nicoll commented
snicoll@6d1c215 fixes the only accidental use of the Java 1.7 APIs.
Juergen can you please review and cherry pick it? Thanks!
spring-projects-issues commentedon Jan 16, 2014
Stéphane Nicoll commented
Juergen, as you're working on that, I'll assign it to you.
Thanks
spring-projects-issues commentedon Jan 16, 2014
Juergen Hoeller commented
Fixed along with a general revision of StandardTypeComparator.
As a reminder for casual readers: For some reason, Integer.compare and Long.compare have been introduced as late as JDK 1.7, even if their Float and Double counterparts have been available for much longer.
Since all that those compare methods do is to calculate a comparison result based on primitive values, it's straightforward to implement equivalent behavior:
private static int compare(int x, int y) {
return (x < y ? -1 : (x > y ? 1 : 0));
}
private static int compare(long x, long y) {
return (x < y ? -1 : (x > y ? 1 : 0));
}
Juergen