camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r804861 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java
Date Mon, 17 Aug 2009 04:51:06 GMT
Author: wtam
Date: Mon Aug 17 04:51:06 2009
New Revision: 804861

URL: http://svn.apache.org/viewvc?rev=804861&view=rev
Log:
back out fix for [CAMEL-1917] as too late for 2.0

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java?rev=804861&r1=804860&r2=804861&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
Mon Aug 17 04:51:06 2009
@@ -210,12 +210,9 @@
                     log.trace("Decoded urlPath: " + urlPath);
                 }
 
-                boolean isLocalFileSystem = "file".equals(url.getProtocol());
-
                 // If it's a file in a directory, trim the stupid file: spec
                 if (urlPath.startsWith("file:")) {
                     urlPath = urlPath.substring(5);
-                    isLocalFileSystem = true;
                 }
 
                 // osgi bundles should be skipped
@@ -241,8 +238,8 @@
                     loadImplementationsInDirectory(test, packageName, file, classes);
                 } else {
                     InputStream stream;
-                    if (!isLocalFileSystem) {
-                        // load resources using http (and other protocols) such as java webstart

+                    if (urlPath.startsWith("http:")) {
+                        // load resources using http such as java webstart
                         log.debug("The current jar is accessed via http");
                         URL urlStream = new URL(urlPath);
                         URLConnection con = urlStream.openConnection();
@@ -279,12 +276,6 @@
         if (log.isTraceEnabled()) {
             log.trace("Getting resource URL for package: " + packageName + " with classloader:
" + loader);
         }
-        
-        // If the URL is a jar, the URLClassloader.getResources() seems to require a trailing
slash.  The
-        // trailing slash is harmless for other URLs  
-        if (!packageName.endsWith("/")) {
-            packageName = packageName + "/";
-        }
         return loader.getResources(packageName);
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java?rev=804861&r1=804860&r2=804861&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/scan/DefaultPackageScanClassResolverTest.java
Mon Aug 17 04:51:06 2009
@@ -123,7 +123,8 @@
         validateMatchingSetContains(scanned,  ScanTargetTwo.class);
     }
     
-    public void testFindByFilterPackageInJarUrl() throws Exception {
+    // Disable until CAMEL-1917 is fixed
+    public void disabledtestFindByFilterPackageInJarUrl() throws Exception {
         
         ClassLoader savedClassLoader = null; 
         try {



Mime
View raw message