commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (MATH-188) Make Complex and Fraction classes immutable and thus thread-safe
Date Mon, 04 Feb 2008 03:49:07 GMT


Phil Steitz commented on MATH-188:

The Fraction change is possible,  since the fields are private, though I don't see this as
a big deal.  I think the class is effectively immutable now.

The Complex change is unfortunately not backward compatible.  We could deprecate the *protected*
fields and aim to remove and replace them later, but we can't make them final now.  The class
as is is immutable, though subclasses could add mutators.

> Make Complex and Fraction classes immutable and thus thread-safe
> ----------------------------------------------------------------
>                 Key: MATH-188
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
> There are many classes with instance fields that could be made final.
> Two in particular seem like ideal candidates:
> Complex - fields: real, imaginary
> Fraction - fields: numerator, denominator (the private reduce() method also needs to
be inlined)
> As far as I can tell, making the above changes makes the classes immutable and therefore

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

View raw message