Bounds checking on tooltip delay value #262

Closed
curttasker opened this Issue Aug 7, 2012 · 0 comments

Projects

None yet

1 participant

@curttasker
Anathema member

Issue first reported here

Preferences > System > Show tooltip for (seconds) Does not have any upper bounds checking on it. This allows the user to accidentally enter a huge number (9999999) which can cause Anathema to crash on launch:

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.anathema.AnathemaBootLoader.main(AnathemaBootLoader.java:13)
Caused by: java.lang.IllegalArgumentException: Invalid initial delay: -727380968

at javax.swing.Timer.setInitialDelay(Unknown Source)
at javax.swing.ToolTipManager.setDismissDelay(Unknown Source)
at net.sf.anathema.framework.environment.AnathemaEnvironment.initTooltip
Manager(AnathemaEnvironment.java:30)
at net.sf.anathema.Anathema.prepareEnvironment(Anathema.java:33)
at net.sf.anathema.Anathema.startApplication(Anathema.java:19)
... 5 more

For the user to fix it manually:

  • Run regedit.exe
  • Navigate to : HKEY_CURRENT_USER\Software\JavaSoft\Prefs\anathema\system
  • Change the value of ToolTipTime to 1.
  • Re-launch anathema, and it should be fine.

Needless to say, bounds checking needs to be added to this field to ensure that users can't accidentally run into this issue.

@curttasker curttasker added a commit that closed this issue Aug 7, 2012
@curttasker curttasker Tooltip delay - added upper bounds
Fixes #262.  The tooltip delay spinner in the preferences screen now caps its value
at 10 seconds.
2a4143e
@curttasker curttasker closed this in 2a4143e Aug 7, 2012
@curttasker curttasker was assigned Aug 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment