Skip to content

Commit cd13f04

Browse files
lprimakdmatej
authored andcommitted
bugfix: clean up effectiveInjectionManager and move cleanup into finally block
1 parent d770f56 commit cd13f04

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,13 +687,16 @@ public void inject(final Object t, final CreationalContext cc) {
687687
threadInjectionManagers.set(injectingManager);
688688
}
689689

690-
delegate.inject(t, cc); // here the injection manager is used in HK2Bean
690+
try {
691+
delegate.inject(t, cc); // here the injection manager is used in HK2Bean
691692

692-
if (injectingManager != null) {
693-
injectingManager.inject(t, CdiComponentProvider.CDI_CLASS_ANALYZER);
693+
if (injectingManager != null) {
694+
injectingManager.inject(t, CdiComponentProvider.CDI_CLASS_ANALYZER);
695+
}
696+
} finally {
697+
threadInjectionManagers.remove();
698+
effectiveInjectionManager.remove();
694699
}
695-
696-
threadInjectionManagers.remove();
697700
}
698701

699702
@Override

0 commit comments

Comments
 (0)