aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r1151530 - /aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java
Date Wed, 27 Jul 2011 16:45:07 GMT
Author: timothyjward
Date: Wed Jul 27 16:45:06 2011
New Revision: 1151530

URL: http://svn.apache.org/viewvc?rev=1151530&view=rev
Log:
ARIES-691 : Allow clients not importing org.osgi.framework to work

Modified:
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java?rev=1151530&r1=1151529&r2=1151530&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java
(original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/UnionClassLoader.java
Wed Jul 27 16:45:06 2011
@@ -28,6 +28,8 @@ import org.osgi.framework.BundleReferenc
 
 public final class UnionClassLoader extends ClassLoader implements BundleReference{
   
+  private static final String ORG_OSGI_FRAMEWORK = "org.osgi.framework.";
+  private static final int DOT_INDEX = ORG_OSGI_FRAMEWORK.lastIndexOf('.');
   private final Bundle eclipseLinkBundle;
   private final Bundle adaptorBundle;
   
@@ -56,6 +58,9 @@ public final class UnionClassLoader exte
         throw new ClassNotFoundException(name, ioe);
       }
       return defineClass(name, baos.toByteArray(), 0, baos.size());
+    } else if (name.startsWith(ORG_OSGI_FRAMEWORK) &&
+        name.lastIndexOf('.') == DOT_INDEX) {
+      return adaptorBundle.loadClass(name);
     }
     return eclipseLinkBundle.loadClass(name);
   }



Mime
View raw message