Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB44018819 for ; Sat, 26 Mar 2016 01:24:25 +0000 (UTC) Received: (qmail 42585 invoked by uid 500); 26 Mar 2016 01:24:25 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 42483 invoked by uid 500); 26 Mar 2016 01:24:25 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 42472 invoked by uid 99); 26 Mar 2016 01:24:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Mar 2016 01:24:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6AB8F2C14DC for ; Sat, 26 Mar 2016 01:24:25 +0000 (UTC) Date: Sat, 26 Mar 2016 01:24:25 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MATH-1340) "serializeAndRecover" testing utility swallows exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15212696#comment-15212696 ] Gilles commented on MATH-1340: ------------------------------ Fix available in branch "feature-MATH-1340". > "serializeAndRecover" testing utility swallows exceptions > --------------------------------------------------------- > > Key: MATH-1340 > URL: https://issues.apache.org/jira/browse/MATH-1340 > Project: Commons Math > Issue Type: Improvement > Reporter: Gilles > Assignee: Gilles > Priority: Trivial > Labels: debugging > Fix For: 4.0 > > > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)