cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor modifications to Spring scanner code to avoid side-effects in Eclipse
Date Tue, 09 Dec 2014 15:47:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 3898cf18c -> d8a6bdbd2


Minor modifications to Spring scanner code to avoid side-effects in Eclipse


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

Branch: refs/heads/master
Commit: d8a6bdbd2c84b3fa0187de935e294d5f66974e46
Parents: 3898cf1
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Dec 9 15:47:08 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Dec 9 15:47:08 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/common/util/SpringClasspathScanner.java  | 9 ++++++---
 .../java/org/apache/cxf/common/util/SpringOsgiUtil.java     | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d8a6bdbd/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
index 12532b0..e8dd183 100644
--- a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
+++ b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
@@ -169,12 +169,15 @@ class SpringClasspathScanner extends ClasspathScanner {
     }
     
     private ResourcePatternResolver getResolver(ClassLoader loader) {
+        ResourcePatternResolver resolver = null;
         if (IN_OSGI) {
-            return SpringOsgiUtil.getResolver(loader);
-        } else {
-            return loader != null 
+            resolver = SpringOsgiUtil.getResolver(loader);
+        } 
+        if (resolver == null) {
+            resolver = loader != null 
                 ? new PathMatchingResourcePatternResolver(loader) : new PathMatchingResourcePatternResolver();
         }
+        return resolver;
     }
        
     private boolean shouldSkip(final String classname) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d8a6bdbd/core/src/main/java/org/apache/cxf/common/util/SpringOsgiUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/SpringOsgiUtil.java b/core/src/main/java/org/apache/cxf/common/util/SpringOsgiUtil.java
index 7312475..26b54b1 100644
--- a/core/src/main/java/org/apache/cxf/common/util/SpringOsgiUtil.java
+++ b/core/src/main/java/org/apache/cxf/common/util/SpringOsgiUtil.java
@@ -39,6 +39,6 @@ final class SpringOsgiUtil {
         } else {
             bundle = FrameworkUtil.getBundle(SpringClasspathScanner.class);
         }
-        return new OsgiBundleResourcePatternResolver(bundle);
+        return bundle != null ? new OsgiBundleResourcePatternResolver(bundle) : null;
     }
 }


Mime
View raw message