You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Rob Tompkins (JIRA)" <ji...@apache.org> on 2017/04/18 15:23:41 UTC

[jira] [Updated] (MATH-1395) MathParseException when parsing fractions on Android

     [ https://issues.apache.org/jira/browse/MATH-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Tompkins updated MATH-1395:
-------------------------------
    Fix Version/s: 4.0

> MathParseException when parsing fractions on Android
> ----------------------------------------------------
>
>                 Key: MATH-1395
>                 URL: https://issues.apache.org/jira/browse/MATH-1395
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Brian Zable
>             Fix For: 4.0
>
>
> I'm seeing a strange issue when trying to work with the Fraction classes on Android. In my tests, which are standard JUnit tests, the following code performs flawlessly;
> {code:java}
> String amount = "1 1/2";
> ProperFractionFormat ff = new ProperFractionFormat();
> Fraction f = ff.parse(amount.trim());
> {code}
> However, at run time in an Android application, the same code throws an Exception:
> {noformat}
>                    Caused by: org.apache.commons.math3.exception.MathParseException: illegal state: string "1 1/2" unparseable (from position 3) as an object of type org.apache.commons.math3.fraction.Fraction
>                       at org.apache.commons.math3.fraction.FractionFormat.parse(FractionFormat.java:199)
> {noformat}
> I am testing on a Nexus 5X emulator with API level 23 for reference.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)