<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 93: NullPointerException in TeeOutputStream</title><link href="https://sourceforge.net/p/dacapobench/bugs/93/" rel="alternate"/><link href="https://sourceforge.net/p/dacapobench/bugs/93/feed.atom" rel="self"/><id>https://sourceforge.net/p/dacapobench/bugs/93/</id><updated>2012-04-10T15:47:55Z</updated><subtitle>Recent changes to 93: NullPointerException in TeeOutputStream</subtitle><entry><title>NullPointerException in TeeOutputStream</title><link href="https://sourceforge.net/p/dacapobench/bugs/93/" rel="alternate"/><published>2012-04-10T15:47:55Z</published><updated>2012-04-10T15:47:55Z</updated><author><name>Radu GRIGORE</name><uri>https://sourceforge.net/u/radugrigore/</uri></author><id>https://sourceforge.net0e0d5de9289afbad751eef75db04260190a34b1c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The class TeeOutputStream is used to redirect System.out, and so is used from multiple threads. It is, however, not thread-safe.&lt;/p&gt;
&lt;p&gt;The relevant part of the code is the following:&lt;/p&gt;
&lt;p&gt;class TeeOutputStream {&lt;br /&gt;
private OutputStream log;&lt;br /&gt;
public void closeLog() { log = null; }&lt;br /&gt;
public void write() { if (log != null) /* here another thread calls closeLog */ log.write(); }&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;I have observed this bug with the tomcat benchmark. But, being a concurrency bug, it is hard to reproduce.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>