summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2010-03-19 16:26:01 +0000
committerBrian S. O'Neill <bronee@gmail.com>2010-03-19 16:26:01 +0000
commite4282e9fc025de087451711670c144bf73fc184a (patch)
treed3382851860e34197944c18896291397b35a6278 /src/main/java/com/amazon
parent6d0c31b64492b0c80f8861c289b655b58cccb00b (diff)
Support class loaders that don't provide a Package.
Diffstat (limited to 'src/main/java/com/amazon')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java8
1 files changed, 6 insertions, 2 deletions
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<BDBRepository> 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