Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C757CF20 for ; Mon, 7 May 2012 18:43:18 +0000 (UTC) Received: (qmail 87129 invoked by uid 500); 7 May 2012 18:43:15 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 87059 invoked by uid 500); 7 May 2012 18:43:15 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 87017 invoked by uid 99); 7 May 2012 18:43:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2012 18:43:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2012 18:43:13 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2DA30437AA9 for ; Mon, 7 May 2012 18:42:52 +0000 (UTC) Date: Mon, 7 May 2012 18:42:52 +0000 (UTC) From: "Michael McCandless (JIRA)" To: dev@lucene.apache.org Message-ID: <1208614251.35747.1336416172201.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1231020570.35207.1329191219586.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (LUCENE-3777) trapping overloaded ctors/setters in Field/NumericField/DocValuesField MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-3777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael McCandless updated LUCENE-3777: --------------------------------------- Attachment: LUCENE-3777.patch Patch fixing DocValuesField: I broke up DocValuesField into one Field class per type (IntDocValuesField, etc.). > trapping overloaded ctors/setters in Field/NumericField/DocValuesField > ---------------------------------------------------------------------- > > Key: LUCENE-3777 > URL: https://issues.apache.org/jira/browse/LUCENE-3777 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 4.0 > Reporter: Robert Muir > Assignee: Michael McCandless > Priority: Blocker > Attachments: LUCENE-3777.patch, LUCENE-3777.patch > > > In trunk, these apis let you easily create a field, but my concern is this: > {code} > public NumericField(String name, int value) > public NumericField(String name, long value) > .. > public Field(String name, int value, FieldType type) > public Field(String name, long value, FieldType type) > .. > public void setValue(int value) > public void setValue(long value) > .. > public DocValuesField(String name, int value, DocValues.Type docValueType) > public DocValuesField(String name, long value, DocValues.Type docValueType) > {code} > I really don't like overloaded ctors/setters where the compiler can type-promote you, > I think it makes the apis hard to use. > Instead for the setters I think we sohuld have setIntValue, setLongValue, ... > For the ctors, I see two other options: > # factories like DocValuesField.newIntField() > # subclasses like IntField > I don't have any patch for this, but I think we should discuss and fix before these apis are released. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org