tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-1855 default shouldnt skip injections in all web components
Date Mon, 04 Jul 2016 10:23:52 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 8cee668c0 -> 971d5c9bd


TOMEE-1855 default shouldnt skip injections in all web components


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/971d5c9b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/971d5c9b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/971d5c9b

Branch: refs/heads/master
Commit: 971d5c9bdc5a0d196c836498dc15adcb439add62
Parents: 8cee668
Author: Romain manni-Bucau <rmannibucau@gmail.com>
Authored: Mon Jul 4 12:23:34 2016 +0200
Committer: Romain manni-Bucau <rmannibucau@gmail.com>
Committed: Mon Jul 4 12:23:34 2016 +0200

----------------------------------------------------------------------
 .../apache/tomee/catalina/JavaeeInstanceManager.java   | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/971d5c9b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/JavaeeInstanceManager.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/JavaeeInstanceManager.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/JavaeeInstanceManager.java
index 8df120d..bab7505 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/JavaeeInstanceManager.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/JavaeeInstanceManager.java
@@ -55,7 +55,8 @@ public class JavaeeInstanceManager implements InstanceManager {
         this.webapp = webapp;
         this.skipContainerTags = SystemInstance.get().getProperty(
                 "tomee.tomcat.instance-manager.skip-container-tags", "org.apache.taglibs.standard.,javax.servlet.jsp.jstl.").split("
*, *");
-        this.skipPrefixes = SystemInstance.get().getProperty("tomee.tomcat.instance-manager.skip-cdi",
"").split(" *, *");
+        final String[] skipCdi = SystemInstance.get().getProperty("tomee.tomcat.instance-manager.skip-cdi",
"").split(" *, *");
+        this.skipPrefixes = skipCdi.length == 1 && skipCdi[0].isEmpty() ? new String[0]
: skipCdi;
     }
 
     public ServletContext getServletContext() {
@@ -75,12 +76,11 @@ public class JavaeeInstanceManager implements InstanceManager {
             }
 
             final Object object = isSkip(name, skipPrefixes) ? clazz.newInstance() : webContext.newInstance(clazz);
-            if (isJsp(object.getClass())) {
+            if (isJsp(clazz)) {
                 initDefaultInstanceMgr();
                 defaultInstanceManager.newInstance(object);
-            } else {
-                postConstruct(object, clazz);
             }
+            postConstruct(object, clazz);
             return object;
         } catch (final OpenEJBException | WebBeansCreationException | WebBeansConfigurationException
e) {
             throw (InstantiationException) new InstantiationException(e.getMessage()).initCause(e);
@@ -133,7 +133,7 @@ public class JavaeeInstanceManager implements InstanceManager {
             return;
         }
         try {
-            if (isSkip(name, skipPrefixes)) {
+            if (!isSkip(name, skipPrefixes)) {
                 webContext.inject(o);
             }
             postConstruct(o, o.getClass());
@@ -170,9 +170,8 @@ public class JavaeeInstanceManager implements InstanceManager {
         try {
             if (isJsp(o.getClass())) {
                 defaultInstanceManager.destroyInstance(o);
-            } else {
-                preDestroy(unwrapped, unwrapped.getClass());
             }
+            preDestroy(unwrapped, unwrapped.getClass());
         } finally {
             webContext.destroy(unwrapped);
             if (unwrapped != o) { // PojoEndpointServer, they create and track a cc so release
it


Mime
View raw message