Modify

Opened 7 years ago

Closed 6 years ago

#14120 closed defect (fixed)

Remove methods deprecated during gsoc-core

Reported by: Don-vip Owned by: michael2402
Priority: normal Milestone: 18.06
Component: Core Version:
Keywords: gsoc-core Cc: bastiK

Description (last modified by Don-vip)

Deprecated features from gsoc-core to remove, which are still used in core or plugins:

  • LatLon.heading(): used in 5 plugins: improveway, iodb, nanolog, photoadjust, rex, ​SimplifyArea
  • Preferences.getColor(): used in MapCSSParser + plugins: utilsplugin2, commandLine, routing, graphview
  • Layer.isChanged(): used in MapView, GpxLayer, AbstractTileSourceLayer + plugin osminspector
  • ImageryLayer.getDx()/getDy()/setOffset()/displace(): used in ApplyOffsetAction, ImageryLayer + 4 plugins: commandLine, imageryadjust, iodb, irsrectify

Attachments (0)

Change History (70)

comment:1 by Don-vip, 7 years ago

Milestone: 16.1217.01

comment:2 by michael2402, 7 years ago

Milestone: 17.0117.03

I don't have much time right now and won't have until March 31. I would like to re-schedule this one for milestone 17.4 (I just put it to 17.3, since there is no 17.4 yet).

comment:3 by Don-vip, 7 years ago

Milestone: 17.0317.04

ok thanks for the heads up :)

comment:4 by stoecker, 7 years ago

In 11623/josm:

see #14120 - fix deprecation in core

comment:5 by Don-vip, 7 years ago

In 11631/josm:

see #14120 - update to JavaCC 7.0.2 - patched to avoid error-prone compilation warnings by removing everything related to ReInit methods in ParseGen.java and SimpleCharStream.template

comment:6 by Don-vip, 7 years ago

The only warnings in core now concern Layer.isChanged().

comment:7 by stoecker, 7 years ago

@michael2402:

Can you please give fixing the deprecations highest priority? We need to get a clean state, before we start other deprecations.

comment:8 by michael2402, 7 years ago

Status: newassigned

comment:9 by Don-vip, 7 years ago

Type: enhancementdefect

comment:10 by Don-vip, 7 years ago

14.04 is due in two weeks, can you please fix the core deprecation warnings before that?

comment:11 by Don-vip, 7 years ago

I think I have updated all the plugins now. But it seems we still have a bug in core:

  • #13503: IAE: Cannot paint layer, it is not registered (TMSLayer)
  • #13604: IAE: Cannot paint layer, it is not registered (OsmDataLayer)
  • #13886: IAE: Cannot paint layer, it is not registered (ValidatorLayer)
  • #14234: IAE: Cannot paint layer, it is not registered (GeoImageLayer)
  • #13589: IAE: Cannot paint layer, it is not registered (ElevationProfileLayer)

comment:12 by Don-vip, 7 years ago

One week left before 14.04. Because of #14604 impacting lots of users, and with #7427 being fixed, the release date this month will not shift.

comment:13 by michael2402, 7 years ago

I've been busy the last week, but I have lots of time this one.

comment:14 by michael2402, 7 years ago

In 12014/josm:

See #14120: Use a listener to get notified of way segment / virtual node highlight changes.

comment:15 by Don-vip, 7 years ago

Two unit tests are failing.

comment:16 by michael2402, 7 years ago

I already saw that. Some problem with the test framework removing a layer twice, i'm debugging it but tests always take some time to run ;-)

comment:17 by Don-vip, 7 years ago

ok thanks :) I tried to fix them but didn't understand the error.

comment:18 by Don-vip, 7 years ago

In 12020/josm:

see #14120 - checkstyle

comment:19 by michael2402, 7 years ago

In 12023/josm:

See #14120: Do not overwrite the mapView field for unit tests. Fix map view scale/center.

comment:20 by michael2402, 7 years ago

In 12024/josm:

See #14120: Fix unit tests by using a separate layer manager when mocking the map view.

comment:21 by michael2402, 7 years ago

In 12025/josm:

See #14120: Throw a nicer exception if a layer is destroyed twice.

comment:22 by michael2402, 7 years ago

I found the problem:

The map view handles the layer lifecycle. If tests create multiple map views for the same layer, each map view destroys the layers during test exit - so we have several destroy() calls. I removed one of the places where MapViewMock is used. We could completely remove that Mock, I think.

comment:23 by Don-vip, 7 years ago

In 12028/josm:

see #14120 - fix java warnings

comment:24 by michael2402, 7 years ago

Description: modified (diff)
Milestone: 17.0417.05

comment:25 by Don-vip, 7 years ago

there are still 10 warnings to fix.

comment:26 by Don-vip, 7 years ago

Also 6 unit tests are failing for 23/26 builds.

comment:27 by michael2402, 7 years ago

I've seen them. The most important thing for me is getting the warnings safely away until next release. They are caused by a selection change event that was used to trigger a map view repaint in most cases. There is a reason why someone added those calls back then, so I'm going trough the UI code and fixing them one by one (or check if it is already fixed by some other mechanism that triggers a repaint). And I'm fixing some other repaint/layout related issues on the way.

The AlignInLineActionTest(s) are caused by the selection not being sorted for a single addSelection(). I tried around a bit and it seems the LinkedHashSet order gets lost in the streams, even when using a LinkedHashSet as collector. Have to look into it more. I was not aware that the selection order is used that much.
If users select the points, multiple addSelection calls will be issued. So for now, this is only a problem if a plugin uses this functionality.

I'll probably set up travis/git again next week, so that I will be able to run the tests in background more easily.

After the selection stuff is done, I already have a patch for the GPX layer that removes the update counting code. That way, we can get rid of the isChanged() methods and rely on layer invalidation events in the future. This should allow us to remove most of the MapView.repaint() calls in code.

comment:28 by Don-vip, 7 years ago

OK thanks :)

in reply to:  27 comment:29 by Klumbumbus, 7 years ago

Replying to michael2402:

I was not aware that the selection order is used that much.
...
So for now, this is only a problem if a plugin uses this functionality.

(Just in case you didn't know: When creating turn restrictions with the turnrestrictions plugin, the selection order is required as the roles are set automatically depending on the selction order.)

comment:30 by Don-vip, 7 years ago

Cc: bastiK added

comment:31 by michael2402, 7 years ago

In 12103/josm:

See #14120: MapView should repaint on temporary layer changes automatically.

comment:32 by bastiK, 7 years ago

Only one failed unit test remaining...

comment:33 by michael2402, 7 years ago

In 12156/josm:

See #14120: Don't make gpx tracks depend on the isChanged method, use a listener based approach instead.

comment:34 by michael2402, 7 years ago

In 12170/josm:

"See #13175, see #14120: Remove isChanged() method call in map view - all layers should invalidate correctly now."

comment:35 by Don-vip, 7 years ago

Only one test to fix and we won't get spammed by Jenkins at each build anymore: MapCSSRendererTest.testRender[order]. After that I expect the build to be stable a longer time. A test failing for 91 builds is a lot of noise :(

comment:36 by michael2402, 7 years ago

I did not know you get a mail for every test run...

But now they are all fixed. There a still a a few deprecations to track down, but then everything should be stabilized for the next release.

comment:37 by michael2402, 7 years ago

Milestone: 17.0517.06

I don't want to remove the remaining selection changed calls now since I did not fully test if/where they are required.

comment:38 by Don-vip, 7 years ago

only one java warning left.

comment:39 by Don-vip, 7 years ago

Milestone: 17.0617.07

comment:40 by Don-vip, 7 years ago

Milestone: 17.0717.08

comment:41 by bastiK, 7 years ago

Milestone: 17.0817.09

comment:42 by Don-vip, 7 years ago

Michael can you please fix the last deprecation warning?

comment:43 by michael2402, 7 years ago

I'll have a look at it.

The line can simply be removed in theory, the hard part is to check if all UI components are actually redrawn correctly if commands are executed.

comment:44 by Don-vip, 6 years ago

Ticket #15251 has been marked as a duplicate of this ticket.

comment:45 by Don-vip, 6 years ago

Milestone: 17.0917.10

comment:46 by bastiK, 6 years ago

In 13010/josm:

see #14120 - fix use of deprecated API (selection handling)

in reply to:  43 ; comment:47 by bastiK, 6 years ago

Replying to michael2402:

The line can simply be removed in theory, the hard part is to check if all UI components are actually redrawn correctly if commands are executed.

Looks like it is working. Why is the private method in DataSet named fireDeprecatedSelectionChange?

comment:48 by bastiK, 6 years ago

Description: modified (diff)

in reply to:  47 comment:49 by michael2402, 6 years ago

Replying to bastiK:

Why is the private method in DataSet named fireDeprecatedSelectionChange?

Because I wanted to deprecated the old selection listener mechanism first - but it was used in too many places so that I could not do this on the inital patch. And then I forgot about the method name...

See #13467

Last edited 6 years ago by michael2402 (previous) (diff)

comment:50 by Don-vip, 6 years ago

Milestone: 17.1017.11

comment:51 by Don-vip, 6 years ago

Milestone: 17.1117.12

comment:52 by Don-vip, 6 years ago

@team: I'm not sure how to update last plugins regarding deprecation of heading()/getDx()/getDy() I'd like to get some help.

comment:53 by Don-vip, 6 years ago

Milestone: 17.1218.01

comment:54 by Don-vip, 6 years ago

Milestone: 18.0118.02

Help is still welcome.

comment:55 by Don-vip, 6 years ago

Milestone: 18.0218.03

comment:56 by Don-vip, 6 years ago

Milestone: 18.0318.04

comment:57 by Don-vip, 6 years ago

Milestone: 18.0418.05

comment:58 by Don-vip, 6 years ago

Milestone: 18.0518.06

comment:59 by Don-vip, 6 years ago

Description: modified (diff)

comment:60 by Don-vip, 6 years ago

iodb updated in [o34337:34338]

comment:61 by Don-vip, 6 years ago

nanolog updated in [o34339:34340].

comment:62 by Don-vip, 6 years ago

Description: modified (diff)

comment:64 by Don-vip, 6 years ago

In 13966/josm:

see #14120, see #12524 - remove deprecated method LatLon.heading()

comment:65 by Don-vip, 6 years ago

Description: modified (diff)

comment:66 by Don-vip, 6 years ago

Description: modified (diff)

comment:67 by Don-vip, 6 years ago

Description: modified (diff)

comment:68 by Don-vip, 6 years ago

irsrectify plugin deleted in [o34341].

comment:69 by Don-vip, 6 years ago

commandline updated in [o34342:34343].

comment:70 by Don-vip, 6 years ago

Resolution: fixed
Status: assignedclosed

In 13967/josm:

fix #14120 - remove deprecated methods ImageryLayer.getDx()/getDy()/setOffset()

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain michael2402.
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.