matthiasblaesing commented on issue #4211:
URL: https://github.com/apache/netbeans/issues/4211#issuecomment-1176550816

   @vieiro 
   > I mean, if `Repository.class` is not "the real McCoy" then the 
`synchronized(Repository.class)` must be synchronizing in a "fake McCoy" and 
not in the "real McCoy", right?
   
   `synchronized(Repository.class)` means, that the synchronisation happens on 
the _class_ Repository, not on a single instance of it. The problem happens in 
the code path, that returns the default repository and in there is a race 
condition. I suspect, that there is some Lookup code involved, that does some 
postprocessing of the results and delays the return, so that the default 
Repository is created.
   
   @ebresie 
   > When creating the new repository instance (i.e. when null) should that 
code be synchronized as well?
   
   See my answer to @vieiro you can create as many repositories as you like. 
The problem is that only one Repository is used as the system wide repository 
and that needs to be the right one.


-- 
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.

To unsubscribe, e-mail: [email protected]

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