ext/rjb.c in rjb-1.4.7 vs ext/rjb.c in rjb-1.4.8
- old
+ new
@@ -13,11 +13,11 @@
* Lesser General Public License for more details.
*
* $Id: rjb.c 199 2012-12-17 13:31:18Z arton $
*/
-#define RJB_VERSION "1.4.7"
+#define RJB_VERSION "1.4.8"
#include "ruby.h"
#include "extconf.h"
#if RJB_RUBY_VERSION_CODE < 190
#include "st.h"
@@ -1064,10 +1064,17 @@
{
jarray ary = NULL;
if (TYPE(v) == T_ARRAY)
{
int i;
- ary = (*jenv)->NewObjectArray(jenv, (jint)RARRAY_LEN(v), j_object, NULL);
+ jclass jcls = NULL;
+ char* p = strchr(cls, ';');
+ if (p)
+ {
+ volatile VALUE clsname = rb_str_new(cls + 1, p - cls - 1); // skip first 'L'
+ jcls = rjb_find_class(jenv, clsname);
+ }
+ ary = (*jenv)->NewObjectArray(jenv, (jint)RARRAY_LEN(v), (jcls) ? jcls : j_object, NULL);
rjb_check_exception(jenv, 0);
for (i = 0; i < RARRAY_LEN(v); i++)
{
jvalue jv;
rv2jobject(jenv, RARRAY_PTR(v)[i], &jv, NULL, 0);