Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#15451 closed enhancement (fixed)

Separate preferences.xml files for plugins

Reported by: bastiK Owned by: team
Priority: normal Milestone:
Component: Plugin Version:
Keywords: plugin Cc:


Currently, all plugins store their settings in the main preferences file. This is fine, as long as proper prefixes are used for the key. But it could be considered better design when plugins can just do their thing and not interfere with JOSM core business.

Plugins need to be updated to replace Main.pref with Config.getPref() anyway, so it may as well be changed to Plugin.getPref() instead.

Attachments (1)

plugin-prefs.patch (22.1 KB ) - added by bastiK 7 years ago.

Download all attachments as: .zip

Change History (10)

by bastiK, 7 years ago

Attachment: plugin-prefs.patch added

comment:1 by stoecker, 6 years ago

I'm not convinced that the additional complexity brings any real benefit (e.g. I think you forgot to adapt Advanced Preferences).

comment:2 by bastiK, 6 years ago

Resolution: fixed
Status: newclosed

In 13021/josm:

make Preferences more generic (see #15229, closes #15451)

  • extract base directories
  • move updateSystemProperties() as it is specific to JOSM-core as a "prefefences client"

in reply to:  1 comment:3 by bastiK, 6 years ago

Replying to stoecker:

I'm not convinced that the additional complexity brings any real benefit (e.g. I think you forgot to adapt Advanced Preferences).

Hm, the advanced preferences GUI is troublesome. I'll settle for the rework of Preferences, as that was the main goal anyway.

comment:4 by bastiK, 6 years ago

In 13022/josm:

see #15451 - fix taginfo script

comment:5 by bastiK, 6 years ago

In 13023/josm:

see #15451 - fix initialization

comment:6 by Don-vip, 6 years ago

JOSM does not start anymore from my Eclipse setup:

2017-10-18 20:51:58.504 GRAVE: Handled by bug report queue: java.lang.NullPointerException
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(
	at org.openstreetmap.josm.gui.MainApplication$2.processArguments(
	at org.openstreetmap.josm.gui.MainApplication.main(

2017-10-18 20:51:58.675 GRAVE: java.util.concurrent.ExecutionException: java.lang.NullPointerException. Cause : java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.get(
	at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitAndReturn(
	at org.openstreetmap.josm.gui.bugreport.BugReportDialog.showFor(
Caused by: java.lang.NullPointerException
	at org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu.addMenuEntry(
	at org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu.addMenuEntries(
	at org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu.attach(
	at org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu.enableMenuFor(
	at org.openstreetmap.josm.gui.widgets.JosmTextArea.<init>(
	at org.openstreetmap.josm.gui.widgets.JosmTextArea.<init>(
	at org.openstreetmap.josm.gui.bugreport.DebugTextDisplay.<init>(
	at org.openstreetmap.josm.gui.bugreport.DebugTextDisplay.<init>(
	at org.openstreetmap.josm.gui.bugreport.BugReportDialog.<init>(
	at org.openstreetmap.josm.gui.bugreport.BugReportDialog.lambda$3(
	at java.awt.event.InvocationEvent.dispatch(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$500(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

comment:7 by bastiK, 6 years ago

In 13025/josm:

see #15451 - fix wiring

comment:8 by Don-vip, 6 years ago

It seems org.openstreetmap.josm.plugins.elevation.tests.HgtReaderTest.testGetElevationFromHgt is now failing because of this, could you please have a look?

comment:9 by bastiK, 6 years ago

Should be fixed in [o33744].

Modify Ticket

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