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

SystemUtils.getJavaVersionAsFloat throws StringIndexOutOfBoundsException on Android runtime/Dalvik VM

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: