Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9EAC0C7AD for ; Sat, 19 May 2012 05:12:52 +0000 (UTC) Received: (qmail 67017 invoked by uid 500); 19 May 2012 05:12:52 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 64884 invoked by uid 500); 19 May 2012 05:12:44 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 64833 invoked by uid 99); 19 May 2012 05:12:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2012 05:12:42 +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; Sat, 19 May 2012 05:12:39 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B36D8DAC6 for ; Sat, 19 May 2012 05:12:18 +0000 (UTC) Date: Sat, 19 May 2012 05:12:18 +0000 (UTC) From: "Jan van der Lugt (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <607114769.17986.1337404338736.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (HADOOP-8415) getDouble() and setDouble() in org.apache.hadoop.conf.Configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Jan van der Lugt created HADOOP-8415: ---------------------------------------- Summary: getDouble() and setDouble() in org.apache.hadoop.conf.Configuration Key: HADOOP-8415 URL: https://issues.apache.org/jira/browse/HADOOP-8415 Project: Hadoop Common Issue Type: Improvement Components: conf Affects Versions: 1.0.2 Reporter: Jan van der Lugt Priority: Minor In the org.apache.hadoop.conf.Configuration class, methods exist to set Integers, Longs, Booleans, Floats and Strings, but methods for Doubles are absent. Are they not there for a reason or should they be added? In the latter case, these are the missing functions: /** * Get the value of the name property as a double. * If no such property exists, the provided default value is returned, * or if the specified value is not a valid double, * then an error is thrown. * * @param name property name. * @param defaultValue default value. * @throws NumberFormatException when the value is invalid * @return property value as a double, * or defaultValue. */ public double getDouble(String name, double defaultValue) { String valueString = getTrimmed(name); if (valueString == null) return defaultValue; return Double.parseDouble(valueString); } /** * Set the value of the name property to a double. * * @param name property name. * @param value property value. */ public void setDouble(String name, double value) { set(name,Double.toString(value)); } -- 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