Modify

Opened 3 months ago

Closed 2 months ago

#20037 closed defect (fixed)

Overpass query wizard generates wrong query with "*=value"

Reported by: GerdP Owned by: GerdP
Priority: normal Milestone: 20.12
Component: Core Version:
Keywords: template_report Cc: simon04

Description

What steps will reproduce the problem?

  1. Use wizard with type:node AND (*=forward OR *=backward)
  2. Click Build Query button

What is the expected result?

A query that finds all nodes with a tag that has a value of forward or backward

What happens instead?

[out:xml][timeout:90][bbox:{{bbox}}];
(
  node;
  node;
);
(._;>;);
out meta;

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

Build-Date:2020-11-04 11:24:41
Revision:17293
Is-Local-Build:true

Identification: JOSM/1.5 (17293 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2004 (19041)
Memory Usage: 653 MB / 1753 MB (328 MB allocated, but free)
Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1080
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:57650, -ea, -javaagent:D:\eclipse-java-2020-09\eclipse\configuration\org.eclipse.osgi\215\0\.cp\lib\javaagent-shaded.jar, -Dfile.encoding=UTF-8]
Program arguments: [--debug]

Plugins:
+ OpeningHoursEditor (35579)
+ apache-commons (35524)
+ buildings_tools (35579)
+ continuosDownload (91)
+ ejml (35313)
+ geotools (35169)
+ jaxb (35092)
+ jts (35122)
+ o5m (35248)
+ opendata (35513)
+ pbf (35636)
+ poly (35248)
+ reltoolbox (35602)
+ reverter (35579)
+ undelete (35521)
+ utilsplugin2 (35624)

Validator rules:
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- 02424.311 W: java.net.SocketException: Socket Closed. Cause: java.net.SocketException: Socket Closed
- 02424.314 E: java.net.SocketException: Socket Closed. Cause: java.net.SocketException: Socket Closed

Attachments (4)

20037.patch (2.5 KB) - added by GerdP 3 months ago.
possible solution
20037.2.patch (2.5 KB) - added by GerdP 3 months ago.
like this? Fixes also a SonarLint issue
20037-refactoring.patch (4.2 KB) - added by GerdP 3 months ago.
refactoring only
20037-fix.patch (5.8 KB) - added by GerdP 3 months ago.
refactoring + fix + unit test

Download all attachments as: .zip

Change History (17)

comment:1 Changed 3 months ago by GerdP

Expected query:

[out:xml][timeout:90][bbox:{{bbox}}];
(
node[~"^.*$"~"forward"]; 
node[~"^.*$"~"backward"]; 
);
(._;>;);
out meta;

comment:2 Changed 3 months ago by GerdP

Cc: simon04 added

Changed 3 months ago by GerdP

Attachment: 20037.patch added

possible solution

comment:3 Changed 3 months ago by simon04

Thanks for spotting and fixing this glitch! Two remarks:

  • the first three chunks of your patch is just refactoring…
  • please add a // fall through comment

Please add a unit test to SearchCompilerQueryWizardTest.

Last edited 3 months ago by simon04 (previous) (diff)

Changed 3 months ago by GerdP

Attachment: 20037.2.patch added

like this? Fixes also a SonarLint issue

comment:4 Changed 3 months ago by GerdP

Unit test is in work...

comment:5 Changed 3 months ago by GerdP

Wait, what's the idea behind the SearchCompilerQueryWizard getInstance() stuff when all methods are could be static?

Last edited 3 months ago by GerdP (previous) (diff)

comment:6 in reply to:  5 Changed 3 months ago by simon04

attachment:20037.2.patch 👍

Replying to GerdP:

Wait, what's the idea behind the SearchCompilerQueryWizard getInstance() stuff when all methods are static?

Legacy stuff from the days when SearchCompilerQueryWizard needed an expensive JavaScript engine initialisation via Nashorn.

comment:7 Changed 3 months ago by GerdP

OK, so that can be removed, too?

comment:8 Changed 3 months ago by simon04

Sure…

comment:9 Changed 3 months ago by GerdP

Milestone: 20.11

Changed 3 months ago by GerdP

Attachment: 20037-refactoring.patch added

refactoring only

Changed 3 months ago by GerdP

Attachment: 20037-fix.patch added

refactoring + fix + unit test

comment:10 Changed 3 months ago by GerdP

It's probably safe to commit the changes for 20.10 as well. Found no referrence in any plugin.

comment:11 Changed 2 months ago by Don-vip

Milestone: 20.1120.12

Milestone renamed

comment:12 Changed 2 months ago by simon04

Owner: changed from team to GerdP

+1

comment:13 Changed 2 months ago by GerdP

Resolution: fixed
Status: newclosed

In 17336/josm:

fix #20037: Overpass query wizard generates wrong query with "*=value"

  • remove obsolete getInstance()
  • fix bug and add unit test

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.