Author: tdraier
Date: Fri Dec  7 11:48:27 2007
New Revision: 19347

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19347&repname=
=3Djahia
Log:
reduce number of useless calls to improve statistics ( JAHIA-2550 )

Modified:
    trunk/core/src/java/org/jahia/services/workflow/WorkflowService.java

Modified: trunk/core/src/java/org/jahia/services/workflow/WorkflowService.j=
ava
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/services/workflow/WorkflowService.java&rev=3D19347&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/services/workflow/WorkflowService.java (o=
riginal)
+++ trunk/core/src/java/org/jahia/services/workflow/WorkflowService.java Fr=
i Dec  7 11:48:27 2007
@@ -798,9 +798,11 @@
         List[] l =3D (List[]) linkedObjectsCache.get(cacheKey);
         if (l =3D=3D null) {
             ContentObjectKey main =3D getTopLinkedObject(object);
-            GroupCacheKey mainCacheKey =3D new GroupCacheKey(main.toString=
()+"_"+descendInAllSubGroups+"_"+checkParents, new HashSet());
-            l =3D (List[]) linkedObjectsCache.get(mainCacheKey);
-
+            GroupCacheKey mainCacheKey =3D null;
+            if (!main.equals(object)) {
+                mainCacheKey =3D new GroupCacheKey(main.toString()+"_"+des=
cendInAllSubGroups+"_"+checkParents, new HashSet());
+                l =3D (List[]) linkedObjectsCache.get(mainCacheKey);
+            }
             cacheKey.getGroups().add(object.toString());
             cacheKey.getGroups().add(MAINPREFIX + main.toString());
             if (l !=3D null) {
@@ -811,10 +813,11 @@
                 getLinkedContentObjects(object, keys, l[0], l[1], descendI=
nAllSubGroups, checkParents);
                 l[1].removeAll(l[0]);
                 linkedObjectsCache.put(cacheKey, l);
-
-                mainCacheKey.getGroups().add(main.toString());
-                mainCacheKey.getGroups().add(MAINPREFIX + main.toString());
-                linkedObjectsCache.put(mainCacheKey, l);
+                if (mainCacheKey !=3D null) {
+                    mainCacheKey.getGroups().add(main.toString());
+                    mainCacheKey.getGroups().add(MAINPREFIX + main.toStrin=
g());
+                    linkedObjectsCache.put(mainCacheKey, l);
+                }
             }
         }
         return l;

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to