Commit 393d4c69bfda82166d6ad5cb0ca9d9b9e3abda06

Authored by Dancovich
1 parent c90630ec
Exists in master

Desregistrando os pseudo-contextos no momento correto

impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/StartupBootstrap.java
@@ -127,7 +127,7 @@ public class StartupBootstrap extends AbstractBootstrap { @@ -127,7 +127,7 @@ public class StartupBootstrap extends AbstractBootstrap {
127 ClassLoader classLoader = ConfigurationLoader.getClassLoaderForClass(processor.getAnnotatedMethod() 127 ClassLoader classLoader = ConfigurationLoader.getClassLoaderForClass(processor.getAnnotatedMethod()
128 .getDeclaringType().getJavaClass().getCanonicalName()); 128 .getDeclaringType().getJavaClass().getCanonicalName());
129 129
130 - if (classLoader.equals(Thread.currentThread().getContextClassLoader())) { 130 + if (Thread.currentThread().getContextClassLoader().equals(classLoader)) {
131 processor.process(); 131 processor.process();
132 132
133 if (remove) { 133 if (remove) {
@@ -140,7 +140,9 @@ public class StartupBootstrap extends AbstractBootstrap { @@ -140,7 +140,9 @@ public class StartupBootstrap extends AbstractBootstrap {
140 } 140 }
141 } 141 }
142 142
143 - unloadTempContexts(); 143 + if (processors.isEmpty()){
  144 + unloadTempContexts();
  145 + }
144 146
145 if (failure != null) { 147 if (failure != null) {
146 throw new DemoiselleException(failure); 148 throw new DemoiselleException(failure);