cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r766964 - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
Date Tue, 21 Apr 2009 03:27:25 GMT
Author: dkulp
Date: Tue Apr 21 03:27:25 2009
New Revision: 766964

URL: http://svn.apache.org/viewvc?rev=766964&view=rev
Log:
Merged revisions 766860 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r766860 | dkulp | 2009-04-20 16:40:39 -0400 (Mon, 20 Apr 2009) | 2 lines
  
  Check if classloader is null before using it.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 21 03:27:25 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java?rev=766964&r1=766963&r2=766964&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
Tue Apr 21 03:27:25 2009
@@ -57,13 +57,16 @@
                 .getResource(resourceName.substring(1));
         }
 
+        ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader();
+        if (cluClassloader == null) {
+            cluClassloader = ClassLoader.getSystemClassLoader();
+        }
         if (url == null) {
-            url = ClassLoaderUtils.class.getClassLoader().getResource(resourceName);
+            url = cluClassloader.getResource(resourceName);
         }
         if (url == null && resourceName.startsWith("/")) {
             //certain classloaders need it without the leading /
-            url = ClassLoaderUtils.class.getClassLoader()
-                .getResource(resourceName.substring(1));
+            url = cluClassloader.getResource(resourceName.substring(1));
         }
 
         if (url == null) {
@@ -124,9 +127,13 @@
             }
         }
 
+        ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader();
+        if (cluClassloader == null) {
+            cluClassloader = ClassLoader.getSystemClassLoader();
+        }
         if (!urls.hasMoreElements()) {
             try {
-                urls = ClassLoaderUtils.class.getClassLoader().getResources(resourceName);
+                urls = cluClassloader.getResources(resourceName);
             } catch (IOException e) {
                 // ignore
             }
@@ -134,8 +141,7 @@
         if (!urls.hasMoreElements() && resourceName.startsWith("/")) {
             //certain classloaders need it without the leading /
             try {
-                urls = ClassLoaderUtils.class.getClassLoader()
-                    .getResources(resourceName.substring(1));
+                urls = cluClassloader.getResources(resourceName.substring(1));
             } catch (IOException e) {
                 // ignore
             }



Mime
View raw message