Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-188

Make Complex and Fraction classes immutable and thus thread-safe

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Labels:
      None

      Description

      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 threadsafe.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: