comparison libinterp/octave-value/ov-java.cc @ 15824:abc9e5f3c661

Return correct value for ischar() predicate test on octave_java objects. * libinterp/octave-value/ov-java.h(is_string): Rename is_string() to is_java_string. Leave only prototype in .h file. * libinterp/octave-value/ov-java.cc(is_java_string): Move code for is_string from ov-java.h to is_java_string in ov-java.cc.
author Rik <rik@octave.org>
date Fri, 21 Dec 2012 10:18:38 -0800
parents e7d9db9531d1
children 9854666df787
comparison
equal deleted inserted replaced
15823:bc7a130bbdfb 15824:abc9e5f3c661
617 retval = jstring_to_string (jni_env, reinterpret_cast<jstring> (obj)); 617 retval = jstring_to_string (jni_env, reinterpret_cast<jstring> (obj));
618 } 618 }
619 } 619 }
620 620
621 return retval; 621 return retval;
622 }
623
624 bool
625 octave_java::is_java_string (void) const
626 {
627 JNIEnv *current_env = thread_jni_env ();
628
629 if (current_env && java_object)
630 {
631 jclass_ref cls (current_env, current_env->FindClass ("java/lang/String"));
632 return current_env->IsInstanceOf (java_object, cls);
633 }
634
635 return false;
622 } 636 }
623 637
624 static octave_value 638 static octave_value
625 check_exception (JNIEnv* jni_env) 639 check_exception (JNIEnv* jni_env)
626 { 640 {