BlockingBuffer now includes InterupttedException stack trace in error

bug 33700, from Seth Ladd

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@170211 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2005-05-15 09:36:15 +00:00
parent f95865f481
commit 2e08f50b6f
2 changed files with 13 additions and 6 deletions

View File

@ -52,6 +52,7 @@ If this causes major headaches to anyone please contact commons-dev at jakarta.a
<li>MapUtils.putAll - Puts an array of key/value pairs into a map [30882]</li>
<li>ExtendedProperties - No longer uses an exception in normal processing [30497]</li>
<li>CollectionUtils/ListUtils - retainAll/removeAll that don't change original colllection</li>
<li>BlockingBuffer - now includes stack trace if InterupttedException occurs [33700]</li>
</ul>
<center><h3>BUG FIXES</h3></center>

View File

@ -15,6 +15,8 @@
*/
package org.apache.commons.collections.buffer;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
import org.apache.commons.collections.Buffer;
@ -93,7 +95,9 @@ public class BlockingBuffer extends SynchronizedBuffer {
try {
wait();
} catch (InterruptedException e) {
throw new BufferUnderflowException();
PrintWriter out = new PrintWriter(new StringWriter());
e.printStackTrace(out);
throw new BufferUnderflowException("Caused by InterruptedException: " + out.toString());
}
}
return getBuffer().get();
@ -106,7 +110,9 @@ public class BlockingBuffer extends SynchronizedBuffer {
try {
wait();
} catch (InterruptedException e) {
throw new BufferUnderflowException();
PrintWriter out = new PrintWriter(new StringWriter());
e.printStackTrace(out);
throw new BufferUnderflowException("Caused by InterruptedException: " + out.toString());
}
}
return getBuffer().remove();