Modify

Opened 3 years ago

Closed 3 years 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 years ago.
possible solution
20037.2.patch (2.5 KB ) - added by GerdP 3 years ago.
like this? Fixes also a SonarLint issue
20037-refactoring.patch (4.2 KB ) - added by GerdP 3 years ago.
refactoring only
20037-fix.patch (5.8 KB ) - added by GerdP 3 years ago.
refactoring + fix + unit test

Download all attachments as: .zip

Change History (17)

comment:1 by GerdP, 3 years ago

Expected query:

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

comment:2 by GerdP, 3 years ago

Cc: simon04 added

by GerdP, 3 years ago

Attachment: 20037.patch added

possible solution

comment:3 by simon04, 3 years ago

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
Version 0, edited 3 years ago by simon04 (next)

by GerdP, 3 years ago

Attachment: 20037.2.patch added

like this? Fixes also a SonarLint issue

comment:4 by GerdP, 3 years ago

Unit test is in work...

comment:5 by GerdP, 3 years ago

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

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

in reply to:  5 comment:6 by simon04, 3 years ago

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 by GerdP, 3 years ago

OK, so that can be removed, too?

comment:8 by simon04, 3 years ago

Sure…

comment:9 by GerdP, 3 years ago

Milestone: 20.11

by GerdP, 3 years ago

Attachment: 20037-refactoring.patch added

refactoring only

by GerdP, 3 years ago

Attachment: 20037-fix.patch added

refactoring + fix + unit test

comment:10 by GerdP, 3 years ago

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

comment:11 by Don-vip, 3 years ago

Milestone: 20.1120.12

Milestone renamed

comment:12 by simon04, 3 years ago

Owner: changed from team to GerdP

+1

comment:13 by GerdP, 3 years ago

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