[ https://issues.apache.org/jira/browse/LANG-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12987629#action_12987629 ]
Matt Benson commented on LANG-624: ---------------------------------- Agreed; +1 for JAVA_VERSION_SPECIFICATION. Perhaps we should talk more about the int/float calls. I would like for existing code to continue to compile (the user having adjusted the import to the lang3 package). However: * the int-based handling seems to invite chaos in the future. What happens when version 1.12 of the spec emerges? * the specification-based version idea we've moved to only accommodates the one decimal, further marking the whole 3-digit int concept as obsolete. * we could support Number, comparing its float value, but this would yield a different behavior for Integer/boxed int than what had worked previously, and would break clients more insidiously than compilation failure. Considering these points I don't see an acceptable way to support existing code. Until someone suggests a better way, my position is that they're more trouble than they're worth. > SystemUtils.getJavaVersionAsFloat throws StringIndexOutOfBoundsException on > Android runtime/Dalvik VM > ----------------------------------------------------------------------------------------------------- > > Key: LANG-624 > URL: https://issues.apache.org/jira/browse/LANG-624 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 2.5 > Reporter: Travis Truman > Fix For: 3.0 > > Attachments: AndriodJavaVersion.png, LANG-624.patch > > > Can be replicated in the Android emulator quite easily. > Stack trace: > {noformat} > 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) > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.