-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
introduce the notion of equivalence #173
Conversation
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hash(className, returnType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perf experts always say that Objects.hash()
is evil when used in hot paths because it allocates one more unnecessary array ;-). In fact, it also sometimes helps to compute the hashcode in the constructor and save it in a field.
It depends on whether we expect the equivalence keys in hash maps and in hot paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ignoring this for now. If that ever becomes problematic, it's straightforward to improve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful, yes. But not really an annotation override ;)
Is it intentional that this is targeted at the |
Not an overlay per se, but having built an annotation overlay on top of Jandex myself, I find this a rather important building block. I didn't consider putting this into 2.4 (would probably become 2.5?), I always thought of this as 3.0 material, but there's probably nothing preventing inclusion into 2.x. |
43aa60c
to
9f74dbf
Compare
Resolves #158