Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support regular expressions in Editor search #12716

Merged

Conversation

riverwanderer
Copy link
Collaborator

Trying to add a checkbox option for Regular Expression search.

@riverwanderer riverwanderer added the enhancement New feature or request label Sep 17, 2023
@riverwanderer riverwanderer added this to the 3.7.1 milestone Sep 17, 2023
@riverwanderer riverwanderer self-assigned this Sep 17, 2023
@riverwanderer
Copy link
Collaborator Author

riverwanderer commented Sep 17, 2023

runtime error:

2023-09-17 22:20:42,499 [39877-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - Commands & Colors: Napoleonics version 4.2.0a42
2023-09-17 22:20:43,501 [39877-main] ERROR VASSAL.tools.ErrorDialog - 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "VASSAL.preferences.Prefs.getValue(String)" is null
	at VASSAL.launch.Launcher.<init>(Launcher.java:164)
	at VASSAL.launch.Editor.<init>(Editor.java:61)
	at VASSAL.launch.Editor.main(Editor.java:54)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "VASSAL.preferences.Prefs.getValue(String)" is null
	at VASSAL.tools.concurrent.SimpleFuture.get(SimpleFuture.java:92)
	at VASSAL.launch.Launcher.<init>(Launcher.java:108)
	... 2 common frames omitted
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "VASSAL.preferences.Prefs.getValue(String)" is null
	at VASSAL.configure.ConfigureTree$SearchParameters.<init>(ConfigureTree.java:1887)
	at VASSAL.configure.ConfigureTree.<init>(ConfigureTree.java:278)
	at VASSAL.configure.ConfigureTree.<init>(ConfigureTree.java:217)
	at VASSAL.launch.ModuleEditorWindow.<init>(ModuleEditorWindow.java:41)
	at VASSAL.launch.EditModuleAction.loadModule(EditModuleAction.java:59)
	at VASSAL.launch.Editor.launch(Editor.java:82)
	at VASSAL.launch.Launcher$1.run(Launcher.java:96)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	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)

@riverwanderer
Copy link
Collaborator Author

riverwanderer commented Sep 17, 2023

Now working.

The example I've given in the documentation is somewhat redudant, as the regex "^ABC$" it turns out in the same as "ABC". Also the screenshots are now out of date. I can update them, but probably from a Mac rather than Windows.

@riverwanderer riverwanderer added Ready for Review Ready to be reviewed for Merging and removed Work In Progress labels Sep 17, 2023
@riverwanderer
Copy link
Collaborator Author

Regex expression is now pre-validated to avoid exception. Invalid regex is notified to the chat window.

@uckelman uckelman changed the title Search help fix now with regex Support regular expressions in Editor search Sep 20, 2023
@uckelman uckelman merged commit 1c30631 into vassalengine:master Sep 20, 2023
1 check passed
@riverwanderer riverwanderer deleted the Search-HelpFix-Now-with-Regex branch October 31, 2023 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Ready for Review Ready to be reviewed for Merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants