You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/04/03 17:51:22 UTC

[GitHub] [commons-io] garydgregory commented on issue #108: Refactor ByteArrayOutputStream into synchronized and non-synchronized versions

garydgregory commented on issue #108: Refactor ByteArrayOutputStream into synchronized and non-synchronized versions
URL: https://github.com/apache/commons-io/pull/108#issuecomment-608576754
 
 
   > This looks like a nice conversion and maintains the previous support. I'd be wary of using a new dependency just to mark the code as Threadsafe with an annotation on an existing class. Bringing in an annotation framework is a different topic.
   > 
   > Using the name FastXXX is presumptuous but I cannot think of something better. NonSyncXXX is not as friendly. Others may have comments on this.
   
   I am a big -1 on calling a new class "Fast" since it is not fast, it just removes thread-safety. You can hope that it is "faster" than the standard class but that's it.
   
   The JRE has been calling some thread-safe classes `Concurrent` like `ConcurrentHashMap` but other JRE thread-safe classes just have names that reflect behavior like `CopyOnWriteArrayList`, it therefore seem OK to me to call a classes that is not synchronized one of:
   - `UnsynchronizedByteArrayOutputStream` (to the point, precise)
   - `SimpleByteArrayOutputStream` (not great)
   - `BasicByteArrayOutputStream` (not great)
   - `DefaultByteArrayOutputStream` (not great)
   
   My preference is `UnsynchroniziedByteArrayOutputStream`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services