Modify

Opened 8 years ago

Closed 7 years ago

#15696 closed defect (fixed)

DMSCoordinateFormat using ',' instead of '.' in German or Portuguese

Reported by: michael2402 Owned by: team
Priority: normal Milestone: 18.09
Component: Core Version:
Keywords: Cc:

Description

This makes the ICoordinateFormatTest fail if the locale is set to German.

org.junit.ComparisonFailure: expected:<47°00'00[.]0"N> but was:<47°00'00[,]0"N>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at org.openstreetmap.josm.data.coor.conversion.ICoordinateFormatTest.testFormatting(ICoordinateFormatTest.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.openstreetmap.josm.testutils.JOSMTestRules$TimeoutThread.run(JOSMTestRules.java:558)

Question is: Should we always format it in the localized way (fix test) or use the '.' separator in all locales?

Attachments (0)

Change History (7)

comment:1 by Don-vip, 8 years ago

In AbstractCoordinateFormat we expect to always have a dot:

    static {
        // Don't use the localized decimal separator. This way we can present
        // a comma separated list of coordinates.
        cDdFormatter = (DecimalFormat) NumberFormat.getInstance(Locale.UK);
        cDdFormatter.applyPattern("###0.0######");
    }

So this looks like a bug.

Last edited 8 years ago by Don-vip (previous) (diff)

comment:2 by Don-vip, 8 years ago

Milestone: 17.1218.01

comment:3 by Don-vip, 8 years ago

Milestone: 18.01

comment:4 by Don-vip, 7 years ago

Summary: DMSCoordinateFormat using ',' instead of '.' in GermanDMSCoordinateFormat using ',' instead of '.' in German or Portuguese

Same problem with pt_BR, see #16688

comment:5 by Don-vip, 7 years ago

Same problem with ExifReaderTest.testReadLatLon

junit.framework.AssertionFailedError: expected:<51°46'43[.]0"> but was:<51°46'43[,]0">
	at org.openstreetmap.josm.tools.ExifReaderTest.testReadLatLon(ExifReaderTest.java:107)

comment:6 by Don-vip, 7 years ago

Milestone: 18.09

comment:7 by Don-vip, 7 years ago

Resolution: fixed
Status: newclosed

In 14203/josm:

fix #15696, see #16688 - Don't use the localized decimal separator for coordinates

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.