lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r894348 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/util/AttributeSource.java
Date Tue, 29 Dec 2009 10:54:27 GMT
Author: uschindler
Date: Tue Dec 29 10:54:27 2009
New Revision: 894348

URL: http://svn.apache.org/viewvc?rev=894348&view=rev
Log:
LUCENE-2182: DEFAULT_ATTRIBUTE_FACTORY was failing to load implementation class when interface
was loaded by a different class loader

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=894348&r1=894347&r2=894348&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Dec 29 10:54:27 2009
@@ -83,6 +83,10 @@
 * 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

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java?rev=894348&r1=894347&r2=894348&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java Tue Dec 29 10:54:27
2009
@@ -64,9 +64,9 @@
         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 @@
           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());
             }



Mime
View raw message