You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/02/22 02:58:23 UTC

svn commit: r1570779 [7/7] - in /tomee/tomee/trunk/container/openejb-core/src/main: config/ java/org/apache/openejb/ java/org/apache/openejb/assembler/classic/ java/org/apache/openejb/assembler/classic/cmd/ java/org/apache/openejb/bval/ java/org/apache...

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java Sat Feb 22 01:58:19 2014
@@ -213,14 +213,26 @@ public class URLClassLoaderFirst extends
             }
         }
 
-        if (name.startsWith("java.")) return true;
-        if (name.startsWith("javax.faces.")) return false;
-        if (name.startsWith("javax.mail.")) return false;
-        if (name.startsWith("javax.")) return isInServer(name);
-        if (name.startsWith("sun.")) return isInJvm(name);
+        if (name.startsWith("java.")) {
+            return true;
+        }
+        if (name.startsWith("javax.faces.")) {
+            return false;
+        }
+        if (name.startsWith("javax.mail.")) {
+            return false;
+        }
+        if (name.startsWith("javax.")) {
+            return isInServer(name);
+        }
+        if (name.startsWith("sun.")) {
+            return isInJvm(name);
+        }
 
         // can be provided in the webapp
-        if (name.startsWith("javax.servlet.jsp.jstl")) return false;
+        if (name.startsWith("javax.servlet.jsp.jstl")) {
+            return false;
+        }
 
         if (name.startsWith("org.")) {
             final String org = name.substring("org.".length());
@@ -229,24 +241,54 @@ public class URLClassLoaderFirst extends
                 final String apache = org.substring("apache.".length());
 
                 // the following block is classes which enrich webapp classloader
-                if (apache.startsWith("webbeans.jsf")) return false;
-                if (apache.startsWith("tomee.mojarra.")) return false;
+                if (apache.startsWith("webbeans.jsf")) {
+                    return false;
+                }
+                if (apache.startsWith("tomee.mojarra.")) {
+                    return false;
+                }
 
                 // here we find server classes
-                if (apache.startsWith("bval.")) return true;
-                if (apache.startsWith("openjpa.")) return true;
-                if (apache.startsWith("xbean.")) return true;
-                if (apache.startsWith("geronimo.")) return true;
-                if (apache.startsWith("coyote")) return true;
-                if (apache.startsWith("webbeans.")) return true;
-                if (apache.startsWith("log4j") && SKIP_LOG4J) return true;
-                if (apache.startsWith("catalina")) return true;
-                if (apache.startsWith("jasper.")) return true;
-                if (apache.startsWith("tomcat.")) return true;
-                if (apache.startsWith("el.")) return true;
+                if (apache.startsWith("bval.")) {
+                    return true;
+                }
+                if (apache.startsWith("openjpa.")) {
+                    return true;
+                }
+                if (apache.startsWith("xbean.")) {
+                    return true;
+                }
+                if (apache.startsWith("geronimo.")) {
+                    return true;
+                }
+                if (apache.startsWith("coyote")) {
+                    return true;
+                }
+                if (apache.startsWith("webbeans.")) {
+                    return true;
+                }
+                if (apache.startsWith("log4j") && SKIP_LOG4J) {
+                    return true;
+                }
+                if (apache.startsWith("catalina")) {
+                    return true;
+                }
+                if (apache.startsWith("jasper.")) {
+                    return true;
+                }
+                if (apache.startsWith("tomcat.")) {
+                    return true;
+                }
+                if (apache.startsWith("el.")) {
+                    return true;
+                }
                 // if (apache.startsWith("jsp")) return true; // precompiled jsp have to be loaded from the webapp
-                if (apache.startsWith("naming")) return true;
-                if (apache.startsWith("taglibs.")) return true;
+                if (apache.startsWith("naming")) {
+                    return true;
+                }
+                if (apache.startsWith("taglibs.")) {
+                    return true;
+                }
 
                 if (apache.startsWith("openejb.")) { // skip all excepted webapp enrichment artifacts
                     return !isWebAppEnrichment(apache.substring("openejb.".length()));
@@ -256,17 +298,39 @@ public class URLClassLoaderFirst extends
                     final String commons = apache.substring("commons.".length());
 
                     // don't stop on commons package since we don't bring all commons
-                    if (commons.startsWith("beanutils")) return true;
-                    if (commons.startsWith("cli")) return true;
-                    if (commons.startsWith("codec")) return true;
-                    if (commons.startsWith("collections")) return true;
-                    if (commons.startsWith("dbcp")) return true;
-                    if (commons.startsWith("digester")) return true;
-                    if (commons.startsWith("jocl")) return true;
-                    if (commons.startsWith("lang")) return true;
-                    if (commons.startsWith("logging")) return false;
-                    if (commons.startsWith("pool")) return true;
-                    if (commons.startsWith("net") && SKIP_COMMONS_NET) return true;
+                    if (commons.startsWith("beanutils")) {
+                        return true;
+                    }
+                    if (commons.startsWith("cli")) {
+                        return true;
+                    }
+                    if (commons.startsWith("codec")) {
+                        return true;
+                    }
+                    if (commons.startsWith("collections")) {
+                        return true;
+                    }
+                    if (commons.startsWith("dbcp")) {
+                        return true;
+                    }
+                    if (commons.startsWith("digester")) {
+                        return true;
+                    }
+                    if (commons.startsWith("jocl")) {
+                        return true;
+                    }
+                    if (commons.startsWith("lang")) {
+                        return true;
+                    }
+                    if (commons.startsWith("logging")) {
+                        return false;
+                    }
+                    if (commons.startsWith("pool")) {
+                        return true;
+                    }
+                    if (commons.startsWith("net") && SKIP_COMMONS_NET) {
+                        return true;
+                    }
 
                     return false;
                 }
@@ -275,51 +339,106 @@ public class URLClassLoaderFirst extends
                     // we bring only myfaces-impl (+api but that's javax)
                     // mainly inspired from a comparison with tomahawk packages
                     final String myfaces = name.substring("myfaces.".length());
-                    if (myfaces.startsWith("shared")) return true;
-                    if (myfaces.startsWith("ee6.")) return true;
-                    if (myfaces.startsWith("lifecycle.")) return true;
-                    if (myfaces.startsWith("context.")) return true;
-                    if (myfaces.startsWith("logging.")) return true;
+                    if (myfaces.startsWith("shared")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("ee6.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("lifecycle.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("context.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("logging.")) {
+                        return true;
+                    }
                     // tomahawk uses component.html package
-                    if (myfaces.startsWith("component.visit.") || myfaces.equals("component.ComponentResourceContainer"))
+                    if (myfaces.startsWith("component.visit.") || myfaces.equals("component.ComponentResourceContainer")) {
                         return true;
-                    if (myfaces.startsWith("application.")) return true;
-                    if (myfaces.startsWith("config.")) return true;
-                    if (myfaces.startsWith("event.")) return true;
-
-                    if (myfaces.startsWith("resource.")) return true;
-                    if (myfaces.startsWith("el.")) return true;
-                    if (myfaces.startsWith("spi.")) return true;
-                    if (myfaces.startsWith("convert.")) return true;
-                    if (myfaces.startsWith("debug.")) return true;
-                    if (myfaces.startsWith("util.")) return true;
-                    if (myfaces.startsWith("view.")) return true;
-                    if (myfaces.equals("convert.ConverterUtils")) return true;
+                    }
+                    if (myfaces.startsWith("application.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("config.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("event.")) {
+                        return true;
+                    }
+
+                    if (myfaces.startsWith("resource.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("el.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("spi.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("convert.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("debug.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("util.")) {
+                        return true;
+                    }
+                    if (myfaces.startsWith("view.")) {
+                        return true;
+                    }
+                    if (myfaces.equals("convert.ConverterUtils")) {
+                        return true;
+                    }
 
                     if (myfaces.startsWith("renderkit.")) {
                         final String renderkit = myfaces.substring("renderkit.".length());
-                        if (renderkit.startsWith("html.Html")) return true;
+                        if (renderkit.startsWith("html.Html")) {
+                            return true;
+                        }
                         final char firstNextletter = renderkit.charAt(0);
-                        if (Character.isUpperCase(firstNextletter)) return true;
+                        if (Character.isUpperCase(firstNextletter)) {
+                            return true;
+                        }
                         return false;
                     }
 
                     if (myfaces.startsWith("taglib.")) {
                         final String taglib = myfaces.substring("taglib.".length());
-                        if (taglib.startsWith("html.Html")) return true;
-                        if (taglib.startsWith("core.")) return true;
+                        if (taglib.startsWith("html.Html")) {
+                            return true;
+                        }
+                        if (taglib.startsWith("core.")) {
+                            return true;
+                        }
                         return false;
                     }
 
                     if (myfaces.startsWith("webapp.")) {
                         final String webapp = myfaces.substring("webapp.".length());
-                        if (webapp.startsWith("Faces")) return true;
-                        if (webapp.startsWith("Jsp")) return true;
-                        if (webapp.startsWith("Startup")) return true;
-                        if (webapp.equals("AbstractFacesInitializer")) return true;
-                        if (webapp.equals("MyFacesServlet")) return true;
-                        if (webapp.equals("ManagedBeanDestroyerListener")) return true;
-                        if (webapp.equals("WebConfigParamsLogger")) return true;
+                        if (webapp.startsWith("Faces")) {
+                            return true;
+                        }
+                        if (webapp.startsWith("Jsp")) {
+                            return true;
+                        }
+                        if (webapp.startsWith("Startup")) {
+                            return true;
+                        }
+                        if (webapp.equals("AbstractFacesInitializer")) {
+                            return true;
+                        }
+                        if (webapp.equals("MyFacesServlet")) {
+                            return true;
+                        }
+                        if (webapp.equals("ManagedBeanDestroyerListener")) {
+                            return true;
+                        }
+                        if (webapp.equals("WebConfigParamsLogger")) {
+                            return true;
+                        }
                         return false;
                     }
 
@@ -330,18 +449,28 @@ public class URLClassLoaderFirst extends
             }
 
             // other org packages
-            if (org.startsWith("hsqldb.") && SKIP_HSQLDB) return true;
+            if (org.startsWith("hsqldb.") && SKIP_HSQLDB) {
+                return true;
+            }
             if (org.startsWith("codehaus.swizzle.")) {
                 final String swizzle = org.substring("codehaus.swizzle.".length());
-                if (swizzle.startsWith("stream.")) return true;
-                if (swizzle.startsWith("rss.")) return true;
-                if (swizzle.startsWith("Grep.class") || swizzle.startsWith("Lexer.class")) return true;
+                if (swizzle.startsWith("stream.")) {
+                    return true;
+                }
+                if (swizzle.startsWith("rss.")) {
+                    return true;
+                }
+                if (swizzle.startsWith("Grep.class") || swizzle.startsWith("Lexer.class")) {
+                    return true;
+                }
                 return false;
             }
             if (org.startsWith("w3c.dom")) {
                 return isInJvm(name);
             }
-            if (org.startsWith("eclipse.jdt.")) return true;
+            if (org.startsWith("eclipse.jdt.")) {
+                return true;
+            }
 
             // let an app use its own slf4j impl (so its own api too)
             // if (org.startsWith("slf4j")) return true;
@@ -350,8 +479,12 @@ public class URLClassLoaderFirst extends
         }
 
         // other packages
-        if (name.startsWith("com.sun.")) return isInJvm(name);
-        if (name.startsWith("serp.bytecode")) return true;
+        if (name.startsWith("com.sun.")) {
+            return isInJvm(name);
+        }
+        if (name.startsWith("serp.bytecode")) {
+            return true;
+        }
 
         return false;
     }
@@ -363,9 +496,15 @@ public class URLClassLoaderFirst extends
     private static boolean isInServer(final String name) {
         if (name.startsWith("javax.")) {
             final String sub = name.substring("javax.".length());
-            if (sub.startsWith("ws.rs.")) return SKIP_JAXRS;
-            if (sub.startsWith("jws.")) return SKIP_JAXWS;
-            if (sub.startsWith("jms.")) return SKIP_JMS;
+            if (sub.startsWith("ws.rs.")) {
+                return SKIP_JAXRS;
+            }
+            if (sub.startsWith("jws.")) {
+                return SKIP_JAXWS;
+            }
+            if (sub.startsWith("jms.")) {
+                return SKIP_JMS;
+            }
         }
         return ParentClassLoaderFinder.Helper.get().getResource(name.replace('.', '/') + ".class") != null;
     }

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/executor/OfferRejectedExecutionHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/executor/OfferRejectedExecutionHandler.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/executor/OfferRejectedExecutionHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/executor/OfferRejectedExecutionHandler.java Sat Feb 22 01:58:19 2014
@@ -36,8 +36,12 @@ public class OfferRejectedExecutionHandl
     }
 
     public OfferRejectedExecutionHandler(final long timeout, final TimeUnit timeUnit) {
-        if (timeout <= 0) throw new IllegalArgumentException("timeout must be greater than zero");
-        if (timeUnit == null) throw new IllegalArgumentException("TimeUnit must not be null");
+        if (timeout <= 0) {
+            throw new IllegalArgumentException("timeout must be greater than zero");
+        }
+        if (timeUnit == null) {
+            throw new IllegalArgumentException("TimeUnit must not be null");
+        }
 
         this.timeout = timeout;
         this.seconds = timeUnit;

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyManager.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyManager.java Sat Feb 22 01:58:19 2014
@@ -34,7 +34,9 @@ public class ProxyManager {
     }
 
     public static void checkDefaultFactory() {
-        if (defaultFactory == null) throw new IllegalStateException("[Proxy Manager] No default proxy factory specified.");
+        if (defaultFactory == null) {
+            throw new IllegalStateException("[Proxy Manager] No default proxy factory specified.");
+        }
     }
 
     public static ProxyFactory getFactory(final String factoryName) {
@@ -43,7 +45,9 @@ public class ProxyManager {
 
     public static synchronized ProxyFactory setDefaultFactory(final String factoryName) {
         final ProxyFactory newFactory = getFactory(factoryName);
-        if (newFactory == null) return defaultFactory;
+        if (newFactory == null) {
+            return defaultFactory;
+        }
 
         final ProxyFactory oldFactory = defaultFactory;
         defaultFactory = newFactory;