You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2010/02/02 08:06:21 UTC

svn commit: r905535 - /geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java

Author: gawor
Date: Tue Feb  2 07:06:21 2010
New Revision: 905535

URL: http://svn.apache.org/viewvc?rev=905535&view=rev
Log:
forgot to commit

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java?rev=905535&r1=905534&r2=905535&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java Tue Feb  2 07:06:21 2010
@@ -51,7 +51,11 @@
 
     public MockBundle(ClassLoader classLoader, String location, long id) {
         this.classLoader = classLoader;
-        this.location = location;
+        if (location != null && location.endsWith("/")) {
+            this.location = location.substring(0, location.length() - 1);
+        } else {
+            this.location = location;
+        }
         this.id = id;
     }
 
@@ -129,13 +133,17 @@
     }
 
     public URL getEntry(String s) {
+        if (s.startsWith("/")) {
+            s = s.substring(1);   
+        }
         try {
-            return new URL(location + s);
+            return new URL(location + "/" + s);
         } catch (MalformedURLException e) {
             throw new RuntimeException(e);
         }
     }
 
+    
     public long getLastModified() {
         return 0;
     }