Modify

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:

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 (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);
        cDdFormatter.applyPattern("###0.0######");
    }

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
Action
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.