Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-993

Apache Pivot does not work with Oracle JDK8u131

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.1, 2.0.5
    • Component/s: all
    • Labels:
      None
    • Environment:
      java version "1.8.0_131"
      Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

      Description

      Attempting to run a Pivot application with Oracle JDK8u131 results in the following stacktrace

      Caused by: java.lang.NumberFormatException: Value out of range. Value:"131" Radix:10
      	at java.lang.Byte.parseByte(Byte.java:151)
      	at java.lang.Byte.parseByte(Byte.java:175)
      	at org.apache.pivot.util.Version.decode(Version.java:150)
      	at org.apache.pivot.wtk.ApplicationContext.<clinit>(ApplicationContext.java:1697)
      	... 15 more
      

      The problem is located in the `Version` class. This class parses version numbers using Byte. 131 is clearly out of range. Should use `Short` or `Integer` instead.

        Issue Links

          Activity

          Hide
          smartini Sandro Martini added a comment -

          Hi Andres, thanks for raising the issue.
          We'll fix it soon.

          Show
          smartini Sandro Martini added a comment - Hi Andres, thanks for raising the issue. We'll fix it soon.
          Hide
          aalmiray Andres Almiray added a comment -

          Lovely, thank you! As an aside, is there an ETA for the next release? Pivot is one of the supported UI toolkits in the Griffon Framework for close to 7 years now and would love to keep it going

          Show
          aalmiray Andres Almiray added a comment - Lovely, thank you! As an aside, is there an ETA for the next release? Pivot is one of the supported UI toolkits in the Griffon Framework for close to 7 years now and would love to keep it going
          Hide
          smartini Sandro Martini added a comment -

          We don't have an ETA, but looking at currently open Issues for 2.0.5 we should be able to resolve them in a few weeks, the only problem is to find enough free time ... now I'll ping our dev mailing list.
          Don't worry, Pivot will continue his life in Griffon support .

          Show
          smartini Sandro Martini added a comment - We don't have an ETA, but looking at currently open Issues for 2.0.5 we should be able to resolve them in a few weeks, the only problem is to find enough free time ... now I'll ping our dev mailing list. Don't worry, Pivot will continue his life in Griffon support .
          Hide
          tvolkert Todd Volkert added a comment -

          I'm getting users of my app unable to run it due to this bug (since we try to parse the Java version in ApplicationContext's static initializer block).

          In my case, I'm still on Pivot 1.4, so I'm just going to have to patch a local fix since updating to Pivot 2.0 is beyond the scope of my work.

          Show
          tvolkert Todd Volkert added a comment - I'm getting users of my app unable to run it due to this bug (since we try to parse the Java version in ApplicationContext's static initializer block). In my case, I'm still on Pivot 1.4, so I'm just going to have to patch a local fix since updating to Pivot 2.0 is beyond the scope of my work.
          Hide
          tvolkert Todd Volkert added a comment -

          Here's an untested patch that should fix this: https://gist.github.com/anonymous/8c1c9be267f04facfa8f8ccd5a11c408

          Show
          tvolkert Todd Volkert added a comment - Here's an untested patch that should fix this: https://gist.github.com/anonymous/8c1c9be267f04facfa8f8ccd5a11c408
          Hide
          smartini Sandro Martini added a comment -

          Hi Todd, thanks I'll take a look .
          Would it be useful to you a 1.4.1 release with that fix ?

          Show
          smartini Sandro Martini added a comment - Hi Todd, thanks I'll take a look . Would it be useful to you a 1.4.1 release with that fix ?
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          Committed Todd's patch (basically) to "branches/2.0.x":
          Transmitting file data .done
          Committing transaction...
          Committed revision 1792480.

          Show
          rwhitcomb Roger Whitcomb added a comment - Committed Todd's patch (basically) to "branches/2.0.x": Transmitting file data .done Committing transaction... Committed revision 1792480.
          Hide
          tvolkert Todd Volkert added a comment -

          No need to release a 1.4.1 maintenance release on my account - I just built a locally patched version for myself

          Also, if you did such a maintenance release, technically you'd probably also want to do one for 1.5.x, etc. - I leave it to you whether you think it's worth it. One argument in favor of doing so would be that `o.a.p.wtk.ApplicationContext` has a static initializer that parses the JDK version, so this bug will likely affect all Pivot users after they update their Java version...

          Roger, this should probably be patched into trunk as well.

          Show
          tvolkert Todd Volkert added a comment - No need to release a 1.4.1 maintenance release on my account - I just built a locally patched version for myself Also, if you did such a maintenance release, technically you'd probably also want to do one for 1.5.x, etc. - I leave it to you whether you think it's worth it. One argument in favor of doing so would be that `o.a.p.wtk.ApplicationContext` has a static initializer that parses the JDK version, so this bug will likely affect all Pivot users after they update their Java version... Roger, this should probably be patched into trunk as well.
          Hide
          smartini Sandro Martini added a comment -

          Todd: ok, we can wait to see if someone other ask for a maintenance release for 1.4.x or 1.5.x ...
          Roger just committed the patch in 2.0.x and should do the same in trunk soon.
          Thanks for the help . Bye

          Show
          smartini Sandro Martini added a comment - Todd: ok, we can wait to see if someone other ask for a maintenance release for 1.4.x or 1.5.x ... Roger just committed the patch in 2.0.x and should do the same in trunk soon. Thanks for the help . Bye
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          I'm working on "trunk" as well as (re)committing the VersionTest.java that seems to have disappeared after version 1.1 – seems useful again.

          Show
          rwhitcomb Roger Whitcomb added a comment - I'm working on "trunk" as well as (re)committing the VersionTest.java that seems to have disappeared after version 1.1 – seems useful again.
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          Merged extant changes from "branches/2.0.x" to "trunk":
          Sending .
          Sending core/src/org/apache/pivot/util/Version.java
          Transmitting file data .done
          Committing transaction...
          Committed revision 1792518.

          Show
          rwhitcomb Roger Whitcomb added a comment - Merged extant changes from "branches/2.0.x" to "trunk": Sending . Sending core/src/org/apache/pivot/util/Version.java Transmitting file data .done Committing transaction... Committed revision 1792518.
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          Fixed the calculations in "getNumber" now that we're using a "long" for the result.

          Updated the IllegalArgumentException messages to allow 0x7FFF as an inclusive value.

          Added a core "VersionTest.java" to test a number of the changes.

          "trunk":
          Sending core\src\org\apache\pivot\util\Version.java
          Adding core\test\org\apache\pivot\util\test\VersionTest.java
          Transmitting file data ..done
          Committing transaction...
          Committed revision 1792531.

          Show
          rwhitcomb Roger Whitcomb added a comment - Fixed the calculations in "getNumber" now that we're using a "long" for the result. Updated the IllegalArgumentException messages to allow 0x7FFF as an inclusive value. Added a core "VersionTest.java" to test a number of the changes. "trunk": Sending core\src\org\apache\pivot\util\Version.java Adding core\test\org\apache\pivot\util\test\VersionTest.java Transmitting file data ..done Committing transaction... Committed revision 1792531.
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          Merged latest changes to "branches/2.0.x":
          Sending .
          Sending core\src\org\apache\pivot\util\Version.java
          Adding core\test\org\apache\pivot\util\test\VersionTest.java
          Transmitting file data .done
          Committing transaction...
          Committed revision 1792532.

          Show
          rwhitcomb Roger Whitcomb added a comment - Merged latest changes to "branches/2.0.x": Sending . Sending core\src\org\apache\pivot\util\Version.java Adding core\test\org\apache\pivot\util\test\VersionTest.java Transmitting file data .done Committing transaction... Committed revision 1792532.
          Hide
          davidbilly DavidBilly added a comment -

          Roger Whitcomb

          Hi Roger,

          May i know when official v2.0.5 jar release? because i have to patch this for my project.

          My user cant use with latest java sdk.

          Thanks.

          Show
          davidbilly DavidBilly added a comment - Roger Whitcomb Hi Roger, May i know when official v2.0.5 jar release? because i have to patch this for my project. My user cant use with latest java sdk. Thanks.
          Hide
          rwhitcomb Roger Whitcomb added a comment -

          Hi David,
          Totally understand. We are working towards the release right now. Have to ask Sandro when he has the cycles to push it out. I expect in the next week or so.
          Thanks,
          ~Roger

          Show
          rwhitcomb Roger Whitcomb added a comment - Hi David, Totally understand. We are working towards the release right now. Have to ask Sandro when he has the cycles to push it out. I expect in the next week or so. Thanks, ~Roger
          Hide
          davidbilly DavidBilly added a comment -

          Roger Whitcomb

          Hi Roger, I'm looking forward it, thanks for the effort

          Show
          davidbilly DavidBilly added a comment - Roger Whitcomb Hi Roger, I'm looking forward it, thanks for the effort

            People

            • Assignee:
              rwhitcomb Roger Whitcomb
              Reporter:
              aalmiray Andres Almiray
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development