https://issues.apache.org/bugzilla/show_bug.cgi?id=57420

--- Comment #4 from Konstantin Kolinko <knst.koli...@gmail.com> ---
1) As far as I see, UDecoder does not have any fields and thus is thread-safe.

The thread safety is not documented, though.

As such, I do not mind creating an instance of UDecoder, as that feels safer.

A possible way to solve documentation issue is to add getInstance() factory
methods to UEncoder, UDecoder. For decoder the method would return a singleton
(thus "documenting" the thread safety), while for encoder it will always return
a new instance.

2) Both encoder and decoder are usually used only once per connection.

Thus I think it would be better to use local variables, creating the objects
just before use, instead of caching them in class fields.

UDecoder is used in connect(). That call happens once.

UEncoder is used in list(). While it is possible to call list() multiple times,
I think that in practice it is called only once.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to