diff --git a/CHANGELOG.md b/CHANGELOG.md index c8fc7f7b..c5b485c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Using depedency injection for Manager, Store and TRS classes - Provide flexibility to for Store properties to be set via the Environment. - Changing the way Resource and ResourceProperty items are represented in dialogs. We include prefixes to make their identification easier. +- Protect initServerProviders() method ### Deprecated diff --git a/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateServiceProviderCatalogSingleton.mtl b/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateServiceProviderCatalogSingleton.mtl index 6899a806..fdf7f308 100644 --- a/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateServiceProviderCatalogSingleton.mtl +++ b/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateServiceProviderCatalogSingleton.mtl @@ -166,11 +166,8 @@ public class [javaClassNameForSingleton(aServiceProviderCatalog) /] public static ServiceProvider [ '[' ']' /] getServiceProviders(HttpServletRequest httpServletRequest) { - synchronized(serviceProviders) - { - initServiceProviders(httpServletRequest); - return serviceProviders.values().toArray(new ServiceProvider[ '[' /] serviceProviders.size()[ ']' /]); - } + initServiceProviders(httpServletRequest); + return serviceProviders.values().toArray(new ServiceProvider[ '[' /] serviceProviders.size()[ ']' /]); } public static boolean containsServiceProvider(final String identifier) { @@ -279,7 +276,7 @@ public class [javaClassNameForSingleton(aServiceProviderCatalog) /] * creation to create unique URI paths for each ServiceProvider. * */ - protected static void initServiceProviders (HttpServletRequest httpServletRequest) + protected static synchronized void initServiceProviders (HttpServletRequest httpServletRequest) { try { // [protected ('initServiceProviders')]