﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
20842	Tagging preset: UOE at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport.evaluateCondition using value_template	skyper	simon04	"==== What steps will reproduce the problem?
1. I tried to get some conditions into `value_template=""""` but failed changing only two lines in defaultpresets, working on #18662:

{{{
#!preset
<text key=""name"" text=""Name"" value_template=""?{ route = train 'Train' | route = subway 'Subway' | route = monorail 'Monorail' | route = tram 'Tram' | route = light_rail 'Light_rail' | ''} {ref}: ?{ '{from} - {via} - {to}' | '{from} - {to}'}"" />
<text key=""ref"" text=""Reference"" />
}}}

==== What is the expected result?
The tagging preset dialog opens and `route=*`, `ref=*`, `from=*`, `to=*` and optional `via=*` are used for the value of `name=*`

==== What happens instead?
UnsupportedOperationException and the preset does not open.

==== Please provide any additional information below. Attach a screenshot if possible.
Loading the file is no problem and does not yield a message about a problem.
Is ther a problem with my syntax? or maybe, I was too fast and not all features or `name_template=""""` are supported by `value_template=""""`, yet ?

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-05-03 19:51:10 +0200 (Mon, 03 May 2021)
Revision:17858
Build-Date:2021-05-04 01:31:01
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17858 en) Linux Debian GNU/Linux 10 (buster)
Memory Usage: 149 MB / 256 MB (24 MB allocated, but free)
Java version: 11.0.11+9-post-Debian-1deb10u1, Debian, OpenJDK 64-Bit Server VM

Tagging presets:
+ ${HOME}/JOSM/new/resources/data/defaultpresets_17833_route_17661_18662.xml

Last errors/warnings:
- 00164.202 E: Handled by bug report queue: java.lang.UnsupportedOperationException
- 00287.821 E: Handled by bug report queue: java.lang.UnsupportedOperationException
- 00548.220 E: Handled by bug report queue: java.lang.UnsupportedOperationException
- 00574.477 E: Handled by bug report queue: java.lang.UnsupportedOperationException
- 01098.860 E: Handled by bug report queue: java.lang.UnsupportedOperationException
- 01441.961 E: Handled by bug report queue: java.lang.UnsupportedOperationException



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.UnsupportedOperationException
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport.evaluateCondition(TaggingPresetItemGuiSupport.java:109)
	at org.openstreetmap.josm.tools.template_engine.SearchExpressionCondition.isValid(SearchExpressionCondition.java:34)
	at org.openstreetmap.josm.tools.template_engine.Condition.appendText(Condition.java:35)
	at org.openstreetmap.josm.tools.template_engine.CompoundTemplateEntry.appendText(CompoundTemplateEntry.java:38)
	at org.openstreetmap.josm.tools.template_engine.TemplateEntry.getText(TemplateEntry.java:20)
	at org.openstreetmap.josm.gui.tagging.presets.items.Text.lambda$setupListeners$3(Text.java:258)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport.lambda$fireItemValueModified$2(TaggingPresetItemGuiSupport.java:127)
	at org.openstreetmap.josm.tools.ListenerList.fireEvent(ListenerList.java:155)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport.fireItemValueModified(TaggingPresetItemGuiSupport.java:127)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.createPanel(TaggingPreset.java:394)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showDialog(TaggingPreset.java:523)
	at org.openstreetmap.josm.gui.dialogs.properties.PresetListPanel$LabelMouseAdapter.mouseClicked(PresetListPanel.java:42)
	at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6638)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6400)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
}}}
"	defect	closed	normal	21.05	Core	latest	fixed	template_report tagging preset value_template	simon04
