/[classpath]/classpath/gnu/java/security/OID.java
ViewVC logotype

Diff of /classpath/gnu/java/security/OID.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by rsdio, Wed Apr 23 23:00:26 2003 UTC revision 1.2 by rsdio, Sat Aug 14 17:51:40 2004 UTC
# Line 7  GNU Classpath is free software; you can Line 7  GNU Classpath is free software; you can
7  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)  the Free Software Foundation; either version 2, or (at your option)
9  any later version.  any later version.
10    
11  GNU Classpath is distributed in the hope that it will be useful, but  GNU Classpath is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Line 65  import gnu.java.security.der.DEREncoding Line 65  import gnu.java.security.der.DEREncoding
65   * <p>OIDs may be relative, in which case the first two elements of the   * <p>OIDs may be relative, in which case the first two elements of the
66   * OID are omitted.   * OID are omitted.
67   *   *
68   * @author Casey Marshall (rsdio@metastatic.org)   * @author Casey Marshall (csm@gnu.org)
69   */   */
70  public class OID implements Cloneable, Comparable, java.io.Serializable  public class OID implements Cloneable, Comparable, java.io.Serializable
71  {  {
# Line 336  public class OID implements Cloneable, C Line 336  public class OID implements Cloneable, C
336    
337    /* Nice idea, but possibly too expensive for whatever benefit it    /* Nice idea, but possibly too expensive for whatever benefit it
338     * provides.     * provides.
339      
340    public String getShortName()    public String getShortName()
341    {    {
342      return OIDTable.getShortName(this);      return OIDTable.getShortName(this);
# Line 391  public class OID implements Cloneable, C Line 391  public class OID implements Cloneable, C
391     */     */
392    public boolean equals(Object o)    public boolean equals(Object o)
393    {    {
394      if (this == o)      if (!(o instanceof OID))
395        return true;        return false;
396      return java.util.Arrays.equals(components, ((OID) o).components);      return java.util.Arrays.equals(components, ((OID) o).components);
397    }    }
398    
# Line 411  public class OID implements Cloneable, C Line 411  public class OID implements Cloneable, C
411     */     */
412    public int compareTo(Object o)    public int compareTo(Object o)
413    {    {
414      if (o == this)      if (equals(o))
415        return 0;        return 0;
416      int[] components2 = ((OID) o).components;      int[] components2 = ((OID) o).components;
417      int len = Math.min(components.length, components2.length);      int len = Math.min(components.length, components2.length);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26