Modify

Opened 8 months ago

#20931 new enhancement

Warn about leading and trailing white spaces in role values and offer a fix

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: template_report role leading trailing white space Cc:

Description

What steps will reproduce the problem?

  1. Have a relation with a member with a trailing or leading white space ( ) in the role value like stop or a single white space
  2. Run Validator

What is the expected result?

A strong warning offering a fix

What happens instead?

The general warning about unknown role (role verification)

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

Only looking at route relations I find thousands of these and the fix should be easy with trim() but how do I get the role of the member.

relation >[role^=" "]*,
relation >[role$=" "]* {
  ThrowError: tr("Invalid role: Leading or trailing white space");
  ???
}

or is this one reason for a java test?

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-05-23 13:56:55 +0200 (Sun, 23 May 2021)
Revision:17908
Build-Date:2021-05-24 01:31:00
URL:https://josm.openstreetmap.de/svn/trunk

Last errors/warnings:
- 04126.276 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 04126.327 W: Already here java.net.SocketException: Socket closed
- 04126.436 E: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 04127.483 E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 04128.643 E: IO Exception - <html>Failed to upload data to or download data from<br>'https://overpass-api.de/api/interpreter'<br>due to a problem with transferring data.<br>Details (untranslated): Read timed out</html>
- 04243.542 E: java.lang.IllegalStateException: JOSM expected to find primitive [relation 5988749] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- 04243.543 E: java.lang.IllegalStateException: JOSM expected to find primitive [relation 5988738] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- 04243.543 E: java.lang.IllegalStateException: JOSM expected to find primitive [relation 5988745] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- 04243.544 E: java.lang.IllegalStateException: JOSM expected to find primitive [relation 5988747] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- 04243.544 E: java.lang.IllegalStateException: JOSM expected to find primitive [relation 5988748] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.

Yet, again, I do not know exactly where the origin of the ISE lies but I suspect some purge and merge action.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to skyper
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.