You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Catherine Hope (JIRA)" <ji...@apache.org> on 2009/07/13 19:23:14 UTC

[jira] Updated: (HARMONY-6271) [classlib][math] BigDecimal.divide should throw an ArithmeticException instead of OutOfMemory for too large scales

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

Catherine Hope updated HARMONY-6271:
------------------------------------

    Attachment: bigdecimal-patch.txt

Fix simply to change the OutOfMemoryError to an ArithmeticException (the error message remains the same as this shouldn't be matched).
Test added to BigIntegerDivideTest.java (testCase25)

> [classlib][math] BigDecimal.divide should throw an ArithmeticException instead of OutOfMemory for too large scales
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6271
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6271
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Priority: Minor
>         Attachments: bigdecimal-patch.txt
>
>
> BigDecimal.divide should throw an ArithmeticException instead of OutOfMemory when called with a scale that can't be satisfied with the available memory.  The exception defined in the specification is:
> "throws ArithmeticException - if divisor is zero, roundingMode==RoundingMode.UNNECESSARY and the specified scale is insufficient to represent the result of the division exactly."
> Which doesn't say what to do in this precise occurrence (though it doesn't say it may throw an OutOfMemoryError), but both Sun and IBM Java implementations have this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.