Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18462 closed defect (fixed)

[Patch RFC] JOSM doesn't use preferences.xml_backup

Reported by: GerdP Owned by: team
Priority: normal Milestone: 20.05
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. Stop JOSM
  2. Edit preferences.xml and remove all but the first 4 lines to simulate a previous crash of JOSM
  3. Start JOSM

What is the expected result?

JOSM detects invalid preferences.xml and valid preferences.xml_backup and uses the backup.

What happens instead?

Popup saying that the preferences.xml was bad and that a new file is created with defaults.
popup

Please provide any additional information below. Attach a screenshot if possible.

See also german forum https://forum.openstreetmap.org/viewtopic.php?id=68309
It seems JOSM never tries to use the backup and it is likely that the user will overwrite this good copy before they really understand what happened.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-12-01 23:10:15 +0100 (Sun, 01 Dec 2019)
Build-Date:2019-12-02 02:30:57
Revision:15553
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15553 de) Windows 10 64-Bit
OS Build number: Windows 10 Home 1903 (18362)
Memory Usage: 674 MB / 4551 MB (145 MB allocated, but free)
Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080

Last errors/warnings:
- E: org.xml.sax.SAXParseException: XML-Dokumentstrukturen müssen innerhalb derselben Entity beginnen und enden.
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (2)

bak.png (7.9 KB ) - added by GerdP 5 years ago.
popup
18462.patch (2.4 KB ) - added by GerdP 5 years ago.

Download all attachments as: .zip

Change History (14)

by GerdP, 5 years ago

Attachment: bak.png added

popup

comment:1 by GerdP, 5 years ago

Description: modified (diff)

comment:2 by GerdP, 5 years ago

Description: modified (diff)

by GerdP, 5 years ago

Attachment: 18462.patch added

comment:3 by GerdP, 5 years ago

Summary: JOSM doesn't use preferences.xml_backup[Patch RFC] JOSM doesn't use preferences.xml_backup

comment:4 by GerdP, 5 years ago

Attached patch shows a different popup saying that JOSM tries to read the preferences.xml_backup.
It copies the content of preferences.xml_backup to preferences.xml and tries to load again.
If that fails also, the preferences are reset (as without the patch).

It improves the cases that preferences.xml is corrupted and preferences.xml_backup is good.

comment:5 by GerdP, 5 years ago

Please try if it works on other OS, I've only tested Windows.

comment:6 by Don-vip, 5 years ago

#18569 should probably be considered while working on saving preferences.xml

comment:7 by Bjoeni, 5 years ago

Replying to GerdP:

Please try if it works on other OS, I've only tested Windows.

Works for me

Build-Date:2020-01-17 22:59:15
Revision:15715
Is-Local-Build:true

Identification: JOSM/1.5 (15715 SVN en_AU) Linux Ubuntu 19.10
Memory Usage: 801 MB / 1744 MB (401 MB allocated, but free)
Java version: 1.8.0_232-8u232-b09-0ubuntu1.1-b09, Private Build, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900
Maximum Screen Size: 1600x900
Java package: openjdk-8-jre:amd64-8u232-b09-0ubuntu1.1
Java ATK Wrapper package: libatk-wrapper-java:all-0.35.0-3
libcommons-logging-java: libcommons-logging-java:-
fonts-noto: fonts-noto:-
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:45233, -javaagent:/home/niklas/.eclipse/360744294_linux_gtk_x86_64/configuration/org.eclipse.osgi/219/0/.cp/lib/javaagent-shaded.jar, -Dfile.encoding=UTF-8]

comment:8 by Don-vip, 5 years ago

Milestone: 20.03

comment:9 by Don-vip, 5 years ago

Milestone: 20.0320.04

comment:10 by GerdP, 5 years ago

@Vincent: IIGTR MacOS should work like other unix based OS, so I think I should commit the patch after 20.03 was released.

comment:11 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

In 16241/josm:

fix #18462: JOSM doesn't use preferences.xml_backup
Show a popup saying that JOSM tries to read the preferences.xml_backup.
It copies the content of preferences.xml_backup to preferences.xml and tries to load again.
If that fails also, the preferences are reset (as without the patch).

It improves the cases that preferences.xml is corrupted and preferences.xml_backup is good.

comment:12 by Klumbumbus, 5 years ago

Milestone: 20.0420.05

Milestone renamed

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. 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.