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

"serializeAndRecover" testing utility swallows exceptions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 4.0
    • None

    Description

      Class TestUtils (in the "test" part of the repository) contains a "serializeAndRecover" method that catches "IOException" and "ClassNotFoundException" and just returns "null".

      When testing code changes, some unit tests can thus throw "NullPointerException". Even if the returned value is checked for "null", there is no trace as to what caused it (the original stack trace is lost).

      I propose to wrap the exception in a "RuntimeException" and rethrow it.

      Attachments

        Activity

          People

            erans Gilles Sadowski
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: