Author: shuber
Date: Wed Oct 17 17:28:31 2007
New Revision: 18913
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18913&repname=
=3Djahia
Log:
Always build copy of groups structure even if we have a larger new limit.
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cac=
he/reference/ReferenceCacheImpl.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/cache/reference/ReferenceCacheImpl=
.java&rev=3D18913&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java Wed Oct 17 17:28:31 2007
@@ -363,19 +363,13 @@
if (groupsLimit !=3D -1) {
// now we must copy values to a new LRUMap with the co=
rrect size;
if (groupsLimit !=3D 0) {
- if ((groups.size() > groupsLimit)) {
- // if the new limit is lower than the current =
one, we must reduce the
- // size of the groups structure. We do this by=
simply copying into
- // a smaller LRU map, starting with the LRU en=
tries, so they will be
- // flushed during the copy.
- GroupLRUMap newGroups =3D new GroupLRUMap(this=
, (int) groupsLimit);
- OrderedMapIterator iterator =3D groups.ordered=
MapIterator();
- while (iterator.hasNext()) {
- iterator.next();
- newGroups.put(iterator.getKey(), iterator.=
getValue());
- }
- groups =3D newGroups;
+ GroupLRUMap newGroups =3D new GroupLRUMap(this, (i=
nt) groupsLimit);
+ OrderedMapIterator iterator =3D groups.orderedMapI=
terator();
+ while (iterator.hasNext()) {
+ iterator.next();
+ newGroups.put(iterator.getKey(), iterator.getV=
alue());
}
+ groups =3D newGroups;
} else {
// if we set 0, we create an LRU map with size 1, =
as a size 0 is
// not allowed.
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list