You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2012/11/08 09:58:20 UTC

svn commit: r1406962 - in /cxf/branches/2.6.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java

Author: ffang
Date: Thu Nov  8 08:58:19 2012
New Revision: 1406962

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

........
  r1406958 | ffang | 2012-11-08 16:48:30 +0800 (四, 08 11 2012) | 1 line
  
  [CXF-4620]Exception at compilation when a 'space' character is present in maven local repository path
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1406958

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

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?rev=1406962&r1=1406961&r2=1406962&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java (original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java Thu Nov  8 08:58:19 2012
@@ -144,15 +144,15 @@ public class OASISCatalogManager {
         Enumeration<URL> catalogs = classLoader.getResources(name);
         while (catalogs.hasMoreElements()) {
             URL catalogURL = catalogs.nextElement();
-            if (!loadedCatalogs.contains(URI.create(catalogURL.toString()))) {
+            if (!loadedCatalogs.contains(URI.create(replaceWhitespace(catalogURL.toString())))) {
                 ((Catalog)catalog).parseCatalog(catalogURL);
-                loadedCatalogs.add(URI.create(catalogURL.toString()));
+                loadedCatalogs.add(URI.create(replaceWhitespace(catalogURL.toString())));
             }
         }
     }
 
     public final void loadCatalog(URL catalogURL) throws IOException {
-        if (!loadedCatalogs.contains(URI.create(catalogURL.toString())) && catalog != null) {
+        if (!loadedCatalogs.contains(URI.create(replaceWhitespace(catalogURL.toString()))) && catalog != null) {
             if ("file".equals(catalogURL.getProtocol())) {
                 try {
                     File file = new File(catalogURL.toURI());
@@ -166,9 +166,16 @@ public class OASISCatalogManager {
 
             ((Catalog)catalog).parseCatalog(catalogURL);
 
-            loadedCatalogs.add(URI.create(catalogURL.toString()));
+            loadedCatalogs.add(URI.create(replaceWhitespace(catalogURL.toString())));
         }
     }
+    
+    private String replaceWhitespace(String str) {
+        if (str.contains(" ")) {
+            str = str.replace(" ", "%20");
+        }
+        return str;
+    }
 
     private static OASISCatalogManager getContextCatalog() {
         try {