diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-29 08:53:26 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-29 08:53:26 +0000 |
commit | 7f61ec586a9dc1bbd71b68331c610fcc0148c999 (patch) | |
tree | e4154863b2fe61c17dc161ef64fd700adca48dc4 /sca-java-2.x/trunk/modules | |
parent | 3f38365459d29ecd8fd83d95ecbc593586627116 (diff) |
TUSCANY-3595 - Only add classloader if not already added previously
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@990511 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java b/sca-java-2.x/trunk/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java index f15e89767c..1917fe05d4 100644 --- a/sca-java-2.x/trunk/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java +++ b/sca-java-2.x/trunk/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java @@ -6,15 +6,15 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ package org.apache.tuscany.sca.extensibility; @@ -108,10 +108,10 @@ public class ClassLoaderContext { /** * Set the thread context classloader (TCCL) to a classloader that delegates to a collection - * of classloaders + * of classloaders * @param parent The parent classloader * @param delegates A list of classloaders to try - * @return The existing TCCL + * @return The existing TCCL */ public static ClassLoader setContextClassLoader(ClassLoader parent, ClassLoader... delegates) { ClassLoaderContext context = new ClassLoaderContext(parent, delegates); @@ -195,7 +195,7 @@ public class ClassLoaderContext { List<ClassLoader> loaders = new ArrayList<ClassLoader>(); for (Class<?> serviceType : serviceTypes) { ClassLoader classLoader = getClassLoader(discovery, serviceType); - if (classLoader != null && loaders.contains(classLoader)) { + if (classLoader != null && !loaders.contains(classLoader)) { loaders.add(classLoader); } } |