Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/617#discussion_r30590383
  
    --- Diff: 
utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java ---
    @@ -69,8 +70,25 @@ public void add(int index, ClassLoader classLoader) {
             if (classLoader != null) classLoaders.add(index, classLoader);
         }
         
    -    /** Returns the _live_ (and modifiable) list of classloaders 
    -     * @return */ 
    +    /** Resets the classloader shown here to be the given set */
    +    public void reset(Collection<? extends ClassLoader> newClassLoaders) {
    +        synchronized (classLoaders) {
    --- End diff --
    
    Clever adding all to end, and then removing `count` from start. However, it 
will break if there is a concurrent call to `add(int index, ClassLoader 
classLoader)`.
    
    Personally I'd prefer a simpler synchronization model, that does not try to 
be clever.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to