You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/04/03 00:01:53 UTC

[jira] Commented: (AXIS-814) URI does not over-ride hashcode()

The following comment has been added to this issue:

     Author: Sam Meder
    Created: Fri, 2 Apr 2004 2:00 PM
       Body:
This bug seems to have been reintroduced in Axis CVS. Should I open another bug for it?
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-814?page=comments#action_27931

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-814

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-814
    Summary: URI does not over-ride hashcode()
       Type: Bug

     Status: Resolved
 Resolution: FIXED

    Project: Axis
 Components: 
             Serialization/Deserialization
   Versions:
             1.1rc2

   Assignee: Axis Developers Mailing List
   Reporter: David Kemp

    Created: Fri, 11 Apr 2003 6:42 AM
    Updated: Fri, 2 Apr 2004 2:00 PM
Environment: Operating System: Linux
Platform: Other

Description:
org.apache.axis.types.URI is not over-riding hashcode() and so it can not be
used as a key to a hashmap.

$ java -fullversion
java full version "1.3.1_03-b03"

Test program:

import org.apache.axis.types.URI;
import org.apache.axis.types.URI.MalformedURIException;

public class URITest {

    public static void main(String[] args) throws MalformedURIException {
    	URI uri1 = new URI("urn:foobar");
		URI uri2 = new URI("urn:foobar");
		System.out.print("Equals: ");
		System.out.println((uri1.equals(uri2)) ?"pass" : "fail");
		System.out.print("Hashcode: ");
		System.out.println((uri1.hashCode() == uri2.hashCode()) ? "pass" : "fail");
   }
}

The result is:

Equals: pass
Hashcode: fail


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira