From: Richard Millet Date: Thu, 5 Jul 2012 22:22:57 +0000 (-0700) Subject: CSPACE-5359: Removing private static class member for storing/cacheing getCommonServi... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=c42f42a17a367790dc1d32f323a18922ee36fccf;p=tmp%2Fjakarta-migration.git CSPACE-5359: Removing private static class member for storing/cacheing getCommonServiceTypes. This is better (more safely) computed with in the getter. Performance should not be an issue with this change. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java index 8b3577c80..9f1bbc29e 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java @@ -194,18 +194,16 @@ public class ServiceBindingUtils { } } - private static ArrayList commonServiceTypes = null; private static ArrayList commonProcedureServiceTypes = null; public static ArrayList getCommonServiceTypes(boolean includeAuthorities) { - if(commonServiceTypes == null) { - commonServiceTypes = new ArrayList(); - if (includeAuthorities == true) { - commonServiceTypes.add(SERVICE_TYPE_AUTHORITY); // REM - CSPACE-5359: Added back authorities to resolve this issue. - } - commonServiceTypes.add(SERVICE_TYPE_OBJECT); - commonServiceTypes.add(SERVICE_TYPE_PROCEDURE); - } + ArrayList commonServiceTypes = new ArrayList(); + if (includeAuthorities == true) { + commonServiceTypes.add(SERVICE_TYPE_AUTHORITY); // REM - CSPACE-5359: Added back authorities on demand to resolve this issue. + } + commonServiceTypes.add(SERVICE_TYPE_OBJECT); + commonServiceTypes.add(SERVICE_TYPE_PROCEDURE); + return commonServiceTypes; } @@ -217,6 +215,7 @@ public class ServiceBindingUtils { // FIXME; this method is intended to be temporary. It was added in part to // make the effect of the workaround more explicit, and in part to avoid // breaking the use of the getCommonServiceTypes method in ServiceGroups. + @Deprecated public static ArrayList getCommonProcedureServiceTypes() { if(commonProcedureServiceTypes == null) { commonProcedureServiceTypes = new ArrayList();