Open GoogleCodeExporter opened 9 years ago
Thanks Luke. Can you show us what your Module code looks like?
Original comment by kevin...@gmail.com
on 3 Jul 2007 at 8:07
Luke, I assume you implemented the annotation interface by hand? Did you follow
the
rules for equals() and hashCode() in Annotation
(http://java.sun.com/javase/6/docs/api/java/lang/annotation/Annotation.html)?
If so,
it should compare to the proxy just fine.
Original comment by crazybob...@gmail.com
on 3 Jul 2007 at 8:17
I implemented the interface by cutting and pasting the code out of the Guice
Users
Guide :-) I was playing around with the equals and hash code and it doesn't
seem to
be being called through the proxy (in debugger). Teh toString is not called
either,
you can see this from the Guice error and inspection in the debugger, e.g my
toString methiod would return "DS(GDS)" where as the Proxy on the same
annotation
returns "@com.rbs.gbm.rates.common.guice.DS(value=GDS)". I can't see the source
for
sun.reflect.annotation.AnnotationInvocationHandler but it looks like it is not
passing through methods such as toString, hashCode, equals etc. So it could be
you
cannot naively use the bare Annotation as part of your Key ... Happy to help
further
but I have to find workaround first to get something working.
Original comment by luke.stu...@gmail.com
on 4 Jul 2007 at 8:22
Attachments:
Apologies - I didn't read the link until after I posted, neither did I
correctly cut
and paste your code. Didn't realise the significance of the 127 or the XOR from
the
sun spec. Working now. You learn something useless every day! Thanks for your
time.
Original comment by luke.stu...@gmail.com
on 4 Jul 2007 at 8:49
Our next release will give you a much, much better way to do this that will be
failsafe and easy!
Original comment by kevin...@gmail.com
on 4 Jul 2007 at 1:44
Original issue reported on code.google.com by
luke.stu...@gmail.com
on 3 Jul 2007 at 6:54