directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: [Patch] MultiException writing to wrong Stream/Writer
Date Wed, 16 Nov 2016 19:20:19 GMT
Friendly ping, any takers for this trivial patch?

You might not believe it, but that missing "out" argument in combination 
with a bug totally unrelated to directory server lead to a deadlock in 
an application.

Thanks and regards,

Rainer

Am 31.10.2016 um 11:02 schrieb Rainer Jung:
> Hi there,
>
> I suggest the following patch to MultiException:
>
> Index:
> trunk-with-dependencies/shared/util/src/main/java/org/apache/directory/api/util/exception/MultiException.java
>
> ===================================================================
> ---
> trunk-with-dependencies/shared/util/src/main/java/org/apache/directory/api/util/exception/MultiException.java
>       (revision 1767225)
> +++
> trunk-with-dependencies/shared/util/src/main/java/org/apache/directory/api/util/exception/MultiException.java
>       (working copy)
> @@ -139,7 +139,7 @@
>                  out.println( "\n\t<<========= Next Nested Exception" +
> " ========>>\n" );
>              }
>
> -            throwable.printStackTrace();
> +            throwable.printStackTrace(out);
>          }
>
>          out.println( "\n\t<<========= Last Nested Exception" + "
> ========>>\n" );
> @@ -171,7 +171,7 @@
>                  out.println( "\n\t<<========= Next Nested Exception" +
> " ========>>\n" );
>              }
>
> -            throwable.printStackTrace();
> +            throwable.printStackTrace(out);
>          }
>
>          out.println( "\n\t<<========= Last Nested Exception" + "
> ========>>\n" );
>
>
> Both methods  printStackTrace(PrintWriter out) and public void
> printStackTrace(PrintStream out) write the main exception to the given
> out param, but the nested ones to the default Stream/Writer, which will
> by System.err. Although the path will be a change of behavior, I don't
> see a good reason to output the main exception and the nested ones to
> different streams/writers.
>
> Regards,
>
> Rainer

Mime
View raw message