-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Jandex 3.1.5 #36105
Upgrade to Jandex 3.1.5 #36105
Conversation
Ladicek
commented
Sep 22, 2023
- https://smallrye.io/blog/jandex-3-1-5/
Hmm, tests failed in my fork (and likely also here) in |
This comment has been minimized.
This comment has been minimized.
Added one commit that fixes ArC's The |
Was reading the release blog - there's one thing puzzling me: wouldn't the "target" always be the same for a given annotation? I assume it's referring to I would have thought that in this case skipping the target would have been a valid optimisation; wondering what I'm missing. |
No, the |
Ah, the actual runtime instance! Thanks, that explains my confusion. |
if (!annotationsAreEqual(a1, a2)) { | ||
for (AnnotationInstance a1 : s1) { | ||
for (AnnotationInstance a2 : s2) { | ||
if (!annotationEquals(a1, a2)) { |
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.
And why don't we use AnnotationInstance.equivalentTo(AnnotationInstance)
instead?
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.
Because AnnotationInstance
doesn't have a corresponding hash code function (yet -- see smallrye/jandex#333). Once AnnotationInstance
has both equivalence and equivalence hash code, we remove both annotationEquals
and annotationHashCode
. Until then, I think it's better to keep both equals
and hashCode
completely self-sufficient.
In other words, if I switched to AnnotationInstance.equivalentTo()
, I would be creating another problem of the same kind that I'm fixing here. Potential problem, that is. The annotationHashCode()
implemented in this commit is consistent with AnnotationInstance.equivalentTo()
, but there's no stated contract saying that. It would be another dependency on an implementation detail.
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.
Well, the contract of AnnotationInstance#equivalentTo()
is pretty clear so I don't see a dependency on an implementation detail. But let's keep it independent if you think it's better...
Makes sense but I wonder if ArC is the only one who relied on this implementation detail of |
That's a good question. Let's see if more tests fail :-) |
This comment has been minimized.
This comment has been minimized.
The number of failures looks creepy, but I can't reproduce any of them locally and the failures look highly unrelated. Especially the failing Oracle DB tests show errors on the database side ("table or view does not exist", "sequence does not exist", "object SYSTEM.MYPROC is invalid"). Many other PRs fail with the same errors, see e.g. #36131, which suggests this is an infrastructure failure. |
This comment has been minimized.
This comment has been minimized.
The `TypeAndQualifiers` compound is used as a key in hash maps, which means its equality and hash code must be consistent. Unfortunately, the implementation of `equals()` is completely custom, because it needs to ignore `AnnotationInstance.target`, yet the `hashCode()` implementation blindly delegates to `AnnotationInstance`. That used to work, because `AnnotationInstance.hashCode()` ignored the `target` before, but that has never been a stated contract. A completely custom implementation of equality should always be accompanied by a custom implementation of hash code. That's what this commit does.
Failing Jobs - Building fcbd46d
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 17 Windows #- Failing: independent-projects/tools/analytics-common
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/maven and 219 more 📦 independent-projects/tools/analytics-common✖
✖
✖
⚙️ Maven Tests - JDK 11 Windows #📦 integration-tests/maven✖
✖
✖
✖
|