Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 14882 invoked from network); 13 Oct 2009 14:45:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Oct 2009 14:45:46 -0000 Received: (qmail 84984 invoked by uid 500); 13 Oct 2009 14:45:45 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 84937 invoked by uid 500); 13 Oct 2009 14:45:45 -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 84928 invoked by uid 99); 13 Oct 2009 14:45:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 14:45:45 +0000 X-ASF-Spam-Status: No, hits=-2.3 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, 13 Oct 2009 14:45:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 34349238889B; Tue, 13 Oct 2009 14:45:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824792 - /lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java Date: Tue, 13 Oct 2009 14:45:23 -0000 To: java-commits@lucene.apache.org From: uschindler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091013144523.34349238889B@eris.apache.org> Author: uschindler Date: Tue Oct 13 14:45:22 2009 New Revision: 824792 URL: http://svn.apache.org/viewvc?rev=824792&view=rev Log: LUCENE-1972: Some additional FieldCache deprecations removed Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java?rev=824792&r1=824791&r2=824792&view=diff ============================================================================== --- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java (original) +++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java Tue Oct 13 14:45:22 2009 @@ -84,8 +84,7 @@ Map.Entry mapEntry = (Map.Entry) entrySetIterator.next(); Entry entry = (Entry) mapEntry.getKey(); result.add(new CacheEntryImpl(readerKey, entry.field, - cacheType, entry.type, - entry.custom, entry.locale, + cacheType, entry.custom, mapEntry.getValue())); } } @@ -95,34 +94,19 @@ } private static final class CacheEntryImpl extends CacheEntry { - /** - * @deprecated Only needed because of Entry (ab)use by - * FieldSortedHitQueue, remove when FieldSortedHitQueue - * is removed - */ - private final int sortFieldType; - /** - * @deprecated Only needed because of Entry (ab)use by - * FieldSortedHitQueue, remove when FieldSortedHitQueue - * is removed - */ - private final Locale locale; - private final Object readerKey; private final String fieldName; private final Class cacheType; private final Object custom; private final Object value; CacheEntryImpl(Object readerKey, String fieldName, - Class cacheType, int sortFieldType, - Object custom, Locale locale, + Class cacheType, + Object custom, Object value) { this.readerKey = readerKey; this.fieldName = fieldName; this.cacheType = cacheType; - this.sortFieldType = sortFieldType; this.custom = custom; - this.locale = locale; this.value = value; // :HACK: for testing. @@ -136,22 +120,6 @@ public Class getCacheType() { return cacheType; } public Object getCustom() { return custom; } public Object getValue() { return value; } - /** - * Adds warning to super.toString if Local or sortFieldType were specified - * @deprecated Only needed because of Entry (ab)use by - * FieldSortedHitQueue, remove when FieldSortedHitQueue - * is removed - */ - public String toString() { - String r = super.toString(); - if (null != locale) { - r = r + "...!!!Locale:" + locale + "???"; - } - if (SortField.CUSTOM != sortFieldType) { - r = r + "...!!!SortType:" + sortFieldType + "???"; - } - return r; - } } /** @@ -243,59 +211,23 @@ /** Expert: Every composite-key in the internal cache is of this type. */ static class Entry { final String field; // which Fieldable - /** - * @deprecated Only (ab)used by FieldSortedHitQueue, - * remove when FieldSortedHitQueue is removed - */ - final int type; // which SortField type final Object custom; // which custom comparator or parser - /** - * @deprecated Only (ab)used by FieldSortedHitQueue, - * remove when FieldSortedHitQueue is removed - */ - final Locale locale; // the locale we're sorting (if string) - - /** - * @deprecated Only (ab)used by FieldSortedHitQueue, - * remove when FieldSortedHitQueue is removed - */ - Entry (String field, int type, Locale locale) { - this.field = StringHelper.intern(field); - this.type = type; - this.custom = null; - this.locale = locale; - } /** Creates one of these objects for a custom comparator/parser. */ Entry (String field, Object custom) { this.field = StringHelper.intern(field); - this.type = SortField.CUSTOM; this.custom = custom; - this.locale = null; - } - - /** - * @deprecated Only (ab)used by FieldSortedHitQueue, - * remove when FieldSortedHitQueue is removed - */ - Entry (String field, int type, Parser parser) { - this.field = StringHelper.intern(field); - this.type = type; - this.custom = parser; - this.locale = null; } /** Two of these are equal iff they reference the same field and type. */ public boolean equals (Object o) { if (o instanceof Entry) { Entry other = (Entry) o; - if (other.field == field && other.type == type) { - if (other.locale == null ? locale == null : other.locale.equals(locale)) { - if (other.custom == null) { - if (custom == null) return true; - } else if (other.custom.equals (custom)) { - return true; - } + if (other.field == field) { + if (other.custom == null) { + if (custom == null) return true; + } else if (other.custom.equals (custom)) { + return true; } } } @@ -304,7 +236,7 @@ /** Composes a hashcode based on the field and type. */ public int hashCode() { - return field.hashCode() ^ type ^ (custom==null ? 0 : custom.hashCode()) ^ (locale==null ? 0 : locale.hashCode()); + return field.hashCode() ^ (custom==null ? 0 : custom.hashCode()); } }