https://gwt-code-reviews.appspot.com/1829804/diff/1/user/src/com/google/web/bindery/autobean/shared/impl/AutoBeanCodexImpl.java File user/src/com/google/web/bindery/autobean/shared/impl/AutoBeanCodexImpl.java (right):
https://gwt-code-reviews.appspot.com/1829804/diff/1/user/src/com/google/web/bindery/autobean/shared/impl/AutoBeanCodexImpl.java#newcode518 user/src/com/google/web/bindery/autobean/shared/impl/AutoBeanCodexImpl.java:518: synchronized (coderFor) { On 2012/09/13 18:48:19, jtamplin wrote:
Isn't it considered bad practice to synchronize on the object you are
protecting
like this? I don't think it is a problem with HashMap, but I would
still prefer
having explicit coderForLock and codersLock objects.
That's what I thought too, and I initially had the lock objects, but: - we already have such synchronization in com.google.gwt.rpc.server.RPC and com.google.gwt.user.server.rpc.RPC - given our use of the map (as a cache, with only get and put), it shouldn't be a problem. I don't mind adding the lock objects back though. What do others think? https://gwt-code-reviews.appspot.com/1829804/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors