Opened 15 years ago
Closed 15 years ago
#4905 closed defect (worksforme)
Search for regex throws exception
Reported by: | AM909 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | tested |
Keywords: | search find exception regex | Cc: |
Description
Choose Edit->Search. Enter "\+=*" (without the quotes) in the search string box. Check "regular expression". The following exception occurs. This _is_ a valid regex AFAIK (looking for a tag where k=+, with any value). Also it seems that this exception should be caught and presented to the user with a normal app error dialog.
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2010-03-08 02:32:04
Last Changed Author: Gubaer
Revision: 3094
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2010-03-07 18:48:56 +0100 (Sun, 07 Mar 2010)
Last Changed Rev: 3094
Memory Usage: 762 MB / 762 MB (82 MB allocated, but free)
Java version: 1.6.0_17, Sun Microsystems Inc., Java HotSpot(TM) Client VM
Operating system: Windows XP
Dataset consistency test:
No problems found
Plugins: Create_grid_of_ways,PicLayer,buildings_tools,lakewalker,measurement,openstreetbugs,osmarender,remotecontrol,tageditor,validator,wmsplugin
Plugin openstreetbugs Version: 20463
Plugin wmsplugin Version: 20566
Plugin PicLayer Version: 20217
Plugin Create_grid_of_ways Version: 19428
Plugin tageditor Version: 20334
Plugin remotecontrol Version: 19946
Plugin buildings_tools Version: 20269
Plugin validator Version: 20155
Plugin lakewalker Version: 19624
Plugin osmarender Version: 19419
Plugin measurement Version: 19681
java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0
+
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at org.openstreetmap.josm.actions.search.SearchCompiler$ExactKeyValue.<init>(SearchCompiler.java:288)
at org.openstreetmap.josm.actions.search.SearchCompiler.parseFactor(SearchCompiler.java:650)
at org.openstreetmap.josm.actions.search.SearchCompiler.parseExpression(SearchCompiler.java:617)
at org.openstreetmap.josm.actions.search.SearchCompiler.parse(SearchCompiler.java:608)
at org.openstreetmap.josm.actions.search.SearchCompiler.compile(SearchCompiler.java:601)
at org.openstreetmap.josm.actions.search.SearchAction.getSelection(SearchAction.java:215)
at org.openstreetmap.josm.actions.search.SearchAction.search(SearchAction.java:270)
at org.openstreetmap.josm.actions.search.SearchAction.searchWithHistory(SearchAction.java:194)
at org.openstreetmap.josm.actions.search.SearchAction.actionPerformed(SearchAction.java:63)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Correct search would be "
+:.*" You need to escape the \ in josm. Fixed the wrong esception in r3303 and r3304.