Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-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 D691817E51 for ; Fri, 10 Apr 2015 20:41:12 +0000 (UTC) Received: (qmail 45610 invoked by uid 500); 10 Apr 2015 20:41:12 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 45528 invoked by uid 500); 10 Apr 2015 20:41:12 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 45405 invoked by uid 99); 10 Apr 2015 20:41:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2015 20:41:12 +0000 Date: Fri, 10 Apr 2015 20:41:12 +0000 (UTC) From: "Jacques Nadeau (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-2626) org.apache.drill.common.StackTrace seems to have duplicate code; should we re-use Throwable's code? 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/DRILL-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Nadeau updated DRILL-2626: ---------------------------------- Component/s: Execution - Flow > org.apache.drill.common.StackTrace seems to have duplicate code; should we re-use Throwable's code? > --------------------------------------------------------------------------------------------------- > > Key: DRILL-2626 > URL: https://issues.apache.org/jira/browse/DRILL-2626 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Flow > Affects Versions: 0.8.0 > Reporter: Daniel Barclay (Drill) > Assignee: Chris Westin > > It seems that class org.apache.drill.common.StackTrace needlessly duplicates code that's already in the JDK. > In particular, it has code to format the stack trace. That seems at least mostly redundant with the formatting code already in java.lang.Throwable. > StackTrace does have a comment about eliminating the StackTrace constructor from the stack trace. However, StackTrace does _not_ actuallly eliminate its contructor from the stack trace (e.g., its stack traces start with "org.apache.drill.common.StackTrace.:..."). > Should StackTrace be implemented by simply subclassing Throwable? > That would eliminate StackTrace's current formatting code (which would also eliminate the difference between StackTrace's format and the standard format). > That should also eliminate having the StackTrace constructor's stack frame show up in the stack trace. (Throwable's constructor/fillInStackTrace already handles that.) > (Having "StackTrace extends Throwable" isn't ideal, since StackTrace is not intended to be a kind of exception, but that would probably be better than the current form, given the bugs StackTrace has/has had (DRILL-2624, DRILL-2625). > That non-ideal subclassing could be eliminated by having a member variable of type Throwable that is constructed during StackTrace's construction, although that would either cause the StackTrace constructor to re-appear in the stack trace or require a non-trivial workaround to re-eliminate it. > Perhaps client code should simply use "new Throwable()" to capture the stack trace and a static methods on a utility class to format the stack trace into a String.) -- This message was sent by Atlassian JIRA (v6.3.4#6332)