Re: [ant] branch master updated: add discardOutput and discardError to redirector, apply, exec, java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [ant] branch master updated: add discardOutput and discardError to redirector, apply, exec, java

Jaikiran Pai-2

On 20/03/21 11:31 pm, [hidden email] wrote:

> ...
> + */
> +public class NullOutputStream extends OutputStream {
> +
> +    /**
> +     * Shared instance which is safe to use concurrently as the stream
> +     * doesn't hold any state at all.
> +     */
> +    public static NullOutputStream INSTANCE = new NullOutputStream();
> +
> +

Should we consider adding a private constructor to prevent anyone from
directly instantiating this class? It won't make that major a
difference, but since we already expose this INSTANCE, it probably is a
good idea to prevent direct instantiation?


-Jaikiran


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [ant] branch master updated: add discardOutput and discardError to redirector, apply, exec, java

Stefan Bodewig
On 2021-03-21, Jaikiran Pai wrote:

> On 20/03/21 11:31 pm, [hidden email] wrote:

> + */
> + public class NullOutputStream extends OutputStream {

> +    /**
> +     * Shared instance which is safe to use concurrently as the stream
> +     * doesn't hold any state at all.
> +     */
> +    public static NullOutputStream INSTANCE = new NullOutputStream();

> Should we consider adding a private constructor to prevent anyone from
> directly instantiating this class?

fine with me.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]