commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Zable (JIRA)" <>
Subject [jira] [Created] (MATH-1395) MathParseException when parsing fractions on Android
Date Thu, 17 Nov 2016 03:02:58 GMT
Brian Zable created MATH-1395:

             Summary: MathParseException when parsing fractions on Android
                 Key: MATH-1395
             Project: Commons Math
          Issue Type: Bug
            Reporter: Brian Zable

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;

String amount = "1 1/2";
ProperFractionFormat ff = new ProperFractionFormat();
Fraction f = ff.parse(amount.trim());

However, at run time in an Android application, the same code throws an Exception:
                   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(

I am testing on a Nexus 5X emulator with API level 23 for reference.

This message was sent by Atlassian JIRA

View raw message