Hashtable.java (internalContainsValue): Removed.

* java/util/Hashtable.java (internalContainsValue): Removed.
	(containsValue): Don't delegate to internalContainsValue.

From-SVN: r74399
This commit is contained in:
Bryce McKinlay 2003-12-07 21:03:49 +00:00 committed by Bryce McKinlay
parent 63cf211af7
commit eb1e64ef80
2 changed files with 23 additions and 39 deletions

View File

@ -1,3 +1,8 @@
2002-12-08 Bryce McKinlay <bryce@mckinlay.net.nz>
* java/util/Hashtable.java (internalContainsValue): Removed.
(containsValue): Don't delegate to internalContainsValue.
2003-12-06 Michael Koch <konqueror@gmx.de>
* javax/naming/directory/Attribute.java,

View File

@ -332,46 +332,6 @@ public class Hashtable extends Dictionary
* @see #containsKey(Object)
*/
public synchronized boolean contains(Object value)
{
/* delegate to non-overridable worker method
* to avoid blowing up the stack, when called
* from overridden contains[Value]() method.
*/
return internalContainsValue(value);
}
/**
* Returns true if this Hashtable contains a value <code>o</code>, such that
* <code>o.equals(value)</code>. This is the new API for the old
* <code>contains()</code>.
*
* @param value the value to search for in this Hashtable
* @return true if at least one key maps to the value
* @see #contains(Object)
* @see #containsKey(Object)
* @throws NullPointerException if <code>value</code> is null
* @since 1.2
*/
public boolean containsValue(Object value)
{
/* delegate to older method to make sure code overwriting it
* continues to work.
*/
return contains(value);
}
/**
* Returns true if this Hashtable contains a value <code>o</code>, such that
* <code>o.equals(value)</code>. This is an internal worker method
* called by <code>contains()</code> and <code>containsValue()</code>.
*
* @param value the value to search for in this Hashtable
* @return true if at least one key maps to the value
* @see #contains(Object)
* @see #containsKey(Object)
* @throws NullPointerException if <code>value</code> is null
*/
private boolean internalContainsValue(Object value)
{
for (int i = buckets.length - 1; i >= 0; i--)
{
@ -391,6 +351,25 @@ public class Hashtable extends Dictionary
return false;
}
/**
* Returns true if this Hashtable contains a value <code>o</code>, such that
* <code>o.equals(value)</code>. This is the new API for the old
* <code>contains()</code>.
*
* @param value the value to search for in this Hashtable
* @return true if at least one key maps to the value
* @see #contains(Object)
* @see #containsKey(Object)
* @throws NullPointerException if <code>value</code> is null
* @since 1.2
*/
public boolean containsValue(Object value)
{
// Delegate to older method to make sure code overriding it continues
// to work.
return contains(value);
}
/**
* Returns true if the supplied object <code>equals()</code> a key
* in this Hashtable.