Opened 4 months ago

Last modified 3 months ago

#15696 new defect

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

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


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(
	at org.junit.Assert.assertEquals(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.openstreetmap.josm.testutils.JOSMTestRules$

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

Attachments (0)

Change History (3)

comment:1 Changed 4 months ago by Don-vip

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);

So this looks like a bug.

Last edited 4 months ago by Don-vip (previous) (diff)

comment:2 Changed 4 months ago by Don-vip

Milestone: 17.1218.01

comment:3 Changed 3 months ago by Don-vip

Milestone: 18.01

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to michael2402
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.