From 7f61ec586a9dc1bbd71b68331c610fcc0148c999 Mon Sep 17 00:00:00 2001 From: lresende Date: Sun, 29 Aug 2010 08:53:26 +0000 Subject: 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 --- .../apache/tuscany/sca/extensibility/ClassLoaderContext.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sca-java-2.x/trunk/modules') 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 loaders = new ArrayList(); for (Class serviceType : serviceTypes) { ClassLoader classLoader = getClassLoader(discovery, serviceType); - if (classLoader != null && loaders.contains(classLoader)) { + if (classLoader != null && !loaders.contains(classLoader)) { loaders.add(classLoader); } } -- cgit v1.2.3