Пример #1
0
 internal void DeleteLocalRef(JniLocalHandle lref)
 {
     if (JniLocalHandle.IsNull(lref))
     {
         throw new ArgumentNullException("lref");
     }
     deleteLocalRef(envPtr, lref);
     //optimized away ExceptionTest();
 }
Пример #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()));
        }
Пример #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;
            }
        }
Пример #4
0
        public bool ExceptionRead()
        {
            JniLocalHandle occurred = ExceptionOccurred();

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