Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 98838 invoked from network); 9 May 2002 03:10:54 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 May 2002 03:10:54 -0000 Received: (qmail 18710 invoked by uid 97); 9 May 2002 03:11:01 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 18651 invoked by uid 97); 9 May 2002 03:11:00 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 18640 invoked by uid 97); 9 May 2002 03:10:59 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 9 May 2002 03:10:46 -0000 Message-ID: <20020509031046.30355.qmail@icarus.apache.org> From: mas@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections LRUMap.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mas 02/05/08 20:10:46 Modified: collections/src/java/org/apache/commons/collections LRUMap.java Log: Fixed to ensure that get(Object) won't add a mapping to a null value when one didn't exist before. That is, if containsKey(foo) returns false, then get(foo) will not change that. Added serial version UID to maintain backwards compatibility. The auto generated serialization UID differs from the released version because of the addition of a new method. Revision Changes Path 1.15 +10 -4 jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java Index: LRUMap.java =================================================================== RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- LRUMap.java 8 May 2002 18:11:36 -0000 1.14 +++ LRUMap.java 9 May 2002 03:10:46 -0000 1.15 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java,v 1.14 2002/05/08 18:11:36 morgand Exp $ - * $Revision: 1.14 $ - * $Date: 2002/05/08 18:11:36 $ + * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java,v 1.15 2002/05/09 03:10:46 mas Exp $ + * $Revision: 1.15 $ + * $Date: 2002/05/09 03:10:46 $ * * ==================================================================== * @@ -131,6 +131,8 @@ * null value or if the key has no value. */ public Object get(Object key) { + if(!containsKey(key)) return null; + Object value = remove(key); super.put(key,value); return value; @@ -240,5 +242,9 @@ removeLRU(); } } - + + + // add a serial version uid, so that if we change things in the future + // without changing the format, we can still deserialize properly. + private static final long serialVersionUID = 2197433140769957051L; } -- To unsubscribe, e-mail: For additional commands, e-mail: