Modify

Opened 3 years ago

Closed 3 years ago

Last modified 12 months ago

#11889 closed enhancement (fixed)

Tiny differences in projection regression unit test with Java 9

Reported by: Don-vip Owned by: team
Priority: minor Milestone: 15.09
Component: Core Version:
Keywords: java9 unit test projection Cc: simon04, bastiK

Description (last modified by Don-vip)

I have added Java 9 basic support to JOSM in r8777:8778.

JOSM now compiles and works fine, as only one unit test is failing.

I think this is due to a change of implementation of Math.toDegrees in Java 9, see javabug:8051808 and javabug:4477961.

I'm not sure what's the best solution for this issue. I'd like to have the test working fine for the three configurations (JDK7, 8, 9).

Attachments (0)

Change History (12)

comment:1 Changed 3 years ago by Don-vip

Description: modified (diff)

comment:2 Changed 3 years ago by Don-vip

Description: modified (diff)

comment:3 Changed 3 years ago by wiktorn

Wouldn't change of regression test asserts from *.equals(...) to *.equalsEpsilon(...) suffice?

Though, this could impact other places, where we are comparing using equals(...) of LatLon's and EastNorth's

But isn't the thing, that we should do anyway?

comment:4 Changed 3 years ago by Don-vip

Cc: simon04 bastiK added

It would work, yes. Paul, Simon, what do you think?

comment:5 Changed 3 years ago by simon04

To my understanding, performing a projection (and back) often involves a loss of precision. So I doubt that bitwise double equivalence is necessary. equalsEpsilon seems an adequate replacement to me …

comment:6 Changed 3 years ago by Don-vip

I'm afraid that's against the spirit of this test. I'm going to take a safer approach right now, we'll see later if we can switch back to an epsilon-based version.

comment:7 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 8793/josm:

fix #11889 - adapt projection regression test to Java 9. Safe approach: keep exact comparison but duplicate data files.

comment:8 Changed 3 years ago by Don-vip

In 8796/josm:

fix #11889 - adapt projection regression test to Java 9 for Jenkins build

comment:9 Changed 3 years ago by Don-vip

In 8797/josm:

fix #11889 - adapt projection regression test to Java 9 for Jenkins build

comment:10 Changed 13 months ago by bastiK

In 12013/josm:

see #11889 - backport improved version of Math.toDegrees and Math.toRadians from Java 9

comment:11 Changed 13 months ago by Don-vip

In 12015/josm:

see #11889 - fix javadoc warnings

comment:12 Changed 12 months ago by Don-vip

In 12131/josm:

see #11889, see #11924, see #13387 - use backported versions of Math.toDegrees/toRadians (more accurate and faster) - to revert when migrating to Java 9

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.