Opened 23 months ago
#22756 new enhancement
Eliminate code duplication [patch]
Reported by: | kolesar | Owned by: | kolesar |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin ImproveWay | Version: | |
Keywords: | Cc: |
Description
[ImproveWay](https://github.com/JOSM/improve-way) plugin used same code base as [ImproveWayAccuracy](https://josm.openstreetmap.de/wiki/Help/Action/ImproveWayAccuracy) mode. Half of code was unnecessary duplication with _old_ code. Moreover, both action in core and plugin needed to be maintained. Common code parts have diverged in years.
ImproveWay plugin was refactored to extend ImproveWayAccuracyAction class from core. This change eliminates code duplication. Also fixed NPE bugs.
ImproveWayAccuracyAction class at core needs some changes to be extendible, mostly protected
instead of private
. I have made a [pull request](https://github.com/JOSM/josm/pull/108) in core repository.
This refactored plugin uses a copy of base class and its modified helper class. This allows to use with current stable JOSM version. Revert commit 97a988332f0c3cc1001e5e1a06e27a080aa06561 after base class patch have been merged into core.