From e4282e9fc025de087451711670c144bf73fc184a Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 19 Mar 2010 16:26:01 +0000 Subject: Support class loaders that don't provide a Package. --- .../com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java index c5e5643..d89380a 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -967,8 +967,12 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { private Constructor getRepositoryConstructor() throws ClassCastException, ClassNotFoundException, NoSuchMethodException { - String className = getClass().getPackage().getName() + '.' + - getBDBProduct().name() + "_Repository"; + String packageName; + { + String thisClassName = getClass().getName(); + packageName = thisClassName.substring(0, thisClassName.lastIndexOf('.')); + } + String className = packageName + '.' + getBDBProduct().name() + "_Repository"; Class repoClass = Class.forName(className); if (BDBRepository.class.isAssignableFrom(repoClass)) { return repoClass.getDeclaredConstructor -- cgit v1.2.3