Program: 79620
Project: 79620
Buggy source:
/** 
 * Creates a list backed by the storage-medium. If a list with this name has already been created, then that existing list will be returned. The returned list is not a live view. Changes are made by calling reference.set(), and the view is refreshed by calling reference.get(). Changes are thread-safe, but callers must be careful not to overwrite other's changes. For example, the code below could overwrite another threads changes that are made to the map between the call to get() and the subsequent call to set(). <pre>  {@code Reference<List<String>> ref = storage.<String>createNonConcurrentList("myid"); List<String> newval = ImmutableList.<String>builder().addAll(ref.get()).add("another").builder(); ref.set(newval);}</pre> TODO Aled says: Is getNonConcurrentList necessary? The purpose of this method, rather than just using  {@code Reference ref = getReference(id); ref.set(ImmutableList.of())}is to allow control of the serialization of the things inside the list  (e.g. switching the Location object to serialize a proxy object of some sort).  I don't want us to have to do deep inspection of every object being added to any map/ref.  Feels like we can use normal serialization unless the top-level object matches an  instanceof for special things like Entity, Location, etc. Peter responds: What I'm a bit scared of is that we need to write some kind of meta serialization mechanism  on top of the mechanisms provided by e.g. Hazelcast or Infinispan. Hazelcast has a very  extensive serialization library where you can plug in all kinds of serialization mechanisms.
 * @param id
 * @return
 */
@Beta <T>Reference<List<T>> getNonConcurrentList(String id);

Fixed version (ground truth):
/** 
 * Creates a list backed by the storage-medium. If a list with this name has already been created, then that existing list will be returned. The returned list is not a live view. Changes are made by calling reference.set(), and the view is refreshed by calling reference.get(). Changes are thread-safe, but callers must be careful not to overwrite other's changes. For example, the code below could overwrite another threads changes that are made to the map between the call to get() and the subsequent call to set(). <pre>  {@code Reference<List<String>> ref = storage.<String>createNonConcurrentList("myid"); List<String> newval = ImmutableList.<String>builder().addAll(ref.get()).add("another").builder(); ref.set(newval);}</pre> TODO Aled says: Is getNonConcurrentList necessary? The purpose of this method, rather than just using  {@code Reference ref = getReference(id); ref.set(ImmutableList.of())}is to allow control of the serialization of the things inside the list  (e.g. switching the Location object to serialize a proxy object of some sort).  I don't want us to have to do deep inspection of every object being added to any map/ref.  Feels like we can use normal serialization unless the top-level object matches an  instanceof for special things like Entity, Location, etc. Peter responds: What I'm a bit scared of is that we need to write some kind of meta serialization mechanism  on top of the mechanisms provided by e.g. Hazelcast or Infinispan. Hazelcast has a very  extensive serialization library where you can plug in all kinds of serialization mechanisms.
 * @param id
 */
@Beta <T>Reference<List<T>> getNonConcurrentList(String id);