I looked at the patch using CopyOnWriteArrayList. It seems like a reasonable approach to me, except for one point that I will mention in a bit. First I would like to see what others think about the usage of CopyOnWriteArrayList.
The defaultResources structure is modified only once per resource in the lifetime of an application - like a hadoop daemon or client. It is iterated over more number of times - typically every time a configuration instance is loaded in the application. Going from the javadoc for the CopyOnWriteArrayList, it does seem the usage is appropriate. The result of using this structure is a simpler code change that is fixing the problem at hand. Given these points, does the patch seem like a right direction ? (Todd, your thoughts ?)
Now, regarding the patch, even if we do agree on using it, I suppose we might still need to synchronize addDefaultResources, because the contains check needs to be synchronized with the add check, no ?