Bug 529196 - [junit] Stack trace filter should not filter the exception
message
Change-Id: I774c76f008e6490b8533992e76f1aab1620e61d1
diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TextualTrace.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TextualTrace.java
index b0a9e52..0d58c69 100644
--- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TextualTrace.java
+++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TextualTrace.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -115,10 +115,12 @@
String line;
String[] patterns = filterPatterns;
+ boolean firstLine= true;
try {
- while ((line = bufferedReader.readLine()) != null) {
- if (!filterLine(patterns, line))
+ while ((line= bufferedReader.readLine()) != null) {
+ if (firstLine || !filterLine(patterns, line))
printWriter.println(line);
+ firstLine= false;
}
} catch (IOException e) {
return stackTrace; // return the stack unfiltered