You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our migration from jersey 2.25.1 to 2.32 we have noticed that the way in which registered binders are iterated is no longer deterministic. This is particularly problematic when different configuration order could lead to the wrong thing getting injected.
A similar issue was raised in #4538 but it doesn't seem like the fix addresses the issue for binders.
It seems to me the problem lies in the following code:
instances was originally created as a LinkedHashSet which is an ordered set, but the method above uses Collectors.toSet() which doesn't preserve order.
The text was updated successfully, but these errors were encountered:
eocantu
changed the title
Registered components not iterated in registration order
Registered binders not iterated in registration order
Nov 16, 2020
In our migration from jersey
2.25.1
to2.32
we have noticed that the way in which registered binders are iterated is no longer deterministic. This is particularly problematic when different configuration order could lead to the wrong thing getting injected.A similar issue was raised in #4538 but it doesn't seem like the fix addresses the issue for binders.
It seems to me the problem lies in the following code:
jersey/core-common/src/main/java/org/glassfish/jersey/model/internal/ComponentBag.java
Lines 603 to 611 in aebe70d
instances
was originally created as aLinkedHashSet
which is an ordered set, but the method above usesCollectors.toSet()
which doesn't preserve order.The text was updated successfully, but these errors were encountered: