Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
41eb7054
Commit
41eb7054
authored
Oct 14, 2015
by
Paul Sokolovsky
Browse files
unix/modjni: call_method: Check for Java exception after method return.
parent
2ec835f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/modjni.c
View file @
41eb7054
...
@@ -450,15 +450,19 @@ STATIC mp_obj_t call_method(jobject obj, const char *name, jarray methods, bool
...
@@ -450,15 +450,19 @@ STATIC mp_obj_t call_method(jobject obj, const char *name, jarray methods, bool
}
else
{
}
else
{
if
(
MATCH
(
ret_type
,
"void"
))
{
if
(
MATCH
(
ret_type
,
"void"
))
{
JJ
(
CallVoidMethodA
,
obj
,
method_id
,
jargs
);
JJ
(
CallVoidMethodA
,
obj
,
method_id
,
jargs
);
check_exception
();
ret
=
mp_const_none
;
ret
=
mp_const_none
;
}
else
if
(
MATCH
(
ret_type
,
"int"
))
{
}
else
if
(
MATCH
(
ret_type
,
"int"
))
{
jint
res
=
JJ
(
CallIntMethodA
,
obj
,
method_id
,
jargs
);
jint
res
=
JJ
(
CallIntMethodA
,
obj
,
method_id
,
jargs
);
check_exception
();
ret
=
mp_obj_new_int
(
res
);
ret
=
mp_obj_new_int
(
res
);
}
else
if
(
MATCH
(
ret_type
,
"boolean"
))
{
}
else
if
(
MATCH
(
ret_type
,
"boolean"
))
{
jboolean
res
=
JJ
(
CallBooleanMethodA
,
obj
,
method_id
,
jargs
);
jboolean
res
=
JJ
(
CallBooleanMethodA
,
obj
,
method_id
,
jargs
);
check_exception
();
ret
=
mp_obj_new_bool
(
res
);
ret
=
mp_obj_new_bool
(
res
);
}
else
if
(
is_object_type
(
ret_type
))
{
}
else
if
(
is_object_type
(
ret_type
))
{
res
=
JJ
(
CallObjectMethodA
,
obj
,
method_id
,
jargs
);
res
=
JJ
(
CallObjectMethodA
,
obj
,
method_id
,
jargs
);
check_exception
();
ret
=
new_jobject
(
res
);
ret
=
new_jobject
(
res
);
}
else
{
}
else
{
JJ
(
ReleaseStringUTFChars
,
name_o
,
decl
);
JJ
(
ReleaseStringUTFChars
,
name_o
,
decl
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment