Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 52534 invoked from network); 4 Sep 2009 13:09:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 13:09:49 -0000 Received: (qmail 32567 invoked by uid 500); 4 Sep 2009 13:09:48 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 32481 invoked by uid 500); 4 Sep 2009 13:09:48 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 32470 invoked by uid 99); 4 Sep 2009 13:09:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 13:09:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.219.214 as permitted sender) Received: from [209.85.219.214] (HELO mail-ew0-f214.google.com) (209.85.219.214) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 13:09:40 +0000 Received: by ewy10 with SMTP id 10so856276ewy.37 for ; Fri, 04 Sep 2009 06:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=7Wqs5g/UbDteWoBs2dE6hNWQxYtLh3cTgrFhXY/HvwA=; b=jjnCFVzSK2iMHA7daYTdlxtV79LYVhaJU3J+WWb+rF7oXRinODjfKpyzLz+2QEI+v2 gCQHoxzA7U+WeqHaBp8cXxHbN4wnnmELTfwc8cd1IuwOfkyeO89YDcID3K7Vv/0539U7 bZj5OyP4OMTUV01vyUlkaWoLwzoFj74eZeLsI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KBdzVIEKMIobiLO6qPCt9YbMkWgbPLfsFg/5cU0QDWf5fR5S1xS6pJM7peVat2K+Ao cD9xUvlol2lpImN020UCjzbTFV3imGncrXUKSb4QsZr0adu3xlVDVy9rDMSsMwpQKyAK uXgkImgEtVjIL81PXHYH2WnxdfZ0kndNwJGDc= MIME-Version: 1.0 Received: by 10.216.46.194 with SMTP id r44mr890938web.20.1252069759318; Fri, 04 Sep 2009 06:09:19 -0700 (PDT) Date: Fri, 4 Sep 2009 14:09:19 +0100 Message-ID: <25aac9fc0909040609y35de84f7w3f9400544f29a814@mail.gmail.com> Subject: Unexpected behaviour of DecimalFormat and spaces From: sebb To: dev@harmony.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Whilst testing Commons Math on Harmony, I came across a difference in DecimalFormat from the Sun Java implementation. Sun Java won't strip leading spaces from numbers, and stops at the first space, whereas Harmony seems to strip all spaces - leading, embedded and trailing. So the string " 1 2 3 " is parsed by Harmony as the number 123. Sun Java returns null (leading space). If the leading space is removed, Sun returns 1. Is this difference intentional? If not, I can file a JIRA if required.