Reflective implementations of equals() & hashCode() in Photo make them slow
(10s of seconds) & noisy (producing lots of output to System.out)
See my comment in
https://sourceforge.net/tracker/index.php?func=detail&aid=2675874&group_id=
131157&atid=721513 (I couldn't work out how to reopen this defect).
It's relatively easy to come up with an adequate hashCode() impl (photo-id,
optionally combined with secret, server & farm). Less clear is which
properties to compare for equals(): a simple approach using the same
properties as hashCode is probably ok for most uses but wouldn't allow
equals() to detect changes in other properties (title, privacy, etc). If
you change Flickr's metadata for a photo, is it still the same photo?
Non-trivial question IMO.
Nobody/Anonymous
None
None
Public
|
Date: 2009-10-30 03:01 Thanks for the response. I'm not sure if you're planning any action as a |
|
Date: 2009-10-29 17:49 The real brake on equals() and hashCode() where the fact that they called |
|
Date: 2009-10-23 05:06 Forgot to mention in the last comment that I'm using rel-1-2. |
|
Date: 2009-10-22 06:38 I've attached a simple main which obtains a public photo from Flickr & |
|
Date: 2009-10-21 17:00 I was able to identify one line of output at hashCode(). That's removed. Is |
|
Date: 2009-10-21 04:41 Oops, for some reason this was added as a feature request, but I intended |
| Filename | Description | Download |
|---|---|---|
| flickrj.2882978.patch | Patch with new impls of Photo.hashCode() & Photos.equals() | Download |
| Main2882978.java | main to display time taken by Photo.toString() & Photo.equals() | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | - | 2009-10-29 17:49 | x-mago |
| status_id | Open | 2009-10-29 17:49 | x-mago |
| File Added | 347824: flickrj.2882978.patch | 2009-10-23 05:03 | richard_barnett |
| File Added | 347689: Main2882978.java | 2009-10-22 06:34 | richard_barnett |