Example #1
0
 internal void DeleteLocalRef(JniLocalHandle lref)
 {
     if (JniLocalHandle.IsNull(lref))
     {
         throw new ArgumentNullException("lref");
     }
     deleteLocalRef(envPtr, lref);
     //optimized away ExceptionTest();
 }
Example #2
0
        public JniGlobalHandle NewGlobalRef(JniHandle lobj)
        {
            if (JniLocalHandle.IsNull(lobj))
            {
                throw new ArgumentNullException("lobj");
            }
            JniGlobalHandleNs res = newGlobalRef(envPtr, lobj);

            return(new JniGlobalHandle(res.handle, GetJavaVM()));
        }
Example #3
0
        public void ExceptionTest()
        {
            JniLocalHandle occurred = ExceptionOccurred();

            if (!JniLocalHandle.IsNull(occurred))
            {
                ExceptionDescribe();
                ExceptionClear();
                throw new Exception("fail in exception test. need to use typed exception");
                //Exception exception = Convertor.FullJ2C<Exception>(this, occurred);
                //throw exception;
            }
        }
Example #4
0
        public bool ExceptionRead()
        {
            JniLocalHandle occurred = ExceptionOccurred();

            if (!JniLocalHandle.IsNull(occurred))
            {
#if DEBUG
                ExceptionDescribe();
#endif
                ExceptionClear();
                return(true);
            }
            return(false);
        }