Uploaded image for project: 'Java Support'
  1. Java Support
  2. JSPT-76

centralise detection of Java runtime version

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.3.0
    • Fix Version/s: 7.4.0, 8.0.0
    • Component/s: None
    • Labels:
      None

      Description

      We have a number of places in our tests where we do different things for Java 8. In opensaml, this is centralised; in the IdP it's distributed around the tests.

      The way version detection is performed in each of these cases was built to distinguish between Java 7 (and to a limited extent Java 6) and Java 8, and tend to be described in terms of whether Java 8 is in use.

      The detection mechanisms written for that context mostly fail in the presence of Java 9 (either by throwing an exception or correctly detecting Java 9 as "not 8" and then interpreting that as Java 7), and of course further down the line we will have to deal with the new post-V9 version system.

      It seems clear that rather than having multiple places to update this on the (now much more frequent) release of a new Java version, we should centralise this functionality in java-support.

      To avoid exposing a broader API than strictly necessary, I propose a utility class with (for now) a single isV8OrLater method:

      • The more obvious API of returning "the Java version" and then having clients compare against it begs the question of what the sequence and ordering of those values will be in the future.
      • I don't think we¬†ever want to write tests for "==8" or similar, given the intended increased release rate.

      It's not clear to me which of the existing java-support packages this would live in; maybe we need a new one.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ian@iay.org.uk Ian Young
              Reporter:
              ian@iay.org.uk Ian Young
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours, 23 minutes
                  6h 23m