technically if you're PrintWriter throws the exception your StringWriter will never be closed :-)