We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1297 - android gets exception from exception class instead of object
Summary: android gets exception from exception class instead of object
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-31 23:33 UTC by jon
Modified: 2011-09-01 01:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jon 2011-08-31 23:33:28 UTC
SDL/src/core/android/SDL_android.cpp:Android_JNI_ExceptionOccurred tries to get the exception message from the exception class instead of the object.

...
jstring exceptionMessage = (jstring)mEnv->CallObjectMethod(exceptionClass, mid);
...

should instead be

jstring exceptionMessage = (jstring)mEnv->CallObjectMethod(exception, mid);
Comment 1 jon 2011-08-31 23:35:14 UTC
Just in case further proof is required, here is the output from 'adb logcat' when the Android_JNI_ExceptionOccured is executed with its current code

W/dalvikvm( 1009): JNI WARNING: can't call Ljava/lang/Throwable;.getMessage on instance of Ljava/lang/Class;
Comment 2 Ryan C. Gordon 2011-09-01 01:43:03 UTC
This is now hg changeset b89f7f3bc9be, thanks!

--ryan.