Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-624

SystemUtils.getJavaVersionAsFloat throws StringIndexOutOfBoundsException on Android runtime/Dalvik VM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 3.0
    • lang.*
    • None

    Description

      Can be replicated in the Android emulator quite easily.

      Stack trace:

      at org.apache.commons.lang.builder.ToStringBuilder.<clinit>(ToStringBuilder.java:98)
      E/AndroidRuntime( 1681): 	... 17 more
      E/AndroidRuntime( 1681): Caused by: java.lang.ExceptionInInitializerError
      E/AndroidRuntime( 1681): 	at org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2276)
      E/AndroidRuntime( 1681): 	at org.apache.commons.lang.builder.ToStringStyle.<clinit>(ToStringStyle.java:94)
      E/AndroidRuntime( 1681): 	... 18 more
      E/AndroidRuntime( 1681): Caused by: java.lang.StringIndexOutOfBoundsException
      E/AndroidRuntime( 1681): 	at java.lang.String.substring(String.java:1571)
      E/AndroidRuntime( 1681): 	at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1153)
      E/AndroidRuntime( 1681): 	at org.apache.commons.lang.SystemUtils.<clinit>(SystemUtils.java:818)
      

      Attachments

        1. LANG-624.patch
          30 kB
          Henri Yandell
        2. AndriodJavaVersion.png
          56 kB
          ggregory@seagullsw.com

        Activity

          People

            Unassigned Unassigned
            trumant Travis Truman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: