diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2005-01-21 02:16:34 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2005-01-21 02:16:34 +0000 |
commit | 46761236fb83c55b5bbbe82c1320c81228871c9b (patch) | |
tree | 6f36f7de0bd8e6016436de46d4dfe92e3f961b03 /javax/naming | |
parent | 719ff92c13d064ec8cb5143132d8377c572b6afd (diff) | |
download | classpath-46761236fb83c55b5bbbe82c1320c81228871c9b.tar.gz |
2005-01-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
Merge of HEAD to generics-branch for 2005/01/20.
2005-01-20 Michael Koch <konqueror@gmx.de>
* java/awt/print/PrinterJob.java
(pageDialog): Throws java.awt.HeadlessException.
(printDialog): Likewise.
2005-01-20 Michael Koch <konqueror@gmx.de>
* doc/hacking.texinfo: Fixed one typo and the paragraph about time
formats.
2005-01-20 Michael Koch <konqueror@gmx.de>
* javax/print/attribute/standard/Chromaticity.java
(serialVersionUID): Fixed value.
* javax/print/attribute/standard/Destination.java
(serialVersionUID): Fixed value.
* javax/print/attribute/standard/MediaPrintableArea.java,
javax/print/attribute/standard/MediaSize.java:
New files.
2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/util/Currency.java:
Added new countryMap which maps country codes
to international currency codes. The cache
has been altered to map currency codes to
Currency objects.
(getInstance(java.util.Locale)): adds to both
caches and attempts initial lookup from country map
(getInstance(java.lang.String)): attempts to
use code -> currency map first
2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/awt/Checkbox.java:
(AccessibleAWTCheckbox): Added class documentation
* java/awt/Scrollbar.java:
(AccessibleAWTScrollBar): typo corrected and docs added
(AccessibleAWTScrollBar.getAccessibleRole()): documented
(AccessibleAWTScrollBar.getAccessibleStateSet()): likewise
(AccessibleAWTScrollBar.getAccessibleValue()): likewise
(AccessibleAWTScrollBar.getCurrentAccessibleValue()): likewise
(AccessibleAWTScrollBar.setCurrentAccessibleValue(java.lang.Number)): likewise
(AccessibleAWTScrollBar.getMinimumAccessibleValue()): likewise
(AccessibleAWTScrollBar.getMaximumAccessibleValue()): likewise
(getAccessibleContext()): name of accessible class corrected
2005-01-20 Mark Wielaard <mark@klomp.org>
* java/util/Currency.java (Currency(Locale)): Add Locale to
IllegalArgumentException message.
2005-01-20 Mark Wielaard <mark@klomp.org>
* java/awt/BasicStroke.java (hashCode): Implement.
(equals): Document.
2005-01-20 Michael Koch <konqueror@gmx.de>
* javax/swing/JTable.java
(getValueAt): New method.
* javax/swing/table/JTableHeader.java
(columnAtPoint): New method.
2005-01-20 Mark Wielaard <mark@klomp.org>
* java/util/Currency.java (Currency(Locale)): Clarify
IllegalArgumentException message.
2005-01-20 Mark Wielaard <mark@klomp.org>
* javax/naming/directory/BasicAttributes.java (equals): Compare to any
Attributes and attribute order doesn't matter.
(BasicAttributesEnumeration.where): Initialize to zero.
(BasicAttributesEnumeration.nextElement): Update and compare where
appropriately (zero based).
2005-01-20 Michael Koch <konqueror@gmx.de>
* javax/swing/JTextField.java
(actions): New field.
(static): Initalize actions field.
(getActions): New method.
2005-01-20 Mark Wielaard <mark@klomp.org>
* native/jni/gtk-peer/gtkpeer.h (gdk_env): Fix prototype.
2005-01-20 Graydon Hoare <graydon@redhat.com>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
(env_union): Use union to avoid type-punning warning.
2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/awt/Checkbox.java:
(AccessibleAWTCheckbox): name capitalization corrected
and serialization UID added.
(AccessibleAWTCheckbox.itemStateChanged(java.awt.event.ItemEvent)):
documented.
(AccessibleAWTCheckbox.getAccessibleAction()): likewise
(AccessibleAWTCheckbox.getAccessibleValue()): likewise
(AccessibleAWTCheckbox.getAccessibleActionCount()): likewise
(AccessibleAWTCheckbox.getAccessibleActionDescription(int)): likewise
(AccessibleAWTCheckbox.doAccessibleAction(int)): likewise
(AccessibleAWTCheckbox.getCurrentAccessibleValue()): likewise
(AccessibleAWTCheckbox.setCurrentAccessibleValue(java.lang.Number)): likewise
(AccessibleAWTCheckbox.getMinimumAccessibleValue()): likewise
(AccessibleAWTCheckbox.getMaximumAccessibleValue()): likewise
(AccessibleAWTCheckbox.getAccessibleRole()): likewise
(AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and
documented
(getAccessibleContext()): name of accessible class corrected
Diffstat (limited to 'javax/naming')
-rw-r--r-- | javax/naming/directory/BasicAttributes.java | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/javax/naming/directory/BasicAttributes.java b/javax/naming/directory/BasicAttributes.java index 9a9a80019..b20072424 100644 --- a/javax/naming/directory/BasicAttributes.java +++ b/javax/naming/directory/BasicAttributes.java @@ -1,5 +1,5 @@ /* BasicAttributes.java -- - Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -83,19 +83,27 @@ public class BasicAttributes implements Attributes return ba; } + /** + * Returns true if and only if the given Object is an instance of + * Attributes, the given attributes both do or don't ignore case for + * IDs and the collection of attributes is the same. + */ public boolean equals (Object obj) { - if (! (obj instanceof BasicAttributes)) + if (! (obj instanceof Attributes)) return false; - BasicAttributes b = (BasicAttributes) obj; - if (ignoreCase != b.ignoreCase - || attributes.size () != b.attributes.size ()) + + Attributes bs = (Attributes) obj; + if (ignoreCase != bs.isCaseIgnored() + || attributes.size () != bs.size ()) return false; - // Does order matter? - for (int i = 0; i < attributes.size (); ++i) + NamingEnumeration bas = bs.getAll(); + while (bas.hasMoreElements()) { - if (! attributes.get (i).equals (b.attributes.get (i))) + Attribute a = (Attribute) bas.nextElement(); + Attribute b = get(a.getID ()); + if (! a.equals(b)) return false; } @@ -191,7 +199,7 @@ public class BasicAttributes implements Attributes // Used when enumerating. private class BasicAttributesEnumeration implements NamingEnumeration { - int where = -1; + int where = 0; boolean id; public BasicAttributesEnumeration (boolean id) @@ -220,10 +228,10 @@ public class BasicAttributes implements Attributes public Object nextElement () throws NoSuchElementException { - if (where + 1 >= attributes.size ()) + if (where >= attributes.size ()) throw new NoSuchElementException ("no more elements"); - ++where; Attribute at = (Attribute) attributes.get (where); + ++where; return id ? (Object) at.getID () : (Object) at; } } |