[
http://jira.jboss.com/jira/browse/JGRP-417?page=comments#action_12353344 ]
Yves Martin commented on JGRP-417:
----------------------------------
All right. I made a big mistake. As I'm working with an old 2.2.0 version, I have just
opened 2.2.9 sources to know if the issue was still there.
And I have simply checked the "IpAddress.equals" method, but not the
ConnectionTable code.
Definitely you're right. The bug I detected with 2.2.0 is fixed already in 2.2.9.
Not because of IpAddress.equals, but because the hashtable become a hashmap and
conns.containsKey now replaces conns.contains.
Sorry to have wasted your precious time.
ConnectionTable.run / ClassCastException with IBM Java 1.5
----------------------------------------------------------
Key: JGRP-417
URL:
http://jira.jboss.com/jira/browse/JGRP-417
Project: JGroups
Issue Type: Bug
Affects Versions: 2.2.9 SP4
Environment: $ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxi32devifx-20061107 (iFix
111765: SR3 + 111700) )
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20061001 (JIT
enabled)
J9VM - 20060915_08260_lHdSMR
JIT - 20060908_1811_r8
GC - 20060906_AA)
JCL - 20061107
Reporter: Yves Martin
Assigned To: Bela Ban
Fix For: 2.x
When migrating a project to IBM Java 1.5,
I get the following warning from ConnectionTable:
ConnectionTable.run(): exception is java.lang.ClassCastException: IpAddress.compareTo():
comparison between different classes
And communication times out.
The same code works perfectly well with Sun Java 1.5.0_07
The drop stack trace show it comes from Hashtable.contains.
After comparison between Sun src.zip and IBM src.jar for Hashtable,
. Sun does entry.equals(value)
. IBM does value.equals(entry)
As a result, JGroups happens to do a IpAddress.equals(Connection) with IBM JVM
and fails. Whereas Connection.equals(IpAddress) is properly handled in case of Sun JVM.
Patch is trivial but the bug analysis was difficult !!
Here is a valid IpAddress.equals method.
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof IpAddress)) return false;
return compareTo(obj) == 0 ? true : false;
}
Thank you in advance to include this patch in JGroups 2.2.9 so that JBoss 4.0.x may work
one day with IBM Java 1.5
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira