-
Thanks for the response. I'm not sure if you're planning any action as a result of this.
You could use reflective impls for these methods that avoid evaluating properties that fetch the image data from the urls. The 'transient' modifier could be used to mark property getters to ignore - this would be consistent with serialisation.
However you implement equals(), hashCode() has to be...
2009-10-30 03:01:27 UTC in flickrj
-
Forgot to mention in the last comment that I'm using rel-1-2.
I've uploaded a patch with simple impls of hashCode() & equals() for Photo; they just use the id & secret properties.
The impl of equals() isn't perfect; see http://www.artima.com/lejava/articles/equality.html for a fuller treatment.
2009-10-23 05:06:20 UTC in flickrj
-
I've attached a simple main which obtains a public photo from Flickr & outputs the time taken to evaluate toString() for it & to evaluate equals() on itself.
For me the output is
false
x=x?: 1031
Photo hashCode unrecognised object: java.awt.image.BufferedImage
Photo hashCode unrecognised object: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
Photo hashCode unrecognised...
2009-10-22 06:38:01 UTC in flickrj
-
Oops, for some reason this was added as a feature request, but I intended to raise it as a bug.
2009-10-21 04:41:36 UTC in flickrj
-
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...
2009-10-21 04:39:02 UTC in flickrj
-
Reflective implementations of equals() & hashCode() & toString() are useful as a first draft but not always suitable for release. The implementations in Photo have two problems; the lesser one is that they write to System.out (IMO they should use a logger API, or just keep quiet).
The more serious problem is that Photo has bean properties whose values are BufferedImage & InputStream (eg...
2009-10-16 00:02:10 UTC in flickrj