Skip to content

Commit

Permalink
We must properly wire the object before attaching it
Browse files Browse the repository at this point in the history
- or else race conditions might occur where the wiring has not happened yet

Fixes: SE-13624
  • Loading branch information
mkeckmkeck committed Nov 28, 2024
1 parent 5c9d9a2 commit bf67fb6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public int getPriority() {
public T make(@Nonnull Object source) {
try {
T result = createInstance(source);
globalContext.wire(result);

if (source instanceof Composable composable && additionalTargetTypes != null) {
for (Class<?> additionalTarget : additionalTargetTypes) {
composable.attach(additionalTarget, result);
}
}

globalContext.wire(result);
return result;
} catch (InvocationTargetException exception) {
if (exception.getCause() instanceof IllegalArgumentException) {
Expand Down

0 comments on commit bf67fb6

Please sign in to comment.