Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 6124 invoked from network); 21 Nov 2005 20:42:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Nov 2005 20:42:27 -0000 Received: (qmail 25354 invoked by uid 500); 21 Nov 2005 20:42:17 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 25232 invoked by uid 500); 21 Nov 2005 20:42:16 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 25192 invoked by uid 99); 21 Nov 2005 20:42:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2005 12:42:16 -0800 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 21 Nov 2005 12:43:49 -0800 Received: (qmail 5877 invoked by uid 65534); 21 Nov 2005 20:41:51 -0000 Message-ID: <20051121204151.5862.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r347975 - /directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java Date: Mon, 21 Nov 2005 20:41:46 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Mon Nov 21 12:41:37 2005 New Revision: 347975 URL: http://svn.apache.org/viewcvs?rev=347975&view=rev Log: The class is now final and protected methods are now private Modified: directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java Modified: directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java?rev=347975&r1=347974&r2=347975&view=diff ============================================================================== --- directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java (original) +++ directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/util/LRUMap.java Mon Nov 21 12:41:37 2005 @@ -48,7 +48,7 @@ * @author James Strachan * @author Morgan Delagrange */ -public class LRUMap extends SequencedHashMap implements Externalizable { +public final class LRUMap extends SequencedHashMap implements Externalizable { private int maximumSize = 0; @@ -120,7 +120,7 @@ if ( mapSize >= maximumSize ) { - synchronized (this) + synchronized ( this ) { // don't retire LRU if you are just // updating an existing key @@ -135,7 +135,10 @@ } else { - retval = super.put(key,value); + synchronized ( this ) + { + retval = super.put(key,value); + } } return retval; @@ -145,7 +148,7 @@ * This method is used internally by the class for * finding and removing the LRU Object. */ - protected void removeLRU() + private void removeLRU() { Object key = getFirstKey(); // be sure to call super.get(key), or you're likely to @@ -155,19 +158,6 @@ remove(key); } - /** - * Subclasses of LRUMap may hook into this method to - * provide specialized actions whenever an Object is - * automatically removed from the cache. By default, - * this method does nothing. - * - * @param key key that was removed - * @param value value of that key (can be null) - */ - protected void processRemovedLRU(Object key, Object value) - { - } - // Externalizable interface //------------------------------------------------------------------------- public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException