timboudreau commented on pull request #2232:
URL: https://github.com/apache/netbeans/pull/2232#issuecomment-656788918


   Not to mention that it necessarily introduces some locking into the picture, 
since using the controller and setting the proxy lookup is a potential race:
   
   ```java
       public static final class Controller {
   
           private Lookup[] initialLookups;
           private Executor initialExecutor;
           private ProxyLookup proxyLookup;
   
           public Controller(Lookup... lookups) {
               initialLookups = lookups;
           }
   
           public Controller() {
               initialLookups = new Lookup[0];
           }
   
           public synchronized void setLookups(Executor exe, Lookup... lookups) 
{
               if (proxyLookup != null) {
                   proxyLookup.setLookups(exe, lookups);
               } else {
                   initialLookups = Arrays.copyOf(lookups, lookups.length);
                   initialExecutor = exe;
               }
           }
   
           public void setLookups(Lookup... lookups) {
               setLookups(null, lookups);
           }
   
           synchronized void setProxyLookup(ProxyLookup lkp) {
               if (this.proxyLookup != null) {
                   throw new IllegalStateException("Attempting to use "
                           + "ProxyLookup.Controller for more than one "
                           + "ProxyLookup is illegal");
               }
               lkp.setLookups(initialExecutor, initialLookups);
           }
       }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to