Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66529 Details for
Bug 174109
hashCode() for org.eclipse.swt.graphics.Point exhibits poor collisional properties.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Path for problem
patch_hash.txt (text/plain), 1.68 KB, created by
Silenio Quarti
on 2007-05-09 14:44:21 EDT
(
hide
)
Description:
Path for problem
Filename:
MIME Type:
Creator:
Silenio Quarti
Created:
2007-05-09 14:44:21 EDT
Size:
1.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java,v >retrieving revision 1.21 >diff -u -r1.21 Rectangle.java >--- Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java 23 Jun 2005 14:51:56 -0000 1.21 >+++ Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java 9 May 2007 18:43:13 -0000 >@@ -62,6 +62,8 @@ > */ > public int height; > >+ static final int PRIME = 37; >+ > static final long serialVersionUID = 3256439218279428914L; > > /** >@@ -167,7 +169,11 @@ > * @see #equals(Object) > */ > public int hashCode () { >- return x ^ y ^ width ^ height; >+ int result = x; >+ result = result * PRIME + y; >+ result = result * PRIME + width; >+ result = result * PRIME + height; >+ return result; > } > > /** >Index: Eclipse SWT/common/org/eclipse/swt/graphics/Point.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java,v >retrieving revision 1.15 >diff -u -r1.15 Point.java >--- Eclipse SWT/common/org/eclipse/swt/graphics/Point.java 23 Jun 2005 14:51:56 -0000 1.15 >+++ Eclipse SWT/common/org/eclipse/swt/graphics/Point.java 9 May 2007 18:43:13 -0000 >@@ -49,6 +49,8 @@ > */ > public int y; > >+ static final int PRIME = 37; >+ > static final long serialVersionUID = 3257002163938146354L; > > /** >@@ -90,7 +92,7 @@ > * @see #equals(Object) > */ > public int hashCode () { >- return x ^ y; >+ return x * PRIME + y; > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 174109
: 66529