Skip to content

Downgrade accidental use of Java 1.7 APIs [SPR-11319] #15943

Closed

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-11319 and commented

To prevent issue similar to #15937 we have integrated animal sniffer in our build to check the use of the JDK APIs.

This issue is about collecting the classes that are using 1.7+ APIs, knowing that some are for perfectly valid reasons (support of 1.8 features)


Issue Links:

Referenced from: commits 838855b

Activity

  1. spring-projects-issues commented on Jan 16, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Stéphane Nicoll commented

    StandardTypeComparator (due to #13802)

  2. spring-projects-issues commented on Jan 16, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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!

  3. spring-projects-issues commented on Jan 16, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Stéphane Nicoll commented

    Juergen, as you're working on that, I'll assign it to you.

    Thanks

  4. spring-projects-issues commented on Jan 16, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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

  5. added this to the 4.0.1 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions