Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 64099 invoked from network); 29 Dec 2009 10:54:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Dec 2009 10:54:55 -0000 Received: (qmail 89356 invoked by uid 500); 29 Dec 2009 10:54:55 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 89274 invoked by uid 500); 29 Dec 2009 10:54:54 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 89265 invoked by uid 99); 29 Dec 2009 10:54:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 10:54:54 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 10:54:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DC5C923889D2; Tue, 29 Dec 2009 10:54:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: java-commits@lucene.apache.org From: uschindler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091229105427.DC5C923889D2@eris.apache.org> 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 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()); }