Bug - Fixed OS X standard menu items trigger debug traces

Veracity

Developer
Staff member
This code in CreateFrameRunnable.java:

Code:
		OSXAdapter.setQuitHandler( KoLmafia.class, KoLmafia.class.getDeclaredMethod( "quit", (Class[]) null ) );
		OSXAdapter.setAboutHandler( KoLmafia.class, KoLmafia.class.getDeclaredMethod( "about", (Class[]) null ) );
		OSXAdapter.setPreferencesHandler( KoLmafia.class, KoLmafia.class.getDeclaredMethod(
					"preferences", (Class[]) null ) );

hooks KoLmafia to standard OS X menu behavior. However, with the Foxtrot removal, they trigger debug stack traces.

Select Quit on the KoLmafia menu:

Code:
class java.lang.Exception: Runnable in event dispatch thread
java.lang.Exception: Runnable in event dispatch thread
	at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:378)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:119)
	at net.sourceforge.kolmafia.session.LogoutManager.logout(LogoutManager.java:118)
	at net.sourceforge.kolmafia.KoLmafia.quit(KoLmafia.java:2338)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at apple.dts.samplecode.osxadapter.OSXAdapter.callTarget(OSXAdapter.java:167)
	at apple.dts.samplecode.osxadapter.OSXAdapter.invoke(OSXAdapter.java:178)
	at $Proxy0.handleQuit(Unknown Source)
	...

Select Preferences on the KoLmafia menu:

Code:
class java.lang.Exception: Triggered creation of main interface in event dispatch thread
java.lang.Exception: Triggered creation of main interface in event dispatch thread
	at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:378)
	at net.sourceforge.kolmafia.CreateFrameRunnable.run(CreateFrameRunnable.java:126)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:438)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:234)
	at net.sourceforge.kolmafia.KoLmafia.preferences(KoLmafia.java:2349)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at apple.dts.samplecode.osxadapter.OSXAdapter.callTarget(OSXAdapter.java:167)
	at apple.dts.samplecode.osxadapter.OSXAdapter.invoke(OSXAdapter.java:178)
	at $Proxy0.handlePreferences(Unknown Source)
	...
and

Code:
class java.lang.Exception: Runnable in event dispatch thread
java.lang.Exception: Runnable in event dispatch thread
	at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:378)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:119)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:423)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:234)
	at net.sourceforge.kolmafia.KoLDesktop.initializeTabs(KoLDesktop.java:178)
	at net.sourceforge.kolmafia.KoLDesktop.getInstance(KoLDesktop.java:236)
	at net.sourceforge.kolmafia.CreateFrameRunnable.run(CreateFrameRunnable.java:129)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:438)
	at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:234)
	at net.sourceforge.kolmafia.KoLmafia.preferences(KoLmafia.java:2349)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at apple.dts.samplecode.osxadapter.OSXAdapter.callTarget(OSXAdapter.java:167)
	at apple.dts.samplecode.osxadapter.OSXAdapter.invoke(OSXAdapter.java:178)
	at $Proxy0.handlePreferences(Unknown Source)
	...
 
Top