mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 03:25:15 +00:00
LUCENE-2182: DEFAULT_ATTRIBUTE_FACTORY was failing to load implementation class when interface was loaded by a different class loader
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@894348 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
45ffab1cd5
commit
5e77ec9845
@ -83,6 +83,10 @@ Bug fixes
|
||||
* LUCENE-2158: At high indexing rates, NRT reader could temporarily
|
||||
lose deletions. (Mike McCandless)
|
||||
|
||||
* LUCENE-2182: DEFAULT_ATTRIBUTE_FACTORY was failing to load
|
||||
implementation class when interface was loaded by a different
|
||||
class loader. (Uwe Schindler, reported on java-user by Ahmed El-dawy)
|
||||
|
||||
New features
|
||||
|
||||
* LUCENE-2128: Parallelized fetching document frequencies during weight
|
||||
|
@ -64,9 +64,9 @@ public class AttributeSource {
|
||||
try {
|
||||
return getClassForInterface(attClass).newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
throw new IllegalArgumentException("Could not instantiate class " + attClass.getName());
|
||||
throw new IllegalArgumentException("Could not instantiate implementing class for " + attClass.getName());
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new IllegalArgumentException("Could not instantiate class " + attClass.getName());
|
||||
throw new IllegalArgumentException("Could not instantiate implementing class for " + attClass.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,10 @@ public class AttributeSource {
|
||||
Class<? extends AttributeImpl> clazz = attClassImplMap.get(attClass);
|
||||
if (clazz == null) {
|
||||
try {
|
||||
attClassImplMap.put(attClass, clazz = Class.forName(attClass.getName() + "Impl").asSubclass(AttributeImpl.class));
|
||||
attClassImplMap.put(attClass,
|
||||
clazz = Class.forName(attClass.getName() + "Impl", true, attClass.getClassLoader())
|
||||
.asSubclass(AttributeImpl.class)
|
||||
);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new IllegalArgumentException("Could not find implementing class for " + attClass.getName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user