Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COTo be honest I am not sure which of these two answers yours or Chris to accept. Because I know we could create some interface which marks that class's object is accessed from many threads,etc., but this is a bit redundant. Appendable interface has nothing to do with threads. And how do you know that StringBuffer is thread safe? Because you can read it in javadoc. But in a project it can be a bit tricky. I am not sure if all developers read all javadoc updates. But I think javadoc seems to be really good place to describe behaviour and it doesn't complicate implementation. hmmm... :)
      singulars
    2. COMy point is: you shouldn't expose concurrency outside the component. Appendable doesn't "mark" your class as thread-safe. It is a business contract, that states: you can append a CharSequence to this "thing". Nothing more. If you need, a thread-safe implementation, then you will instantiate a StringBuffer. Otherwise, it would be more efficient to use a StringBuilder. The client doesn't have to know about the synchronization mechanisms, that are used internally to protect the state. Same thing applies to the service "world" (take EJBs for an example).
      singulars
    3. COOn another note: "updating javadocs" on an existing component doesn't really affect any real life situations. It's just like saying "it's not my business, the client should adapt and I don't really care - read the CHANGELOG, if you get into any problems". Also, unit tests won't help you much in this case, since reliable testing of concurrency can be really tricky (detecting deadlocks and process starvation for example).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload