cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/map StaticBucketMap.java UnmodifiableEntrySet.java ReferenceMap.java PredicatedMap.java
scolebourne2003/12/29 07:08:16 Modified:collections/src/java/org/apache/commons/collections/map StaticBucketMap.java UnmodifiableEntrySet.java ReferenceMap.java PredicatedMap.java Log: Change to standard variable naming and braces style Revision ChangesPath 1.5 +16 -16 jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java Index: StaticBucketMap.java === RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- StaticBucketMap.java 28 Dec 2003 16:36:48 - 1.4 +++ StaticBucketMap.java 29 Dec 2003 15:08:15 - 1.5 @@ -498,23 +498,23 @@ (value == null ? 0 : value.hashCode())); } -public boolean equals(Object o) { -if (o == this) { +public boolean equals(Object obj) { +if (obj == this) { return true; } -if (o instanceof Map.Entry == false) { +if (obj instanceof Map.Entry == false) { return false; } -Map.Entry e2 = (Map.Entry) o; +Map.Entry e2 = (Map.Entry) obj; return ( (key == null ? e2.getKey() == null : key.equals(e2.getKey())) (value == null ? e2.getValue() == null : value.equals(e2.getValue(; } -public Object setValue(Object val) { +public Object setValue(Object obj) { Object retVal = value; -value = val; +value = obj; return retVal; } } @@ -600,8 +600,8 @@ return new EntryIterator(); } -public boolean contains(Object o) { -Map.Entry entry = (Map.Entry)o; +public boolean contains(Object obj) { +Map.Entry entry = (Map.Entry) obj; int hash = getHash(entry.getKey()); synchronized (m_locks[hash]) { for (Node n = m_buckets[hash]; n != null; n = n.next) { @@ -615,7 +615,7 @@ if (obj instanceof Map.Entry == false) { return false; } -Map.Entry entry = (Map.Entry)obj; +Map.Entry entry = (Map.Entry) obj; int hash = getHash(entry.getKey()); synchronized (m_locks[hash]) { for (Node n = m_buckets[hash]; n != null; n = n.next) { @@ -645,16 +645,16 @@ return new KeyIterator(); } -public boolean contains(Object o) { -return StaticBucketMap.this.containsKey(o); +public boolean contains(Object obj) { +return StaticBucketMap.this.containsKey(obj); } -public boolean remove(Object o) { -int hash = getHash(o); +public boolean remove(Object obj) { +int hash = getHash(obj); synchronized (m_locks[hash]) { for (Node n = m_buckets[hash]; n != null; n = n.next) { Object k = n.getKey(); -if ((k == o) || ((k != null) k.equals(o))) { +if ((k == obj) || ((k != null) k.equals(obj))) { StaticBucketMap.this.remove(k); return true; } 1.3 +3 -3 jakarta-commons/collections/src/java/org/apache/commons/collections/map/UnmodifiableEntrySet.java Index: UnmodifiableEntrySet.java === RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/UnmodifiableEntrySet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- UnmodifiableEntrySet.java 5 Dec 2003 20:23:57 - 1.2 +++ UnmodifiableEntrySet.java 29 Dec 2003 15:08:15 - 1.3 @@ -195,7 +195,7 @@ super(entry); } -public Object setValue(Object o) { +public Object setValue(Object obj) { throw new UnsupportedOperationException(); } } 1.6 +55 -31 jakarta-commons/collections/src/java/org/apache/commons/collections/map/ReferenceMap.java Index: ReferenceMap.java === RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/ReferenceMap.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ReferenceMap.java 29 Dec 2003 14:54:58 - 1.5 +++ ReferenceMap.java 29 Dec 2003 15:08:15
cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/map StaticBucketMap.java
scolebourne2003/12/14 05:00:03 Modified:collections/src/java/org/apache/commons/collections/map StaticBucketMap.java Log: Fix bug in remove method from coverage testing Revision ChangesPath 1.3 +7 -4 jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java Index: StaticBucketMap.java === RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StaticBucketMap.java 6 Dec 2003 13:03:15 - 1.2 +++ StaticBucketMap.java 14 Dec 2003 13:00:03 - 1.3 @@ -611,8 +611,11 @@ return false; } -public boolean remove(Object o) { -Map.Entry entry = (Map.Entry)o; +public boolean remove(Object obj) { +if (obj instanceof Map.Entry == false) { +return false; +} +Map.Entry entry = (Map.Entry)obj; int hash = getHash(entry.getKey()); synchronized (m_locks[hash]) { for (Node n = m_buckets[hash]; n != null; n = n.next) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/map StaticBucketMap.java package.html
scolebourne2003/12/03 07:16:49 Modified:collections/src/java/org/apache/commons/collections StaticBucketMap.java collections/src/test/org/apache/commons/collections/map TestAll.java collections/src/java/org/apache/commons/collections/map package.html Added: collections/src/test/org/apache/commons/collections/map TestStaticBucketMap.java collections/src/java/org/apache/commons/collections/map StaticBucketMap.java Log: Refactor StaticBucketMap to map subpackage Revision ChangesPath 1.13 +3 -2 jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java Index: StaticBucketMap.java === RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- StaticBucketMap.java 31 Aug 2003 17:26:44 - 1.12 +++ StaticBucketMap.java 3 Dec 2003 15:16:49 - 1.13 @@ -129,6 +129,7 @@ * iterations, or if you can make your own guarantees about how bulk * operations will affect the map.p * + * @deprecated Moved to map subpackage. Due to be removed in v4.0. * @since Commons Collections 2.1 * @version $Revision$ $Date$ * 1.7 +6 -4 jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestAll.java Index: TestAll.java === RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestAll.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestAll.java 2 Dec 2003 21:57:08 - 1.6 +++ TestAll.java 3 Dec 2003 15:16:49 - 1.7 @@ -83,11 +83,13 @@ public static Test suite() { TestSuite suite = new TestSuite(); -suite.addTest(TestFixedSizeMap.suite()); -suite.addTest(TestFixedSizeSortedMap.suite()); suite.addTest(TestFlat3Map.suite()); suite.addTest(TestHashedMap.suite()); suite.addTest(TestIdentityMap.suite()); +suite.addTest(TestStaticBucketMap.suite()); + +suite.addTest(TestFixedSizeMap.suite()); +suite.addTest(TestFixedSizeSortedMap.suite()); suite.addTest(TestLazyMap.suite()); suite.addTest(TestLazySortedMap.suite()); suite.addTest(TestListOrderedMap.suite()); 1.1 jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java Index: TestStaticBucketMap.java === /* * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java,v 1.1 2003/12/03 15:16:49 scolebourne Exp $ * * * The Apache Software License, Version 1.1 * * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR