commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Tompkins (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MATH-1395) MathParseException when parsing fractions on Android
Date Tue, 18 Apr 2017 15:23:41 GMT

     [ 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)

Mime
View raw message