Plugins: deprecated API to be removed

Paul Hartmann phaaurlt at gmail.com
Thu Oct 19 13:22:19 UTC 2017


Dear plugin developers,

Recently we have started an effort to make the JOSM source code more 
modular. [1] This requires a lot of refactoring and many of the original 
methods and classes have been deprecated. The work is not finished by 
any means, but we would like to make a cut and remove currently 
deprecated API at the end of 2017. [2]

Please update any plugins that you are maintaining! The majority of 
fixes should be not more than replacing one method by another, as 
indicated in the deprecation JavaDoc comment.

Some notable API changes:
* So far, plugins place all their files in one directory, namely 
Plugin.getPluginDir(). Now there are separate directories for plugin 
user data, preferences, and cache. (The old directory is the same as the 
new plugin user data directory.) Among other things, this allows backup 
processes to ignore possibly large amounts of non-essential data 
(cache). [3]
* The preference interface has been reworked: The field Main.pref is not 
technically deprecated yet, but should be replaced by Config.getPref(). 
The new interface is more restrictive, but sufficient for getting and 
setting preference values.

As most plugin developers are aware, the plugin "Mainversion" needs to 
be updated whenever older versions of JOSM will become incompatible with 
the updated plugin binary (as is usually the case for deprecation 
fixes). [4]

[1] https://josm.openstreetmap.de/ticket/15182 (Standalone JOSM validator),
https://josm.openstreetmap.de/ticket/15229 (modular structure for JOSM core)
[2] https://josm.openstreetmap.de/ticket/15310 (The Great Deprecation 
Cleanup)
[3] https://josm.openstreetmap.de/ticket/15436 (Store cache data of 
plugins in cache location)
[4] 
<https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins#Publishingthenewplugin>

Paul



More information about the josm-dev mailing list