comparison src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 882:d850a5e6ff15

remove UncheckedPrintWriter
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 04 Oct 2016 16:12:50 -0600
parents 5f8a242392da
children 150092cebf3e
comparison
equal deleted inserted replaced
881:31e803481e33 882:d850a5e6ff15
51 import org.eclipse.jetty.io.Buffers; 51 import org.eclipse.jetty.io.Buffers;
52 import org.eclipse.jetty.io.Connection; 52 import org.eclipse.jetty.io.Connection;
53 import org.eclipse.jetty.io.EndPoint; 53 import org.eclipse.jetty.io.EndPoint;
54 import org.eclipse.jetty.io.EofException; 54 import org.eclipse.jetty.io.EofException;
55 import org.eclipse.jetty.io.RuntimeIOException; 55 import org.eclipse.jetty.io.RuntimeIOException;
56 import org.eclipse.jetty.io.UncheckedPrintWriter;
57 import org.eclipse.jetty.server.handler.ErrorHandler; 56 import org.eclipse.jetty.server.handler.ErrorHandler;
58 import org.eclipse.jetty.server.nio.NIOConnector; 57 import org.eclipse.jetty.server.nio.NIOConnector;
59 import org.eclipse.jetty.server.ssl.SslConnector; 58 import org.eclipse.jetty.server.ssl.SslConnector;
60 import org.eclipse.jetty.util.QuotedStringTokenizer; 59 import org.eclipse.jetty.util.QuotedStringTokenizer;
61 import org.eclipse.jetty.util.StringUtil; 60 import org.eclipse.jetty.util.StringUtil;
364 { 363 {
365 getOutputStream(); 364 getOutputStream();
366 if (_writer==null) 365 if (_writer==null)
367 { 366 {
368 _writer=new OutputWriter(); 367 _writer=new OutputWriter();
369 if (_server.isUncheckedPrintWriter()) 368 _printWriter = new PrintWriter(_writer)
370 _printWriter=new UncheckedPrintWriter(_writer); 369 {
371 else 370 public void close()
372 _printWriter = new PrintWriter(_writer) 371 {
373 { 372 synchronized (lock)
374 public void close()
375 { 373 {
376 synchronized (lock) 374 try
377 { 375 {
378 try 376 out.close();
379 { 377 }
380 out.close(); 378 catch (IOException e)
381 } 379 {
382 catch (IOException e) 380 setError();
383 {
384 setError();
385 }
386 } 381 }
387 } 382 }
388 }; 383 }
384 };
389 } 385 }
390 _writer.setCharacterEncoding(encoding); 386 _writer.setCharacterEncoding(encoding);
391 return _printWriter; 387 return _printWriter;
392 } 388 }
393 389