Issue 12071

String formatting in WKT generation fails on some non english Locales

12071
Reporter: lfrancke
Assignee: lfrancke
Type: Bug
Summary: String formatting in WKT generation fails on some non english Locales
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2012-10-23 23:29:05.423
Updated: 2013-12-06 12:06:32.402
Resolved: 2012-10-24 10:53:48.262
        
Description: String.format is used without a locale.

This test fails for a german Locale:
{code}
  @Test
  public void testToWellKnownText() throws Exception {
    BoundingBox bbox =
      BoundingBox.builder().minLatitude(1.2).minLongitude(1.3).maxLatitude(1.4).maxLongitude(1.5).build();
    assertEquals("POLYGON ((1.300000 1.200000, 1.300000 1.400000, 1.500000 1.400000, 1.500000 1.200000))",
                 bbox.toWellKnownText());
  }
{code}

Instead of {{1.300000}} etc. it creates {{1,300000}}. This can be fixed by passing an explicit Locale.]]>
    


Author: lfrancke@gbif.org
Comment: Patch under review at http://dev.gbif.org/code/cru/CR-GBIFCOM-4
Created: 2012-10-23 23:48:47.719
Updated: 2012-10-23 23:48:47.719