From 57bb8f6b5f30a5c73fa9d70ad240ad666645edb0 Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Wed, 20 Jan 2010 22:33:16 +0000 Subject: [PATCH] HHH-4822 proper placement of the fillStackTrace call git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18597 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../java/org/hibernate/test/annotations/TestCase.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java b/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java index a1c55f68f3..fca78693e4 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java @@ -227,15 +227,10 @@ public abstract class TestCase extends junit.framework.TestCase { closeSession(); throw t; } - catch ( InvocationTargetException e ) { - e.fillInStackTrace(); - throw e.getTargetException(); - } - catch ( IllegalAccessException e ) { - e.fillInStackTrace(); - throw e; - } catch ( Throwable t ) { + if ( t instanceof InvocationTargetException || t instanceof IllegalAccessException ) { + t.fillInStackTrace(); + } closeSession(); if ( failureExpected ) { FailureExpected ann = runMethod.getAnnotation( FailureExpected.class );