Modify

Opened 11 months ago

Last modified 6 months ago

#22971 new defect

min-josm-version ignored for validator rules

Reported by: Famlam Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report min-josm-version validator meta Cc:

Description (last modified by gaben)

What steps will reproduce the problem?

  1. Create the following file, name it X.validator.mapcss and load it into JOSM as an external validator rule file
    meta {
      title: "Test";
      min-josm-version: 999999;
    }
    
    * {
      throwWarning: "X";
    }
    
  2. Validate any data

What is the expected result?

No warning "X" for any data, as JOSM is only at version 18721, thus failing the min-josm-version requirement
min-josm-version is supported in meta according to Help/Styles/MapCSSImplementation

What happens instead?

Any object gets a warning (e.g. min-josm-version is ignored)

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

Of course this isn't a problem for most users, until new features get added, like the recently introduced parent_way_angle()

Revision:18721
Build-Date:2023-05-03 12:38:30

Identification: JOSM/1.5 (18721 nl) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 405 MB / 2012 MB (230 MB allocated, but free)
Java version: 17.0.7+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.10×1.10)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: nl_NL
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18721, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (35924)
+ SimplifyArea (35978)
+ imagery_offset_db (35978)
+ pbf (36034)
+ pt_assistant (2.1.15-19-g9aeec3c-SNAPSHOT)
+ reverter (36043)
+ tageditor (36011)
+ turnlanes-tagging (v0.0.5)
+ undelete (36011)
+ utilsplugin2 (36011)

Tagging presets:
+ http://mijndev.openstreetmap.nl/~allroads/JOSM/Presets/NL-Fiets.zip

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.mappaint.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1

Validator rules:
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.validator.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/SuspiciousSwimming_Pool&zip=1
+ https://raw.githubusercontent.com/Famlam/OsmMapcssValidationNL/main/netherlands.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_Destination.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/Colour.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/notprefix.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_MultipleTag2.validator.mapcss
+ %UserProfile%\Documents\tijdelijke bestanden\Osmose\osmose-backend-master\plugins\Josm_workarounds.validator.mapcss

Last errors/warnings:
- 00001.163 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00001.167 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00002.690 E: java.security.KeyStoreException: Windows-ROOT not found. Oorzaak: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available

Attachments (0)

Change History (8)

comment:1 by gaben, 11 months ago

Description: modified (diff)

That's interesting. It seems the meta values are checked on mappaint styles but not on validator rules.

comment:2 by gaben, 11 months ago

Interestingly r6670 added the removal of meta blocks. See here MapCSSTagCheckerRule.java?rev=18365#L196.

Last edited 11 months ago by gaben (previous) (diff)

comment:3 by taylor.smock, 11 months ago

That is interesting. I wonder why it removes the meta blocks. Unfortunately, the comment doesn't tell us why we are ignoring the meta block for validator rules, and I doubt the author remembers why (9 years later).

comment:4 by stoecker, 11 months ago

The ticket gives no indication either...

Remove it and test what happens :-)

comment:5 by taylor.smock, 10 months ago

We only use the min-josm-version when enabling a style/validator from the preferences list, not when adding it from a file. I think the removal of the meta information is just to save memory.

In fact, I rather suspect that enabling a style/validator that requires a newer JOSM version in said newer JOSM version and then falling back to an earlier version of JOSM will not cause a warning.

Note: The min-josm-version is written to ExtendedSourceEntry.minJosmVersion, and is only checked in SourceEditor.ActivateSourcesAction#actionPerformed ("Entry ''{0}'' requires JOSM Version {1}. (Currently running: {2})").

comment:6 by Famlam, 10 months ago

In fact, I rather suspect that enabling a style/validator that requires a newer JOSM version in said newer JOSM version and then falling back to an earlier version of JOSM will not cause a warning.

This is probably an extremely rare case, not?

comment:7 by taylor.smock, 10 months ago

I would expect it to be a fairly rare case, but it can happen if the user has multiple operating systems sharing the same JOSM home directory.

in reply to:  4 comment:8 by gaben, 6 months ago

Replying to stoecker:

The ticket gives no indication either...

May it be security related? E.g. loading some external resources. I don't know, just asking.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Famlam.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.