Menu

#16 Unhandled event loop exception when search contains spaces

v0.5.1
closed
None
5
2020-08-08
2020-06-09
No

Hello,

I tried seaching for the following hexadecimal sequence: "00 00 03 00"

I copy pasted the above sequence in the seach dialogue, and got an "Unhandled event loop exception" error with the following stack trace:

java.lang.NumberFormatException: For input string: " 0" under radix 16
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
    at java.base/java.lang.Integer.parseInt(Integer.java:638)
    at net.sourceforge.javahexeditor.HexTexts.hexStringToByte(HexTexts.java:270)
    at net.sourceforge.javahexeditor.HexTexts.initFinder(HexTexts.java:1347)
    at net.sourceforge.javahexeditor.HexTexts.findAndSelectInternal(HexTexts.java:1230)
    at net.sourceforge.javahexeditor.HexTexts.findAndSelect(HexTexts.java:1219)
    at net.sourceforge.javahexeditor.FindReplaceDialog.doFind(FindReplaceDialog.java:589)
    at net.sourceforge.javahexeditor.FindReplaceDialog$5.widgetSelected(FindReplaceDialog.java:487)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3789)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
    at org.eclipse.ui.internal.Workbench$$Lambda$120/0000000000000000.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)

I later realised that the "right" value to search for should have been "00000300" (i.e. without the spaces). The dialogue does prevent you from typing in spaces, but lets you copy-paste an existing string containing spaces. Furthermore, the plugin does display the hexadecimal characters with spaces between them, which led me to keep them in the search in the first place. This is a somewhat confusing user experience.

Let me know if you need any more information!

Discussion

  • Peter Dell

    Peter Dell - 2020-08-06

    Hello Pierre,

    I finally found some time to look into this. I've changed the handling, so values with whitespaces as separators between hex value are accepted now also in the input. I.e. "a 1 23 456" becomes "0a 01 23 04 56".
    Are you using only the Eclipse plugin or also the Standalone version?

    Best regards, Peter.

     
  • Peter Dell

    Peter Dell - 2020-08-06
    • status: open --> pending
    • assigned_to: Peter Dell
     
  • Pierre-Yves B.

    Pierre-Yves B. - 2020-08-06

    Hello Peter!

    Thanks for looking into this. The search seem to now work, but I'm having trouble testing the new version due to another exception. I'm open a separate issue as it doesn't seem related to search.

    I'm using the Eclipse plugin. My current use case is code that parses video data, the plugin is quite handy to create fixtures for test cases. :)

    Best regards,

    Pierre-Yves

     
  • Peter Dell

    Peter Dell - 2020-08-08
    • status: pending --> closed
     

Log in to post a comment.

Auth0 Logo