Skip to content

Instantly share code, notes, and snippets.

@AndreMiras
Created March 31, 2018 15:46
Show Gist options
  • Save AndreMiras/7a74ab3cba7d9d2d79102ef83715250b to your computer and use it in GitHub Desktop.
Save AndreMiras/7a74ab3cba7d9d2d79102ef83715250b to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/* Generated by Cython 0.25.2 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
#error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
#if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
#define HAVE_LONG_LONG
#endif
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#elif defined(PYSTON_VERSION)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#if PY_MAJOR_VERSION < 3
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 1
#endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#undef SHIFT
#undef BASE
#undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#define __Pyx_PyCFunctionFast _PyCFunctionFast
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
#define PyUnicode_1BYTE_KIND 1
#define PyUnicode_2BYTE_KIND 2
#define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
#define PyObject_ASCII(o) PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyNumber_Int PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
#ifndef PyUnicode_InternFromString
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#endif
#if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
# if defined(__cplusplus)
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#elif defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
__pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#define __PYX_HAVE__jnius__jnius
#define __PYX_HAVE_API__jnius__jnius
#include <string.h>
#include <stdlib.h>
#include "jni.h"
#include <stdio.h>
#include "pythread.h"
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
#if defined (__cplusplus) && __cplusplus >= 201103L
#include <cstdlib>
#define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
#define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
#define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
const Py_UNICODE *u_end = u;
while (*u_end++) ;
return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
PyObject* ascii_chars_u = NULL;
PyObject* ascii_chars_b = NULL;
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
if (strcmp(default_encoding_c, "ascii") == 0) {
__Pyx_sys_getdefaultencoding_not_ascii = 0;
} else {
char ascii_chars[128];
int c;
for (c = 0; c < 128; c++) {
ascii_chars[c] = c;
}
__Pyx_sys_getdefaultencoding_not_ascii = 1;
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
if (!ascii_chars_u) goto bad;
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
PyErr_Format(
PyExc_ValueError,
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
default_encoding_c);
goto bad;
}
Py_DECREF(ascii_chars_u);
Py_DECREF(ascii_chars_b);
}
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
Py_XDECREF(ascii_chars_u);
Py_XDECREF(ascii_chars_b);
return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
return -1;
}
#endif
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"jnius/jnius_export_class.pxi",
"jnius/jnius_proxy.pxi",
"jnius/jnius_utils.pxi",
"jnius/jnius_conversion.pxi",
"jnius/jnius_localref.pxi",
"jnius/jnius_nativetypes3.pxi",
"jnius/jnius_export_func.pxi",
"stringsource",
"jnius/jnius.pyx",
"type.pxd",
"bool.pxd",
"complex.pxd",
"jnius/jnius_env.pxi",
};
/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
char *data;
Py_ssize_t shape[8];
Py_ssize_t strides[8];
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
const char* name;
struct __Pyx_StructField_* fields;
size_t size;
size_t arraysize[8];
int ndim;
char typegroup;
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
__Pyx_TypeInfo* type;
const char* name;
size_t offset;
} __Pyx_StructField;
typedef struct {
__Pyx_StructField* field;
size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
__Pyx_StructField root;
__Pyx_BufFmt_StackElem* head;
size_t fmt_offset;
size_t new_count, enc_count;
size_t struct_alignment;
int is_complex;
char enc_type;
char new_packmode;
char enc_packmode;
char is_valid_array;
} __Pyx_BufFmt_Context;
/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
#define CYTHON_ATOMICS 1
#endif
#define __pyx_atomic_int_type int
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
!defined(__i386__)
#define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
#ifdef __PYX_DEBUG_ATOMICS
#warning "Using GNU atomics"
#endif
#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type LONG
#define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
#define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
#ifdef __PYX_DEBUG_ATOMICS
#pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
#define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
#ifdef __PYX_DEBUG_ATOMICS
#warning "Using Intel atomics"
#endif
#else
#undef CYTHON_ATOMICS
#define CYTHON_ATOMICS 0
#ifdef __PYX_DEBUG_ATOMICS
#warning "Not using atomics"
#endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
#define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#define __pyx_sub_acquisition_count(memview)\
__pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#else
#define __pyx_add_acquisition_count(memview)\
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
/*--- Type declarations ---*/
struct __pyx_obj_5jnius_5jnius_LocalRef;
struct __pyx_obj_5jnius_5jnius_ByteArray;
struct __pyx_obj_5jnius_5jnius_JavaObject;
struct __pyx_obj_5jnius_5jnius_JavaClassStorage;
struct __pyx_obj_5jnius_5jnius_JavaClass;
struct __pyx_obj_5jnius_5jnius_JavaField;
struct __pyx_obj_5jnius_5jnius_JavaMethod;
struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod;
struct __pyx_obj_5jnius_5jnius_PythonJavaClass;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_opt_args_5jnius_5jnius_calculate_score;
/* "jnius/jnius_utils.pxi":223
*
*
* cdef int calculate_score(sign_args, args, is_varargs=False) except *: # <<<<<<<<<<<<<<
* cdef int index
* cdef int score = 0
*/
struct __pyx_opt_args_5jnius_5jnius_calculate_score {
int __pyx_n;
PyObject *is_varargs;
};
/* "jnius/jnius_localref.pxi":1
* cdef class LocalRef: # <<<<<<<<<<<<<<
* cdef jobject obj
*
*/
struct __pyx_obj_5jnius_5jnius_LocalRef {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_LocalRef *__pyx_vtab;
jobject obj;
};
/* "jnius/jnius_nativetypes3.pxi":16
* return a != b
*
* cdef class ByteArray: # <<<<<<<<<<<<<<
* cdef LocalRef _jobject
* cdef long _size
*/
struct __pyx_obj_5jnius_5jnius_ByteArray {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_ByteArray *__pyx_vtab;
struct __pyx_obj_5jnius_5jnius_LocalRef *_jobject;
long _size;
unsigned char *_buf;
__Pyx_memviewslice _arr;
};
/* "jnius/jnius_export_class.pxi":15
*
*
* cdef class JavaObject(object): # <<<<<<<<<<<<<<
* '''Can contain any Java object. Used to store instance, or whatever.
* '''
*/
struct __pyx_obj_5jnius_5jnius_JavaObject {
PyObject_HEAD
jobject obj;
};
/* "jnius/jnius_export_class.pxi":25
*
*
* cdef class JavaClassStorage: # <<<<<<<<<<<<<<
* cdef jclass j_cls
*
*/
struct __pyx_obj_5jnius_5jnius_JavaClassStorage {
PyObject_HEAD
jclass j_cls;
};
/* "jnius/jnius_export_class.pxi":138
*
*
* cdef class JavaClass(object): # <<<<<<<<<<<<<<
* '''Main class to do introspection.
* '''
*/
struct __pyx_obj_5jnius_5jnius_JavaClass {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *__pyx_vtab;
JNIEnv *j_env;
jclass j_cls;
struct __pyx_obj_5jnius_5jnius_LocalRef *j_self;
};
/* "jnius/jnius_export_class.pxi":285
*
*
* cdef class JavaField(object): # <<<<<<<<<<<<<<
* cdef jfieldID j_field
* cdef JNIEnv *j_env
*/
struct __pyx_obj_5jnius_5jnius_JavaField {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_JavaField *__pyx_vtab;
jfieldID j_field;
JNIEnv *j_env;
jclass j_cls;
PyObject *is_static;
PyObject *name;
PyObject *classname;
PyObject *definition;
};
/* "jnius/jnius_export_class.pxi":545
*
*
* cdef class JavaMethod(object): # <<<<<<<<<<<<<<
* '''Used to resolve a Java method, and do the call
* '''
*/
struct __pyx_obj_5jnius_5jnius_JavaMethod {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_JavaMethod *__pyx_vtab;
jmethodID j_method;
jclass j_cls;
struct __pyx_obj_5jnius_5jnius_LocalRef *j_self;
PyObject *name;
PyObject *classname;
PyObject *definition;
PyObject *is_static;
int is_varargs;
PyObject *definition_return;
PyObject *definition_args;
};
/* "jnius/jnius_export_class.pxi":824
*
*
* cdef class JavaMultipleMethod(object): # <<<<<<<<<<<<<<
*
* cdef LocalRef j_self
*/
struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod {
PyObject_HEAD
struct __pyx_vtabstruct_5jnius_5jnius_JavaMultipleMethod *__pyx_vtab;
struct __pyx_obj_5jnius_5jnius_LocalRef *j_self;
PyObject *definitions;
PyObject *static_methods;
PyObject *instance_methods;
PyObject *name;
PyObject *classname;
};
/* "jnius/jnius_proxy.pxi":16
*
*
* cdef class PythonJavaClass(object): # <<<<<<<<<<<<<<
* '''
* Base class to create a java class from python
*/
struct __pyx_obj_5jnius_5jnius_PythonJavaClass {
PyObject_HEAD
jclass j_cls;
PyObject *j_self;
};
/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_array_obj {
PyObject_HEAD
struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
int ndim;
Py_ssize_t *_shape;
Py_ssize_t *_strides;
Py_ssize_t itemsize;
PyObject *mode;
PyObject *_format;
void (*callback_free_data)(void *);
int free_data;
int dtype_is_object;
};
/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
* cdef object name
* def __init__(self, name):
*/
struct __pyx_MemviewEnum_obj {
PyObject_HEAD
PyObject *name;
};
/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
*
* cdef object obj
*/
struct __pyx_memoryview_obj {
PyObject_HEAD
struct __pyx_vtabstruct_memoryview *__pyx_vtab;
PyObject *obj;
PyObject *_size;
PyObject *_array_interface;
PyThread_type_lock lock;
__pyx_atomic_int acquisition_count[2];
__pyx_atomic_int *acquisition_count_aligned_p;
Py_buffer view;
int flags;
int dtype_is_object;
__Pyx_TypeInfo *typeinfo;
};
/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
* "Internal class for passing memoryview slices to Python"
*
*/
struct __pyx_memoryviewslice_obj {
struct __pyx_memoryview_obj __pyx_base;
__Pyx_memviewslice from_slice;
PyObject *from_object;
PyObject *(*to_object_func)(char *);
int (*to_dtype_func)(char *, PyObject *);
};
/* "jnius/jnius_localref.pxi":1
* cdef class LocalRef: # <<<<<<<<<<<<<<
* cdef jobject obj
*
*/
struct __pyx_vtabstruct_5jnius_5jnius_LocalRef {
void (*create)(struct __pyx_obj_5jnius_5jnius_LocalRef *, JNIEnv *, jobject);
};
static struct __pyx_vtabstruct_5jnius_5jnius_LocalRef *__pyx_vtabptr_5jnius_5jnius_LocalRef;
/* "jnius/jnius_nativetypes3.pxi":16
* return a != b
*
* cdef class ByteArray: # <<<<<<<<<<<<<<
* cdef LocalRef _jobject
* cdef long _size
*/
struct __pyx_vtabstruct_5jnius_5jnius_ByteArray {
void (*set_buffer)(struct __pyx_obj_5jnius_5jnius_ByteArray *, JNIEnv *, jobject, long, jbyte *);
};
static struct __pyx_vtabstruct_5jnius_5jnius_ByteArray *__pyx_vtabptr_5jnius_5jnius_ByteArray;
/* "jnius/jnius_export_class.pxi":138
*
*
* cdef class JavaClass(object): # <<<<<<<<<<<<<<
* '''Main class to do introspection.
* '''
*/
struct __pyx_vtabstruct_5jnius_5jnius_JavaClass {
void (*instanciate_from)(struct __pyx_obj_5jnius_5jnius_JavaClass *, struct __pyx_obj_5jnius_5jnius_LocalRef *);
void (*call_constructor)(struct __pyx_obj_5jnius_5jnius_JavaClass *, PyObject *);
void (*resolve_methods)(struct __pyx_obj_5jnius_5jnius_JavaClass *);
void (*resolve_fields)(struct __pyx_obj_5jnius_5jnius_JavaClass *);
};
static struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *__pyx_vtabptr_5jnius_5jnius_JavaClass;
/* "jnius/jnius_export_class.pxi":285
*
*
* cdef class JavaField(object): # <<<<<<<<<<<<<<
* cdef jfieldID j_field
* cdef JNIEnv *j_env
*/
struct __pyx_vtabstruct_5jnius_5jnius_JavaField {
void (*set_resolve_info)(struct __pyx_obj_5jnius_5jnius_JavaField *, JNIEnv *, jclass, PyObject *, PyObject *);
void (*ensure_field)(struct __pyx_obj_5jnius_5jnius_JavaField *);
PyObject *(*write_field)(struct __pyx_obj_5jnius_5jnius_JavaField *, jobject, PyObject *);
PyObject *(*read_field)(struct __pyx_obj_5jnius_5jnius_JavaField *, jobject);
PyObject *(*read_static_field)(struct __pyx_obj_5jnius_5jnius_JavaField *);
};
static struct __pyx_vtabstruct_5jnius_5jnius_JavaField *__pyx_vtabptr_5jnius_5jnius_JavaField;
/* "jnius/jnius_export_class.pxi":545
*
*
* cdef class JavaMethod(object): # <<<<<<<<<<<<<<
* '''Used to resolve a Java method, and do the call
* '''
*/
struct __pyx_vtabstruct_5jnius_5jnius_JavaMethod {
void (*ensure_method)(struct __pyx_obj_5jnius_5jnius_JavaMethod *);
void (*set_resolve_info)(struct __pyx_obj_5jnius_5jnius_JavaMethod *, JNIEnv *, jclass, struct __pyx_obj_5jnius_5jnius_LocalRef *, PyObject *, PyObject *);
PyObject *(*call_method)(struct __pyx_obj_5jnius_5jnius_JavaMethod *, JNIEnv *, jvalue *);
PyObject *(*call_staticmethod)(struct __pyx_obj_5jnius_5jnius_JavaMethod *, JNIEnv *, jvalue *);
};
static struct __pyx_vtabstruct_5jnius_5jnius_JavaMethod *__pyx_vtabptr_5jnius_5jnius_JavaMethod;
/* "jnius/jnius_export_class.pxi":824
*
*
* cdef class JavaMultipleMethod(object): # <<<<<<<<<<<<<<
*
* cdef LocalRef j_self
*/
struct __pyx_vtabstruct_5jnius_5jnius_JavaMultipleMethod {
void (*set_resolve_info)(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *, JNIEnv *, jclass, struct __pyx_obj_5jnius_5jnius_LocalRef *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_5jnius_5jnius_JavaMultipleMethod *__pyx_vtabptr_5jnius_5jnius_JavaMultipleMethod;
/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_vtabstruct_array {
PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
*
* cdef object obj
*/
struct __pyx_vtabstruct_memoryview {
char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
* "Internal class for passing memoryview slices to Python"
*
*/
struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#define __Pyx_RefNannyFinishContext()\
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_XDECREF(tmp);\
} while (0)
#define __Pyx_DECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_DECREF(tmp);\
} while (0)
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_getattr))
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
#endif
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
/* IncludeStringH.proto */
#include <string.h>
/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
int result = PySequence_Contains(seq, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
Py_SIZE(list) = len+1;
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif
/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
int full_traceback, int nogil);
/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
/* object_ord.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Ord(c)\
(likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
#else
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
#endif
static long __Pyx__PyObject_Ord(PyObject* c);
/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (!PyErr_Occurred()) {
PyObject* args = PyTuple_Pack(1, key);
if (likely(args))
PyErr_SetObject(PyExc_KeyError, args);
Py_XDECREF(args);
}
return NULL;
}
Py_INCREF(value);
return value;
}
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len)) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
Py_SIZE(list) = len+1;
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
PyObject* string, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
return __Pyx_decode_c_bytes(
PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
start, stop, encoding, errors, decode_func);
}
/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
int is_tuple, int has_known_size, int decref_tuple);
/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
/* BufferFormatCheck.proto */
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
__Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack,
__Pyx_TypeInfo* type); // PROTO
/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
#define __Pyx_MEMVIEW_FULL 4
#define __Pyx_MEMVIEW_CONTIG 8
#define __Pyx_MEMVIEW_STRIDED 16
#define __Pyx_MEMVIEW_FOLLOW 32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_setattro))
return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_setattr))
return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
PyObject_RichCompare(op1, op2, Py_EQ)
#endif
/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#endif
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
#endif
/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_Join _PyString_Join
#else
#define __Pyx_PyBytes_Join _PyBytes_Join
#endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif
/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
if (unlikely(!none))
return -1;
Py_DECREF(none);
return 0;
#else
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);
/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
PyObject *func_classobj;
void *defaults;
int defaults_pyobjects;
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *self,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
size_t size,
int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(void);
/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
/* ClassMethod.proto */
#include "descrobject.h"
static PyObject* __Pyx_Method_ClassMethod(PyObject *method);
/* CodeObjectCache.proto */
typedef struct {
PyCodeObject* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
size_t refcount;
Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
__Pyx_Buffer *rcbuffer;
char *data;
__Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;
/* None.proto */
static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
char order, int ndim);
/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
__Pyx_memviewslice *slice2,
int ndim, size_t itemsize);
/* Capsule.proto */
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jint(jint value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jboolean(jboolean value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jlong(jlong value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jshort(jshort value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jbyte(jbyte value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_jchar(jchar value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif
/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
const char *mode, int ndim,
size_t sizeof_dtype, int contig_flag,
int dtype_is_object);
/* CIntFromPy.proto */
static CYTHON_INLINE jint __Pyx_PyInt_As_jint(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE jboolean __Pyx_PyInt_As_jboolean(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE jbyte __Pyx_PyInt_As_jbyte(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE jshort __Pyx_PyInt_As_jshort(PyObject *);
/* TypeInfoToFormat.proto */
struct __pyx_typeinfo_string {
char string[3];
};
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
/* CIntFromPy.proto */
static CYTHON_INLINE jlong __Pyx_PyInt_As_jlong(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE jchar __Pyx_PyInt_As_jchar(PyObject *);
/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
int buf_flags,
int ndim,
__Pyx_TypeInfo *dtype,
__Pyx_BufFmt_StackElem stack[],
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *);
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif
/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static void __pyx_f_5jnius_5jnius_8LocalRef_create(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self, JNIEnv *__pyx_v_env, jobject __pyx_v_obj); /* proto*/
static void __pyx_f_5jnius_5jnius_9ByteArray_set_buffer(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self, JNIEnv *__pyx_v_env, jobject __pyx_v_obj, long __pyx_v_size, jbyte *__pyx_v_buf); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaClass_instanciate_from(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_j_self); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaClass_call_constructor(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, PyObject *__pyx_v_args); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaClass_resolve_methods(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaClass_resolve_fields(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaField_set_resolve_info(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, CYTHON_UNUSED JNIEnv *__pyx_v_j_env, jclass __pyx_v_j_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_classname); /* proto*/
static void __pyx_f_5jnius_5jnius_9JavaField_ensure_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_5jnius_5jnius_9JavaField_write_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, jobject __pyx_v_j_self, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_f_5jnius_5jnius_9JavaField_read_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, jobject __pyx_v_j_self); /* proto*/
static PyObject *__pyx_f_5jnius_5jnius_9JavaField_read_static_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self); /* proto*/
static void __pyx_f_5jnius_5jnius_10JavaMethod_ensure_method(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self); /* proto*/
static void __pyx_f_5jnius_5jnius_10JavaMethod_set_resolve_info(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, CYTHON_UNUSED JNIEnv *__pyx_v_j_env, jclass __pyx_v_j_cls, struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_j_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classname); /* proto*/
static PyObject *__pyx_f_5jnius_5jnius_10JavaMethod_call_method(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, JNIEnv *__pyx_v_j_env, jvalue *__pyx_v_j_args); /* proto*/
static PyObject *__pyx_f_5jnius_5jnius_10JavaMethod_call_staticmethod(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, JNIEnv *__pyx_v_j_env, jvalue *__pyx_v_j_args); /* proto*/
static void __pyx_f_5jnius_5jnius_18JavaMultipleMethod_set_resolve_info(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_self, JNIEnv *__pyx_v_j_env, jclass __pyx_v_j_cls, struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_j_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classname); /* proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
/* Module declarations from 'libc.string' */
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'cpython.version' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
/* Module declarations from 'libc.stdio' */
/* Module declarations from 'cpython.object' */
/* Module declarations from 'cpython.ref' */
/* Module declarations from 'cpython.exc' */
/* Module declarations from 'cpython.module' */
/* Module declarations from 'cpython.mem' */
/* Module declarations from 'cpython.tuple' */
/* Module declarations from 'cpython.list' */
/* Module declarations from 'cpython.sequence' */
/* Module declarations from 'cpython.mapping' */
/* Module declarations from 'cpython.iterator' */
/* Module declarations from 'cpython.number' */
/* Module declarations from 'cpython.int' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
/* Module declarations from 'cpython.long' */
/* Module declarations from 'cpython.float' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
/* Module declarations from 'cpython.string' */
/* Module declarations from 'cpython.unicode' */
/* Module declarations from 'cpython.dict' */
/* Module declarations from 'cpython.instance' */
/* Module declarations from 'cpython.function' */
/* Module declarations from 'cpython.method' */
/* Module declarations from 'cpython.weakref' */
/* Module declarations from 'cpython.getargs' */
/* Module declarations from 'cpython.pythread' */
/* Module declarations from 'cpython.pystate' */
/* Module declarations from 'cpython.cobject' */
/* Module declarations from 'cpython.oldbuffer' */
/* Module declarations from 'cpython.set' */
/* Module declarations from 'cpython.buffer' */
/* Module declarations from 'cpython.bytes' */
/* Module declarations from 'cpython.pycapsule' */
/* Module declarations from 'cpython' */
/* Module declarations from 'jnius.jnius' */
static PyTypeObject *__pyx_ptype_5jnius_5jnius_LocalRef = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_ByteArray = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaObject = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaClassStorage = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaClass = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaField = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaMethod = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_JavaMultipleMethod = 0;
static PyTypeObject *__pyx_ptype_5jnius_5jnius_PythonJavaClass = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
static JNIEnv *__pyx_v_5jnius_5jnius_default_env;
static JavaVM *__pyx_v_5jnius_5jnius_jvm;
static PyObject *__pyx_v_5jnius_5jnius_assignable_from = 0;
static int __pyx_v_5jnius_5jnius_assignable_from_order;
static PyObject *__pyx_v_5jnius_5jnius_jclass_register = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
__PYX_EXTERN_C DL_IMPORT(JNIEnv) *SDL_AndroidGetJNIEnv(void); /*proto*/
static JNIEnv *__pyx_f_5jnius_5jnius_get_platform_jnienv(void); /*proto*/
static JNIEnv *__pyx_f_5jnius_5jnius_get_jnienv(void); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_str_for_c(PyObject *); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_items_compat(PyObject *); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_parse_definition(PyObject *); /*proto*/
static void __pyx_f_5jnius_5jnius_check_exception(JNIEnv *); /*proto*/
static void __pyx_f_5jnius_5jnius__append_exception_trace_messages(JNIEnv *, PyObject *, jthrowable, jmethodID, jmethodID, jmethodID); /*proto*/
static void __pyx_f_5jnius_5jnius_check_assignable_from(JNIEnv *, struct __pyx_obj_5jnius_5jnius_JavaClass *, PyObject *); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_lookup_java_object_name(JNIEnv *, jobject); /*proto*/
static int __pyx_f_5jnius_5jnius_calculate_score(PyObject *, PyObject *, struct __pyx_opt_args_5jnius_5jnius_calculate_score *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_jstringy_arg(PyObject *); /*proto*/
static void __pyx_f_5jnius_5jnius_release_args(JNIEnv *, PyObject *, jvalue *, PyObject *); /*proto*/
static void __pyx_f_5jnius_5jnius_populate_args(JNIEnv *, PyObject *, jvalue *, PyObject *); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jobject_to_python(JNIEnv *, PyObject *, jobject); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jstring_to_python(JNIEnv *, jstring); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jarray_to_python(JNIEnv *, PyObject *, jobject); /*proto*/
static jobject __pyx_f_5jnius_5jnius_convert_python_to_jobject(JNIEnv *, PyObject *, PyObject *); /*proto*/
static jstring __pyx_f_5jnius_5jnius_convert_pystr_to_java(JNIEnv *, PyObject *); /*proto*/
static jobject __pyx_f_5jnius_5jnius_convert_pyarray_to_java(JNIEnv *, PyObject *, PyObject *); /*proto*/
static struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_f_5jnius_5jnius_create_local_ref(JNIEnv *, jobject); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_python_op(int, PyObject *, PyObject *); /*proto*/
static jobject __pyx_f_5jnius_5jnius_py_invoke0(JNIEnv *, jobject, jobject, jobject, jobjectArray); /*proto*/
static jobject __pyx_f_5jnius_5jnius_invoke0(JNIEnv *, jobject, jobject, jobject, jobjectArray); /*proto*/
static PyObject *__pyx_f_5jnius_5jnius_create_proxy_instance(JNIEnv *, PyObject *, PyObject *, PyObject *); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 };
#define __Pyx_MODULE_NAME "jnius.jnius"
int __pyx_module_is_main_jnius__jnius = 0;
/* Implementation of 'jnius.jnius' */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_IndexError;
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_F[] = "F";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_J[] = "J";
static const char __pyx_k_L[] = "L";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T{";
static const char __pyx_k_V[] = "V";
static const char __pyx_k_Z[] = "Z";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_s[] = "(%s)";
static const char __pyx_k__3[] = "(";
static const char __pyx_k__5[] = ")";
static const char __pyx_k__7[] = "";
static const char __pyx_k__8[] = "[";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_jc[] = "jc";
static const char __pyx_k_jf[] = "jf";
static const char __pyx_k_jm[] = "jm";
static const char __pyx_k_tp[] = "tp";
static const char __pyx_k_B_2[] = "[B";
static const char __pyx_k_C_2[] = "[C";
static const char __pyx_k_V_2[] = "()V";
static const char __pyx_k__11[] = ";";
static const char __pyx_k__14[] = "/";
static const char __pyx_k__15[] = ".";
static const char __pyx_k__64[] = "\n=======================================\n";
static const char __pyx_k__83[] = "^";
static const char __pyx_k__84[] = ":";
static const char __pyx_k__85[] = "}";
static const char __pyx_k__86[] = ",";
static const char __pyx_k_all[] = "__all__";
static const char __pyx_k_app[] = "app";
static const char __pyx_k_chr[] = "chr";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_jcs[] = "jcs";
static const char __pyx_k_jmm[] = "jmm";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_ord[] = "ord";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_call[] = "__call__";
static const char __pyx_k_cast[] = "cast";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_jobj[] = "jobj";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_meta[] = "meta";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_Class[] = "Class";
static const char __pyx_k_Proxy[] = "$Proxy";
static const char __pyx_k_bases[] = "bases";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_get_2[] = "__get__";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_j_env[] = "j_env";
static const char __pyx_k_jargs[] = "jargs";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Method[] = "Method";
static const char __pyx_k_Object[] = "Object";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_detach[] = "detach";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_invoke[] = "_invoke";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_static[] = "static";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_system[] = "system";
static const char __pyx_k_tolist[] = "tolist";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_getName[] = "getName";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_namestr[] = "namestr";
static const char __pyx_k_partial[] = "partial";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_reflect[] = "reflect";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_varargs[] = "varargs";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_ZBCSIJFD[] = "ZBCSIJFD";
static const char __pyx_k_instance[] = "instance";
static const char __pyx_k_invoke_2[] = "invoke";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_javaname[] = "__javaname__";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_tostring[] = "tostring";
static const char __pyx_k_Caused_by[] = "Caused by:";
static const char __pyx_k_JavaClass[] = "JavaClass";
static const char __pyx_k_JavaField[] = "JavaField";
static const char __pyx_k_Signature[] = "\nSignature: ({}){}";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_autoclass[] = "autoclass";
static const char __pyx_k_baseclass[] = "baseclass";
static const char __pyx_k_classDict[] = "classDict";
static const char __pyx_k_classname[] = "classname";
static const char __pyx_k_destclass[] = "destclass";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_javaclass[] = "__javaclass__";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_print_exc[] = "print_exc";
static const char __pyx_k_signature[] = "signature";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_JavaMethod[] = "JavaMethod";
static const char __pyx_k_JavaObject[] = "JavaObject";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_class_name[] = "class_name";
static const char __pyx_k_definition[] = "definition";
static const char __pyx_k_interfaces[] = "interfaces";
static const char __pyx_k_noinstance[] = "noinstance";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_stacktrace[] = "stacktrace";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_classLoader[] = "classLoader";
static const char __pyx_k_cls_storage[] = "__cls_storage";
static const char __pyx_k_definitions[] = "definitions";
static const char __pyx_k_java_method[] = "java_method";
static const char __pyx_k_javacontext[] = "__javacontext__";
static const char __pyx_k_javamethods[] = "__javamethods__";
static const char __pyx_k_jnius_jnius[] = "jnius.jnius";
static const char __pyx_k_Python_class[] = "\nPython class:";
static const char __pyx_k_innermessage[] = "innermessage";
static const char __pyx_k_instancetype[] = "instancetype";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_JavaException[] = "JavaException";
static const char __pyx_k_MetaJavaClass[] = "MetaJavaClass";
static const char __pyx_k_currentThread[] = "currentThread";
static const char __pyx_k_getProxyClass[] = "getProxyClass";
static const char __pyx_k_getReturnType[] = "getReturnType";
static const char __pyx_k_get_javaclass[] = "get_javaclass";
static const char __pyx_k_get_signature[] = "get_signature";
static const char __pyx_k_javabaseclass[] = "__javabaseclass__";
static const char __pyx_k_javasignature[] = "__javasignature__";
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
static const char __pyx_k_resolve_class[] = "resolve_class";
static const char __pyx_k_find_javaclass[] = "find_javaclass";
static const char __pyx_k_getClassLoader[] = "getClassLoader";
static const char __pyx_k_java_lang_Byte[] = "java/lang/Byte";
static const char __pyx_k_java_lang_Long[] = "java/lang/Long";
static const char __pyx_k_javainterfaces[] = "__javainterfaces__";
static const char __pyx_k_JavaStaticField[] = "JavaStaticField";
static const char __pyx_k_Ljava_lang_Byte[] = "Ljava/lang/Byte;";
static const char __pyx_k_Ljava_lang_Long[] = "Ljava/lang/Long;";
static const char __pyx_k_PythonJavaClass[] = "PythonJavaClass";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_java_lang_Class[] = "java/lang/Class";
static const char __pyx_k_java_lang_Float[] = "java/lang/Float";
static const char __pyx_k_java_lang_Short[] = "java/lang/Short";
static const char __pyx_k_javaconstructor[] = "__javaconstructor__";
static const char __pyx_k_JavaStaticMethod[] = "JavaStaticMethod";
static const char __pyx_k_Java_method_name[] = "\nJava method name:";
static const char __pyx_k_Ljava_lang_Float[] = "Ljava/lang/Float;";
static const char __pyx_k_Ljava_lang_Short[] = "Ljava/lang/Short;";
static const char __pyx_k_java_lang_Double[] = "java/lang/Double";
static const char __pyx_k_java_lang_Object[] = "java/lang/Object";
static const char __pyx_k_java_lang_String[] = "java/lang/String";
static const char __pyx_k_java_lang_Thread[] = "java.lang.Thread";
static const char __pyx_k_newProxyInstance[] = "newProxyInstance";
static const char __pyx_k_Ljava_lang_Double[] = "Ljava/lang/Double;";
static const char __pyx_k_Ljava_lang_Number[] = "Ljava/lang/Number;";
static const char __pyx_k_Ljava_lang_Object[] = "Ljava/lang/Object;";
static const char __pyx_k_Ljava_lang_String[] = "Ljava/lang/String;";
static const char __pyx_k_getParameterTypes[] = "getParameterTypes";
static const char __pyx_k_java_lang_Boolean[] = "java/lang/Boolean";
static const char __pyx_k_java_lang_Integer[] = "java/lang/Integer";
static const char __pyx_k_java_method___get[] = "java_method.__get__";
static const char __pyx_k_Ljava_lang_Boolean[] = "Ljava/lang/Boolean;";
static const char __pyx_k_Ljava_lang_Integer[] = "Ljava/lang/Integer;";
static const char __pyx_k_java_method___call[] = "java_method.__call__";
static const char __pyx_k_java_method___init[] = "java_method.__init__";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_Class_not_found_0_r[] = "Class not found {0!r}";
static const char __pyx_k_MetaJavaClass___new[] = "MetaJavaClass.__new__";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_java_lang_Character[] = "java/lang/Character";
static const char __pyx_k_ByteArray_size_at_0x[] = "<ByteArray size={} at 0x{}>";
static const char __pyx_k_JavaException___init[] = "JavaException.__init__";
static const char __pyx_k_Ljava_lang_Character[] = "Ljava/lang/Character;";
static const char __pyx_k_getSystemClassLoader[] = "getSystemClassLoader";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_getContextClassLoader[] = "getContextClassLoader";
static const char __pyx_k_java_lang_ClassLoader[] = "java.lang.ClassLoader";
static const char __pyx_k_JavaStaticField___init[] = "JavaStaticField.__init__";
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static const char __pyx_k_java_lang_CharSequence[] = "java/lang/CharSequence";
static const char __pyx_k_JavaStaticMethod___init[] = "JavaStaticMethod.__init__";
static const char __pyx_k_Ljava_lang_CharSequence[] = "Ljava/lang/CharSequence;";
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static const char __pyx_k_Unable_to_instanciate_0[] = "Unable to instanciate {0}";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_java_lang_reflect_Proxy[] = "java.lang.reflect.Proxy";
static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
static const char __pyx_k_Invalid_array_definition[] = "Invalid array definition";
static const char __pyx_k_Invalid_field_definition[] = "Invalid field definition";
static const char __pyx_k_JVM_exception_occurred_s[] = "JVM exception occurred: %s";
static const char __pyx_k_No_constructor_available[] = "No constructor available";
static const char __pyx_k_Invalid_return_definition[] = "Invalid return definition?";
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
static const char __pyx_k_Python_java_method_missing[] = "\n===== Python/java method missing ======";
static const char __pyx_k_Unable_to_find_the_class_0[] = "Unable to find the class {0}";
static const char __pyx_k_MetaJavaClass_get_javaclass[] = "MetaJavaClass.get_javaclass";
static const char __pyx_k_MetaJavaClass_resolve_class[] = "MetaJavaClass.resolve_class";
static const char __pyx_k_Unable_to_found_the_field_0[] = "Unable to found the field {0}";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_0_at_0x_1_x_jclass_2_jself_3[] = "<{0} at 0x{1:x} jclass={2} jself={3}>";
static const char __pyx_k_Cannot_call_set_buffer_twice[] = "Cannot call set_buffer() twice.";
static const char __pyx_k_Unable_to_create_the_class_0[] = "Unable to create the class {0}";
static const char __pyx_k_Unable_to_find_a_None_method[] = "Unable to find a None method!";
static const char __pyx_k_LocalRef_obj_0x_0_x_at_0x_1_x[] = "<LocalRef obj=0x{0:x} at 0x{1:x}>";
static const char __pyx_k_The_method_is_not_implemented[] = "The method {} is not implemented";
static const char __pyx_k_Unable_to_find_the_method_0_1[] = "Unable to find the method {0}({1})";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_javaclass___definition_missing[] = "__javaclass__ definition missing";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_Can_be_a_real_java_exception_or[] = "Can be a real java exception, or just an exception from the wrapper.\n ";
static const char __pyx_k_Invalid___javacontext___must_be[] = "Invalid __javacontext__ {}, must be app or system.";
static const char __pyx_k_Invalid_call_number_of_argument[] = "Invalid call, number of argument mismatch for constructor";
static const char __pyx_k_Invalid_character_in_definition[] = "Invalid \"{}\" character in definition \"{}\"";
static const char __pyx_k_Java_wrapper_With_this_module_y[] = "\nJava wrapper\n============\n\nWith this module, you can create Python class that reflects a Java class, and use\nit directly in Python.\n\nExample with static method\n--------------------------\n\nJava::\n\n package org.test;\n public class Hardware {\n static int getDPI() {\n return metrics.densityDpi;\n }\n }\n\nPython::\n\n class Hardware(JavaClass):\n __metaclass__ = MetaJavaClass\n __javaclass__ = 'org/test/Hardware'\n getDPI = JavaStaticMethod('()I')\n\n Hardware.getDPI()\n\n\nExample with instance method\n----------------------------\n\nJava::\n\n package org.test;\n public class Action {\n public String getName() {\n return new String(\"Hello world\")\n }\n }\n\nPython::\n\n class Action(JavaClass):\n __metaclass__ = MetaJavaClass\n __javaclass__ = 'org/test/Action'\n getName = JavaMethod('()Ljava/lang/String;')\n\n action = Action()\n print action.getName()\n # will output Hello World\n\n\nExample with static/instance field\n----------------------------------\n\nJava::\n\n package org.test;\n public class Test {\n public static String field1 = new String(\"hello\");\n public String field2;\n\n public Test() {\n this.field2 = new String(\"world\");\n }\n }\n\nPython::\n\n class Test(JavaClass):\n __metaclass__ = MetaJavaClass\n __javaclass__ = 'org/test/Test'\n\n field1 = JavaStaticField('Ljava/lang/String;')\n field2 = JavaField('Ljava/lang/String;')\n\n # access directly to the static field\n print Test.field1\n\n # create the instance, and access to the instance field\n test = Test()\n print test.field2\n\n";
static const char __pyx_k_Unable_to_found_the_class_for_0[] = "Unable to found the class for {0!r}";
static const char __pyx_k_Unable_to_found_the_constructor[] = "Unable to found the constructor for {0}";
static const char __pyx_k_home_andre_demo_buildozer_andro[] = "/home/andre/demo/.buildozer/android/platform/build/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a/pyjnius/jnius/jnius_env.pxi";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_call_instance_method_on_a[] = "Cannot call instance method on a un-instanciated class";
static const char __pyx_k_Cannot_create_array_with_a_class[] = "Cannot create array with a class not found {0!r}";
static const char __pyx_k_Cannot_use_ByteArray_for_signatu[] = "Cannot use ByteArray for signature {}";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Expecting_a_python_list_tuple_go[] = "Expecting a python list/tuple, got {0!r}";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_instance_of_0_r_passed_f[] = "Invalid instance of {0!r} passed for a {1!r}";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static const char __pyx_k_Invalid_python_object_for_this_a[] = "Invalid python object for this argument. Want {0!r}, got {1!r}";
static const char __pyx_k_Invalid_return_definition_for_ar[] = "Invalid return definition for array";
static const char __pyx_k_Invalid_variable_used_for_L_arra[] = "Invalid variable used for L array";
static const char __pyx_k_No_constructor_matching_your_arg[] = "No constructor matching your arguments";
static const char __pyx_k_No_methods_matching_your_argumen[] = "No methods matching your arguments";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
static const char __pyx_k_Unable_to_allocate_memory_for_ja[] = "Unable to allocate memory for java args";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
static const char __pyx_k_java_lang_reflect_InvocationHand[] = "java/lang/reflect/InvocationHandler";
static const char __pyx_k_org_jnius_NativeInvocationHandle[] = "org/jnius/NativeInvocationHandler";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_Invalid_call_number_of_argument_2[] = "Invalid call, number of argument mismatch";
static const char __pyx_k_home_andre_demo_buildozer_andro_2[] = "/home/andre/demo/.buildozer/android/platform/build/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a/pyjnius/jnius/jnius_export_func.pxi";
static const char __pyx_k_home_andre_demo_buildozer_andro_3[] = "/home/andre/demo/.buildozer/android/platform/build/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a/pyjnius/jnius/jnius_export_class.pxi";
static const char __pyx_k_home_andre_demo_buildozer_andro_4[] = "/home/andre/demo/.buildozer/android/platform/build/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a/pyjnius/jnius/jnius_proxy.pxi";
static const char __pyx_k_org_jnius_NativeInvocationHandle_2[] = "org.jnius.NativeInvocationHandler";
static PyObject *__pyx_kp_s_0_at_0x_1_x_jclass_2_jself_3;
static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_kp_s_B_2;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_kp_s_ByteArray_size_at_0x;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_kp_s_C_2;
static PyObject *__pyx_kp_s_Can_be_a_real_java_exception_or;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
static PyObject *__pyx_kp_s_Cannot_call_instance_method_on_a;
static PyObject *__pyx_kp_s_Cannot_call_set_buffer_twice;
static PyObject *__pyx_kp_s_Cannot_create_array_with_a_class;
static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
static PyObject *__pyx_kp_s_Cannot_use_ByteArray_for_signatu;
static PyObject *__pyx_kp_s_Caused_by;
static PyObject *__pyx_n_s_Class;
static PyObject *__pyx_kp_s_Class_not_found_0_r;
static PyObject *__pyx_n_s_D;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
static PyObject *__pyx_kp_s_Expecting_a_python_list_tuple_go;
static PyObject *__pyx_n_s_F;
static PyObject *__pyx_n_s_I;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
static PyObject *__pyx_kp_s_Invalid___javacontext___must_be;
static PyObject *__pyx_kp_s_Invalid_array_definition;
static PyObject *__pyx_kp_s_Invalid_call_number_of_argument;
static PyObject *__pyx_kp_s_Invalid_call_number_of_argument_2;
static PyObject *__pyx_kp_s_Invalid_character_in_definition;
static PyObject *__pyx_kp_s_Invalid_field_definition;
static PyObject *__pyx_kp_s_Invalid_instance_of_0_r_passed_f;
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
static PyObject *__pyx_kp_s_Invalid_python_object_for_this_a;
static PyObject *__pyx_kp_s_Invalid_return_definition;
static PyObject *__pyx_kp_s_Invalid_return_definition_for_ar;
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
static PyObject *__pyx_kp_s_Invalid_variable_used_for_L_arra;
static PyObject *__pyx_n_s_J;
static PyObject *__pyx_kp_s_JVM_exception_occurred_s;
static PyObject *__pyx_n_s_JavaClass;
static PyObject *__pyx_n_s_JavaException;
static PyObject *__pyx_n_s_JavaException___init;
static PyObject *__pyx_n_s_JavaField;
static PyObject *__pyx_n_s_JavaMethod;
static PyObject *__pyx_n_s_JavaObject;
static PyObject *__pyx_n_s_JavaStaticField;
static PyObject *__pyx_n_s_JavaStaticField___init;
static PyObject *__pyx_n_s_JavaStaticMethod;
static PyObject *__pyx_n_s_JavaStaticMethod___init;
static PyObject *__pyx_kp_s_Java_method_name;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_kp_s_Ljava_lang_Boolean;
static PyObject *__pyx_kp_s_Ljava_lang_Byte;
static PyObject *__pyx_kp_s_Ljava_lang_CharSequence;
static PyObject *__pyx_kp_s_Ljava_lang_Character;
static PyObject *__pyx_kp_s_Ljava_lang_Double;
static PyObject *__pyx_kp_s_Ljava_lang_Float;
static PyObject *__pyx_kp_s_Ljava_lang_Integer;
static PyObject *__pyx_kp_s_Ljava_lang_Long;
static PyObject *__pyx_kp_s_Ljava_lang_Number;
static PyObject *__pyx_kp_s_Ljava_lang_Object;
static PyObject *__pyx_kp_s_Ljava_lang_Short;
static PyObject *__pyx_kp_s_Ljava_lang_String;
static PyObject *__pyx_kp_s_LocalRef_obj_0x_0_x_at_0x_1_x;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
static PyObject *__pyx_kp_s_MemoryView_of_r_object;
static PyObject *__pyx_n_s_MetaJavaClass;
static PyObject *__pyx_n_s_MetaJavaClass___new;
static PyObject *__pyx_n_s_MetaJavaClass_get_javaclass;
static PyObject *__pyx_n_s_MetaJavaClass_resolve_class;
static PyObject *__pyx_n_s_Method;
static PyObject *__pyx_kp_s_No_constructor_available;
static PyObject *__pyx_kp_s_No_constructor_matching_your_arg;
static PyObject *__pyx_kp_s_No_methods_matching_your_argumen;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_n_s_Object;
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
static PyObject *__pyx_kp_s_Proxy;
static PyObject *__pyx_n_s_PythonJavaClass;
static PyObject *__pyx_kp_s_Python_class;
static PyObject *__pyx_kp_s_Python_java_method_missing;
static PyObject *__pyx_n_s_S;
static PyObject *__pyx_kp_s_Signature;
static PyObject *__pyx_kp_b_T;
static PyObject *__pyx_kp_s_The_method_is_not_implemented;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unable_to_allocate_memory_for_ja;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_kp_s_Unable_to_create_the_class_0;
static PyObject *__pyx_kp_s_Unable_to_find_a_None_method;
static PyObject *__pyx_kp_s_Unable_to_find_the_class_0;
static PyObject *__pyx_kp_s_Unable_to_find_the_method_0_1;
static PyObject *__pyx_kp_s_Unable_to_found_the_class_for_0;
static PyObject *__pyx_kp_s_Unable_to_found_the_constructor;
static PyObject *__pyx_kp_s_Unable_to_found_the_field_0;
static PyObject *__pyx_kp_s_Unable_to_instanciate_0;
static PyObject *__pyx_n_s_V;
static PyObject *__pyx_kp_s_V_2;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_Z;
static PyObject *__pyx_n_s_ZBCSIJFD;
static PyObject *__pyx_kp_s__11;
static PyObject *__pyx_kp_s__14;
static PyObject *__pyx_kp_s__15;
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_kp_s__5;
static PyObject *__pyx_kp_s__64;
static PyObject *__pyx_kp_b__7;
static PyObject *__pyx_kp_s__7;
static PyObject *__pyx_kp_s__8;
static PyObject *__pyx_kp_b__83;
static PyObject *__pyx_kp_b__84;
static PyObject *__pyx_kp_b__85;
static PyObject *__pyx_kp_u__86;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_app;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_autoclass;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_baseclass;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_s_cast;
static PyObject *__pyx_n_s_chr;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_classDict;
static PyObject *__pyx_n_s_classLoader;
static PyObject *__pyx_n_s_class_name;
static PyObject *__pyx_n_s_classname;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_cls_storage;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
static PyObject *__pyx_n_s_currentThread;
static PyObject *__pyx_n_s_definition;
static PyObject *__pyx_n_s_definitions;
static PyObject *__pyx_n_s_destclass;
static PyObject *__pyx_n_s_detach;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_find_javaclass;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getClassLoader;
static PyObject *__pyx_n_s_getContextClassLoader;
static PyObject *__pyx_n_s_getName;
static PyObject *__pyx_n_s_getParameterTypes;
static PyObject *__pyx_n_s_getProxyClass;
static PyObject *__pyx_n_s_getReturnType;
static PyObject *__pyx_n_s_getSystemClassLoader;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_get_javaclass;
static PyObject *__pyx_n_s_get_signature;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
static PyObject *__pyx_kp_s_home_andre_demo_buildozer_andro;
static PyObject *__pyx_kp_s_home_andre_demo_buildozer_andro_2;
static PyObject *__pyx_kp_s_home_andre_demo_buildozer_andro_3;
static PyObject *__pyx_kp_s_home_andre_demo_buildozer_andro_4;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_innermessage;
static PyObject *__pyx_n_s_instance;
static PyObject *__pyx_n_s_instancetype;
static PyObject *__pyx_n_s_interfaces;
static PyObject *__pyx_n_s_invoke;
static PyObject *__pyx_n_s_invoke_2;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_j_env;
static PyObject *__pyx_n_s_jargs;
static PyObject *__pyx_kp_s_java_lang_Boolean;
static PyObject *__pyx_kp_s_java_lang_Byte;
static PyObject *__pyx_kp_s_java_lang_CharSequence;
static PyObject *__pyx_kp_s_java_lang_Character;
static PyObject *__pyx_kp_s_java_lang_Class;
static PyObject *__pyx_kp_s_java_lang_ClassLoader;
static PyObject *__pyx_kp_s_java_lang_Double;
static PyObject *__pyx_kp_s_java_lang_Float;
static PyObject *__pyx_kp_s_java_lang_Integer;
static PyObject *__pyx_kp_s_java_lang_Long;
static PyObject *__pyx_kp_s_java_lang_Object;
static PyObject *__pyx_kp_s_java_lang_Short;
static PyObject *__pyx_kp_s_java_lang_String;
static PyObject *__pyx_kp_s_java_lang_Thread;
static PyObject *__pyx_kp_s_java_lang_reflect_InvocationHand;
static PyObject *__pyx_kp_s_java_lang_reflect_Proxy;
static PyObject *__pyx_n_s_java_method;
static PyObject *__pyx_n_s_java_method___call;
static PyObject *__pyx_n_s_java_method___get;
static PyObject *__pyx_n_s_java_method___init;
static PyObject *__pyx_n_s_javabaseclass;
static PyObject *__pyx_n_s_javaclass;
static PyObject *__pyx_kp_s_javaclass___definition_missing;
static PyObject *__pyx_n_s_javaconstructor;
static PyObject *__pyx_n_s_javacontext;
static PyObject *__pyx_n_s_javainterfaces;
static PyObject *__pyx_n_s_javamethods;
static PyObject *__pyx_n_s_javaname;
static PyObject *__pyx_n_s_javasignature;
static PyObject *__pyx_n_s_jc;
static PyObject *__pyx_n_s_jcs;
static PyObject *__pyx_n_s_jf;
static PyObject *__pyx_n_s_jm;
static PyObject *__pyx_n_s_jmm;
static PyObject *__pyx_n_s_jnius_jnius;
static PyObject *__pyx_n_s_jobj;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_meta;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_namestr;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_newProxyInstance;
static PyObject *__pyx_n_s_noinstance;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_kp_s_org_jnius_NativeInvocationHandle;
static PyObject *__pyx_kp_s_org_jnius_NativeInvocationHandle_2;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_partial;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_print_exc;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reflect;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_resolve_class;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_signature;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_stacktrace;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_static;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_kp_s_strided_and_direct;
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
static PyObject *__pyx_kp_s_strided_and_indirect;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_system;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tolist;
static PyObject *__pyx_n_s_tostring;
static PyObject *__pyx_n_s_tp;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_varargs;
static PyObject *__pyx_pf_5jnius_5jnius_detach(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_5jnius_5jnius_8LocalRef___cinit__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self); /* proto */
static void __pyx_pf_5jnius_5jnius_8LocalRef_2__dealloc__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_8LocalRef_4__repr__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self); /* proto */
static int __pyx_pf_5jnius_5jnius_9ByteArray___cinit__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static void __pyx_pf_5jnius_5jnius_9ByteArray_2__dealloc__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_4__str__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_5jnius_5jnius_9ByteArray_6__len__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_8__getitem__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_10__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_12tolist(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_14tostring(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_2cast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_destclass, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_4find_javaclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_namestr); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_13JavaException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_classname, PyObject *__pyx_v_innermessage, PyObject *__pyx_v_stacktrace); /* proto */
static int __pyx_pf_5jnius_5jnius_10JavaObject___cinit__(struct __pyx_obj_5jnius_5jnius_JavaObject *__pyx_v_self); /* proto */
static int __pyx_pf_5jnius_5jnius_16JavaClassStorage___cinit__(struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_self); /* proto */
static void __pyx_pf_5jnius_5jnius_16JavaClassStorage_2__dealloc__(struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_meta, PyObject *__pyx_v_classname, PyObject *__pyx_v_bases, PyObject *__pyx_v_classDict); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass_2get_javaclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_meta, PyObject *__pyx_v_classDict); /* proto */
static int __pyx_pf_5jnius_5jnius_9JavaClass___cinit__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_5jnius_5jnius_9JavaClass_2__init__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9JavaClass_4__repr__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self); /* proto */
static int __pyx_pf_5jnius_5jnius_9JavaField___cinit__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_definition, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_5jnius_5jnius_9JavaField_2__init__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_definition, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_9JavaField_4__get__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_objtype); /* proto */
static int __pyx_pf_5jnius_5jnius_9JavaField_6__set__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5jnius_5jnius_10JavaMethod___cinit__(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_definition, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_5jnius_5jnius_10JavaMethod_2__init__(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, PyObject *__pyx_v_definition, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_10JavaMethod_4__get__(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_objtype); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_10JavaMethod_6__call__(struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_5jnius_5jnius_18JavaMultipleMethod___cinit__(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_definition, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_5jnius_5jnius_18JavaMultipleMethod_2__init__(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_self, PyObject *__pyx_v_definitions, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_18JavaMultipleMethod_4__get__(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_objtype); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_18JavaMultipleMethod_6__call__(struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_16JavaStaticMethod___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_definition, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_15JavaStaticField___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_definition, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_11java_method___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_signature, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_11java_method_2__get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_instancetype); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_11java_method_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_f); /* proto */
static int __pyx_pf_5jnius_5jnius_15PythonJavaClass___cinit__(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_5jnius_5jnius_15PythonJavaClass_2__init__(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_15PythonJavaClass_4invoke(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_15PythonJavaClass_6_invoke(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_5jnius_5jnius_15PythonJavaClass_6j_self___get__(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self); /* proto */
static int __pyx_pf_5jnius_5jnius_15PythonJavaClass_6j_self_2__set__(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5jnius_5jnius_15PythonJavaClass_6j_self_4__del__(struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_self); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_5jnius_5jnius_LocalRef(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_ByteArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaClassStorage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaClass(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaField(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaMethod(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_JavaMultipleMethod(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5jnius_5jnius_PythonJavaClass(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2147483648;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__4;
static PyObject *__pyx_slice__9;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_slice__10;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__18;
static PyObject *__pyx_slice__19;
static PyObject *__pyx_slice__20;
static PyObject *__pyx_slice__21;
static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__23;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__25;
static PyObject *__pyx_slice__26;
static PyObject *__pyx_slice__29;
static PyObject *__pyx_slice__30;
static PyObject *__pyx_slice__32;
static PyObject *__pyx_slice__33;
static PyObject *__pyx_slice__34;
static PyObject *__pyx_slice__35;
static PyObject *__pyx_slice__36;
static PyObject *__pyx_slice__37;
static PyObject *__pyx_slice__38;
static PyObject *__pyx_slice__40;
static PyObject *__pyx_slice__51;
static PyObject *__pyx_slice__53;
static PyObject *__pyx_slice__59;
static PyObject *__pyx_slice__61;
static PyObject *__pyx_slice__65;
static PyObject *__pyx_slice__79;
static PyObject *__pyx_slice__80;
static PyObject *__pyx_slice__81;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
/* "jnius/jnius_jvm_android.pxi":4
* cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
*
* cdef JNIEnv *get_platform_jnienv(): # <<<<<<<<<<<<<<
* return <JNIEnv*>SDL_AndroidGetJNIEnv()
*/
static JNIEnv *__pyx_f_5jnius_5jnius_get_platform_jnienv(void) {
JNIEnv *__pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_platform_jnienv", 0);
/* "jnius/jnius_jvm_android.pxi":5
*
* cdef JNIEnv *get_platform_jnienv():
* return <JNIEnv*>SDL_AndroidGetJNIEnv() # <<<<<<<<<<<<<<
*/
__pyx_r = ((JNIEnv *)SDL_AndroidGetJNIEnv());
goto __pyx_L0;
/* "jnius/jnius_jvm_android.pxi":4
* cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
*
* cdef JNIEnv *get_platform_jnienv(): # <<<<<<<<<<<<<<
* return <JNIEnv*>SDL_AndroidGetJNIEnv()
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_env.pxi":7
* cdef JavaVM *jvm = NULL
*
* cdef JNIEnv *get_jnienv() except NULL: # <<<<<<<<<<<<<<
* global default_env
* # first call, init.
*/
static JNIEnv *__pyx_f_5jnius_5jnius_get_jnienv(void) {
JNIEnv *__pyx_v_env;
JNIEnv *__pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_jnienv", 0);
/* "jnius/jnius_env.pxi":10
* global default_env
* # first call, init.
* if default_env == NULL: # <<<<<<<<<<<<<<
* default_env = get_platform_jnienv()
* if default_env == NULL:
*/
__pyx_t_1 = ((__pyx_v_5jnius_5jnius_default_env == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_env.pxi":11
* # first call, init.
* if default_env == NULL:
* default_env = get_platform_jnienv() # <<<<<<<<<<<<<<
* if default_env == NULL:
* return NULL
*/
__pyx_v_5jnius_5jnius_default_env = __pyx_f_5jnius_5jnius_get_platform_jnienv();
/* "jnius/jnius_env.pxi":12
* if default_env == NULL:
* default_env = get_platform_jnienv()
* if default_env == NULL: # <<<<<<<<<<<<<<
* return NULL
* default_env[0].GetJavaVM(default_env, &jvm)
*/
__pyx_t_1 = ((__pyx_v_5jnius_5jnius_default_env == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_env.pxi":13
* default_env = get_platform_jnienv()
* if default_env == NULL:
* return NULL # <<<<<<<<<<<<<<
* default_env[0].GetJavaVM(default_env, &jvm)
*
*/
__pyx_r = NULL;
goto __pyx_L0;
/* "jnius/jnius_env.pxi":12
* if default_env == NULL:
* default_env = get_platform_jnienv()
* if default_env == NULL: # <<<<<<<<<<<<<<
* return NULL
* default_env[0].GetJavaVM(default_env, &jvm)
*/
}
/* "jnius/jnius_env.pxi":14
* if default_env == NULL:
* return NULL
* default_env[0].GetJavaVM(default_env, &jvm) # <<<<<<<<<<<<<<
*
* # return the current env attached to the thread
*/
(__pyx_v_5jnius_5jnius_default_env[0])->GetJavaVM(__pyx_v_5jnius_5jnius_default_env, (&__pyx_v_5jnius_5jnius_jvm));
/* "jnius/jnius_env.pxi":10
* global default_env
* # first call, init.
* if default_env == NULL: # <<<<<<<<<<<<<<
* default_env = get_platform_jnienv()
* if default_env == NULL:
*/
}
/* "jnius/jnius_env.pxi":18
* # return the current env attached to the thread
* # XXX it threads are created from C (not java), we'll leak here.
* cdef JNIEnv *env = NULL # <<<<<<<<<<<<<<
* jvm[0].AttachCurrentThread(jvm, &env, NULL)
* return env
*/
__pyx_v_env = NULL;
/* "jnius/jnius_env.pxi":19
* # XXX it threads are created from C (not java), we'll leak here.
* cdef JNIEnv *env = NULL
* jvm[0].AttachCurrentThread(jvm, &env, NULL) # <<<<<<<<<<<<<<
* return env
*
*/
(__pyx_v_5jnius_5jnius_jvm[0])->AttachCurrentThread(__pyx_v_5jnius_5jnius_jvm, (&__pyx_v_env), NULL);
/* "jnius/jnius_env.pxi":20
* cdef JNIEnv *env = NULL
* jvm[0].AttachCurrentThread(jvm, &env, NULL)
* return env # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_env;
goto __pyx_L0;
/* "jnius/jnius_env.pxi":7
* cdef JavaVM *jvm = NULL
*
* cdef JNIEnv *get_jnienv() except NULL: # <<<<<<<<<<<<<<
* global default_env
* # first call, init.
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_env.pxi":23
*
*
* def detach(): # <<<<<<<<<<<<<<
* jvm[0].DetachCurrentThread(jvm)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_1detach(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_1detach = {"detach", (PyCFunction)__pyx_pw_5jnius_5jnius_1detach, METH_NOARGS, 0};
static PyObject *__pyx_pw_5jnius_5jnius_1detach(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("detach (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_detach(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_detach(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("detach", 0);
/* "jnius/jnius_env.pxi":24
*
* def detach():
* jvm[0].DetachCurrentThread(jvm) # <<<<<<<<<<<<<<
*
*/
(__pyx_v_5jnius_5jnius_jvm[0])->DetachCurrentThread(__pyx_v_5jnius_5jnius_jvm);
/* "jnius/jnius_env.pxi":23
*
*
* def detach(): # <<<<<<<<<<<<<<
* jvm[0].DetachCurrentThread(jvm)
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_utils.pxi":3
* from cpython.version cimport PY_MAJOR_VERSION
*
* cdef str_for_c(s): # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION < 3:
* if isinstance(s, unicode):
*/
static PyObject *__pyx_f_5jnius_5jnius_str_for_c(PyObject *__pyx_v_s) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("str_for_c", 0);
/* "jnius/jnius_utils.pxi":4
*
* cdef str_for_c(s):
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* if isinstance(s, unicode):
* return s.encode('utf-8')
*/
__pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":5
* cdef str_for_c(s):
* if PY_MAJOR_VERSION < 3:
* if isinstance(s, unicode): # <<<<<<<<<<<<<<
* return s.encode('utf-8')
* else:
*/
__pyx_t_1 = PyUnicode_Check(__pyx_v_s);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":6
* if PY_MAJOR_VERSION < 3:
* if isinstance(s, unicode):
* return s.encode('utf-8') # <<<<<<<<<<<<<<
* else:
* return s
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":5
* cdef str_for_c(s):
* if PY_MAJOR_VERSION < 3:
* if isinstance(s, unicode): # <<<<<<<<<<<<<<
* return s.encode('utf-8')
* else:
*/
}
/* "jnius/jnius_utils.pxi":8
* return s.encode('utf-8')
* else:
* return s # <<<<<<<<<<<<<<
* else:
* return s.encode('utf-8')
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_s);
__pyx_r = __pyx_v_s;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":4
*
* cdef str_for_c(s):
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* if isinstance(s, unicode):
* return s.encode('utf-8')
*/
}
/* "jnius/jnius_utils.pxi":10
* return s
* else:
* return s.encode('utf-8') # <<<<<<<<<<<<<<
*
* cdef items_compat(d):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":3
* from cpython.version cimport PY_MAJOR_VERSION
*
* cdef str_for_c(s): # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION < 3:
* if isinstance(s, unicode):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("jnius.jnius.str_for_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_utils.pxi":12
* return s.encode('utf-8')
*
* cdef items_compat(d): # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION >= 3:
* return d.items()
*/
static PyObject *__pyx_f_5jnius_5jnius_items_compat(PyObject *__pyx_v_d) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("items_compat", 0);
/* "jnius/jnius_utils.pxi":13
*
* cdef items_compat(d):
* if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* return d.items()
* else:
*/
__pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":14
* cdef items_compat(d):
* if PY_MAJOR_VERSION >= 3:
* return d.items() # <<<<<<<<<<<<<<
* else:
* return d.iteritems()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":13
*
* cdef items_compat(d):
* if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* return d.items()
* else:
*/
}
/* "jnius/jnius_utils.pxi":16
* return d.items()
* else:
* return d.iteritems() # <<<<<<<<<<<<<<
*
* cdef parse_definition(definition):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":12
* return s.encode('utf-8')
*
* cdef items_compat(d): # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION >= 3:
* return d.items()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("jnius.jnius.items_compat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_utils.pxi":18
* return d.iteritems()
*
* cdef parse_definition(definition): # <<<<<<<<<<<<<<
* # not a function, just a field
* if definition[0] != '(':
*/
static PyObject *__pyx_f_5jnius_5jnius_parse_definition(PyObject *__pyx_v_definition) {
PyObject *__pyx_v_argdef = NULL;
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_c = NULL;
PyObject *__pyx_v_prefix = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
Py_ssize_t __pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
int __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("parse_definition", 0);
/* "jnius/jnius_utils.pxi":20
* cdef parse_definition(definition):
* # not a function, just a field
* if definition[0] != '(': # <<<<<<<<<<<<<<
* return definition, None
*
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__3, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 20, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":21
* # not a function, just a field
* if definition[0] != '(':
* return definition, None # <<<<<<<<<<<<<<
*
* # it's a function!
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_definition);
__Pyx_GIVEREF(__pyx_v_definition);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_definition);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":20
* cdef parse_definition(definition):
* # not a function, just a field
* if definition[0] != '(': # <<<<<<<<<<<<<<
* return definition, None
*
*/
}
/* "jnius/jnius_utils.pxi":24
*
* # it's a function!
* argdef, ret = definition[1:].split(')') # <<<<<<<<<<<<<<
* args = []
*
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(2, 24, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(2, 24, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(2, 24, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__pyx_v_argdef = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_ret = __pyx_t_4;
__pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":25
* # it's a function!
* argdef, ret = definition[1:].split(')')
* args = [] # <<<<<<<<<<<<<<
*
* while len(argdef):
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":27
* args = []
*
* while len(argdef): # <<<<<<<<<<<<<<
* c = argdef[0]
*
*/
while (1) {
__pyx_t_7 = PyObject_Length(__pyx_v_argdef); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 27, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_7 != 0);
if (!__pyx_t_2) break;
/* "jnius/jnius_utils.pxi":28
*
* while len(argdef):
* c = argdef[0] # <<<<<<<<<<<<<<
*
* # read the array char(s)
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_argdef, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 28, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":31
*
* # read the array char(s)
* prefix = '' # <<<<<<<<<<<<<<
* while c == '[':
* prefix += c
*/
__Pyx_INCREF(__pyx_kp_s__7);
__Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_kp_s__7);
/* "jnius/jnius_utils.pxi":32
* # read the array char(s)
* prefix = ''
* while c == '[': # <<<<<<<<<<<<<<
* prefix += c
* argdef = argdef[1:]
*/
while (1) {
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_c, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 32, __pyx_L1_error)
if (!__pyx_t_2) break;
/* "jnius/jnius_utils.pxi":33
* prefix = ''
* while c == '[':
* prefix += c # <<<<<<<<<<<<<<
* argdef = argdef[1:]
* c = argdef[0]
*/
__pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_prefix, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":34
* while c == '[':
* prefix += c
* argdef = argdef[1:] # <<<<<<<<<<<<<<
* c = argdef[0]
*
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_argdef, 1, 0, NULL, NULL, &__pyx_slice__9, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_argdef, __pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":35
* prefix += c
* argdef = argdef[1:]
* c = argdef[0] # <<<<<<<<<<<<<<
*
* # native type
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_argdef, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "jnius/jnius_utils.pxi":38
*
* # native type
* if c in 'ZBCSIJFD': # <<<<<<<<<<<<<<
* args.append(prefix + c)
* argdef = argdef[1:]
*/
__pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_n_s_ZBCSIJFD, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 38, __pyx_L1_error)
__pyx_t_8 = (__pyx_t_2 != 0);
if (__pyx_t_8) {
/* "jnius/jnius_utils.pxi":39
* # native type
* if c in 'ZBCSIJFD':
* args.append(prefix + c) # <<<<<<<<<<<<<<
* argdef = argdef[1:]
* continue
*/
__pyx_t_1 = PyNumber_Add(__pyx_v_prefix, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 39, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":40
* if c in 'ZBCSIJFD':
* args.append(prefix + c)
* argdef = argdef[1:] # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_argdef, 1, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_argdef, __pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":41
* args.append(prefix + c)
* argdef = argdef[1:]
* continue # <<<<<<<<<<<<<<
*
* # java class
*/
goto __pyx_L6_continue;
/* "jnius/jnius_utils.pxi":38
*
* # native type
* if c in 'ZBCSIJFD': # <<<<<<<<<<<<<<
* args.append(prefix + c)
* argdef = argdef[1:]
*/
}
/* "jnius/jnius_utils.pxi":44
*
* # java class
* if c == 'L': # <<<<<<<<<<<<<<
* c, argdef = argdef.split(';', 1)
* args.append(prefix + c + ';')
*/
__pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_c, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(2, 44, __pyx_L1_error)
if (__pyx_t_8) {
/* "jnius/jnius_utils.pxi":45
* # java class
* if c == 'L':
* c, argdef = argdef.split(';', 1) # <<<<<<<<<<<<<<
* args.append(prefix + c + ';')
* continue
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_argdef, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
PyObject* sequence = __pyx_t_4;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(2, 45, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(2, 45, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L13_unpacking_done;
__pyx_L12_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(2, 45, __pyx_L1_error)
__pyx_L13_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_argdef, __pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_utils.pxi":46
* if c == 'L':
* c, argdef = argdef.split(';', 1)
* args.append(prefix + c + ';') # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_t_4 = PyNumber_Add(__pyx_v_prefix, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__11); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 46, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_utils.pxi":47
* c, argdef = argdef.split(';', 1)
* args.append(prefix + c + ';')
* continue # <<<<<<<<<<<<<<
*
* raise Exception('Invalid "{}" character in definition "{}"'.format(
*/
goto __pyx_L6_continue;
/* "jnius/jnius_utils.pxi":44
*
* # java class
* if c == 'L': # <<<<<<<<<<<<<<
* c, argdef = argdef.split(';', 1)
* args.append(prefix + c + ';')
*/
}
/* "jnius/jnius_utils.pxi":49
* continue
*
* raise Exception('Invalid "{}" character in definition "{}"'.format( # <<<<<<<<<<<<<<
* c, definition[1:]))
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_character_in_definition, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "jnius/jnius_utils.pxi":50
*
* raise Exception('Invalid "{}" character in definition "{}"'.format(
* c, definition[1:])) # <<<<<<<<<<<<<<
*
* return ret, tuple(args)
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
__pyx_t_10 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_10 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_c, __pyx_t_1};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_c, __pyx_t_1};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_v_c);
__Pyx_GIVEREF(__pyx_v_c);
PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_c);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":49
* continue
*
* raise Exception('Invalid "{}" character in definition "{}"'.format( # <<<<<<<<<<<<<<
* c, definition[1:]))
*
*/
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 49, __pyx_L1_error)
__pyx_L6_continue:;
}
/* "jnius/jnius_utils.pxi":52
* c, definition[1:]))
*
* return ret, tuple(args) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 52, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 52, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_ret);
__Pyx_GIVEREF(__pyx_v_ret);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ret);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":18
* return d.iteritems()
*
* cdef parse_definition(definition): # <<<<<<<<<<<<<<
* # not a function, just a field
* if definition[0] != '(':
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("jnius.jnius.parse_definition", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_argdef);
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_c);
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_utils.pxi":55
*
*
* cdef void check_exception(JNIEnv *j_env) except *: # <<<<<<<<<<<<<<
* cdef jmethodID toString = NULL
* cdef jmethodID getCause = NULL
*/
static void __pyx_f_5jnius_5jnius_check_exception(JNIEnv *__pyx_v_j_env) {
jmethodID __pyx_v_toString;
jmethodID __pyx_v_getCause;
jmethodID __pyx_v_getStackTrace;
jmethodID __pyx_v_getMessage;
jstring __pyx_v_e_msg;
jthrowable __pyx_v_exc;
jclass __pyx_v_cls_object;
jclass __pyx_v_cls_throwable;
PyObject *__pyx_v_pymsg = NULL;
PyObject *__pyx_v_pystack = NULL;
PyObject *__pyx_v_pyexcclass = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("check_exception", 0);
/* "jnius/jnius_utils.pxi":56
*
* cdef void check_exception(JNIEnv *j_env) except *:
* cdef jmethodID toString = NULL # <<<<<<<<<<<<<<
* cdef jmethodID getCause = NULL
* cdef jmethodID getStackTrace = NULL
*/
__pyx_v_toString = NULL;
/* "jnius/jnius_utils.pxi":57
* cdef void check_exception(JNIEnv *j_env) except *:
* cdef jmethodID toString = NULL
* cdef jmethodID getCause = NULL # <<<<<<<<<<<<<<
* cdef jmethodID getStackTrace = NULL
* cdef jmethodID getMessage = NULL
*/
__pyx_v_getCause = NULL;
/* "jnius/jnius_utils.pxi":58
* cdef jmethodID toString = NULL
* cdef jmethodID getCause = NULL
* cdef jmethodID getStackTrace = NULL # <<<<<<<<<<<<<<
* cdef jmethodID getMessage = NULL
* cdef jstring e_msg
*/
__pyx_v_getStackTrace = NULL;
/* "jnius/jnius_utils.pxi":59
* cdef jmethodID getCause = NULL
* cdef jmethodID getStackTrace = NULL
* cdef jmethodID getMessage = NULL # <<<<<<<<<<<<<<
* cdef jstring e_msg
* cdef jboolean isCopy
*/
__pyx_v_getMessage = NULL;
/* "jnius/jnius_utils.pxi":62
* cdef jstring e_msg
* cdef jboolean isCopy
* cdef jthrowable exc = j_env[0].ExceptionOccurred(j_env) # <<<<<<<<<<<<<<
* cdef jclass cls_object = NULL
* cdef jclass cls_throwable = NULL
*/
__pyx_v_exc = (__pyx_v_j_env[0])->ExceptionOccurred(__pyx_v_j_env);
/* "jnius/jnius_utils.pxi":63
* cdef jboolean isCopy
* cdef jthrowable exc = j_env[0].ExceptionOccurred(j_env)
* cdef jclass cls_object = NULL # <<<<<<<<<<<<<<
* cdef jclass cls_throwable = NULL
* if exc:
*/
__pyx_v_cls_object = NULL;
/* "jnius/jnius_utils.pxi":64
* cdef jthrowable exc = j_env[0].ExceptionOccurred(j_env)
* cdef jclass cls_object = NULL
* cdef jclass cls_throwable = NULL # <<<<<<<<<<<<<<
* if exc:
* # ExceptionDescribe always writes to stderr, preventing tidy exception
*/
__pyx_v_cls_throwable = NULL;
/* "jnius/jnius_utils.pxi":65
* cdef jclass cls_object = NULL
* cdef jclass cls_throwable = NULL
* if exc: # <<<<<<<<<<<<<<
* # ExceptionDescribe always writes to stderr, preventing tidy exception
* # handling, so should only be for debugging
*/
__pyx_t_1 = (__pyx_v_exc != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":69
* # handling, so should only be for debugging
* # j_env[0].ExceptionDescribe(j_env)
* j_env[0].ExceptionClear(j_env) # <<<<<<<<<<<<<<
*
* cls_object = j_env[0].FindClass(j_env, "java/lang/Object")
*/
(__pyx_v_j_env[0])->ExceptionClear(__pyx_v_j_env);
/* "jnius/jnius_utils.pxi":71
* j_env[0].ExceptionClear(j_env)
*
* cls_object = j_env[0].FindClass(j_env, "java/lang/Object") # <<<<<<<<<<<<<<
* cls_throwable = j_env[0].FindClass(j_env, "java/lang/Throwable")
*
*/
__pyx_v_cls_object = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Object"));
/* "jnius/jnius_utils.pxi":72
*
* cls_object = j_env[0].FindClass(j_env, "java/lang/Object")
* cls_throwable = j_env[0].FindClass(j_env, "java/lang/Throwable") # <<<<<<<<<<<<<<
*
* toString = j_env[0].GetMethodID(j_env, cls_object, "toString", "()Ljava/lang/String;");
*/
__pyx_v_cls_throwable = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Throwable"));
/* "jnius/jnius_utils.pxi":74
* cls_throwable = j_env[0].FindClass(j_env, "java/lang/Throwable")
*
* toString = j_env[0].GetMethodID(j_env, cls_object, "toString", "()Ljava/lang/String;"); # <<<<<<<<<<<<<<
* getMessage = j_env[0].GetMethodID(j_env, cls_throwable, "getMessage", "()Ljava/lang/String;");
* getCause = j_env[0].GetMethodID(j_env, cls_throwable, "getCause", "()Ljava/lang/Throwable;");
*/
__pyx_v_toString = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_cls_object, ((char const *)"toString"), ((char const *)"()Ljava/lang/String;"));
/* "jnius/jnius_utils.pxi":75
*
* toString = j_env[0].GetMethodID(j_env, cls_object, "toString", "()Ljava/lang/String;");
* getMessage = j_env[0].GetMethodID(j_env, cls_throwable, "getMessage", "()Ljava/lang/String;"); # <<<<<<<<<<<<<<
* getCause = j_env[0].GetMethodID(j_env, cls_throwable, "getCause", "()Ljava/lang/Throwable;");
* getStackTrace = j_env[0].GetMethodID(j_env, cls_throwable, "getStackTrace", "()[Ljava/lang/StackTraceElement;");
*/
__pyx_v_getMessage = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_cls_throwable, ((char const *)"getMessage"), ((char const *)"()Ljava/lang/String;"));
/* "jnius/jnius_utils.pxi":76
* toString = j_env[0].GetMethodID(j_env, cls_object, "toString", "()Ljava/lang/String;");
* getMessage = j_env[0].GetMethodID(j_env, cls_throwable, "getMessage", "()Ljava/lang/String;");
* getCause = j_env[0].GetMethodID(j_env, cls_throwable, "getCause", "()Ljava/lang/Throwable;"); # <<<<<<<<<<<<<<
* getStackTrace = j_env[0].GetMethodID(j_env, cls_throwable, "getStackTrace", "()[Ljava/lang/StackTraceElement;");
*
*/
__pyx_v_getCause = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_cls_throwable, ((char const *)"getCause"), ((char const *)"()Ljava/lang/Throwable;"));
/* "jnius/jnius_utils.pxi":77
* getMessage = j_env[0].GetMethodID(j_env, cls_throwable, "getMessage", "()Ljava/lang/String;");
* getCause = j_env[0].GetMethodID(j_env, cls_throwable, "getCause", "()Ljava/lang/Throwable;");
* getStackTrace = j_env[0].GetMethodID(j_env, cls_throwable, "getStackTrace", "()[Ljava/lang/StackTraceElement;"); # <<<<<<<<<<<<<<
*
* e_msg = j_env[0].CallObjectMethod(j_env, exc, getMessage);
*/
__pyx_v_getStackTrace = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_cls_throwable, ((char const *)"getStackTrace"), ((char const *)"()[Ljava/lang/StackTraceElement;"));
/* "jnius/jnius_utils.pxi":79
* getStackTrace = j_env[0].GetMethodID(j_env, cls_throwable, "getStackTrace", "()[Ljava/lang/StackTraceElement;");
*
* e_msg = j_env[0].CallObjectMethod(j_env, exc, getMessage); # <<<<<<<<<<<<<<
* pymsg = None if e_msg == NULL else convert_jstring_to_python(j_env, e_msg)
*
*/
__pyx_v_e_msg = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_exc, __pyx_v_getMessage);
/* "jnius/jnius_utils.pxi":80
*
* e_msg = j_env[0].CallObjectMethod(j_env, exc, getMessage);
* pymsg = None if e_msg == NULL else convert_jstring_to_python(j_env, e_msg) # <<<<<<<<<<<<<<
*
* pystack = []
*/
if (((__pyx_v_e_msg == NULL) != 0)) {
__Pyx_INCREF(Py_None);
__pyx_t_2 = Py_None;
} else {
__pyx_t_3 = __pyx_f_5jnius_5jnius_convert_jstring_to_python(__pyx_v_j_env, __pyx_v_e_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_t_3;
__pyx_t_3 = 0;
}
__pyx_v_pymsg = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_utils.pxi":82
* pymsg = None if e_msg == NULL else convert_jstring_to_python(j_env, e_msg)
*
* pystack = [] # <<<<<<<<<<<<<<
* _append_exception_trace_messages(j_env, pystack, exc, getCause, getStackTrace, toString)
*
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_pystack = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_utils.pxi":83
*
* pystack = []
* _append_exception_trace_messages(j_env, pystack, exc, getCause, getStackTrace, toString) # <<<<<<<<<<<<<<
*
* pyexcclass = lookup_java_object_name(j_env, exc).replace('/', '.')
*/
__pyx_f_5jnius_5jnius__append_exception_trace_messages(__pyx_v_j_env, __pyx_v_pystack, __pyx_v_exc, __pyx_v_getCause, __pyx_v_getStackTrace, __pyx_v_toString);
/* "jnius/jnius_utils.pxi":85
* _append_exception_trace_messages(j_env, pystack, exc, getCause, getStackTrace, toString)
*
* pyexcclass = lookup_java_object_name(j_env, exc).replace('/', '.') # <<<<<<<<<<<<<<
*
* j_env[0].DeleteLocalRef(j_env, cls_object)
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_lookup_java_object_name(__pyx_v_j_env, __pyx_v_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pyexcclass = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_utils.pxi":87
* pyexcclass = lookup_java_object_name(j_env, exc).replace('/', '.')
*
* j_env[0].DeleteLocalRef(j_env, cls_object) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, cls_throwable)
* if e_msg != NULL:
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_cls_object);
/* "jnius/jnius_utils.pxi":88
*
* j_env[0].DeleteLocalRef(j_env, cls_object)
* j_env[0].DeleteLocalRef(j_env, cls_throwable) # <<<<<<<<<<<<<<
* if e_msg != NULL:
* j_env[0].DeleteLocalRef(j_env, e_msg)
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_cls_throwable);
/* "jnius/jnius_utils.pxi":89
* j_env[0].DeleteLocalRef(j_env, cls_object)
* j_env[0].DeleteLocalRef(j_env, cls_throwable)
* if e_msg != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, e_msg)
* j_env[0].DeleteLocalRef(j_env, exc)
*/
__pyx_t_1 = ((__pyx_v_e_msg != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":90
* j_env[0].DeleteLocalRef(j_env, cls_throwable)
* if e_msg != NULL:
* j_env[0].DeleteLocalRef(j_env, e_msg) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, exc)
*
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_e_msg);
/* "jnius/jnius_utils.pxi":89
* j_env[0].DeleteLocalRef(j_env, cls_object)
* j_env[0].DeleteLocalRef(j_env, cls_throwable)
* if e_msg != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, e_msg)
* j_env[0].DeleteLocalRef(j_env, exc)
*/
}
/* "jnius/jnius_utils.pxi":91
* if e_msg != NULL:
* j_env[0].DeleteLocalRef(j_env, e_msg)
* j_env[0].DeleteLocalRef(j_env, exc) # <<<<<<<<<<<<<<
*
* raise JavaException('JVM exception occurred: %s' % (pymsg if pymsg is not None else pyexcclass), pyexcclass, pymsg, pystack)
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_exc);
/* "jnius/jnius_utils.pxi":93
* j_env[0].DeleteLocalRef(j_env, exc)
*
* raise JavaException('JVM exception occurred: %s' % (pymsg if pymsg is not None else pyexcclass), pyexcclass, pymsg, pystack) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = (__pyx_v_pymsg != Py_None);
if ((__pyx_t_1 != 0)) {
__Pyx_INCREF(__pyx_v_pymsg);
__pyx_t_4 = __pyx_v_pymsg;
} else {
__Pyx_INCREF(__pyx_v_pyexcclass);
__pyx_t_4 = __pyx_v_pyexcclass;
}
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_JVM_exception_occurred_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_5, __pyx_v_pyexcclass, __pyx_v_pymsg, __pyx_v_pystack};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_5, __pyx_v_pyexcclass, __pyx_v_pymsg, __pyx_v_pystack};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
__Pyx_INCREF(__pyx_v_pyexcclass);
__Pyx_GIVEREF(__pyx_v_pyexcclass);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_pyexcclass);
__Pyx_INCREF(__pyx_v_pymsg);
__Pyx_GIVEREF(__pyx_v_pymsg);
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_pymsg);
__Pyx_INCREF(__pyx_v_pystack);
__Pyx_GIVEREF(__pyx_v_pystack);
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_pystack);
__pyx_t_5 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 93, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":65
* cdef jclass cls_object = NULL
* cdef jclass cls_throwable = NULL
* if exc: # <<<<<<<<<<<<<<
* # ExceptionDescribe always writes to stderr, preventing tidy exception
* # handling, so should only be for debugging
*/
}
/* "jnius/jnius_utils.pxi":55
*
*
* cdef void check_exception(JNIEnv *j_env) except *: # <<<<<<<<<<<<<<
* cdef jmethodID toString = NULL
* cdef jmethodID getCause = NULL
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("jnius.jnius.check_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pymsg);
__Pyx_XDECREF(__pyx_v_pystack);
__Pyx_XDECREF(__pyx_v_pyexcclass);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_utils.pxi":96
*
*
* cdef void _append_exception_trace_messages( # <<<<<<<<<<<<<<
* JNIEnv* j_env,
* list pystack,
*/
static void __pyx_f_5jnius_5jnius__append_exception_trace_messages(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_pystack, jthrowable __pyx_v_exc, jmethodID __pyx_v_mid_getCause, jmethodID __pyx_v_mid_getStackTrace, jmethodID __pyx_v_mid_toString) {
jobjectArray __pyx_v_frames;
jsize __pyx_v_frames_length;
jstring __pyx_v_msg_obj;
jobject __pyx_v_frame;
jthrowable __pyx_v_cause;
PyObject *__pyx_v_pystr = NULL;
jsize __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
jsize __pyx_t_6;
jsize __pyx_t_7;
__Pyx_RefNannySetupContext("_append_exception_trace_messages", 0);
/* "jnius/jnius_utils.pxi":105
*
* # Get the array of StackTraceElements.
* cdef jobjectArray frames = j_env[0].CallObjectMethod(j_env, exc, mid_getStackTrace) # <<<<<<<<<<<<<<
* cdef jsize frames_length = j_env[0].GetArrayLength(j_env, frames)
* cdef jstring msg_obj
*/
__pyx_v_frames = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_exc, __pyx_v_mid_getStackTrace);
/* "jnius/jnius_utils.pxi":106
* # Get the array of StackTraceElements.
* cdef jobjectArray frames = j_env[0].CallObjectMethod(j_env, exc, mid_getStackTrace)
* cdef jsize frames_length = j_env[0].GetArrayLength(j_env, frames) # <<<<<<<<<<<<<<
* cdef jstring msg_obj
* cdef jobject frame
*/
__pyx_v_frames_length = (__pyx_v_j_env[0])->GetArrayLength(__pyx_v_j_env, __pyx_v_frames);
/* "jnius/jnius_utils.pxi":112
*
* # Add Throwable.toString() before descending stack trace messages.
* if frames != NULL: # <<<<<<<<<<<<<<
* msg_obj = j_env[0].CallObjectMethod(j_env, exc, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
*/
__pyx_t_1 = ((__pyx_v_frames != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":113
* # Add Throwable.toString() before descending stack trace messages.
* if frames != NULL:
* msg_obj = j_env[0].CallObjectMethod(j_env, exc, mid_toString) # <<<<<<<<<<<<<<
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* # If this is not the top-of-the-trace then this is a cause.
*/
__pyx_v_msg_obj = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_exc, __pyx_v_mid_toString);
/* "jnius/jnius_utils.pxi":114
* if frames != NULL:
* msg_obj = j_env[0].CallObjectMethod(j_env, exc, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj) # <<<<<<<<<<<<<<
* # If this is not the top-of-the-trace then this is a cause.
* if len(pystack) > 0:
*/
if (((__pyx_v_msg_obj == NULL) != 0)) {
__Pyx_INCREF(Py_None);
__pyx_t_2 = Py_None;
} else {
__pyx_t_3 = __pyx_f_5jnius_5jnius_convert_jobject_to_python(__pyx_v_j_env, __pyx_kp_s_Ljava_lang_String, __pyx_v_msg_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_t_3;
__pyx_t_3 = 0;
}
__pyx_v_pystr = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_utils.pxi":116
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* # If this is not the top-of-the-trace then this is a cause.
* if len(pystack) > 0: # <<<<<<<<<<<<<<
* pystack.append("Caused by:")
* pystack.append(pystr)
*/
if (unlikely(__pyx_v_pystack == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(2, 116, __pyx_L1_error)
}
__pyx_t_4 = PyList_GET_SIZE(__pyx_v_pystack); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 116, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_4 > 0) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":117
* # If this is not the top-of-the-trace then this is a cause.
* if len(pystack) > 0:
* pystack.append("Caused by:") # <<<<<<<<<<<<<<
* pystack.append(pystr)
* if msg_obj != NULL:
*/
if (unlikely(__pyx_v_pystack == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
__PYX_ERR(2, 117, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pystack, __pyx_kp_s_Caused_by); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 117, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":116
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* # If this is not the top-of-the-trace then this is a cause.
* if len(pystack) > 0: # <<<<<<<<<<<<<<
* pystack.append("Caused by:")
* pystack.append(pystr)
*/
}
/* "jnius/jnius_utils.pxi":118
* if len(pystack) > 0:
* pystack.append("Caused by:")
* pystack.append(pystr) # <<<<<<<<<<<<<<
* if msg_obj != NULL:
* j_env[0].DeleteLocalRef(j_env, msg_obj)
*/
if (unlikely(__pyx_v_pystack == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
__PYX_ERR(2, 118, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pystack, __pyx_v_pystr); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 118, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":119
* pystack.append("Caused by:")
* pystack.append(pystr)
* if msg_obj != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, msg_obj)
*
*/
__pyx_t_1 = ((__pyx_v_msg_obj != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":120
* pystack.append(pystr)
* if msg_obj != NULL:
* j_env[0].DeleteLocalRef(j_env, msg_obj) # <<<<<<<<<<<<<<
*
* # Append stack trace messages if there are any.
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_msg_obj);
/* "jnius/jnius_utils.pxi":119
* pystack.append("Caused by:")
* pystack.append(pystr)
* if msg_obj != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, msg_obj)
*
*/
}
/* "jnius/jnius_utils.pxi":112
*
* # Add Throwable.toString() before descending stack trace messages.
* if frames != NULL: # <<<<<<<<<<<<<<
* msg_obj = j_env[0].CallObjectMethod(j_env, exc, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
*/
}
/* "jnius/jnius_utils.pxi":123
*
* # Append stack trace messages if there are any.
* if frames_length > 0: # <<<<<<<<<<<<<<
* for i in range(frames_length):
* # Get the string returned from the 'toString()' method of the next frame and append it to the error message.
*/
__pyx_t_1 = ((__pyx_v_frames_length > 0) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":124
* # Append stack trace messages if there are any.
* if frames_length > 0:
* for i in range(frames_length): # <<<<<<<<<<<<<<
* # Get the string returned from the 'toString()' method of the next frame and append it to the error message.
* frame = j_env[0].GetObjectArrayElement(j_env, frames, i)
*/
__pyx_t_6 = __pyx_v_frames_length;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_v_i = __pyx_t_7;
/* "jnius/jnius_utils.pxi":126
* for i in range(frames_length):
* # Get the string returned from the 'toString()' method of the next frame and append it to the error message.
* frame = j_env[0].GetObjectArrayElement(j_env, frames, i) # <<<<<<<<<<<<<<
* msg_obj = j_env[0].CallObjectMethod(j_env, frame, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
*/
__pyx_v_frame = (__pyx_v_j_env[0])->GetObjectArrayElement(__pyx_v_j_env, __pyx_v_frames, __pyx_v_i);
/* "jnius/jnius_utils.pxi":127
* # Get the string returned from the 'toString()' method of the next frame and append it to the error message.
* frame = j_env[0].GetObjectArrayElement(j_env, frames, i)
* msg_obj = j_env[0].CallObjectMethod(j_env, frame, mid_toString) # <<<<<<<<<<<<<<
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* pystack.append(pystr)
*/
__pyx_v_msg_obj = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_frame, __pyx_v_mid_toString);
/* "jnius/jnius_utils.pxi":128
* frame = j_env[0].GetObjectArrayElement(j_env, frames, i)
* msg_obj = j_env[0].CallObjectMethod(j_env, frame, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj) # <<<<<<<<<<<<<<
* pystack.append(pystr)
* if msg_obj != NULL:
*/
if (((__pyx_v_msg_obj == NULL) != 0)) {
__Pyx_INCREF(Py_None);
__pyx_t_2 = Py_None;
} else {
__pyx_t_3 = __pyx_f_5jnius_5jnius_convert_jobject_to_python(__pyx_v_j_env, __pyx_kp_s_Ljava_lang_String, __pyx_v_msg_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_t_3;
__pyx_t_3 = 0;
}
__Pyx_XDECREF_SET(__pyx_v_pystr, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_utils.pxi":129
* msg_obj = j_env[0].CallObjectMethod(j_env, frame, mid_toString)
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* pystack.append(pystr) # <<<<<<<<<<<<<<
* if msg_obj != NULL:
* j_env[0].DeleteLocalRef(j_env, msg_obj)
*/
if (unlikely(__pyx_v_pystack == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
__PYX_ERR(2, 129, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pystack, __pyx_v_pystr); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 129, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":130
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* pystack.append(pystr)
* if msg_obj != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, msg_obj)
* j_env[0].DeleteLocalRef(j_env, frame)
*/
__pyx_t_1 = ((__pyx_v_msg_obj != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":131
* pystack.append(pystr)
* if msg_obj != NULL:
* j_env[0].DeleteLocalRef(j_env, msg_obj) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, frame)
*
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_msg_obj);
/* "jnius/jnius_utils.pxi":130
* pystr = None if msg_obj == NULL else convert_jobject_to_python(j_env, <bytes> 'Ljava/lang/String;', msg_obj)
* pystack.append(pystr)
* if msg_obj != NULL: # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, msg_obj)
* j_env[0].DeleteLocalRef(j_env, frame)
*/
}
/* "jnius/jnius_utils.pxi":132
* if msg_obj != NULL:
* j_env[0].DeleteLocalRef(j_env, msg_obj)
* j_env[0].DeleteLocalRef(j_env, frame) # <<<<<<<<<<<<<<
*
* # If 'exc' has a cause then append the stack trace messages from the cause.
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_frame);
}
/* "jnius/jnius_utils.pxi":123
*
* # Append stack trace messages if there are any.
* if frames_length > 0: # <<<<<<<<<<<<<<
* for i in range(frames_length):
* # Get the string returned from the 'toString()' method of the next frame and append it to the error message.
*/
}
/* "jnius/jnius_utils.pxi":135
*
* # If 'exc' has a cause then append the stack trace messages from the cause.
* if frames != NULL: # <<<<<<<<<<<<<<
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause)
* if cause != NULL:
*/
__pyx_t_1 = ((__pyx_v_frames != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":136
* # If 'exc' has a cause then append the stack trace messages from the cause.
* if frames != NULL:
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause) # <<<<<<<<<<<<<<
* if cause != NULL:
* _append_exception_trace_messages(j_env, pystack, cause,
*/
__pyx_v_cause = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_exc, __pyx_v_mid_getCause);
/* "jnius/jnius_utils.pxi":137
* if frames != NULL:
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause)
* if cause != NULL: # <<<<<<<<<<<<<<
* _append_exception_trace_messages(j_env, pystack, cause,
* mid_getCause, mid_getStackTrace, mid_toString)
*/
__pyx_t_1 = ((__pyx_v_cause != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":138
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause)
* if cause != NULL:
* _append_exception_trace_messages(j_env, pystack, cause, # <<<<<<<<<<<<<<
* mid_getCause, mid_getStackTrace, mid_toString)
* j_env[0].DeleteLocalRef(j_env, cause)
*/
__pyx_f_5jnius_5jnius__append_exception_trace_messages(__pyx_v_j_env, __pyx_v_pystack, __pyx_v_cause, __pyx_v_mid_getCause, __pyx_v_mid_getStackTrace, __pyx_v_mid_toString);
/* "jnius/jnius_utils.pxi":140
* _append_exception_trace_messages(j_env, pystack, cause,
* mid_getCause, mid_getStackTrace, mid_toString)
* j_env[0].DeleteLocalRef(j_env, cause) # <<<<<<<<<<<<<<
*
* j_env[0].DeleteLocalRef(j_env, frames)
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_cause);
/* "jnius/jnius_utils.pxi":137
* if frames != NULL:
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause)
* if cause != NULL: # <<<<<<<<<<<<<<
* _append_exception_trace_messages(j_env, pystack, cause,
* mid_getCause, mid_getStackTrace, mid_toString)
*/
}
/* "jnius/jnius_utils.pxi":135
*
* # If 'exc' has a cause then append the stack trace messages from the cause.
* if frames != NULL: # <<<<<<<<<<<<<<
* cause = j_env[0].CallObjectMethod(j_env, exc, mid_getCause)
* if cause != NULL:
*/
}
/* "jnius/jnius_utils.pxi":142
* j_env[0].DeleteLocalRef(j_env, cause)
*
* j_env[0].DeleteLocalRef(j_env, frames) # <<<<<<<<<<<<<<
*
*
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_frames);
/* "jnius/jnius_utils.pxi":96
*
*
* cdef void _append_exception_trace_messages( # <<<<<<<<<<<<<<
* JNIEnv* j_env,
* list pystack,
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_WriteUnraisable("jnius.jnius._append_exception_trace_messages", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pystr);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_utils.pxi":147
* cdef dict assignable_from = {}
* cdef int assignable_from_order = 0
* cdef void check_assignable_from(JNIEnv *env, JavaClass jc, signature) except *: # <<<<<<<<<<<<<<
* global assignable_from_order
* cdef jclass cls, clsA, clsB
*/
static void __pyx_f_5jnius_5jnius_check_assignable_from(JNIEnv *__pyx_v_env, struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc, PyObject *__pyx_v_signature) {
jclass __pyx_v_cls;
jclass __pyx_v_clsA;
jclass __pyx_v_clsB;
jthrowable __pyx_v_exc;
PyObject *__pyx_v_result = NULL;
PyObject *__pyx_v_s = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
char *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("check_assignable_from", 0);
/* "jnius/jnius_utils.pxi":156
* # Ref: https://github.com/kivy/pyjnius/issues/92
* # Google Bug: https://android.googlesource.com/platform/art/+/1268b74%5E!/
* if assignable_from_order == 0: # <<<<<<<<<<<<<<
* clsA = env[0].FindClass(env, "java/lang/String")
* clsB = env[0].FindClass(env, "java/lang/Object")
*/
__pyx_t_1 = ((__pyx_v_5jnius_5jnius_assignable_from_order == 0) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":157
* # Google Bug: https://android.googlesource.com/platform/art/+/1268b74%5E!/
* if assignable_from_order == 0:
* clsA = env[0].FindClass(env, "java/lang/String") # <<<<<<<<<<<<<<
* clsB = env[0].FindClass(env, "java/lang/Object")
* if env[0].IsAssignableFrom(env, clsB, clsA):
*/
__pyx_v_clsA = (__pyx_v_env[0])->FindClass(__pyx_v_env, ((char *)"java/lang/String"));
/* "jnius/jnius_utils.pxi":158
* if assignable_from_order == 0:
* clsA = env[0].FindClass(env, "java/lang/String")
* clsB = env[0].FindClass(env, "java/lang/Object") # <<<<<<<<<<<<<<
* if env[0].IsAssignableFrom(env, clsB, clsA):
* # Bug triggered, IsAssignableFrom said we can do things like:
*/
__pyx_v_clsB = (__pyx_v_env[0])->FindClass(__pyx_v_env, ((char *)"java/lang/Object"));
/* "jnius/jnius_utils.pxi":159
* clsA = env[0].FindClass(env, "java/lang/String")
* clsB = env[0].FindClass(env, "java/lang/Object")
* if env[0].IsAssignableFrom(env, clsB, clsA): # <<<<<<<<<<<<<<
* # Bug triggered, IsAssignableFrom said we can do things like:
* # String a = Object()
*/
__pyx_t_1 = ((__pyx_v_env[0])->IsAssignableFrom(__pyx_v_env, __pyx_v_clsB, __pyx_v_clsA) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":162
* # Bug triggered, IsAssignableFrom said we can do things like:
* # String a = Object()
* assignable_from_order = -1 # <<<<<<<<<<<<<<
* else:
* assignable_from_order = 1
*/
__pyx_v_5jnius_5jnius_assignable_from_order = -1;
/* "jnius/jnius_utils.pxi":159
* clsA = env[0].FindClass(env, "java/lang/String")
* clsB = env[0].FindClass(env, "java/lang/Object")
* if env[0].IsAssignableFrom(env, clsB, clsA): # <<<<<<<<<<<<<<
* # Bug triggered, IsAssignableFrom said we can do things like:
* # String a = Object()
*/
goto __pyx_L4;
}
/* "jnius/jnius_utils.pxi":164
* assignable_from_order = -1
* else:
* assignable_from_order = 1 # <<<<<<<<<<<<<<
*
* # if we have a JavaObject, it's always ok.
*/
/*else*/ {
__pyx_v_5jnius_5jnius_assignable_from_order = 1;
}
__pyx_L4:;
/* "jnius/jnius_utils.pxi":156
* # Ref: https://github.com/kivy/pyjnius/issues/92
* # Google Bug: https://android.googlesource.com/platform/art/+/1268b74%5E!/
* if assignable_from_order == 0: # <<<<<<<<<<<<<<
* clsA = env[0].FindClass(env, "java/lang/String")
* clsB = env[0].FindClass(env, "java/lang/Object")
*/
}
/* "jnius/jnius_utils.pxi":167
*
* # if we have a JavaObject, it's always ok.
* if signature == 'java/lang/Object': # <<<<<<<<<<<<<<
* return
*
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s_java_lang_Object, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 167, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":168
* # if we have a JavaObject, it's always ok.
* if signature == 'java/lang/Object':
* return # <<<<<<<<<<<<<<
*
* # FIXME Android/libART specific check
*/
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":167
*
* # if we have a JavaObject, it's always ok.
* if signature == 'java/lang/Object': # <<<<<<<<<<<<<<
* return
*
*/
}
/* "jnius/jnius_utils.pxi":174
* # org/jnius/NativeInvocationHandler java/lang/reflect/InvocationHandler
* # Because we know it's ok, just return here.
* if signature == 'java/lang/reflect/InvocationHandler' and \ # <<<<<<<<<<<<<<
* jc.__javaclass__ == 'org/jnius/NativeInvocationHandler':
* return
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s_java_lang_reflect_InvocationHand, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 174, __pyx_L1_error)
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
/* "jnius/jnius_utils.pxi":175
* # Because we know it's ok, just return here.
* if signature == 'java/lang/reflect/InvocationHandler' and \
* jc.__javaclass__ == 'org/jnius/NativeInvocationHandler': # <<<<<<<<<<<<<<
* return
*
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s_org_jnius_NativeInvocationHandle, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
/* "jnius/jnius_utils.pxi":174
* # org/jnius/NativeInvocationHandler java/lang/reflect/InvocationHandler
* # Because we know it's ok, just return here.
* if signature == 'java/lang/reflect/InvocationHandler' and \ # <<<<<<<<<<<<<<
* jc.__javaclass__ == 'org/jnius/NativeInvocationHandler':
* return
*/
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":176
* if signature == 'java/lang/reflect/InvocationHandler' and \
* jc.__javaclass__ == 'org/jnius/NativeInvocationHandler':
* return # <<<<<<<<<<<<<<
*
* # if the signature is a direct match, it's ok too :)
*/
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":174
* # org/jnius/NativeInvocationHandler java/lang/reflect/InvocationHandler
* # Because we know it's ok, just return here.
* if signature == 'java/lang/reflect/InvocationHandler' and \ # <<<<<<<<<<<<<<
* jc.__javaclass__ == 'org/jnius/NativeInvocationHandler':
* return
*/
}
/* "jnius/jnius_utils.pxi":179
*
* # if the signature is a direct match, it's ok too :)
* if jc.__javaclass__ == signature: # <<<<<<<<<<<<<<
* return
*
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_signature, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 179, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 179, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":180
* # if the signature is a direct match, it's ok too :)
* if jc.__javaclass__ == signature:
* return # <<<<<<<<<<<<<<
*
* # if we already did the test before, use the cache result!
*/
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":179
*
* # if the signature is a direct match, it's ok too :)
* if jc.__javaclass__ == signature: # <<<<<<<<<<<<<<
* return
*
*/
}
/* "jnius/jnius_utils.pxi":183
*
* # if we already did the test before, use the cache result!
* result = assignable_from.get((jc.__javaclass__, signature), None) # <<<<<<<<<<<<<<
* if result is None:
*
*/
if (unlikely(__pyx_v_5jnius_5jnius_assignable_from == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
__PYX_ERR(2, 183, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_INCREF(__pyx_v_signature);
__Pyx_GIVEREF(__pyx_v_signature);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_signature);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_5jnius_5jnius_assignable_from, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_result = __pyx_t_4;
__pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":184
* # if we already did the test before, use the cache result!
* result = assignable_from.get((jc.__javaclass__, signature), None)
* if result is None: # <<<<<<<<<<<<<<
*
* # we got an object that doesn't match with the signature
*/
__pyx_t_1 = (__pyx_v_result == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":188
* # we got an object that doesn't match with the signature
* # check if we can use it.
* s = str_for_c(signature) # <<<<<<<<<<<<<<
* cls = env[0].FindClass(env, s)
* if cls == NULL:
*/
__pyx_t_4 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_s = __pyx_t_4;
__pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":189
* # check if we can use it.
* s = str_for_c(signature)
* cls = env[0].FindClass(env, s) # <<<<<<<<<<<<<<
* if cls == NULL:
* raise JavaException('Unable to found the class for {0!r}'.format(
*/
__pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(2, 189, __pyx_L1_error)
__pyx_v_cls = (__pyx_v_env[0])->FindClass(__pyx_v_env, __pyx_t_5);
/* "jnius/jnius_utils.pxi":190
* s = str_for_c(signature)
* cls = env[0].FindClass(env, s)
* if cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the class for {0!r}'.format(
* signature))
*/
__pyx_t_2 = ((__pyx_v_cls == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":191
* cls = env[0].FindClass(env, s)
* if cls == NULL:
* raise JavaException('Unable to found the class for {0!r}'.format( # <<<<<<<<<<<<<<
* signature))
*
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_found_the_class_for_0, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
/* "jnius/jnius_utils.pxi":192
* if cls == NULL:
* raise JavaException('Unable to found the class for {0!r}'.format(
* signature)) # <<<<<<<<<<<<<<
*
* if assignable_from_order == 1:
*/
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
if (!__pyx_t_8) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_signature); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_signature};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_signature};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_v_signature);
__Pyx_GIVEREF(__pyx_v_signature);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_signature);
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_7) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(2, 191, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":190
* s = str_for_c(signature)
* cls = env[0].FindClass(env, s)
* if cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the class for {0!r}'.format(
* signature))
*/
}
/* "jnius/jnius_utils.pxi":194
* signature))
*
* if assignable_from_order == 1: # <<<<<<<<<<<<<<
* result = bool(env[0].IsAssignableFrom(env, jc.j_cls, cls))
* else:
*/
__pyx_t_2 = ((__pyx_v_5jnius_5jnius_assignable_from_order == 1) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":195
*
* if assignable_from_order == 1:
* result = bool(env[0].IsAssignableFrom(env, jc.j_cls, cls)) # <<<<<<<<<<<<<<
* else:
* result = bool(env[0].IsAssignableFrom(env, cls, jc.j_cls))
*/
__pyx_t_4 = __Pyx_PyInt_From_jboolean((__pyx_v_env[0])->IsAssignableFrom(__pyx_v_env, __pyx_v_jc->j_cls, __pyx_v_cls)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 195, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":194
* signature))
*
* if assignable_from_order == 1: # <<<<<<<<<<<<<<
* result = bool(env[0].IsAssignableFrom(env, jc.j_cls, cls))
* else:
*/
goto __pyx_L12;
}
/* "jnius/jnius_utils.pxi":197
* result = bool(env[0].IsAssignableFrom(env, jc.j_cls, cls))
* else:
* result = bool(env[0].IsAssignableFrom(env, cls, jc.j_cls)) # <<<<<<<<<<<<<<
*
* exc = env[0].ExceptionOccurred(env)
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyInt_From_jboolean((__pyx_v_env[0])->IsAssignableFrom(__pyx_v_env, __pyx_v_cls, __pyx_v_jc->j_cls)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L12:;
/* "jnius/jnius_utils.pxi":199
* result = bool(env[0].IsAssignableFrom(env, cls, jc.j_cls))
*
* exc = env[0].ExceptionOccurred(env) # <<<<<<<<<<<<<<
* if exc:
* env[0].ExceptionDescribe(env)
*/
__pyx_v_exc = (__pyx_v_env[0])->ExceptionOccurred(__pyx_v_env);
/* "jnius/jnius_utils.pxi":200
*
* exc = env[0].ExceptionOccurred(env)
* if exc: # <<<<<<<<<<<<<<
* env[0].ExceptionDescribe(env)
* env[0].ExceptionClear(env)
*/
__pyx_t_2 = (__pyx_v_exc != 0);
if (__pyx_t_2) {
/* "jnius/jnius_utils.pxi":201
* exc = env[0].ExceptionOccurred(env)
* if exc:
* env[0].ExceptionDescribe(env) # <<<<<<<<<<<<<<
* env[0].ExceptionClear(env)
*
*/
(__pyx_v_env[0])->ExceptionDescribe(__pyx_v_env);
/* "jnius/jnius_utils.pxi":202
* if exc:
* env[0].ExceptionDescribe(env)
* env[0].ExceptionClear(env) # <<<<<<<<<<<<<<
*
* assignable_from[(jc.__javaclass__, signature)] = bool(result)
*/
(__pyx_v_env[0])->ExceptionClear(__pyx_v_env);
/* "jnius/jnius_utils.pxi":200
*
* exc = env[0].ExceptionOccurred(env)
* if exc: # <<<<<<<<<<<<<<
* env[0].ExceptionDescribe(env)
* env[0].ExceptionClear(env)
*/
}
/* "jnius/jnius_utils.pxi":204
* env[0].ExceptionClear(env)
*
* assignable_from[(jc.__javaclass__, signature)] = bool(result) # <<<<<<<<<<<<<<
*
* if result is False:
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 204, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__pyx_v_5jnius_5jnius_assignable_from == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(2, 204, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
__Pyx_INCREF(__pyx_v_signature);
__Pyx_GIVEREF(__pyx_v_signature);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_signature);
__pyx_t_3 = 0;
if (unlikely(PyDict_SetItem(__pyx_v_5jnius_5jnius_assignable_from, __pyx_t_9, __pyx_t_4) < 0)) __PYX_ERR(2, 204, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "jnius/jnius_utils.pxi":184
* # if we already did the test before, use the cache result!
* result = assignable_from.get((jc.__javaclass__, signature), None)
* if result is None: # <<<<<<<<<<<<<<
*
* # we got an object that doesn't match with the signature
*/
}
/* "jnius/jnius_utils.pxi":206
* assignable_from[(jc.__javaclass__, signature)] = bool(result)
*
* if result is False: # <<<<<<<<<<<<<<
* raise JavaException('Invalid instance of {0!r} passed for a {1!r}'.format(
* jc.__javaclass__, signature))
*/
__pyx_t_2 = (__pyx_v_result == Py_False);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":207
*
* if result is False:
* raise JavaException('Invalid instance of {0!r} passed for a {1!r}'.format( # <<<<<<<<<<<<<<
* jc.__javaclass__, signature))
*
*/
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_instance_of_0_r_passed_f, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
/* "jnius/jnius_utils.pxi":208
* if result is False:
* raise JavaException('Invalid instance of {0!r} passed for a {1!r}'.format(
* jc.__javaclass__, signature)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
__pyx_t_10 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_10 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_signature};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_signature};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
}
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
__Pyx_INCREF(__pyx_v_signature);
__Pyx_GIVEREF(__pyx_v_signature);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_signature);
__pyx_t_7 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
}
}
if (!__pyx_t_6) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(2, 207, __pyx_L1_error)
/* "jnius/jnius_utils.pxi":206
* assignable_from[(jc.__javaclass__, signature)] = bool(result)
*
* if result is False: # <<<<<<<<<<<<<<
* raise JavaException('Invalid instance of {0!r} passed for a {1!r}'.format(
* jc.__javaclass__, signature))
*/
}
/* "jnius/jnius_utils.pxi":147
* cdef dict assignable_from = {}
* cdef int assignable_from_order = 0
* cdef void check_assignable_from(JNIEnv *env, JavaClass jc, signature) except *: # <<<<<<<<<<<<<<
* global assignable_from_order
* cdef jclass cls, clsA, clsB
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("jnius.jnius.check_assignable_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_result);
__Pyx_XDECREF(__pyx_v_s);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_utils.pxi":211
*
*
* cdef lookup_java_object_name(JNIEnv *j_env, jobject j_obj): # <<<<<<<<<<<<<<
* cdef jclass jcls = j_env[0].GetObjectClass(j_env, j_obj)
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls)
*/
static PyObject *__pyx_f_5jnius_5jnius_lookup_java_object_name(JNIEnv *__pyx_v_j_env, jobject __pyx_v_j_obj) {
jclass __pyx_v_jcls;
jclass __pyx_v_jcls2;
jmethodID __pyx_v_jmeth;
jobject __pyx_v_js;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("lookup_java_object_name", 0);
/* "jnius/jnius_utils.pxi":212
*
* cdef lookup_java_object_name(JNIEnv *j_env, jobject j_obj):
* cdef jclass jcls = j_env[0].GetObjectClass(j_env, j_obj) # <<<<<<<<<<<<<<
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls)
* cdef jmethodID jmeth = j_env[0].GetMethodID(j_env, jcls2, 'getName', '()Ljava/lang/String;')
*/
__pyx_v_jcls = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_obj);
/* "jnius/jnius_utils.pxi":213
* cdef lookup_java_object_name(JNIEnv *j_env, jobject j_obj):
* cdef jclass jcls = j_env[0].GetObjectClass(j_env, j_obj)
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls) # <<<<<<<<<<<<<<
* cdef jmethodID jmeth = j_env[0].GetMethodID(j_env, jcls2, 'getName', '()Ljava/lang/String;')
* cdef jobject js = j_env[0].CallObjectMethod(j_env, jcls, jmeth)
*/
__pyx_v_jcls2 = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_jcls);
/* "jnius/jnius_utils.pxi":214
* cdef jclass jcls = j_env[0].GetObjectClass(j_env, j_obj)
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls)
* cdef jmethodID jmeth = j_env[0].GetMethodID(j_env, jcls2, 'getName', '()Ljava/lang/String;') # <<<<<<<<<<<<<<
* cdef jobject js = j_env[0].CallObjectMethod(j_env, jcls, jmeth)
* name = convert_jobject_to_python(j_env, 'Ljava/lang/String;', js)
*/
__pyx_v_jmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_jcls2, ((char const *)"getName"), ((char const *)"()Ljava/lang/String;"));
/* "jnius/jnius_utils.pxi":215
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls)
* cdef jmethodID jmeth = j_env[0].GetMethodID(j_env, jcls2, 'getName', '()Ljava/lang/String;')
* cdef jobject js = j_env[0].CallObjectMethod(j_env, jcls, jmeth) # <<<<<<<<<<<<<<
* name = convert_jobject_to_python(j_env, 'Ljava/lang/String;', js)
* j_env[0].DeleteLocalRef(j_env, js)
*/
__pyx_v_js = (__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_jcls, __pyx_v_jmeth);
/* "jnius/jnius_utils.pxi":216
* cdef jmethodID jmeth = j_env[0].GetMethodID(j_env, jcls2, 'getName', '()Ljava/lang/String;')
* cdef jobject js = j_env[0].CallObjectMethod(j_env, jcls, jmeth)
* name = convert_jobject_to_python(j_env, 'Ljava/lang/String;', js) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, js)
* j_env[0].DeleteLocalRef(j_env, jcls)
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_convert_jobject_to_python(__pyx_v_j_env, __pyx_kp_s_Ljava_lang_String, __pyx_v_js); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_name = __pyx_t_1;
__pyx_t_1 = 0;
/* "jnius/jnius_utils.pxi":217
* cdef jobject js = j_env[0].CallObjectMethod(j_env, jcls, jmeth)
* name = convert_jobject_to_python(j_env, 'Ljava/lang/String;', js)
* j_env[0].DeleteLocalRef(j_env, js) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, jcls)
* j_env[0].DeleteLocalRef(j_env, jcls2)
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_js);
/* "jnius/jnius_utils.pxi":218
* name = convert_jobject_to_python(j_env, 'Ljava/lang/String;', js)
* j_env[0].DeleteLocalRef(j_env, js)
* j_env[0].DeleteLocalRef(j_env, jcls) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, jcls2)
* return name.replace('.', '/')
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_jcls);
/* "jnius/jnius_utils.pxi":219
* j_env[0].DeleteLocalRef(j_env, js)
* j_env[0].DeleteLocalRef(j_env, jcls)
* j_env[0].DeleteLocalRef(j_env, jcls2) # <<<<<<<<<<<<<<
* return name.replace('.', '/')
*
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_jcls2);
/* "jnius/jnius_utils.pxi":220
* j_env[0].DeleteLocalRef(j_env, jcls)
* j_env[0].DeleteLocalRef(j_env, jcls2)
* return name.replace('.', '/') # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":211
*
*
* cdef lookup_java_object_name(JNIEnv *j_env, jobject j_obj): # <<<<<<<<<<<<<<
* cdef jclass jcls = j_env[0].GetObjectClass(j_env, j_obj)
* cdef jclass jcls2 = j_env[0].GetObjectClass(j_env, jcls)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("jnius.jnius.lookup_java_object_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_utils.pxi":223
*
*
* cdef int calculate_score(sign_args, args, is_varargs=False) except *: # <<<<<<<<<<<<<<
* cdef int index
* cdef int score = 0
*/
static int __pyx_f_5jnius_5jnius_calculate_score(PyObject *__pyx_v_sign_args, PyObject *__pyx_v_args, struct __pyx_opt_args_5jnius_5jnius_calculate_score *__pyx_optional_args) {
PyObject *__pyx_v_is_varargs = ((PyObject *)Py_False);
int __pyx_v_index;
int __pyx_v_score;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc = 0;
PyObject *__pyx_v_r = NULL;
PyObject *__pyx_v_arg = NULL;
int __pyx_v_subscore;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
int __pyx_t_10;
__Pyx_RefNannySetupContext("calculate_score", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_is_varargs = __pyx_optional_args->is_varargs;
}
}
/* "jnius/jnius_utils.pxi":225
* cdef int calculate_score(sign_args, args, is_varargs=False) except *:
* cdef int index
* cdef int score = 0 # <<<<<<<<<<<<<<
* cdef JavaClass jc
*
*/
__pyx_v_score = 0;
/* "jnius/jnius_utils.pxi":228
* cdef JavaClass jc
*
* if len(args) != len(sign_args) and not is_varargs: # <<<<<<<<<<<<<<
* # if the number of arguments expected is not the same
* # as the number of arguments the method gets
*/
__pyx_t_2 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 228, __pyx_L1_error)
__pyx_t_3 = PyObject_Length(__pyx_v_sign_args); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 228, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_2 != __pyx_t_3) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_is_varargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 228, __pyx_L1_error)
__pyx_t_5 = ((!__pyx_t_4) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":234
* # if the method has varargs aka. it takes
* # an undefined number of arguments
* return -1 # <<<<<<<<<<<<<<
* elif len(args) == len(sign_args) and not is_varargs:
* # if the method has the good number of arguments and
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":228
* cdef JavaClass jc
*
* if len(args) != len(sign_args) and not is_varargs: # <<<<<<<<<<<<<<
* # if the number of arguments expected is not the same
* # as the number of arguments the method gets
*/
}
/* "jnius/jnius_utils.pxi":235
* # an undefined number of arguments
* return -1
* elif len(args) == len(sign_args) and not is_varargs: # <<<<<<<<<<<<<<
* # if the method has the good number of arguments and
* # the method doesn't take varargs increment the score
*/
__pyx_t_3 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 235, __pyx_L1_error)
__pyx_t_2 = PyObject_Length(__pyx_v_sign_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 235, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_3 == __pyx_t_2) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_is_varargs); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 235, __pyx_L1_error)
__pyx_t_4 = ((!__pyx_t_5) != 0);
__pyx_t_1 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":243
* # and
* # (Integer, Integer, Integer) takes precedence over (Integer, Integer, Integer...)
* score += 10 # <<<<<<<<<<<<<<
*
* for index in range(len(sign_args)):
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":235
* # an undefined number of arguments
* return -1
* elif len(args) == len(sign_args) and not is_varargs: # <<<<<<<<<<<<<<
* # if the method has the good number of arguments and
* # the method doesn't take varargs increment the score
*/
}
/* "jnius/jnius_utils.pxi":245
* score += 10
*
* for index in range(len(sign_args)): # <<<<<<<<<<<<<<
* r = sign_args[index]
* arg = args[index]
*/
__pyx_t_2 = PyObject_Length(__pyx_v_sign_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 245, __pyx_L1_error)
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
__pyx_v_index = __pyx_t_6;
/* "jnius/jnius_utils.pxi":246
*
* for index in range(len(sign_args)):
* r = sign_args[index] # <<<<<<<<<<<<<<
* arg = args[index]
*
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_sign_args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_utils.pxi":247
* for index in range(len(sign_args)):
* r = sign_args[index]
* arg = args[index] # <<<<<<<<<<<<<<
*
* if r == 'Z':
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_utils.pxi":249
* arg = args[index]
*
* if r == 'Z': # <<<<<<<<<<<<<<
* if not isinstance(arg, bool):
* return -1
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 249, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":250
*
* if r == 'Z':
* if not isinstance(arg, bool): # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
__pyx_t_7 = ((PyObject*)&PyBool_Type);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_1 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_7); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 250, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_4 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":251
* if r == 'Z':
* if not isinstance(arg, bool):
* return -1 # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":250
*
* if r == 'Z':
* if not isinstance(arg, bool): # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":252
* if not isinstance(arg, bool):
* return -1
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":253
* return -1
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if r == 'B':
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":249
* arg = args[index]
*
* if r == 'Z': # <<<<<<<<<<<<<<
* if not isinstance(arg, bool):
* return -1
*/
}
/* "jnius/jnius_utils.pxi":255
* continue
*
* if r == 'B': # <<<<<<<<<<<<<<
* if not isinstance(arg, int):
* return -1
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 255, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":256
*
* if r == 'B':
* if not isinstance(arg, int): # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
__pyx_t_4 = PyInt_Check(__pyx_v_arg);
__pyx_t_1 = ((!(__pyx_t_4 != 0)) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":257
* if r == 'B':
* if not isinstance(arg, int):
* return -1 # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":256
*
* if r == 'B':
* if not isinstance(arg, int): # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":258
* if not isinstance(arg, int):
* return -1
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":259
* return -1
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if r == 'C':
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":255
* continue
*
* if r == 'B': # <<<<<<<<<<<<<<
* if not isinstance(arg, int):
* return -1
*/
}
/* "jnius/jnius_utils.pxi":261
* continue
*
* if r == 'C': # <<<<<<<<<<<<<<
* if not isinstance(arg, str) or len(arg) != 1:
* return -1
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 261, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":262
*
* if r == 'C':
* if not isinstance(arg, str) or len(arg) != 1: # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
__pyx_t_4 = PyString_Check(__pyx_v_arg);
__pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L16_bool_binop_done;
}
__pyx_t_3 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 262, __pyx_L1_error)
__pyx_t_5 = ((__pyx_t_3 != 1) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L16_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":263
* if r == 'C':
* if not isinstance(arg, str) or len(arg) != 1:
* return -1 # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":262
*
* if r == 'C':
* if not isinstance(arg, str) or len(arg) != 1: # <<<<<<<<<<<<<<
* return -1
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":264
* if not isinstance(arg, str) or len(arg) != 1:
* return -1
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":265
* return -1
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if r == 'S' or r == 'I':
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":261
* continue
*
* if r == 'C': # <<<<<<<<<<<<<<
* if not isinstance(arg, str) or len(arg) != 1:
* return -1
*/
}
/* "jnius/jnius_utils.pxi":267
* continue
*
* if r == 'S' or r == 'I': # <<<<<<<<<<<<<<
* if isinstance(arg, int) or (
* (isinstance(arg, long) and arg < 2147483648)):
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 267, __pyx_L1_error)
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L19_bool_binop_done;
}
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 267, __pyx_L1_error)
__pyx_t_1 = __pyx_t_5;
__pyx_L19_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":268
*
* if r == 'S' or r == 'I':
* if isinstance(arg, int) or ( # <<<<<<<<<<<<<<
* (isinstance(arg, long) and arg < 2147483648)):
* score += 10
*/
__pyx_t_5 = PyInt_Check(__pyx_v_arg);
__pyx_t_4 = (__pyx_t_5 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L22_bool_binop_done;
}
/* "jnius/jnius_utils.pxi":269
* if r == 'S' or r == 'I':
* if isinstance(arg, int) or (
* (isinstance(arg, long) and arg < 2147483648)): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_4 = PyLong_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_7 = PyObject_RichCompare(__pyx_v_arg, __pyx_int_2147483648, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 269, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 269, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_1 = __pyx_t_5;
__pyx_L22_bool_binop_done:;
/* "jnius/jnius_utils.pxi":268
*
* if r == 'S' or r == 'I':
* if isinstance(arg, int) or ( # <<<<<<<<<<<<<<
* (isinstance(arg, long) and arg < 2147483648)):
* score += 10
*/
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":270
* if isinstance(arg, int) or (
* (isinstance(arg, long) and arg < 2147483648)):
* score += 10 # <<<<<<<<<<<<<<
* continue
* elif isinstance(arg, float):
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":271
* (isinstance(arg, long) and arg < 2147483648)):
* score += 10
* continue # <<<<<<<<<<<<<<
* elif isinstance(arg, float):
* score += 5
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":268
*
* if r == 'S' or r == 'I':
* if isinstance(arg, int) or ( # <<<<<<<<<<<<<<
* (isinstance(arg, long) and arg < 2147483648)):
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":272
* score += 10
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
__pyx_t_1 = PyFloat_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_1 != 0);
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":273
* continue
* elif isinstance(arg, float):
* score += 5 # <<<<<<<<<<<<<<
* continue
* else:
*/
__pyx_v_score = (__pyx_v_score + 5);
/* "jnius/jnius_utils.pxi":274
* elif isinstance(arg, float):
* score += 5
* continue # <<<<<<<<<<<<<<
* else:
* return -1
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":272
* score += 10
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
}
/* "jnius/jnius_utils.pxi":276
* continue
* else:
* return -1 # <<<<<<<<<<<<<<
*
* if r == 'J':
*/
/*else*/ {
__pyx_r = -1;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":267
* continue
*
* if r == 'S' or r == 'I': # <<<<<<<<<<<<<<
* if isinstance(arg, int) or (
* (isinstance(arg, long) and arg < 2147483648)):
*/
}
/* "jnius/jnius_utils.pxi":278
* return -1
*
* if r == 'J': # <<<<<<<<<<<<<<
* if isinstance(arg, int) or isinstance(arg, long):
* score += 10
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_J, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 278, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":279
*
* if r == 'J':
* if isinstance(arg, int) or isinstance(arg, long): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_1 = PyInt_Check(__pyx_v_arg);
__pyx_t_4 = (__pyx_t_1 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L27_bool_binop_done;
}
__pyx_t_4 = PyLong_Check(__pyx_v_arg);
__pyx_t_1 = (__pyx_t_4 != 0);
__pyx_t_5 = __pyx_t_1;
__pyx_L27_bool_binop_done:;
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":280
* if r == 'J':
* if isinstance(arg, int) or isinstance(arg, long):
* score += 10 # <<<<<<<<<<<<<<
* continue
* elif isinstance(arg, float):
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":281
* if isinstance(arg, int) or isinstance(arg, long):
* score += 10
* continue # <<<<<<<<<<<<<<
* elif isinstance(arg, float):
* score += 5
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":279
*
* if r == 'J':
* if isinstance(arg, int) or isinstance(arg, long): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":282
* score += 10
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
__pyx_t_5 = PyFloat_Check(__pyx_v_arg);
__pyx_t_1 = (__pyx_t_5 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":283
* continue
* elif isinstance(arg, float):
* score += 5 # <<<<<<<<<<<<<<
* continue
* else:
*/
__pyx_v_score = (__pyx_v_score + 5);
/* "jnius/jnius_utils.pxi":284
* elif isinstance(arg, float):
* score += 5
* continue # <<<<<<<<<<<<<<
* else:
* return -1
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":282
* score += 10
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
}
/* "jnius/jnius_utils.pxi":286
* continue
* else:
* return -1 # <<<<<<<<<<<<<<
*
* if r == 'F' or r == 'D':
*/
/*else*/ {
__pyx_r = -1;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":278
* return -1
*
* if r == 'J': # <<<<<<<<<<<<<<
* if isinstance(arg, int) or isinstance(arg, long):
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":288
* return -1
*
* if r == 'F' or r == 'D': # <<<<<<<<<<<<<<
* if isinstance(arg, int):
* score += 5
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 288, __pyx_L1_error)
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L30_bool_binop_done;
}
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 288, __pyx_L1_error)
__pyx_t_1 = __pyx_t_5;
__pyx_L30_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":289
*
* if r == 'F' or r == 'D':
* if isinstance(arg, int): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
__pyx_t_1 = PyInt_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_1 != 0);
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":290
* if r == 'F' or r == 'D':
* if isinstance(arg, int):
* score += 5 # <<<<<<<<<<<<<<
* continue
* elif isinstance(arg, float):
*/
__pyx_v_score = (__pyx_v_score + 5);
/* "jnius/jnius_utils.pxi":291
* if isinstance(arg, int):
* score += 5
* continue # <<<<<<<<<<<<<<
* elif isinstance(arg, float):
* score += 10
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":289
*
* if r == 'F' or r == 'D':
* if isinstance(arg, int): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
}
/* "jnius/jnius_utils.pxi":292
* score += 5
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_5 = PyFloat_Check(__pyx_v_arg);
__pyx_t_1 = (__pyx_t_5 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":293
* continue
* elif isinstance(arg, float):
* score += 10 # <<<<<<<<<<<<<<
* continue
* else:
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":294
* elif isinstance(arg, float):
* score += 10
* continue # <<<<<<<<<<<<<<
* else:
* return -1
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":292
* score += 5
* continue
* elif isinstance(arg, float): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":296
* continue
* else:
* return -1 # <<<<<<<<<<<<<<
*
* if r[0] == 'L':
*/
/*else*/ {
__pyx_r = -1;
goto __pyx_L0;
}
/* "jnius/jnius_utils.pxi":288
* return -1
*
* if r == 'F' or r == 'D': # <<<<<<<<<<<<<<
* if isinstance(arg, int):
* score += 5
*/
}
/* "jnius/jnius_utils.pxi":298
* return -1
*
* if r[0] == 'L': # <<<<<<<<<<<<<<
*
* r = r[1:-1]
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 298, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":300
* if r[0] == 'L':
*
* r = r[1:-1] # <<<<<<<<<<<<<<
*
* if arg is None:
*/
__pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_r, 1, -1L, NULL, NULL, &__pyx_slice__18, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF_SET(__pyx_v_r, __pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_utils.pxi":302
* r = r[1:-1]
*
* if arg is None: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_1 = (__pyx_v_arg == Py_None);
__pyx_t_5 = (__pyx_t_1 != 0);
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":303
*
* if arg is None:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":304
* if arg is None:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* # if it's a string, accept any python string
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":302
* r = r[1:-1]
*
* if arg is None: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":307
*
* # if it's a string, accept any python string
* if r == 'java/lang/String' and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_String, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 307, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_5 = __pyx_t_1;
goto __pyx_L36_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyBaseString_Check(__pyx_v_arg);
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L36_bool_binop_done;
}
__pyx_t_4 = ((PY_MAJOR_VERSION < 3) != 0);
__pyx_t_5 = __pyx_t_4;
__pyx_L36_bool_binop_done:;
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":308
* # if it's a string, accept any python string
* if r == 'java/lang/String' and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":309
* if r == 'java/lang/String' and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if r == 'java/lang/String' and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":307
*
* # if it's a string, accept any python string
* if r == 'java/lang/String' and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":311
* continue
*
* if r == 'java/lang/String' and isinstance(arg, str) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_String, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 311, __pyx_L1_error)
if (__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L40_bool_binop_done;
}
__pyx_t_4 = PyString_Check(__pyx_v_arg);
__pyx_t_1 = (__pyx_t_4 != 0);
if (__pyx_t_1) {
} else {
__pyx_t_5 = __pyx_t_1;
goto __pyx_L40_bool_binop_done;
}
__pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0);
__pyx_t_5 = __pyx_t_1;
__pyx_L40_bool_binop_done:;
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":312
*
* if r == 'java/lang/String' and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":313
* if r == 'java/lang/String' and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* # if it's a generic object, accept python string, or any java
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":311
* continue
*
* if r == 'java/lang/String' and isinstance(arg, str) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":317
* # if it's a generic object, accept python string, or any java
* # class/object
* if r == 'java/lang/Object': # <<<<<<<<<<<<<<
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject):
* score += 10
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Object, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 317, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":318
* # class/object
* if r == 'java/lang/Object':
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass);
__pyx_t_4 = (__pyx_t_1 != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_5 = __pyx_t_4;
goto __pyx_L45_bool_binop_done;
}
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaObject);
__pyx_t_1 = (__pyx_t_4 != 0);
__pyx_t_5 = __pyx_t_1;
__pyx_L45_bool_binop_done:;
if (__pyx_t_5) {
/* "jnius/jnius_utils.pxi":319
* if r == 'java/lang/Object':
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject):
* score += 10 # <<<<<<<<<<<<<<
* continue
* elif isinstance(arg, basestring):
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":320
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject):
* score += 10
* continue # <<<<<<<<<<<<<<
* elif isinstance(arg, basestring):
* score += 5
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":318
* # class/object
* if r == 'java/lang/Object':
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":321
* score += 10
* continue
* elif isinstance(arg, basestring): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
__pyx_t_5 = __Pyx_PyBaseString_Check(__pyx_v_arg);
__pyx_t_1 = (__pyx_t_5 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":322
* continue
* elif isinstance(arg, basestring):
* score += 5 # <<<<<<<<<<<<<<
* continue
* return -1
*/
__pyx_v_score = (__pyx_v_score + 5);
/* "jnius/jnius_utils.pxi":323
* elif isinstance(arg, basestring):
* score += 5
* continue # <<<<<<<<<<<<<<
* return -1
*
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":321
* score += 10
* continue
* elif isinstance(arg, basestring): # <<<<<<<<<<<<<<
* score += 5
* continue
*/
}
/* "jnius/jnius_utils.pxi":324
* score += 5
* continue
* return -1 # <<<<<<<<<<<<<<
*
* # accept an autoclass class for java/lang/Class.
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":317
* # if it's a generic object, accept python string, or any java
* # class/object
* if r == 'java/lang/Object': # <<<<<<<<<<<<<<
* if isinstance(arg, JavaClass) or isinstance(arg, JavaObject):
* score += 10
*/
}
/* "jnius/jnius_utils.pxi":327
*
* # accept an autoclass class for java/lang/Class.
* if hasattr(arg, '__javaclass__') and r == 'java/lang/Class': # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_5 = PyObject_HasAttr(__pyx_v_arg, __pyx_n_s_javaclass); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 327, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_5 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L48_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Class, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 327, __pyx_L1_error)
__pyx_t_1 = __pyx_t_4;
__pyx_L48_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":328
* # accept an autoclass class for java/lang/Class.
* if hasattr(arg, '__javaclass__') and r == 'java/lang/Class':
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":329
* if hasattr(arg, '__javaclass__') and r == 'java/lang/Class':
* score += 10
* continue # <<<<<<<<<<<<<<
*
* # if we pass a JavaClass, ensure the definition is matching
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":327
*
* # accept an autoclass class for java/lang/Class.
* if hasattr(arg, '__javaclass__') and r == 'java/lang/Class': # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":333
* # if we pass a JavaClass, ensure the definition is matching
* # XXX FIXME what if we use a subclass or something ?
* if isinstance(arg, JavaClass): # <<<<<<<<<<<<<<
* jc = arg
* if jc.__javaclass__ == r:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass);
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":334
* # XXX FIXME what if we use a subclass or something ?
* if isinstance(arg, JavaClass):
* jc = arg # <<<<<<<<<<<<<<
* if jc.__javaclass__ == r:
* score += 10
*/
if (!(likely(((__pyx_v_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(2, 334, __pyx_L1_error)
__pyx_t_7 = __pyx_v_arg;
__Pyx_INCREF(__pyx_t_7);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_7));
__pyx_t_7 = 0;
/* "jnius/jnius_utils.pxi":335
* if isinstance(arg, JavaClass):
* jc = arg
* if jc.__javaclass__ == r: # <<<<<<<<<<<<<<
* score += 10
* else:
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_jc), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_r, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":336
* jc = arg
* if jc.__javaclass__ == r:
* score += 10 # <<<<<<<<<<<<<<
* else:
* #try:
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":335
* if isinstance(arg, JavaClass):
* jc = arg
* if jc.__javaclass__ == r: # <<<<<<<<<<<<<<
* score += 10
* else:
*/
goto __pyx_L51;
}
/* "jnius/jnius_utils.pxi":342
* #except:
* # return -1
* score += 5 # <<<<<<<<<<<<<<
* continue
*
*/
/*else*/ {
__pyx_v_score = (__pyx_v_score + 5);
}
__pyx_L51:;
/* "jnius/jnius_utils.pxi":343
* # return -1
* score += 5
* continue # <<<<<<<<<<<<<<
*
* # always accept unknow object, but can be dangerous too.
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":333
* # if we pass a JavaClass, ensure the definition is matching
* # XXX FIXME what if we use a subclass or something ?
* if isinstance(arg, JavaClass): # <<<<<<<<<<<<<<
* jc = arg
* if jc.__javaclass__ == r:
*/
}
/* "jnius/jnius_utils.pxi":346
*
* # always accept unknow object, but can be dangerous too.
* if isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* score += 1
* continue
*/
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaObject);
__pyx_t_1 = (__pyx_t_4 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":347
* # always accept unknow object, but can be dangerous too.
* if isinstance(arg, JavaObject):
* score += 1 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 1);
/* "jnius/jnius_utils.pxi":348
* if isinstance(arg, JavaObject):
* score += 1
* continue # <<<<<<<<<<<<<<
*
* if isinstance(arg, PythonJavaClass):
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":346
*
* # always accept unknow object, but can be dangerous too.
* if isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* score += 1
* continue
*/
}
/* "jnius/jnius_utils.pxi":350
* continue
*
* if isinstance(arg, PythonJavaClass): # <<<<<<<<<<<<<<
* score += 1
* continue
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_PythonJavaClass);
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":351
*
* if isinstance(arg, PythonJavaClass):
* score += 1 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 1);
/* "jnius/jnius_utils.pxi":352
* if isinstance(arg, PythonJavaClass):
* score += 1
* continue # <<<<<<<<<<<<<<
*
* # native type? not accepted
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":350
* continue
*
* if isinstance(arg, PythonJavaClass): # <<<<<<<<<<<<<<
* score += 1
* continue
*/
}
/* "jnius/jnius_utils.pxi":355
*
* # native type? not accepted
* return -1 # <<<<<<<<<<<<<<
*
* if r[0] == '[':
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":298
* return -1
*
* if r[0] == 'L': # <<<<<<<<<<<<<<
*
* r = r[1:-1]
*/
}
/* "jnius/jnius_utils.pxi":357
* return -1
*
* if r[0] == '[': # <<<<<<<<<<<<<<
*
* if arg is None:
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 357, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":359
* if r[0] == '[':
*
* if arg is None: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_4 = (__pyx_v_arg == Py_None);
__pyx_t_1 = (__pyx_t_4 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":360
*
* if arg is None:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":361
* if arg is None:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if (r == '[B' or r == '[C') and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3:
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":359
* if r[0] == '[':
*
* if arg is None: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":363
* continue
*
* if (r == '[B' or r == '[C') and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_B_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 363, __pyx_L1_error)
if (!__pyx_t_4) {
} else {
goto __pyx_L58_next_and;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_C_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 363, __pyx_L1_error)
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L57_bool_binop_done;
}
__pyx_L58_next_and:;
__pyx_t_4 = __Pyx_PyBaseString_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L57_bool_binop_done;
}
__pyx_t_5 = ((PY_MAJOR_VERSION < 3) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L57_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":364
*
* if (r == '[B' or r == '[C') and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":365
* if (r == '[B' or r == '[C') and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if (r == '[B') and isinstance(arg, bytes) and PY_MAJOR_VERSION >= 3:
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":363
* continue
*
* if (r == '[B' or r == '[C') and isinstance(arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":367
* continue
*
* if (r == '[B') and isinstance(arg, bytes) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_B_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 367, __pyx_L1_error)
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L62_bool_binop_done;
}
__pyx_t_5 = PyBytes_Check(__pyx_v_arg);
__pyx_t_4 = (__pyx_t_5 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L62_bool_binop_done;
}
__pyx_t_4 = ((PY_MAJOR_VERSION >= 3) != 0);
__pyx_t_1 = __pyx_t_4;
__pyx_L62_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":368
*
* if (r == '[B') and isinstance(arg, bytes) and PY_MAJOR_VERSION >= 3:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":369
* if (r == '[B') and isinstance(arg, bytes) and PY_MAJOR_VERSION >= 3:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if (r == '[C') and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":367
* continue
*
* if (r == '[B') and isinstance(arg, bytes) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":371
* continue
*
* if (r == '[C') and isinstance(arg, str) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_C_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 371, __pyx_L1_error)
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L66_bool_binop_done;
}
__pyx_t_4 = PyString_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L66_bool_binop_done;
}
__pyx_t_5 = ((PY_MAJOR_VERSION >= 3) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L66_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":372
*
* if (r == '[C') and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":373
* if (r == '[C') and isinstance(arg, str) and PY_MAJOR_VERSION >= 3:
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if r == '[B' and isinstance(arg, (bytearray, ByteArray)):
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":371
* continue
*
* if (r == '[C') and isinstance(arg, str) and PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":375
* continue
*
* if r == '[B' and isinstance(arg, (bytearray, ByteArray)): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_B_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(2, 375, __pyx_L1_error)
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L70_bool_binop_done;
}
__pyx_t_4 = PyByteArray_Check(__pyx_v_arg);
__pyx_t_9 = (__pyx_t_4 != 0);
if (!__pyx_t_9) {
} else {
__pyx_t_5 = __pyx_t_9;
goto __pyx_L72_bool_binop_done;
}
__pyx_t_9 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_ByteArray);
__pyx_t_4 = (__pyx_t_9 != 0);
__pyx_t_5 = __pyx_t_4;
__pyx_L72_bool_binop_done:;
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_1 = __pyx_t_4;
__pyx_L70_bool_binop_done:;
if (__pyx_t_1) {
/* "jnius/jnius_utils.pxi":376
*
* if r == '[B' and isinstance(arg, (bytearray, ByteArray)):
* score += 10 # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":377
* if r == '[B' and isinstance(arg, (bytearray, ByteArray)):
* score += 10
* continue # <<<<<<<<<<<<<<
*
* if not isinstance(arg, (list, tuple)):
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":375
* continue
*
* if r == '[B' and isinstance(arg, (bytearray, ByteArray)): # <<<<<<<<<<<<<<
* score += 10
* continue
*/
}
/* "jnius/jnius_utils.pxi":379
* continue
*
* if not isinstance(arg, (list, tuple)): # <<<<<<<<<<<<<<
* return -1
*
*/
__pyx_t_4 = PyList_Check(__pyx_v_arg);
__pyx_t_5 = (__pyx_t_4 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L75_bool_binop_done;
}
__pyx_t_5 = PyTuple_Check(__pyx_v_arg);
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_1 = __pyx_t_4;
__pyx_L75_bool_binop_done:;
__pyx_t_4 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":380
*
* if not isinstance(arg, (list, tuple)):
* return -1 # <<<<<<<<<<<<<<
*
* # calculate the score for our subarray
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":379
* continue
*
* if not isinstance(arg, (list, tuple)): # <<<<<<<<<<<<<<
* return -1
*
*/
}
/* "jnius/jnius_utils.pxi":383
*
* # calculate the score for our subarray
* if len(arg) > 0: # <<<<<<<<<<<<<<
* # if there are supplemantal arguments we compute the score
* subscore = calculate_score([r[1:]] * len(arg), arg)
*/
__pyx_t_3 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 383, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_3 > 0) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":385
* if len(arg) > 0:
* # if there are supplemantal arguments we compute the score
* subscore = calculate_score([r[1:]] * len(arg), arg) # <<<<<<<<<<<<<<
* if subscore == -1:
* return -1
*/
__pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_r, 1, 0, NULL, NULL, &__pyx_slice__19, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 385, __pyx_L1_error)
__pyx_t_7 = PyList_New(1 * ((__pyx_t_3<0) ? 0:__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_t_3; __pyx_temp++) {
__Pyx_INCREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_t_8);
}
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = __pyx_f_5jnius_5jnius_calculate_score(__pyx_t_7, __pyx_v_arg, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 385, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_subscore = __pyx_t_10;
/* "jnius/jnius_utils.pxi":386
* # if there are supplemantal arguments we compute the score
* subscore = calculate_score([r[1:]] * len(arg), arg)
* if subscore == -1: # <<<<<<<<<<<<<<
* return -1
* # the supplemental arguments match the varargs arguments
*/
__pyx_t_4 = ((__pyx_v_subscore == -1L) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_utils.pxi":387
* subscore = calculate_score([r[1:]] * len(arg), arg)
* if subscore == -1:
* return -1 # <<<<<<<<<<<<<<
* # the supplemental arguments match the varargs arguments
* score += 10
*/
__pyx_r = -1;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":386
* # if there are supplemantal arguments we compute the score
* subscore = calculate_score([r[1:]] * len(arg), arg)
* if subscore == -1: # <<<<<<<<<<<<<<
* return -1
* # the supplemental arguments match the varargs arguments
*/
}
/* "jnius/jnius_utils.pxi":389
* return -1
* # the supplemental arguments match the varargs arguments
* score += 10 # <<<<<<<<<<<<<<
* continue
* # else if there is no supplemental arguments
*/
__pyx_v_score = (__pyx_v_score + 10);
/* "jnius/jnius_utils.pxi":390
* # the supplemental arguments match the varargs arguments
* score += 10
* continue # <<<<<<<<<<<<<<
* # else if there is no supplemental arguments
* # it might be the good method but there may be
*/
goto __pyx_L8_continue;
/* "jnius/jnius_utils.pxi":383
*
* # calculate the score for our subarray
* if len(arg) > 0: # <<<<<<<<<<<<<<
* # if there are supplemantal arguments we compute the score
* subscore = calculate_score([r[1:]] * len(arg), arg)
*/
}
/* "jnius/jnius_utils.pxi":357
* return -1
*
* if r[0] == '[': # <<<<<<<<<<<<<<
*
* if arg is None:
*/
}
__pyx_L8_continue:;
}
/* "jnius/jnius_utils.pxi":395
* # a method with a better signature so we don't
* # change this method score
* return score # <<<<<<<<<<<<<<
*/
__pyx_r = __pyx_v_score;
goto __pyx_L0;
/* "jnius/jnius_utils.pxi":223
*
*
* cdef int calculate_score(sign_args, args, is_varargs=False) except *: # <<<<<<<<<<<<<<
* cdef int index
* cdef int score = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.calculate_score", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jc);
__Pyx_XDECREF(__pyx_v_r);
__Pyx_XDECREF(__pyx_v_arg);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":4
* from cpython cimport PyUnicode_DecodeUTF16
*
* cdef jstringy_arg(argtype): # <<<<<<<<<<<<<<
* return argtype in ('Ljava/lang/String;',
* 'Ljava/lang/CharSequence;',
*/
static PyObject *__pyx_f_5jnius_5jnius_jstringy_arg(PyObject *__pyx_v_argtype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
__Pyx_RefNannySetupContext("jstringy_arg", 0);
/* "jnius/jnius_conversion.pxi":5
*
* cdef jstringy_arg(argtype):
* return argtype in ('Ljava/lang/String;', # <<<<<<<<<<<<<<
* 'Ljava/lang/CharSequence;',
* 'Ljava/lang/Object;')
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_argtype);
__pyx_t_1 = __pyx_v_argtype;
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_String, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 5, __pyx_L1_error)
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_CharSequence, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 5, __pyx_L1_error)
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_Object, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 5, __pyx_L1_error)
__pyx_t_2 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":4
* from cpython cimport PyUnicode_DecodeUTF16
*
* cdef jstringy_arg(argtype): # <<<<<<<<<<<<<<
* return argtype in ('Ljava/lang/String;',
* 'Ljava/lang/CharSequence;',
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("jnius.jnius.jstringy_arg", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":9
* 'Ljava/lang/Object;')
*
* cdef void release_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, args) except *: # <<<<<<<<<<<<<<
* # do the conversion from a Python object to Java from a Java definition
* cdef JavaObject jo
*/
static void __pyx_f_5jnius_5jnius_release_args(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition_args, jvalue *__pyx_v_j_args, PyObject *__pyx_v_args) {
int __pyx_v_index;
PyObject *__pyx_v_argtype = NULL;
PyObject *__pyx_v_py_arg = NULL;
PyObject *__pyx_v_ret = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_t_12;
__Pyx_RefNannySetupContext("release_args", 0);
/* "jnius/jnius_conversion.pxi":14
* cdef JavaClass jc
* cdef int index
* for index, argtype in enumerate(definition_args): # <<<<<<<<<<<<<<
* py_arg = args[index]
* if argtype[0] == 'L':
*/
__pyx_t_1 = 0;
__pyx_t_2 = __pyx_v_definition_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
for (;;) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 14, __pyx_L1_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_v_argtype, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_v_index = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
/* "jnius/jnius_conversion.pxi":15
* cdef int index
* for index, argtype in enumerate(definition_args):
* py_arg = args[index] # <<<<<<<<<<<<<<
* if argtype[0] == 'L':
* if py_arg is None:
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_py_arg, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":16
* for index, argtype in enumerate(definition_args):
* py_arg = args[index]
* if argtype[0] == 'L': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argtype, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 16, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":17
* py_arg = args[index]
* if argtype[0] == 'L':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \
*/
__pyx_t_5 = (__pyx_v_py_arg == Py_None);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "jnius/jnius_conversion.pxi":18
* if argtype[0] == 'L':
* if py_arg is None:
* j_args[index].l = NULL # <<<<<<<<<<<<<<
* if isinstance(py_arg, basestring) and \
* jstringy_arg(argtype):
*/
(__pyx_v_j_args[__pyx_v_index]).l = NULL;
/* "jnius/jnius_conversion.pxi":17
* py_arg = args[index]
* if argtype[0] == 'L':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \
*/
}
/* "jnius/jnius_conversion.pxi":19
* if py_arg is None:
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \ # <<<<<<<<<<<<<<
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*/
__pyx_t_5 = __Pyx_PyBaseString_Check(__pyx_v_py_arg);
__pyx_t_7 = (__pyx_t_5 != 0);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L8_bool_binop_done;
}
/* "jnius/jnius_conversion.pxi":20
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \
* jstringy_arg(argtype): # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
* elif argtype[0] == '[':
*/
__pyx_t_4 = __pyx_f_5jnius_5jnius_jstringy_arg(__pyx_v_argtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 20, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_7;
__pyx_L8_bool_binop_done:;
/* "jnius/jnius_conversion.pxi":19
* if py_arg is None:
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \ # <<<<<<<<<<<<<<
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*/
if (__pyx_t_6) {
/* "jnius/jnius_conversion.pxi":21
* if isinstance(py_arg, basestring) and \
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l) # <<<<<<<<<<<<<<
* elif argtype[0] == '[':
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, (__pyx_v_j_args[__pyx_v_index]).l);
/* "jnius/jnius_conversion.pxi":19
* if py_arg is None:
* j_args[index].l = NULL
* if isinstance(py_arg, basestring) and \ # <<<<<<<<<<<<<<
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*/
}
/* "jnius/jnius_conversion.pxi":16
* for index, argtype in enumerate(definition_args):
* py_arg = args[index]
* if argtype[0] == 'L': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":22
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
* elif argtype[0] == '[': # <<<<<<<<<<<<<<
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try:
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argtype, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 22, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
/* "jnius/jnius_conversion.pxi":23
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
* elif argtype[0] == '[':
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l) # <<<<<<<<<<<<<<
* try:
* args[index][:] = ret
*/
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_argtype, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = __pyx_f_5jnius_5jnius_convert_jarray_to_python(__pyx_v_j_env, __pyx_t_4, (__pyx_v_j_args[__pyx_v_index]).l); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_ret, __pyx_t_8);
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":24
* elif argtype[0] == '[':
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try: # <<<<<<<<<<<<<<
* args[index][:] = ret
* except TypeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
/*try:*/ {
/* "jnius/jnius_conversion.pxi":25
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try:
* args[index][:] = ret # <<<<<<<<<<<<<<
* except TypeError:
* pass
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 25, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_PyObject_SetSlice(__pyx_t_8, __pyx_v_ret, 0, 0, NULL, NULL, &__pyx_slice__21, 0, 0, 1) < 0) __PYX_ERR(3, 25, __pyx_L10_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":24
* elif argtype[0] == '[':
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try: # <<<<<<<<<<<<<<
* args[index][:] = ret
* except TypeError:
*/
}
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L17_try_end;
__pyx_L10_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":26
* try:
* args[index][:] = ret
* except TypeError: # <<<<<<<<<<<<<<
* pass
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*/
__pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_12) {
__Pyx_ErrRestore(0,0,0);
goto __pyx_L11_exception_handled;
}
goto __pyx_L12_except_error;
__pyx_L12_except_error:;
/* "jnius/jnius_conversion.pxi":24
* elif argtype[0] == '[':
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try: # <<<<<<<<<<<<<<
* args[index][:] = ret
* except TypeError:
*/
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
goto __pyx_L1_error;
__pyx_L11_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
__pyx_L17_try_end:;
}
/* "jnius/jnius_conversion.pxi":28
* except TypeError:
* pass
* j_env[0].DeleteLocalRef(j_env, j_args[index].l) # <<<<<<<<<<<<<<
*
* cdef void populate_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, args) except *:
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, (__pyx_v_j_args[__pyx_v_index]).l);
/* "jnius/jnius_conversion.pxi":22
* jstringy_arg(argtype):
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
* elif argtype[0] == '[': # <<<<<<<<<<<<<<
* ret = convert_jarray_to_python(j_env, argtype[1:], j_args[index].l)
* try:
*/
}
__pyx_L5:;
/* "jnius/jnius_conversion.pxi":14
* cdef JavaClass jc
* cdef int index
* for index, argtype in enumerate(definition_args): # <<<<<<<<<<<<<<
* py_arg = args[index]
* if argtype[0] == 'L':
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":9
* 'Ljava/lang/Object;')
*
* cdef void release_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, args) except *: # <<<<<<<<<<<<<<
* # do the conversion from a Python object to Java from a Java definition
* cdef JavaObject jo
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.release_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_argtype);
__Pyx_XDECREF(__pyx_v_py_arg);
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_conversion.pxi":30
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*
* cdef void populate_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, args) except *: # <<<<<<<<<<<<<<
* # do the conversion from a Python object to Java from a Java definition
* cdef JavaClassStorage jcs
*/
static void __pyx_f_5jnius_5jnius_populate_args(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition_args, jvalue *__pyx_v_j_args, PyObject *__pyx_v_args) {
struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_jcs = 0;
struct __pyx_obj_5jnius_5jnius_JavaObject *__pyx_v_jo = 0;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc = 0;
struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_pc = 0;
int __pyx_v_index;
PyObject *__pyx_v_argtype = NULL;
PyObject *__pyx_v_py_arg = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
jboolean __pyx_t_6;
jbyte __pyx_t_7;
long __pyx_t_8;
jshort __pyx_t_9;
jint __pyx_t_10;
jlong __pyx_t_11;
jfloat __pyx_t_12;
jdouble __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
jstring __pyx_t_16;
jobject __pyx_t_17;
jclass __pyx_t_18;
PyObject *__pyx_t_19 = NULL;
PyObject *__pyx_t_20 = NULL;
PyObject *__pyx_t_21 = NULL;
PyObject *__pyx_t_22 = NULL;
PyObject *__pyx_t_23 = NULL;
int __pyx_t_24;
PyObject *__pyx_t_25 = NULL;
__Pyx_RefNannySetupContext("populate_args", 0);
/* "jnius/jnius_conversion.pxi":38
* cdef int index
*
* for index, argtype in enumerate(definition_args): # <<<<<<<<<<<<<<
* py_arg = args[index]
* if argtype == 'Z':
*/
__pyx_t_1 = 0;
__pyx_t_2 = __pyx_v_definition_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
for (;;) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 38, __pyx_L1_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_v_argtype, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_v_index = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
/* "jnius/jnius_conversion.pxi":39
*
* for index, argtype in enumerate(definition_args):
* py_arg = args[index] # <<<<<<<<<<<<<<
* if argtype == 'Z':
* j_args[index].z = py_arg
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_py_arg, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":40
* for index, argtype in enumerate(definition_args):
* py_arg = args[index]
* if argtype == 'Z': # <<<<<<<<<<<<<<
* j_args[index].z = py_arg
* elif argtype == 'B':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 40, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":41
* py_arg = args[index]
* if argtype == 'Z':
* j_args[index].z = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'B':
* j_args[index].b = py_arg
*/
__pyx_t_6 = __Pyx_PyInt_As_jboolean(__pyx_v_py_arg); if (unlikely((__pyx_t_6 == ((jboolean)-1)) && PyErr_Occurred())) __PYX_ERR(3, 41, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).z = __pyx_t_6;
/* "jnius/jnius_conversion.pxi":40
* for index, argtype in enumerate(definition_args):
* py_arg = args[index]
* if argtype == 'Z': # <<<<<<<<<<<<<<
* j_args[index].z = py_arg
* elif argtype == 'B':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":42
* if argtype == 'Z':
* j_args[index].z = py_arg
* elif argtype == 'B': # <<<<<<<<<<<<<<
* j_args[index].b = py_arg
* elif argtype == 'C':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 42, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":43
* j_args[index].z = py_arg
* elif argtype == 'B':
* j_args[index].b = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'C':
* j_args[index].c = ord(py_arg)
*/
__pyx_t_7 = __Pyx_PyInt_As_jbyte(__pyx_v_py_arg); if (unlikely((__pyx_t_7 == ((jbyte)-1)) && PyErr_Occurred())) __PYX_ERR(3, 43, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).b = __pyx_t_7;
/* "jnius/jnius_conversion.pxi":42
* if argtype == 'Z':
* j_args[index].z = py_arg
* elif argtype == 'B': # <<<<<<<<<<<<<<
* j_args[index].b = py_arg
* elif argtype == 'C':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":44
* elif argtype == 'B':
* j_args[index].b = py_arg
* elif argtype == 'C': # <<<<<<<<<<<<<<
* j_args[index].c = ord(py_arg)
* elif argtype == 'S':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 44, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":45
* j_args[index].b = py_arg
* elif argtype == 'C':
* j_args[index].c = ord(py_arg) # <<<<<<<<<<<<<<
* elif argtype == 'S':
* j_args[index].s = py_arg
*/
__pyx_t_8 = __Pyx_PyObject_Ord(__pyx_v_py_arg); if (unlikely(__pyx_t_8 == (long)(Py_UCS4)-1)) __PYX_ERR(3, 45, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).c = __pyx_t_8;
/* "jnius/jnius_conversion.pxi":44
* elif argtype == 'B':
* j_args[index].b = py_arg
* elif argtype == 'C': # <<<<<<<<<<<<<<
* j_args[index].c = ord(py_arg)
* elif argtype == 'S':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":46
* elif argtype == 'C':
* j_args[index].c = ord(py_arg)
* elif argtype == 'S': # <<<<<<<<<<<<<<
* j_args[index].s = py_arg
* elif argtype == 'I':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 46, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":47
* j_args[index].c = ord(py_arg)
* elif argtype == 'S':
* j_args[index].s = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'I':
* j_args[index].i = py_arg
*/
__pyx_t_9 = __Pyx_PyInt_As_jshort(__pyx_v_py_arg); if (unlikely((__pyx_t_9 == ((jshort)-1)) && PyErr_Occurred())) __PYX_ERR(3, 47, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).s = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":46
* elif argtype == 'C':
* j_args[index].c = ord(py_arg)
* elif argtype == 'S': # <<<<<<<<<<<<<<
* j_args[index].s = py_arg
* elif argtype == 'I':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":48
* elif argtype == 'S':
* j_args[index].s = py_arg
* elif argtype == 'I': # <<<<<<<<<<<<<<
* j_args[index].i = py_arg
* elif argtype == 'J':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 48, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":49
* j_args[index].s = py_arg
* elif argtype == 'I':
* j_args[index].i = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'J':
* j_args[index].j = py_arg
*/
__pyx_t_10 = __Pyx_PyInt_As_jint(__pyx_v_py_arg); if (unlikely((__pyx_t_10 == ((jint)-1)) && PyErr_Occurred())) __PYX_ERR(3, 49, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).i = __pyx_t_10;
/* "jnius/jnius_conversion.pxi":48
* elif argtype == 'S':
* j_args[index].s = py_arg
* elif argtype == 'I': # <<<<<<<<<<<<<<
* j_args[index].i = py_arg
* elif argtype == 'J':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":50
* elif argtype == 'I':
* j_args[index].i = py_arg
* elif argtype == 'J': # <<<<<<<<<<<<<<
* j_args[index].j = py_arg
* elif argtype == 'F':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_J, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 50, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":51
* j_args[index].i = py_arg
* elif argtype == 'J':
* j_args[index].j = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'F':
* j_args[index].f = py_arg
*/
__pyx_t_11 = __Pyx_PyInt_As_jlong(__pyx_v_py_arg); if (unlikely((__pyx_t_11 == ((jlong)-1)) && PyErr_Occurred())) __PYX_ERR(3, 51, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).j = __pyx_t_11;
/* "jnius/jnius_conversion.pxi":50
* elif argtype == 'I':
* j_args[index].i = py_arg
* elif argtype == 'J': # <<<<<<<<<<<<<<
* j_args[index].j = py_arg
* elif argtype == 'F':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":52
* elif argtype == 'J':
* j_args[index].j = py_arg
* elif argtype == 'F': # <<<<<<<<<<<<<<
* j_args[index].f = py_arg
* elif argtype == 'D':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 52, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":53
* j_args[index].j = py_arg
* elif argtype == 'F':
* j_args[index].f = py_arg # <<<<<<<<<<<<<<
* elif argtype == 'D':
* j_args[index].d = py_arg
*/
__pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_py_arg); if (unlikely((__pyx_t_12 == ((jfloat)-1)) && PyErr_Occurred())) __PYX_ERR(3, 53, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).f = __pyx_t_12;
/* "jnius/jnius_conversion.pxi":52
* elif argtype == 'J':
* j_args[index].j = py_arg
* elif argtype == 'F': # <<<<<<<<<<<<<<
* j_args[index].f = py_arg
* elif argtype == 'D':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":54
* elif argtype == 'F':
* j_args[index].f = py_arg
* elif argtype == 'D': # <<<<<<<<<<<<<<
* j_args[index].d = py_arg
* elif argtype[0] == 'L':
*/
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 54, __pyx_L1_error)
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":55
* j_args[index].f = py_arg
* elif argtype == 'D':
* j_args[index].d = py_arg # <<<<<<<<<<<<<<
* elif argtype[0] == 'L':
* if py_arg is None:
*/
__pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_py_arg); if (unlikely((__pyx_t_13 == ((jdouble)-1)) && PyErr_Occurred())) __PYX_ERR(3, 55, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).d = __pyx_t_13;
/* "jnius/jnius_conversion.pxi":54
* elif argtype == 'F':
* j_args[index].f = py_arg
* elif argtype == 'D': # <<<<<<<<<<<<<<
* j_args[index].d = py_arg
* elif argtype[0] == 'L':
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":56
* elif argtype == 'D':
* j_args[index].d = py_arg
* elif argtype[0] == 'L': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argtype, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 56, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
/* "jnius/jnius_conversion.pxi":57
* j_args[index].d = py_arg
* elif argtype[0] == 'L':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
*/
__pyx_t_5 = (__pyx_v_py_arg == Py_None);
__pyx_t_14 = (__pyx_t_5 != 0);
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":58
* elif argtype[0] == 'L':
* if py_arg is None:
* j_args[index].l = NULL # <<<<<<<<<<<<<<
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
*/
(__pyx_v_j_args[__pyx_v_index]).l = NULL;
/* "jnius/jnius_conversion.pxi":57
* j_args[index].d = py_arg
* elif argtype[0] == 'L':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":59
* if py_arg is None:
* j_args[index].l = NULL
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype): # <<<<<<<<<<<<<<
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
* elif isinstance(py_arg, JavaClass):
*/
__pyx_t_5 = __Pyx_PyBaseString_Check(__pyx_v_py_arg);
__pyx_t_15 = (__pyx_t_5 != 0);
if (__pyx_t_15) {
} else {
__pyx_t_14 = __pyx_t_15;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_4 = __pyx_f_5jnius_5jnius_jstringy_arg(__pyx_v_argtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 59, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_14 = __pyx_t_15;
__pyx_L7_bool_binop_done:;
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":60
* j_args[index].l = NULL
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
* j_args[index].l = convert_pystr_to_java(j_env, py_arg) # <<<<<<<<<<<<<<
* elif isinstance(py_arg, JavaClass):
* jc = py_arg
*/
if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_py_arg))||((__pyx_v_py_arg) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_py_arg)->tp_name), 0))) __PYX_ERR(3, 60, __pyx_L1_error)
__pyx_t_16 = __pyx_f_5jnius_5jnius_convert_pystr_to_java(__pyx_v_j_env, ((PyObject*)__pyx_v_py_arg)); if (unlikely(__pyx_t_16 == NULL)) __PYX_ERR(3, 60, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_16;
/* "jnius/jnius_conversion.pxi":59
* if py_arg is None:
* j_args[index].l = NULL
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype): # <<<<<<<<<<<<<<
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
* elif isinstance(py_arg, JavaClass):
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":61
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
* elif isinstance(py_arg, JavaClass): # <<<<<<<<<<<<<<
* jc = py_arg
* check_assignable_from(j_env, jc, argtype[1:-1])
*/
__pyx_t_14 = __Pyx_TypeCheck(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_JavaClass);
__pyx_t_15 = (__pyx_t_14 != 0);
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":62
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
* elif isinstance(py_arg, JavaClass):
* jc = py_arg # <<<<<<<<<<<<<<
* check_assignable_from(j_env, jc, argtype[1:-1])
* j_args[index].l = jc.j_self.obj
*/
if (!(likely(((__pyx_v_py_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 62, __pyx_L1_error)
__pyx_t_4 = __pyx_v_py_arg;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":63
* elif isinstance(py_arg, JavaClass):
* jc = py_arg
* check_assignable_from(j_env, jc, argtype[1:-1]) # <<<<<<<<<<<<<<
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, JavaObject):
*/
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_argtype, 1, -1L, NULL, NULL, &__pyx_slice__22, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 63, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_f_5jnius_5jnius_check_assignable_from(__pyx_v_j_env, __pyx_v_jc, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 63, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":64
* jc = py_arg
* check_assignable_from(j_env, jc, argtype[1:-1])
* j_args[index].l = jc.j_self.obj # <<<<<<<<<<<<<<
* elif isinstance(py_arg, JavaObject):
* jo = py_arg
*/
__pyx_t_17 = __pyx_v_jc->j_self->obj;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":61
* elif isinstance(py_arg, basestring) and jstringy_arg(argtype):
* j_args[index].l = convert_pystr_to_java(j_env, py_arg)
* elif isinstance(py_arg, JavaClass): # <<<<<<<<<<<<<<
* jc = py_arg
* check_assignable_from(j_env, jc, argtype[1:-1])
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":65
* check_assignable_from(j_env, jc, argtype[1:-1])
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, JavaObject): # <<<<<<<<<<<<<<
* jo = py_arg
* j_args[index].l = jo.obj
*/
__pyx_t_15 = __Pyx_TypeCheck(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_JavaObject);
__pyx_t_14 = (__pyx_t_15 != 0);
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":66
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, JavaObject):
* jo = py_arg # <<<<<<<<<<<<<<
* j_args[index].l = jo.obj
* elif isinstance(py_arg, MetaJavaClass):
*/
if (!(likely(((__pyx_v_py_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_JavaObject))))) __PYX_ERR(3, 66, __pyx_L1_error)
__pyx_t_4 = __pyx_v_py_arg;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_jo, ((struct __pyx_obj_5jnius_5jnius_JavaObject *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":67
* elif isinstance(py_arg, JavaObject):
* jo = py_arg
* j_args[index].l = jo.obj # <<<<<<<<<<<<<<
* elif isinstance(py_arg, MetaJavaClass):
* jcs = py_arg.__cls_storage
*/
__pyx_t_17 = __pyx_v_jo->obj;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":65
* check_assignable_from(j_env, jc, argtype[1:-1])
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, JavaObject): # <<<<<<<<<<<<<<
* jo = py_arg
* j_args[index].l = jo.obj
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":68
* jo = py_arg
* j_args[index].l = jo.obj
* elif isinstance(py_arg, MetaJavaClass): # <<<<<<<<<<<<<<
* jcs = py_arg.__cls_storage
* j_args[index].l = jcs.j_cls
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_MetaJavaClass); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_14 = PyObject_IsInstance(__pyx_v_py_arg, __pyx_t_4); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(3, 68, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_15 = (__pyx_t_14 != 0);
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":69
* j_args[index].l = jo.obj
* elif isinstance(py_arg, MetaJavaClass):
* jcs = py_arg.__cls_storage # <<<<<<<<<<<<<<
* j_args[index].l = jcs.j_cls
* elif isinstance(py_arg, PythonJavaClass):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_arg, __pyx_n_s_cls_storage); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5jnius_5jnius_JavaClassStorage))))) __PYX_ERR(3, 69, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_jcs, ((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":70
* elif isinstance(py_arg, MetaJavaClass):
* jcs = py_arg.__cls_storage
* j_args[index].l = jcs.j_cls # <<<<<<<<<<<<<<
* elif isinstance(py_arg, PythonJavaClass):
* # from python class, get the proxy/python class
*/
__pyx_t_18 = __pyx_v_jcs->j_cls;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_18;
/* "jnius/jnius_conversion.pxi":68
* jo = py_arg
* j_args[index].l = jo.obj
* elif isinstance(py_arg, MetaJavaClass): # <<<<<<<<<<<<<<
* jcs = py_arg.__cls_storage
* j_args[index].l = jcs.j_cls
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":71
* jcs = py_arg.__cls_storage
* j_args[index].l = jcs.j_cls
* elif isinstance(py_arg, PythonJavaClass): # <<<<<<<<<<<<<<
* # from python class, get the proxy/python class
* pc = py_arg
*/
__pyx_t_15 = __Pyx_TypeCheck(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_PythonJavaClass);
__pyx_t_14 = (__pyx_t_15 != 0);
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":73
* elif isinstance(py_arg, PythonJavaClass):
* # from python class, get the proxy/python class
* pc = py_arg # <<<<<<<<<<<<<<
* # get the java class
* jc = pc.j_self
*/
if (!(likely(((__pyx_v_py_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_PythonJavaClass))))) __PYX_ERR(3, 73, __pyx_L1_error)
__pyx_t_4 = __pyx_v_py_arg;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_pc, ((struct __pyx_obj_5jnius_5jnius_PythonJavaClass *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":75
* pc = py_arg
* # get the java class
* jc = pc.j_self # <<<<<<<<<<<<<<
* # get the localref
* j_args[index].l = jc.j_self.obj
*/
if (!(likely(((__pyx_v_pc->j_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pc->j_self, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 75, __pyx_L1_error)
__pyx_t_4 = __pyx_v_pc->j_self;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":77
* jc = pc.j_self
* # get the localref
* j_args[index].l = jc.j_self.obj # <<<<<<<<<<<<<<
* elif isinstance(py_arg, type):
* jc = py_arg
*/
__pyx_t_17 = __pyx_v_jc->j_self->obj;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":71
* jcs = py_arg.__cls_storage
* j_args[index].l = jcs.j_cls
* elif isinstance(py_arg, PythonJavaClass): # <<<<<<<<<<<<<<
* # from python class, get the proxy/python class
* pc = py_arg
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":78
* # get the localref
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, type): # <<<<<<<<<<<<<<
* jc = py_arg
* j_args[index].l = jc.j_cls
*/
__pyx_t_14 = PyType_Check(__pyx_v_py_arg);
__pyx_t_15 = (__pyx_t_14 != 0);
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":79
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, type):
* jc = py_arg # <<<<<<<<<<<<<<
* j_args[index].l = jc.j_cls
* elif isinstance(py_arg, (tuple, list)):
*/
if (!(likely(((__pyx_v_py_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 79, __pyx_L1_error)
__pyx_t_4 = __pyx_v_py_arg;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":80
* elif isinstance(py_arg, type):
* jc = py_arg
* j_args[index].l = jc.j_cls # <<<<<<<<<<<<<<
* elif isinstance(py_arg, (tuple, list)):
* j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg)
*/
__pyx_t_18 = __pyx_v_jc->j_cls;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_18;
/* "jnius/jnius_conversion.pxi":78
* # get the localref
* j_args[index].l = jc.j_self.obj
* elif isinstance(py_arg, type): # <<<<<<<<<<<<<<
* jc = py_arg
* j_args[index].l = jc.j_cls
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":81
* jc = py_arg
* j_args[index].l = jc.j_cls
* elif isinstance(py_arg, (tuple, list)): # <<<<<<<<<<<<<<
* j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg)
* else:
*/
__pyx_t_14 = PyTuple_Check(__pyx_v_py_arg);
__pyx_t_5 = (__pyx_t_14 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_15 = __pyx_t_5;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_5 = PyList_Check(__pyx_v_py_arg);
__pyx_t_14 = (__pyx_t_5 != 0);
__pyx_t_15 = __pyx_t_14;
__pyx_L9_bool_binop_done:;
__pyx_t_14 = (__pyx_t_15 != 0);
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":82
* j_args[index].l = jc.j_cls
* elif isinstance(py_arg, (tuple, list)):
* j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg) # <<<<<<<<<<<<<<
* else:
* raise JavaException('Invalid python object for this '
*/
__pyx_t_17 = __pyx_f_5jnius_5jnius_convert_pyarray_to_java(__pyx_v_j_env, __pyx_v_argtype, __pyx_v_py_arg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 82, __pyx_L1_error)
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":81
* jc = py_arg
* j_args[index].l = jc.j_cls
* elif isinstance(py_arg, (tuple, list)): # <<<<<<<<<<<<<<
* j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg)
* else:
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":84
* j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg)
* else:
* raise JavaException('Invalid python object for this ' # <<<<<<<<<<<<<<
* 'argument. Want {0!r}, got {1!r}'.format(
* argtype[1:-1], py_arg))
*/
/*else*/ {
__pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
/* "jnius/jnius_conversion.pxi":85
* else:
* raise JavaException('Invalid python object for this '
* 'argument. Want {0!r}, got {1!r}'.format( # <<<<<<<<<<<<<<
* argtype[1:-1], py_arg))
* elif argtype[0] == '[':
*/
__pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_python_object_for_this_a, __pyx_n_s_format); if (unlikely(!__pyx_t_21)) __PYX_ERR(3, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_21);
/* "jnius/jnius_conversion.pxi":86
* raise JavaException('Invalid python object for this '
* 'argument. Want {0!r}, got {1!r}'.format(
* argtype[1:-1], py_arg)) # <<<<<<<<<<<<<<
* elif argtype[0] == '[':
* if py_arg is None:
*/
__pyx_t_22 = __Pyx_PyObject_GetSlice(__pyx_v_argtype, 1, -1L, NULL, NULL, &__pyx_slice__23, 1, 1, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__pyx_t_23 = NULL;
__pyx_t_24 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_21))) {
__pyx_t_23 = PyMethod_GET_SELF(__pyx_t_21);
if (likely(__pyx_t_23)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
__Pyx_INCREF(__pyx_t_23);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_21, function);
__pyx_t_24 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_21)) {
PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_22, __pyx_v_py_arg};
__pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 85, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_GOTREF(__pyx_t_20);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_22, __pyx_v_py_arg};
__pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 85, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_GOTREF(__pyx_t_20);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
} else
#endif
{
__pyx_t_25 = PyTuple_New(2+__pyx_t_24); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_25);
if (__pyx_t_23) {
__Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_23); __pyx_t_23 = NULL;
}
__Pyx_GIVEREF(__pyx_t_22);
PyTuple_SET_ITEM(__pyx_t_25, 0+__pyx_t_24, __pyx_t_22);
__Pyx_INCREF(__pyx_v_py_arg);
__Pyx_GIVEREF(__pyx_v_py_arg);
PyTuple_SET_ITEM(__pyx_t_25, 1+__pyx_t_24, __pyx_v_py_arg);
__pyx_t_22 = 0;
__pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_25, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_20);
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
}
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
__pyx_t_21 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
__pyx_t_21 = PyMethod_GET_SELF(__pyx_t_19);
if (likely(__pyx_t_21)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
__Pyx_INCREF(__pyx_t_21);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_19, function);
}
}
if (!__pyx_t_21) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_t_20};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_t_20};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
} else
#endif
{
__pyx_t_25 = PyTuple_New(1+1); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_25);
__Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_21); __pyx_t_21 = NULL;
__Pyx_GIVEREF(__pyx_t_20);
PyTuple_SET_ITEM(__pyx_t_25, 0+1, __pyx_t_20);
__pyx_t_20 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
}
}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 84, __pyx_L1_error)
}
__pyx_L6:;
/* "jnius/jnius_conversion.pxi":56
* elif argtype == 'D':
* j_args[index].d = py_arg
* elif argtype[0] == 'L': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
goto __pyx_L5;
}
/* "jnius/jnius_conversion.pxi":87
* 'argument. Want {0!r}, got {1!r}'.format(
* argtype[1:-1], py_arg))
* elif argtype[0] == '[': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argtype, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(3, 87, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":88
* argtype[1:-1], py_arg))
* elif argtype[0] == '[':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* continue
*/
__pyx_t_14 = (__pyx_v_py_arg == Py_None);
__pyx_t_15 = (__pyx_t_14 != 0);
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":89
* elif argtype[0] == '[':
* if py_arg is None:
* j_args[index].l = NULL # <<<<<<<<<<<<<<
* continue
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3:
*/
(__pyx_v_j_args[__pyx_v_index]).l = NULL;
/* "jnius/jnius_conversion.pxi":90
* if py_arg is None:
* j_args[index].l = NULL
* continue # <<<<<<<<<<<<<<
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3:
* if argtype == '[B':
*/
goto __pyx_L3_continue;
/* "jnius/jnius_conversion.pxi":88
* argtype[1:-1], py_arg))
* elif argtype[0] == '[':
* if py_arg is None: # <<<<<<<<<<<<<<
* j_args[index].l = NULL
* continue
*/
}
/* "jnius/jnius_conversion.pxi":91
* j_args[index].l = NULL
* continue
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* if argtype == '[B':
* py_arg = map(ord, py_arg)
*/
__pyx_t_14 = __Pyx_PyBaseString_Check(__pyx_v_py_arg);
__pyx_t_5 = (__pyx_t_14 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_15 = __pyx_t_5;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_5 = ((PY_MAJOR_VERSION < 3) != 0);
__pyx_t_15 = __pyx_t_5;
__pyx_L13_bool_binop_done:;
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":92
* continue
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3:
* if argtype == '[B': # <<<<<<<<<<<<<<
* py_arg = map(ord, py_arg)
* elif argtype == '[C':
*/
__pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_kp_s_B_2, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 92, __pyx_L1_error)
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":93
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3:
* if argtype == '[B':
* py_arg = map(ord, py_arg) # <<<<<<<<<<<<<<
* elif argtype == '[C':
* py_arg = list(py_arg)
*/
__pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
__Pyx_INCREF(__pyx_v_py_arg);
__Pyx_GIVEREF(__pyx_v_py_arg);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_py_arg);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF_SET(__pyx_v_py_arg, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":92
* continue
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3:
* if argtype == '[B': # <<<<<<<<<<<<<<
* py_arg = map(ord, py_arg)
* elif argtype == '[C':
*/
goto __pyx_L15;
}
/* "jnius/jnius_conversion.pxi":94
* if argtype == '[B':
* py_arg = map(ord, py_arg)
* elif argtype == '[C': # <<<<<<<<<<<<<<
* py_arg = list(py_arg)
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
*/
__pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_kp_s_C_2, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 94, __pyx_L1_error)
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":95
* py_arg = map(ord, py_arg)
* elif argtype == '[C':
* py_arg = list(py_arg) # <<<<<<<<<<<<<<
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
* py_arg = list(py_arg)
*/
__pyx_t_4 = PySequence_List(__pyx_v_py_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_py_arg, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":94
* if argtype == '[B':
* py_arg = map(ord, py_arg)
* elif argtype == '[C': # <<<<<<<<<<<<<<
* py_arg = list(py_arg)
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
*/
}
__pyx_L15:;
/* "jnius/jnius_conversion.pxi":91
* j_args[index].l = NULL
* continue
* if isinstance(py_arg, basestring) and PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* if argtype == '[B':
* py_arg = map(ord, py_arg)
*/
}
/* "jnius/jnius_conversion.pxi":96
* elif argtype == '[C':
* py_arg = list(py_arg)
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C': # <<<<<<<<<<<<<<
* py_arg = list(py_arg)
* if isinstance(py_arg, ByteArray) and argtype != '[B':
*/
__pyx_t_5 = PyString_Check(__pyx_v_py_arg);
__pyx_t_14 = (__pyx_t_5 != 0);
if (__pyx_t_14) {
} else {
__pyx_t_15 = __pyx_t_14;
goto __pyx_L17_bool_binop_done;
}
__pyx_t_14 = ((PY_MAJOR_VERSION >= 3) != 0);
if (__pyx_t_14) {
} else {
__pyx_t_15 = __pyx_t_14;
goto __pyx_L17_bool_binop_done;
}
__pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_kp_s_C_2, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(3, 96, __pyx_L1_error)
__pyx_t_15 = __pyx_t_14;
__pyx_L17_bool_binop_done:;
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":97
* py_arg = list(py_arg)
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
* py_arg = list(py_arg) # <<<<<<<<<<<<<<
* if isinstance(py_arg, ByteArray) and argtype != '[B':
* raise JavaException(
*/
__pyx_t_4 = PySequence_List(__pyx_v_py_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_py_arg, __pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":96
* elif argtype == '[C':
* py_arg = list(py_arg)
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C': # <<<<<<<<<<<<<<
* py_arg = list(py_arg)
* if isinstance(py_arg, ByteArray) and argtype != '[B':
*/
}
/* "jnius/jnius_conversion.pxi":98
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
* py_arg = list(py_arg)
* if isinstance(py_arg, ByteArray) and argtype != '[B': # <<<<<<<<<<<<<<
* raise JavaException(
* 'Cannot use ByteArray for signature {}'.format(argtype))
*/
__pyx_t_14 = __Pyx_TypeCheck(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_ByteArray);
__pyx_t_5 = (__pyx_t_14 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_15 = __pyx_t_5;
goto __pyx_L21_bool_binop_done;
}
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_argtype, __pyx_kp_s_B_2, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 98, __pyx_L1_error)
__pyx_t_15 = __pyx_t_5;
__pyx_L21_bool_binop_done:;
if (__pyx_t_15) {
/* "jnius/jnius_conversion.pxi":99
* py_arg = list(py_arg)
* if isinstance(py_arg, ByteArray) and argtype != '[B':
* raise JavaException( # <<<<<<<<<<<<<<
* 'Cannot use ByteArray for signature {}'.format(argtype))
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)):
*/
__pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
/* "jnius/jnius_conversion.pxi":100
* if isinstance(py_arg, ByteArray) and argtype != '[B':
* raise JavaException(
* 'Cannot use ByteArray for signature {}'.format(argtype)) # <<<<<<<<<<<<<<
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)):
* raise JavaException('Expecting a python list/tuple, got '
*/
__pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_use_ByteArray_for_signatu, __pyx_n_s_format); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_20);
__pyx_t_21 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) {
__pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
if (likely(__pyx_t_21)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
__Pyx_INCREF(__pyx_t_21);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_20, function);
}
}
if (!__pyx_t_21) {
__pyx_t_25 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_argtype); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_25);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_20)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_v_argtype};
__pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_25);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_v_argtype};
__pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_25);
} else
#endif
{
__pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __pyx_t_21 = NULL;
__Pyx_INCREF(__pyx_v_argtype);
__Pyx_GIVEREF(__pyx_v_argtype);
PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_v_argtype);
__pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_22, NULL); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_25);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
}
}
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__pyx_t_20 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
__pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
if (likely(__pyx_t_20)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
__Pyx_INCREF(__pyx_t_20);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_19, function);
}
}
if (!__pyx_t_20) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_25); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_25};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_25};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
} else
#endif
{
__pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20); __pyx_t_20 = NULL;
__Pyx_GIVEREF(__pyx_t_25);
PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_25);
__pyx_t_25 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
}
}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 99, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":98
* if isinstance(py_arg, str) and PY_MAJOR_VERSION >= 3 and argtype == '[C':
* py_arg = list(py_arg)
* if isinstance(py_arg, ByteArray) and argtype != '[B': # <<<<<<<<<<<<<<
* raise JavaException(
* 'Cannot use ByteArray for signature {}'.format(argtype))
*/
}
/* "jnius/jnius_conversion.pxi":101
* raise JavaException(
* 'Cannot use ByteArray for signature {}'.format(argtype))
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)): # <<<<<<<<<<<<<<
* raise JavaException('Expecting a python list/tuple, got '
* '{0!r}'.format(py_arg))
*/
__pyx_t_5 = PyList_Check(__pyx_v_py_arg);
__pyx_t_14 = (__pyx_t_5 != 0);
if (!__pyx_t_14) {
} else {
__pyx_t_15 = __pyx_t_14;
goto __pyx_L24_bool_binop_done;
}
__pyx_t_14 = PyTuple_Check(__pyx_v_py_arg);
__pyx_t_5 = (__pyx_t_14 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_15 = __pyx_t_5;
goto __pyx_L24_bool_binop_done;
}
__pyx_t_5 = __Pyx_TypeCheck(__pyx_v_py_arg, __pyx_ptype_5jnius_5jnius_ByteArray);
__pyx_t_14 = (__pyx_t_5 != 0);
if (!__pyx_t_14) {
} else {
__pyx_t_15 = __pyx_t_14;
goto __pyx_L24_bool_binop_done;
}
__pyx_t_14 = PyBytes_Check(__pyx_v_py_arg);
__pyx_t_5 = (__pyx_t_14 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_15 = __pyx_t_5;
goto __pyx_L24_bool_binop_done;
}
__pyx_t_5 = PyByteArray_Check(__pyx_v_py_arg);
__pyx_t_14 = (__pyx_t_5 != 0);
__pyx_t_15 = __pyx_t_14;
__pyx_L24_bool_binop_done:;
__pyx_t_14 = ((!(__pyx_t_15 != 0)) != 0);
if (__pyx_t_14) {
/* "jnius/jnius_conversion.pxi":102
* 'Cannot use ByteArray for signature {}'.format(argtype))
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)):
* raise JavaException('Expecting a python list/tuple, got ' # <<<<<<<<<<<<<<
* '{0!r}'.format(py_arg))
* j_args[index].l = convert_pyarray_to_java(
*/
__pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
/* "jnius/jnius_conversion.pxi":103
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)):
* raise JavaException('Expecting a python list/tuple, got '
* '{0!r}'.format(py_arg)) # <<<<<<<<<<<<<<
* j_args[index].l = convert_pyarray_to_java(
* j_env, argtype[1:], py_arg)
*/
__pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Expecting_a_python_list_tuple_go, __pyx_n_s_format); if (unlikely(!__pyx_t_25)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_25);
__pyx_t_20 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_25))) {
__pyx_t_20 = PyMethod_GET_SELF(__pyx_t_25);
if (likely(__pyx_t_20)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_25);
__Pyx_INCREF(__pyx_t_20);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_25, function);
}
}
if (!__pyx_t_20) {
__pyx_t_22 = __Pyx_PyObject_CallOneArg(__pyx_t_25, __pyx_v_py_arg); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_25)) {
PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_py_arg};
__pyx_t_22 = __Pyx_PyFunction_FastCall(__pyx_t_25, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_22);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_25)) {
PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_py_arg};
__pyx_t_22 = __Pyx_PyCFunction_FastCall(__pyx_t_25, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_22);
} else
#endif
{
__pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_21);
__Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20); __pyx_t_20 = NULL;
__Pyx_INCREF(__pyx_v_py_arg);
__Pyx_GIVEREF(__pyx_v_py_arg);
PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_v_py_arg);
__pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_t_21, NULL); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
}
}
__Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
__pyx_t_25 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
__pyx_t_25 = PyMethod_GET_SELF(__pyx_t_19);
if (likely(__pyx_t_25)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
__Pyx_INCREF(__pyx_t_25);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_19, function);
}
}
if (!__pyx_t_25) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_25, __pyx_t_22};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_25, __pyx_t_22};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
} else
#endif
{
__pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_21);
__Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_25); __pyx_t_25 = NULL;
__Pyx_GIVEREF(__pyx_t_22);
PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_t_22);
__pyx_t_22 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
}
}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 102, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":101
* raise JavaException(
* 'Cannot use ByteArray for signature {}'.format(argtype))
* if not isinstance(py_arg, (list, tuple, ByteArray, bytes, bytearray)): # <<<<<<<<<<<<<<
* raise JavaException('Expecting a python list/tuple, got '
* '{0!r}'.format(py_arg))
*/
}
/* "jnius/jnius_conversion.pxi":105
* '{0!r}'.format(py_arg))
* j_args[index].l = convert_pyarray_to_java(
* j_env, argtype[1:], py_arg) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_argtype, 1, 0, NULL, NULL, &__pyx_slice__24, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "jnius/jnius_conversion.pxi":104
* raise JavaException('Expecting a python list/tuple, got '
* '{0!r}'.format(py_arg))
* j_args[index].l = convert_pyarray_to_java( # <<<<<<<<<<<<<<
* j_env, argtype[1:], py_arg)
*
*/
__pyx_t_17 = __pyx_f_5jnius_5jnius_convert_pyarray_to_java(__pyx_v_j_env, __pyx_t_4, __pyx_v_py_arg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 104, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_j_args[__pyx_v_index]).l = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":87
* 'argument. Want {0!r}, got {1!r}'.format(
* argtype[1:-1], py_arg))
* elif argtype[0] == '[': # <<<<<<<<<<<<<<
* if py_arg is None:
* j_args[index].l = NULL
*/
}
__pyx_L5:;
/* "jnius/jnius_conversion.pxi":38
* cdef int index
*
* for index, argtype in enumerate(definition_args): # <<<<<<<<<<<<<<
* py_arg = args[index]
* if argtype == 'Z':
*/
__pyx_L3_continue:;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":30
* j_env[0].DeleteLocalRef(j_env, j_args[index].l)
*
* cdef void populate_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, args) except *: # <<<<<<<<<<<<<<
* # do the conversion from a Python object to Java from a Java definition
* cdef JavaClassStorage jcs
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_XDECREF(__pyx_t_20);
__Pyx_XDECREF(__pyx_t_21);
__Pyx_XDECREF(__pyx_t_22);
__Pyx_XDECREF(__pyx_t_23);
__Pyx_XDECREF(__pyx_t_25);
__Pyx_AddTraceback("jnius.jnius.populate_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jcs);
__Pyx_XDECREF((PyObject *)__pyx_v_jo);
__Pyx_XDECREF((PyObject *)__pyx_v_jc);
__Pyx_XDECREF((PyObject *)__pyx_v_pc);
__Pyx_XDECREF(__pyx_v_argtype);
__Pyx_XDECREF(__pyx_v_py_arg);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_conversion.pxi":108
*
*
* cdef convert_jobject_to_python(JNIEnv *j_env, definition, jobject j_object): # <<<<<<<<<<<<<<
* # Convert a Java Object to a Python object, according to the definition.
* # If the definition is a java/lang/Object, then try to determine what is it
*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jobject_to_python(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition, jobject __pyx_v_j_object) {
PyObject *__pyx_v_r = NULL;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_ret_jc = 0;
jclass __pyx_v_retclass;
jmethodID __pyx_v_retmeth;
jstring __pyx_v_string;
PyObject *__pyx_v_Object = NULL;
PyObject *__pyx_v_autoclass = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
long __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("convert_jobject_to_python", 0);
__Pyx_INCREF(__pyx_v_definition);
/* "jnius/jnius_conversion.pxi":112
* # If the definition is a java/lang/Object, then try to determine what is it
* # exactly.
* r = definition[1:-1] # <<<<<<<<<<<<<<
* cdef JavaObject ret_jobject
* cdef JavaClass ret_jc
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__25, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_r = __pyx_t_1;
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":119
*
* # we got a generic object -> lookup for the real name instead.
* if r == 'java/lang/Object': # <<<<<<<<<<<<<<
* r = definition = lookup_java_object_name(j_env, j_object)
* # print('cjtp:r {0} definition {1}'.format(r, definition))
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Object, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 119, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":120
* # we got a generic object -> lookup for the real name instead.
* if r == 'java/lang/Object':
* r = definition = lookup_java_object_name(j_env, j_object) # <<<<<<<<<<<<<<
* # print('cjtp:r {0} definition {1}'.format(r, definition))
*
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_lookup_java_object_name(__pyx_v_j_env, __pyx_v_j_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_definition, __pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":119
*
* # we got a generic object -> lookup for the real name instead.
* if r == 'java/lang/Object': # <<<<<<<<<<<<<<
* r = definition = lookup_java_object_name(j_env, j_object)
* # print('cjtp:r {0} definition {1}'.format(r, definition))
*/
}
/* "jnius/jnius_conversion.pxi":123
* # print('cjtp:r {0} definition {1}'.format(r, definition))
*
* if definition[0] == '[': # <<<<<<<<<<<<<<
* return convert_jarray_to_python(j_env, definition[1:], j_object)
*
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":124
*
* if definition[0] == '[':
* return convert_jarray_to_python(j_env, definition[1:], j_object) # <<<<<<<<<<<<<<
*
* # XXX what about others native type?
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__26, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_f_5jnius_5jnius_convert_jarray_to_python(__pyx_v_j_env, __pyx_t_1, __pyx_v_j_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":123
* # print('cjtp:r {0} definition {1}'.format(r, definition))
*
* if definition[0] == '[': # <<<<<<<<<<<<<<
* return convert_jarray_to_python(j_env, definition[1:], j_object)
*
*/
}
/* "jnius/jnius_conversion.pxi":132
*
* # if we got a string, just convert back to Python str.
* if r in ('java/lang/String', 'java/lang/CharSequence'): # <<<<<<<<<<<<<<
* if r == 'java/lang/CharSequence':
* # call toString()
*/
__Pyx_INCREF(__pyx_v_r);
__pyx_t_3 = __pyx_v_r;
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s_java_lang_String, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 132, __pyx_L1_error)
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s_java_lang_CharSequence, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 132, __pyx_L1_error)
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":133
* # if we got a string, just convert back to Python str.
* if r in ('java/lang/String', 'java/lang/CharSequence'):
* if r == 'java/lang/CharSequence': # <<<<<<<<<<<<<<
* # call toString()
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_CharSequence, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 133, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":135
* if r == 'java/lang/CharSequence':
* # call toString()
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, "toString", "()Ljava/lang/String;")
* string = <jstring> (j_env[0].CallObjectMethod(j_env, j_object, retmeth))
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":136
* # call toString()
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, "toString", "()Ljava/lang/String;") # <<<<<<<<<<<<<<
* string = <jstring> (j_env[0].CallObjectMethod(j_env, j_object, retmeth))
* else:
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"toString"), ((char const *)"()Ljava/lang/String;"));
/* "jnius/jnius_conversion.pxi":137
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, "toString", "()Ljava/lang/String;")
* string = <jstring> (j_env[0].CallObjectMethod(j_env, j_object, retmeth)) # <<<<<<<<<<<<<<
* else:
* string = <jstring>j_object
*/
__pyx_v_string = ((jstring)(__pyx_v_j_env[0])->CallObjectMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth));
/* "jnius/jnius_conversion.pxi":133
* # if we got a string, just convert back to Python str.
* if r in ('java/lang/String', 'java/lang/CharSequence'):
* if r == 'java/lang/CharSequence': # <<<<<<<<<<<<<<
* # call toString()
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
goto __pyx_L8;
}
/* "jnius/jnius_conversion.pxi":139
* string = <jstring> (j_env[0].CallObjectMethod(j_env, j_object, retmeth))
* else:
* string = <jstring>j_object # <<<<<<<<<<<<<<
* return convert_jstring_to_python(j_env, string)
*
*/
/*else*/ {
__pyx_v_string = ((jstring)__pyx_v_j_object);
}
__pyx_L8:;
/* "jnius/jnius_conversion.pxi":140
* else:
* string = <jstring>j_object
* return convert_jstring_to_python(j_env, string) # <<<<<<<<<<<<<<
*
* # XXX should be deactivable from configuration
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_5jnius_5jnius_convert_jstring_to_python(__pyx_v_j_env, __pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":132
*
* # if we got a string, just convert back to Python str.
* if r in ('java/lang/String', 'java/lang/CharSequence'): # <<<<<<<<<<<<<<
* if r == 'java/lang/CharSequence':
* # call toString()
*/
}
/* "jnius/jnius_conversion.pxi":144
* # XXX should be deactivable from configuration
* # ie, user might not want autoconvertion of lang classes.
* if r == 'java/lang/Long': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Long, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 144, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":145
* # ie, user might not want autoconvertion of lang classes.
* if r == 'java/lang/Long':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
* return j_env[0].CallLongMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":146
* if r == 'java/lang/Long':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J') # <<<<<<<<<<<<<<
* return j_env[0].CallLongMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Integer':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"longValue"), ((char const *)"()J"));
/* "jnius/jnius_conversion.pxi":147
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
* return j_env[0].CallLongMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Integer':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jlong((__pyx_v_j_env[0])->CallLongMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":144
* # XXX should be deactivable from configuration
* # ie, user might not want autoconvertion of lang classes.
* if r == 'java/lang/Long': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
*/
}
/* "jnius/jnius_conversion.pxi":148
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
* return j_env[0].CallLongMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Integer': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Integer, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 148, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":149
* return j_env[0].CallLongMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Integer':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
* return j_env[0].CallIntMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":150
* if r == 'java/lang/Integer':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I') # <<<<<<<<<<<<<<
* return j_env[0].CallIntMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Float':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"intValue"), ((char const *)"()I"));
/* "jnius/jnius_conversion.pxi":151
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
* return j_env[0].CallIntMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Float':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jint((__pyx_v_j_env[0])->CallIntMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":148
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'longValue', '()J')
* return j_env[0].CallLongMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Integer': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
*/
}
/* "jnius/jnius_conversion.pxi":152
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
* return j_env[0].CallIntMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Float': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Float, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 152, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":153
* return j_env[0].CallIntMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Float':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":154
* if r == 'java/lang/Float':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F') # <<<<<<<<<<<<<<
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Double':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"floatValue"), ((char const *)"()F"));
/* "jnius/jnius_conversion.pxi":155
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Double':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyFloat_FromDouble((__pyx_v_j_env[0])->CallFloatMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":152
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'intValue', '()I')
* return j_env[0].CallIntMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Float': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
*/
}
/* "jnius/jnius_conversion.pxi":156
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Double': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Double, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 156, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":157
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Double':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":158
* if r == 'java/lang/Double':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D') # <<<<<<<<<<<<<<
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Short':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"doubleValue"), ((char const *)"()D"));
/* "jnius/jnius_conversion.pxi":159
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Short':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyFloat_FromDouble((__pyx_v_j_env[0])->CallDoubleMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":156
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'floatValue', '()F')
* return j_env[0].CallFloatMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Double': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
*/
}
/* "jnius/jnius_conversion.pxi":160
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Short': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Short, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 160, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":161
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Short':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
* return j_env[0].CallShortMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":162
* if r == 'java/lang/Short':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S') # <<<<<<<<<<<<<<
* return j_env[0].CallShortMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Boolean':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"shortValue"), ((char const *)"()S"));
/* "jnius/jnius_conversion.pxi":163
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
* return j_env[0].CallShortMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Boolean':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jshort((__pyx_v_j_env[0])->CallShortMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":160
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'doubleValue', '()D')
* return j_env[0].CallDoubleMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Short': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
*/
}
/* "jnius/jnius_conversion.pxi":164
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
* return j_env[0].CallShortMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Boolean': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Boolean, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 164, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":165
* return j_env[0].CallShortMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Boolean':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":166
* if r == 'java/lang/Boolean':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z') # <<<<<<<<<<<<<<
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Byte':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"booleanValue"), ((char const *)"()Z"));
/* "jnius/jnius_conversion.pxi":167
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Byte':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jboolean((__pyx_v_j_env[0])->CallBooleanMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":164
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'shortValue', '()S')
* return j_env[0].CallShortMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Boolean': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
*/
}
/* "jnius/jnius_conversion.pxi":168
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Byte': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Byte, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 168, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":169
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Byte':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
* return j_env[0].CallByteMethod(j_env, j_object, retmeth)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":170
* if r == 'java/lang/Byte':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B') # <<<<<<<<<<<<<<
* return j_env[0].CallByteMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Character':
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"byteValue"), ((char const *)"()B"));
/* "jnius/jnius_conversion.pxi":171
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
* return j_env[0].CallByteMethod(j_env, j_object, retmeth) # <<<<<<<<<<<<<<
* if r == 'java/lang/Character':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jbyte((__pyx_v_j_env[0])->CallByteMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":168
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'booleanValue', '()Z')
* return j_env[0].CallBooleanMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Byte': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
*/
}
/* "jnius/jnius_conversion.pxi":172
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
* return j_env[0].CallByteMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Character': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'charValue', '()C')
*/
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s_java_lang_Character, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 172, __pyx_L1_error)
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":173
* return j_env[0].CallByteMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Character':
* retclass = j_env[0].GetObjectClass(j_env, j_object) # <<<<<<<<<<<<<<
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'charValue', '()C')
* return ord(j_env[0].CallCharMethod(j_env, j_object, retmeth))
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":174
* if r == 'java/lang/Character':
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'charValue', '()C') # <<<<<<<<<<<<<<
* return ord(j_env[0].CallCharMethod(j_env, j_object, retmeth))
*
*/
__pyx_v_retmeth = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"charValue"), ((char const *)"()C"));
/* "jnius/jnius_conversion.pxi":175
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'charValue', '()C')
* return ord(j_env[0].CallCharMethod(j_env, j_object, retmeth)) # <<<<<<<<<<<<<<
*
* if r not in jclass_register:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_jchar((__pyx_v_j_env[0])->CallCharMethod(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_retmeth)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) __PYX_ERR(3, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":172
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'byteValue', '()B')
* return j_env[0].CallByteMethod(j_env, j_object, retmeth)
* if r == 'java/lang/Character': # <<<<<<<<<<<<<<
* retclass = j_env[0].GetObjectClass(j_env, j_object)
* retmeth = j_env[0].GetMethodID(j_env, retclass, 'charValue', '()C')
*/
}
/* "jnius/jnius_conversion.pxi":177
* return ord(j_env[0].CallCharMethod(j_env, j_object, retmeth))
*
* if r not in jclass_register: # <<<<<<<<<<<<<<
* if r.startswith('$Proxy'):
* # only for $Proxy on android, don't use autoclass. The dalvik vm is
*/
if (unlikely(__pyx_v_5jnius_5jnius_jclass_register == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(3, 177, __pyx_L1_error)
}
__pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_r, __pyx_v_5jnius_5jnius_jclass_register, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 177, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_4 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":178
*
* if r not in jclass_register:
* if r.startswith('$Proxy'): # <<<<<<<<<<<<<<
* # only for $Proxy on android, don't use autoclass. The dalvik vm is
* # not able to give us introspection on that one (FindClass return
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 178, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":182
* # not able to give us introspection on that one (FindClass return
* # NULL).
* from .reflect import Object # <<<<<<<<<<<<<<
* ret_jc = Object(noinstance=True)
* else:
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_Object);
__Pyx_GIVEREF(__pyx_n_s_Object);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Object);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_reflect, __pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_Object = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_conversion.pxi":183
* # NULL).
* from .reflect import Object
* ret_jc = Object(noinstance=True) # <<<<<<<<<<<<<<
* else:
* from .reflect import autoclass
*/
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(3, 183, __pyx_L1_error)
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_Object, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 183, __pyx_L1_error)
__pyx_v_ret_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":178
*
* if r not in jclass_register:
* if r.startswith('$Proxy'): # <<<<<<<<<<<<<<
* # only for $Proxy on android, don't use autoclass. The dalvik vm is
* # not able to give us introspection on that one (FindClass return
*/
goto __pyx_L18;
}
/* "jnius/jnius_conversion.pxi":185
* ret_jc = Object(noinstance=True)
* else:
* from .reflect import autoclass # <<<<<<<<<<<<<<
* ret_jc = autoclass(r.replace('/', '.'))(noinstance=True)
* else:
*/
/*else*/ {
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_autoclass);
__Pyx_GIVEREF(__pyx_n_s_autoclass);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_autoclass);
__pyx_t_3 = __Pyx_Import(__pyx_n_s_reflect, __pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_autoclass); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_autoclass = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_conversion.pxi":186
* else:
* from .reflect import autoclass
* ret_jc = autoclass(r.replace('/', '.'))(noinstance=True) # <<<<<<<<<<<<<<
* else:
* ret_jc = jclass_register[r](noinstance=True)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_INCREF(__pyx_v_autoclass);
__pyx_t_1 = __pyx_v_autoclass; __pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
if (!__pyx_t_7) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(3, 186, __pyx_L1_error)
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 186, __pyx_L1_error)
__pyx_v_ret_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_8);
__pyx_t_8 = 0;
}
__pyx_L18:;
/* "jnius/jnius_conversion.pxi":177
* return ord(j_env[0].CallCharMethod(j_env, j_object, retmeth))
*
* if r not in jclass_register: # <<<<<<<<<<<<<<
* if r.startswith('$Proxy'):
* # only for $Proxy on android, don't use autoclass. The dalvik vm is
*/
goto __pyx_L17;
}
/* "jnius/jnius_conversion.pxi":188
* ret_jc = autoclass(r.replace('/', '.'))(noinstance=True)
* else:
* ret_jc = jclass_register[r](noinstance=True) # <<<<<<<<<<<<<<
* ret_jc.instanciate_from(create_local_ref(j_env, j_object))
* return ret_jc
*/
/*else*/ {
if (unlikely(__pyx_v_5jnius_5jnius_jclass_register == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(3, 188, __pyx_L1_error)
}
__pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_5jnius_5jnius_jclass_register, __pyx_v_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(3, 188, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 188, __pyx_L1_error)
__pyx_v_ret_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_3);
__pyx_t_3 = 0;
}
__pyx_L17:;
/* "jnius/jnius_conversion.pxi":189
* else:
* ret_jc = jclass_register[r](noinstance=True)
* ret_jc.instanciate_from(create_local_ref(j_env, j_object)) # <<<<<<<<<<<<<<
* return ret_jc
*
*/
__pyx_t_3 = ((PyObject *)__pyx_f_5jnius_5jnius_create_local_ref(__pyx_v_j_env, __pyx_v_j_object)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_ret_jc->__pyx_vtab)->instanciate_from(__pyx_v_ret_jc, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_conversion.pxi":190
* ret_jc = jclass_register[r](noinstance=True)
* ret_jc.instanciate_from(create_local_ref(j_env, j_object))
* return ret_jc # <<<<<<<<<<<<<<
*
* cdef convert_jstring_to_python(JNIEnv *j_env, jstring j_string):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret_jc));
__pyx_r = ((PyObject *)__pyx_v_ret_jc);
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":108
*
*
* cdef convert_jobject_to_python(JNIEnv *j_env, definition, jobject j_object): # <<<<<<<<<<<<<<
* # Convert a Java Object to a Python object, according to the definition.
* # If the definition is a java/lang/Object, then try to determine what is it
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.convert_jobject_to_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_r);
__Pyx_XDECREF((PyObject *)__pyx_v_ret_jc);
__Pyx_XDECREF(__pyx_v_Object);
__Pyx_XDECREF(__pyx_v_autoclass);
__Pyx_XDECREF(__pyx_v_definition);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":192
* return ret_jc
*
* cdef convert_jstring_to_python(JNIEnv *j_env, jstring j_string): # <<<<<<<<<<<<<<
* cdef jchar *j_chars
* cdef jsize j_strlen
*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jstring_to_python(JNIEnv *__pyx_v_j_env, jstring __pyx_v_j_string) {
jchar *__pyx_v_j_chars;
jsize __pyx_v_j_strlen;
Py_ssize_t __pyx_v_buffsize;
PyObject *__pyx_v_py_uni = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
char const *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("convert_jstring_to_python", 0);
/* "jnius/jnius_conversion.pxi":198
* cdef unicode py_uni
*
* j_chars = j_env[0].GetStringChars(j_env, j_string, NULL) # <<<<<<<<<<<<<<
* if j_chars == NULL:
* check_exception(j_env) # raise error as JavaException
*/
__pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
/* "jnius/jnius_conversion.pxi":199
*
* j_chars = j_env[0].GetStringChars(j_env, j_string, NULL)
* if j_chars == NULL: # <<<<<<<<<<<<<<
* check_exception(j_env) # raise error as JavaException
* try:
*/
__pyx_t_1 = ((__pyx_v_j_chars == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":200
* j_chars = j_env[0].GetStringChars(j_env, j_string, NULL)
* if j_chars == NULL:
* check_exception(j_env) # raise error as JavaException # <<<<<<<<<<<<<<
* try:
* j_strlen = j_env[0].GetStringLength(j_env, j_string);
*/
__pyx_f_5jnius_5jnius_check_exception(__pyx_v_j_env); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":199
*
* j_chars = j_env[0].GetStringChars(j_env, j_string, NULL)
* if j_chars == NULL: # <<<<<<<<<<<<<<
* check_exception(j_env) # raise error as JavaException
* try:
*/
}
/* "jnius/jnius_conversion.pxi":201
* if j_chars == NULL:
* check_exception(j_env) # raise error as JavaException
* try: # <<<<<<<<<<<<<<
* j_strlen = j_env[0].GetStringLength(j_env, j_string);
*
*/
/*try:*/ {
/* "jnius/jnius_conversion.pxi":202
* check_exception(j_env) # raise error as JavaException
* try:
* j_strlen = j_env[0].GetStringLength(j_env, j_string); # <<<<<<<<<<<<<<
*
* buffsize = j_strlen * sizeof(jchar)
*/
__pyx_v_j_strlen = (__pyx_v_j_env[0])->GetStringLength(__pyx_v_j_env, __pyx_v_j_string);
/* "jnius/jnius_conversion.pxi":204
* j_strlen = j_env[0].GetStringLength(j_env, j_string);
*
* buffsize = j_strlen * sizeof(jchar) # <<<<<<<<<<<<<<
* # py_uni = (<char *>j_chars)[:buffsize].decode('utf-16')
* # Calling directly into c-api for utf-16 decoding due to Cython code gen
*/
__pyx_v_buffsize = (__pyx_v_j_strlen * (sizeof(jchar)));
/* "jnius/jnius_conversion.pxi":208
* # Calling directly into c-api for utf-16 decoding due to Cython code gen
* # bug for utf-16: https://github.com/cython/cython/issues/1696
* py_uni = PyUnicode_DecodeUTF16(<char *>j_chars, buffsize, NULL, NULL) # <<<<<<<<<<<<<<
* finally:
* j_env[0].ReleaseStringChars(j_env, j_string, j_chars)
*/
__pyx_t_2 = PyUnicode_DecodeUTF16(((char *)__pyx_v_j_chars), __pyx_v_buffsize, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 208, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_py_uni = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
}
/* "jnius/jnius_conversion.pxi":210
* py_uni = PyUnicode_DecodeUTF16(<char *>j_chars, buffsize, NULL, NULL)
* finally:
* j_env[0].ReleaseStringChars(j_env, j_string, j_chars) # <<<<<<<<<<<<<<
*
* if PY_MAJOR_VERSION < 3:
*/
/*finally:*/ {
/*normal exit:*/{
(__pyx_v_j_env[0])->ReleaseStringChars(__pyx_v_j_env, __pyx_v_j_string, __pyx_v_j_chars);
goto __pyx_L6;
}
/*exception exit:*/{
__Pyx_PyThreadState_declare
__pyx_L5_error:;
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
{
(__pyx_v_j_env[0])->ReleaseStringChars(__pyx_v_j_env, __pyx_v_j_string, __pyx_v_j_chars);
}
__Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
goto __pyx_L1_error;
}
__pyx_L6:;
}
/* "jnius/jnius_conversion.pxi":212
* j_env[0].ReleaseStringChars(j_env, j_string, j_chars)
*
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* return py_uni.encode('utf-8')
* else:
*/
__pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":213
*
* if PY_MAJOR_VERSION < 3:
* return py_uni.encode('utf-8') # <<<<<<<<<<<<<<
* else:
* return py_uni
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_py_uni == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
__PYX_ERR(3, 213, __pyx_L1_error)
}
__pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_py_uni); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":212
* j_env[0].ReleaseStringChars(j_env, j_string, j_chars)
*
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* return py_uni.encode('utf-8')
* else:
*/
}
/* "jnius/jnius_conversion.pxi":215
* return py_uni.encode('utf-8')
* else:
* return py_uni # <<<<<<<<<<<<<<
*
* cdef convert_jarray_to_python(JNIEnv *j_env, definition, jobject j_object):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_py_uni);
__pyx_r = __pyx_v_py_uni;
goto __pyx_L0;
}
/* "jnius/jnius_conversion.pxi":192
* return ret_jc
*
* cdef convert_jstring_to_python(JNIEnv *j_env, jstring j_string): # <<<<<<<<<<<<<<
* cdef jchar *j_chars
* cdef jsize j_strlen
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("jnius.jnius.convert_jstring_to_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_py_uni);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":217
* return py_uni
*
* cdef convert_jarray_to_python(JNIEnv *j_env, definition, jobject j_object): # <<<<<<<<<<<<<<
* cdef jboolean iscopy
* cdef jboolean *j_booleans
*/
static PyObject *__pyx_f_5jnius_5jnius_convert_jarray_to_python(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition, jobject __pyx_v_j_object) {
jboolean __pyx_v_iscopy;
jboolean *__pyx_v_j_booleans;
jbyte *__pyx_v_j_bytes;
jchar *__pyx_v_j_chars;
jshort *__pyx_v_j_shorts;
jint *__pyx_v_j_ints;
jlong *__pyx_v_j_longs;
jfloat *__pyx_v_j_floats;
jdouble *__pyx_v_j_doubles;
PyObject *__pyx_v_ret = 0;
jsize __pyx_v_array_size;
int __pyx_v_i;
jobject __pyx_v_j_object_item;
struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_ret_as_bytearray = 0;
PyObject *__pyx_v_r = NULL;
PyObject *__pyx_v_obj = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
jsize __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
__Pyx_RefNannySetupContext("convert_jarray_to_python", 0);
/* "jnius/jnius_conversion.pxi":227
* cdef jfloat *j_floats
* cdef jdouble *j_doubles
* cdef object ret = None # <<<<<<<<<<<<<<
* cdef jsize array_size
*
*/
__Pyx_INCREF(Py_None);
__pyx_v_ret = Py_None;
/* "jnius/jnius_conversion.pxi":238
* cdef ByteArray ret_as_bytearray
*
* if j_object == NULL: # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_1 = ((__pyx_v_j_object == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":239
*
* if j_object == NULL:
* return None # <<<<<<<<<<<<<<
*
* array_size = j_env[0].GetArrayLength(j_env, j_object)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":238
* cdef ByteArray ret_as_bytearray
*
* if j_object == NULL: # <<<<<<<<<<<<<<
* return None
*
*/
}
/* "jnius/jnius_conversion.pxi":241
* return None
*
* array_size = j_env[0].GetArrayLength(j_env, j_object) # <<<<<<<<<<<<<<
*
* r = definition[0]
*/
__pyx_v_array_size = (__pyx_v_j_env[0])->GetArrayLength(__pyx_v_j_env, __pyx_v_j_object);
/* "jnius/jnius_conversion.pxi":243
* array_size = j_env[0].GetArrayLength(j_env, j_object)
*
* r = definition[0] # <<<<<<<<<<<<<<
* if r == 'Z':
* j_booleans = j_env[0].GetBooleanArrayElements(
*/
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_r = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":244
*
* r = definition[0]
* if r == 'Z': # <<<<<<<<<<<<<<
* j_booleans = j_env[0].GetBooleanArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 244, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":245
* r = definition[0]
* if r == 'Z':
* j_booleans = j_env[0].GetBooleanArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(True if j_booleans[i] else False)
*/
__pyx_v_j_booleans = (__pyx_v_j_env[0])->GetBooleanArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":247
* j_booleans = j_env[0].GetBooleanArrayElements(
* j_env, j_object, &iscopy)
* ret = [(True if j_booleans[i] else False) # <<<<<<<<<<<<<<
* for i in range(array_size)]
* j_env[0].ReleaseBooleanArrayElements(
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "jnius/jnius_conversion.pxi":248
* j_env, j_object, &iscopy)
* ret = [(True if j_booleans[i] else False)
* for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseBooleanArrayElements(
* j_env, j_object, j_booleans, 0)
*/
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "jnius/jnius_conversion.pxi":247
* j_booleans = j_env[0].GetBooleanArrayElements(
* j_env, j_object, &iscopy)
* ret = [(True if j_booleans[i] else False) # <<<<<<<<<<<<<<
* for i in range(array_size)]
* j_env[0].ReleaseBooleanArrayElements(
*/
if (((__pyx_v_j_booleans[__pyx_v_i]) != 0)) {
__Pyx_INCREF(Py_True);
__pyx_t_5 = Py_True;
} else {
__Pyx_INCREF(Py_False);
__pyx_t_5 = Py_False;
}
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 247, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":249
* ret = [(True if j_booleans[i] else False)
* for i in range(array_size)]
* j_env[0].ReleaseBooleanArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_booleans, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseBooleanArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_booleans, 0);
/* "jnius/jnius_conversion.pxi":244
*
* r = definition[0]
* if r == 'Z': # <<<<<<<<<<<<<<
* j_booleans = j_env[0].GetBooleanArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":252
* j_env, j_object, j_booleans, 0)
*
* elif r == 'B': # <<<<<<<<<<<<<<
* j_bytes = j_env[0].GetByteArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 252, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":253
*
* elif r == 'B':
* j_bytes = j_env[0].GetByteArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret_as_bytearray = ByteArray()
*/
__pyx_v_j_bytes = (__pyx_v_j_env[0])->GetByteArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":255
* j_bytes = j_env[0].GetByteArrayElements(
* j_env, j_object, &iscopy)
* ret_as_bytearray = ByteArray() # <<<<<<<<<<<<<<
* ret_as_bytearray.set_buffer(j_env, j_object, array_size, j_bytes)
* return ret_as_bytearray
*/
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5jnius_5jnius_ByteArray), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ret_as_bytearray = ((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":256
* j_env, j_object, &iscopy)
* ret_as_bytearray = ByteArray()
* ret_as_bytearray.set_buffer(j_env, j_object, array_size, j_bytes) # <<<<<<<<<<<<<<
* return ret_as_bytearray
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_ByteArray *)__pyx_v_ret_as_bytearray->__pyx_vtab)->set_buffer(__pyx_v_ret_as_bytearray, __pyx_v_j_env, __pyx_v_j_object, __pyx_v_array_size, __pyx_v_j_bytes);
/* "jnius/jnius_conversion.pxi":257
* ret_as_bytearray = ByteArray()
* ret_as_bytearray.set_buffer(j_env, j_object, array_size, j_bytes)
* return ret_as_bytearray # <<<<<<<<<<<<<<
*
* elif r == 'C':
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ret_as_bytearray));
__pyx_r = ((PyObject *)__pyx_v_ret_as_bytearray);
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":252
* j_env, j_object, j_booleans, 0)
*
* elif r == 'B': # <<<<<<<<<<<<<<
* j_bytes = j_env[0].GetByteArrayElements(
* j_env, j_object, &iscopy)
*/
}
/* "jnius/jnius_conversion.pxi":259
* return ret_as_bytearray
*
* elif r == 'C': # <<<<<<<<<<<<<<
* j_chars = j_env[0].GetCharArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 259, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":260
*
* elif r == 'C':
* j_chars = j_env[0].GetCharArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [chr(<char>j_chars[i]) for i in range(array_size)]
*/
__pyx_v_j_chars = (__pyx_v_j_env[0])->GetCharArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":262
* j_chars = j_env[0].GetCharArrayElements(
* j_env, j_object, &iscopy)
* ret = [chr(<char>j_chars[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseCharArrayElements(
* j_env, j_object, j_chars, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = __Pyx_PyInt_From_char(((char)(__pyx_v_j_chars[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":263
* j_env, j_object, &iscopy)
* ret = [chr(<char>j_chars[i]) for i in range(array_size)]
* j_env[0].ReleaseCharArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_chars, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseCharArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_chars, 0);
/* "jnius/jnius_conversion.pxi":259
* return ret_as_bytearray
*
* elif r == 'C': # <<<<<<<<<<<<<<
* j_chars = j_env[0].GetCharArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":266
* j_env, j_object, j_chars, 0)
*
* elif r == 'S': # <<<<<<<<<<<<<<
* j_shorts = j_env[0].GetShortArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 266, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":267
*
* elif r == 'S':
* j_shorts = j_env[0].GetShortArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(<short>j_shorts[i]) for i in range(array_size)]
*/
__pyx_v_j_shorts = (__pyx_v_j_env[0])->GetShortArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":269
* j_shorts = j_env[0].GetShortArrayElements(
* j_env, j_object, &iscopy)
* ret = [(<short>j_shorts[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseShortArrayElements(
* j_env, j_object, j_shorts, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = __Pyx_PyInt_From_short(((short)(__pyx_v_j_shorts[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 269, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":270
* j_env, j_object, &iscopy)
* ret = [(<short>j_shorts[i]) for i in range(array_size)]
* j_env[0].ReleaseShortArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_shorts, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseShortArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_shorts, 0);
/* "jnius/jnius_conversion.pxi":266
* j_env, j_object, j_chars, 0)
*
* elif r == 'S': # <<<<<<<<<<<<<<
* j_shorts = j_env[0].GetShortArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":273
* j_env, j_object, j_shorts, 0)
*
* elif r == 'I': # <<<<<<<<<<<<<<
* j_ints = j_env[0].GetIntArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 273, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":274
*
* elif r == 'I':
* j_ints = j_env[0].GetIntArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(<int>j_ints[i]) for i in range(array_size)]
*/
__pyx_v_j_ints = (__pyx_v_j_env[0])->GetIntArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":276
* j_ints = j_env[0].GetIntArrayElements(
* j_env, j_object, &iscopy)
* ret = [(<int>j_ints[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseIntArrayElements(
* j_env, j_object, j_ints, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = __Pyx_PyInt_From_int(((int)(__pyx_v_j_ints[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 276, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":277
* j_env, j_object, &iscopy)
* ret = [(<int>j_ints[i]) for i in range(array_size)]
* j_env[0].ReleaseIntArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_ints, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseIntArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_ints, 0);
/* "jnius/jnius_conversion.pxi":273
* j_env, j_object, j_shorts, 0)
*
* elif r == 'I': # <<<<<<<<<<<<<<
* j_ints = j_env[0].GetIntArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":280
* j_env, j_object, j_ints, 0)
*
* elif r == 'J': # <<<<<<<<<<<<<<
* j_longs = j_env[0].GetLongArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_J, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 280, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":281
*
* elif r == 'J':
* j_longs = j_env[0].GetLongArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(<long long>j_longs[i]) for i in range(array_size)]
*/
__pyx_v_j_longs = (__pyx_v_j_env[0])->GetLongArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":283
* j_longs = j_env[0].GetLongArrayElements(
* j_env, j_object, &iscopy)
* ret = [(<long long>j_longs[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseLongArrayElements(
* j_env, j_object, j_longs, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(((PY_LONG_LONG)(__pyx_v_j_longs[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 283, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":284
* j_env, j_object, &iscopy)
* ret = [(<long long>j_longs[i]) for i in range(array_size)]
* j_env[0].ReleaseLongArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_longs, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseLongArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_longs, 0);
/* "jnius/jnius_conversion.pxi":280
* j_env, j_object, j_ints, 0)
*
* elif r == 'J': # <<<<<<<<<<<<<<
* j_longs = j_env[0].GetLongArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":287
* j_env, j_object, j_longs, 0)
*
* elif r == 'F': # <<<<<<<<<<<<<<
* j_floats = j_env[0].GetFloatArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 287, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":288
*
* elif r == 'F':
* j_floats = j_env[0].GetFloatArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(<float>j_floats[i]) for i in range(array_size)]
*/
__pyx_v_j_floats = (__pyx_v_j_env[0])->GetFloatArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":290
* j_floats = j_env[0].GetFloatArrayElements(
* j_env, j_object, &iscopy)
* ret = [(<float>j_floats[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseFloatArrayElements(
* j_env, j_object, j_floats, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = PyFloat_FromDouble(((float)(__pyx_v_j_floats[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 290, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":291
* j_env, j_object, &iscopy)
* ret = [(<float>j_floats[i]) for i in range(array_size)]
* j_env[0].ReleaseFloatArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_floats, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseFloatArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_floats, 0);
/* "jnius/jnius_conversion.pxi":287
* j_env, j_object, j_longs, 0)
*
* elif r == 'F': # <<<<<<<<<<<<<<
* j_floats = j_env[0].GetFloatArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":294
* j_env, j_object, j_floats, 0)
*
* elif r == 'D': # <<<<<<<<<<<<<<
* j_doubles = j_env[0].GetDoubleArrayElements(
* j_env, j_object, &iscopy)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 294, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":295
*
* elif r == 'D':
* j_doubles = j_env[0].GetDoubleArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, &iscopy)
* ret = [(<double>j_doubles[i]) for i in range(array_size)]
*/
__pyx_v_j_doubles = (__pyx_v_j_env[0])->GetDoubleArrayElements(__pyx_v_j_env, __pyx_v_j_object, (&__pyx_v_iscopy));
/* "jnius/jnius_conversion.pxi":297
* j_doubles = j_env[0].GetDoubleArrayElements(
* j_env, j_object, &iscopy)
* ret = [(<double>j_doubles[i]) for i in range(array_size)] # <<<<<<<<<<<<<<
* j_env[0].ReleaseDoubleArrayElements(
* j_env, j_object, j_doubles, 0)
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
__pyx_t_5 = PyFloat_FromDouble(((double)(__pyx_v_j_doubles[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 297, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":298
* j_env, j_object, &iscopy)
* ret = [(<double>j_doubles[i]) for i in range(array_size)]
* j_env[0].ReleaseDoubleArrayElements( # <<<<<<<<<<<<<<
* j_env, j_object, j_doubles, 0)
*
*/
(__pyx_v_j_env[0])->ReleaseDoubleArrayElements(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_j_doubles, 0);
/* "jnius/jnius_conversion.pxi":294
* j_env, j_object, j_floats, 0)
*
* elif r == 'D': # <<<<<<<<<<<<<<
* j_doubles = j_env[0].GetDoubleArrayElements(
* j_env, j_object, &iscopy)
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":301
* j_env, j_object, j_doubles, 0)
*
* elif r == 'L': # <<<<<<<<<<<<<<
* r = definition[1:-1]
* ret = []
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 301, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":302
*
* elif r == 'L':
* r = definition[1:-1] # <<<<<<<<<<<<<<
* ret = []
* for i in range(array_size):
*/
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__29, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_r, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":303
* elif r == 'L':
* r = definition[1:-1]
* ret = [] # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_object_item = j_env[0].GetObjectArrayElement(
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":304
* r = definition[1:-1]
* ret = []
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
*/
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "jnius/jnius_conversion.pxi":305
* ret = []
* for i in range(array_size):
* j_object_item = j_env[0].GetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, j_object, i)
* if j_object_item == NULL:
*/
__pyx_v_j_object_item = (__pyx_v_j_env[0])->GetObjectArrayElement(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_i);
/* "jnius/jnius_conversion.pxi":307
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
* if j_object_item == NULL: # <<<<<<<<<<<<<<
* ret.append(None)
* continue
*/
__pyx_t_1 = ((__pyx_v_j_object_item == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":308
* j_env, j_object, i)
* if j_object_item == NULL:
* ret.append(None) # <<<<<<<<<<<<<<
* continue
* obj = convert_jobject_to_python(j_env, definition, j_object_item)
*/
__pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_ret, Py_None); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 308, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":309
* if j_object_item == NULL:
* ret.append(None)
* continue # <<<<<<<<<<<<<<
* obj = convert_jobject_to_python(j_env, definition, j_object_item)
* ret.append(obj)
*/
goto __pyx_L19_continue;
/* "jnius/jnius_conversion.pxi":307
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
* if j_object_item == NULL: # <<<<<<<<<<<<<<
* ret.append(None)
* continue
*/
}
/* "jnius/jnius_conversion.pxi":310
* ret.append(None)
* continue
* obj = convert_jobject_to_python(j_env, definition, j_object_item) # <<<<<<<<<<<<<<
* ret.append(obj)
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_convert_jobject_to_python(__pyx_v_j_env, __pyx_v_definition, __pyx_v_j_object_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":311
* continue
* obj = convert_jobject_to_python(j_env, definition, j_object_item)
* ret.append(obj) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*
*/
__pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_v_obj); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 311, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":312
* obj = convert_jobject_to_python(j_env, definition, j_object_item)
* ret.append(obj)
* j_env[0].DeleteLocalRef(j_env, j_object_item) # <<<<<<<<<<<<<<
*
* elif r == '[':
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_j_object_item);
__pyx_L19_continue:;
}
/* "jnius/jnius_conversion.pxi":301
* j_env, j_object, j_doubles, 0)
*
* elif r == 'L': # <<<<<<<<<<<<<<
* r = definition[1:-1]
* ret = []
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":314
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*
* elif r == '[': # <<<<<<<<<<<<<<
* r = definition[1:]
* ret = []
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 314, __pyx_L1_error)
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":315
*
* elif r == '[':
* r = definition[1:] # <<<<<<<<<<<<<<
* ret = []
* for i in range(array_size):
*/
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__30, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_r, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":316
* elif r == '[':
* r = definition[1:]
* ret = [] # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_object_item = j_env[0].GetObjectArrayElement(
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":317
* r = definition[1:]
* ret = []
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
*/
__pyx_t_3 = __pyx_v_array_size;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "jnius/jnius_conversion.pxi":318
* ret = []
* for i in range(array_size):
* j_object_item = j_env[0].GetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, j_object, i)
* if j_object_item == NULL:
*/
__pyx_v_j_object_item = (__pyx_v_j_env[0])->GetObjectArrayElement(__pyx_v_j_env, __pyx_v_j_object, __pyx_v_i);
/* "jnius/jnius_conversion.pxi":320
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
* if j_object_item == NULL: # <<<<<<<<<<<<<<
* ret.append(None)
* continue
*/
__pyx_t_1 = ((__pyx_v_j_object_item == NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_conversion.pxi":321
* j_env, j_object, i)
* if j_object_item == NULL:
* ret.append(None) # <<<<<<<<<<<<<<
* continue
* obj = convert_jarray_to_python(j_env, r, j_object_item)
*/
__pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_ret, Py_None); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 321, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":322
* if j_object_item == NULL:
* ret.append(None)
* continue # <<<<<<<<<<<<<<
* obj = convert_jarray_to_python(j_env, r, j_object_item)
* ret.append(obj)
*/
goto __pyx_L22_continue;
/* "jnius/jnius_conversion.pxi":320
* j_object_item = j_env[0].GetObjectArrayElement(
* j_env, j_object, i)
* if j_object_item == NULL: # <<<<<<<<<<<<<<
* ret.append(None)
* continue
*/
}
/* "jnius/jnius_conversion.pxi":323
* ret.append(None)
* continue
* obj = convert_jarray_to_python(j_env, r, j_object_item) # <<<<<<<<<<<<<<
* ret.append(obj)
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_convert_jarray_to_python(__pyx_v_j_env, __pyx_v_r, __pyx_v_j_object_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_conversion.pxi":324
* continue
* obj = convert_jarray_to_python(j_env, r, j_object_item)
* ret.append(obj) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*
*/
__pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_v_obj); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 324, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":325
* obj = convert_jarray_to_python(j_env, r, j_object_item)
* ret.append(obj)
* j_env[0].DeleteLocalRef(j_env, j_object_item) # <<<<<<<<<<<<<<
*
* else:
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_j_object_item);
__pyx_L22_continue:;
}
/* "jnius/jnius_conversion.pxi":314
* j_env[0].DeleteLocalRef(j_env, j_object_item)
*
* elif r == '[': # <<<<<<<<<<<<<<
* r = definition[1:]
* ret = []
*/
goto __pyx_L4;
}
/* "jnius/jnius_conversion.pxi":328
*
* else:
* raise JavaException('Invalid return definition for array') # <<<<<<<<<<<<<<
*
* return ret
*/
/*else*/ {
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(3, 328, __pyx_L1_error)
}
__pyx_L4:;
/* "jnius/jnius_conversion.pxi":330
* raise JavaException('Invalid return definition for array')
*
* return ret # <<<<<<<<<<<<<<
*
* cdef jobject convert_python_to_jobject(JNIEnv *j_env, definition, obj) except *:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ret);
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":217
* return py_uni
*
* cdef convert_jarray_to_python(JNIEnv *j_env, definition, jobject j_object): # <<<<<<<<<<<<<<
* cdef jboolean iscopy
* cdef jboolean *j_booleans
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("jnius.jnius.convert_jarray_to_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XDECREF((PyObject *)__pyx_v_ret_as_bytearray);
__Pyx_XDECREF(__pyx_v_r);
__Pyx_XDECREF(__pyx_v_obj);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":332
* return ret
*
* cdef jobject convert_python_to_jobject(JNIEnv *j_env, definition, obj) except *: # <<<<<<<<<<<<<<
* cdef jobject retobject, retsubobject
* cdef jclass retclass
*/
static jobject __pyx_f_5jnius_5jnius_convert_python_to_jobject(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition, PyObject *__pyx_v_obj) {
jobject __pyx_v_retobject;
jobject __pyx_v_retsubobject;
jclass __pyx_v_retclass;
jvalue __pyx_v_j_ret[1];
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc = 0;
struct __pyx_obj_5jnius_5jnius_JavaObject *__pyx_v_jo = 0;
struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_jcs = 0;
struct __pyx_obj_5jnius_5jnius_PythonJavaClass *__pyx_v_pc = 0;
int __pyx_v_index;
jmethodID __pyx_v_retmidinit;
PyObject *__pyx_v_conversions = NULL;
PyObject *__pyx_v_item = NULL;
PyObject *__pyx_v_item_definition = NULL;
jobject __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
jstring __pyx_t_5;
int __pyx_t_6;
jint __pyx_t_7;
jobject __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
Py_ssize_t __pyx_t_16;
PyObject *(*__pyx_t_17)(PyObject *);
jbyte __pyx_t_18;
jshort __pyx_t_19;
jlong __pyx_t_20;
jfloat __pyx_t_21;
jdouble __pyx_t_22;
long __pyx_t_23;
jboolean __pyx_t_24;
__Pyx_RefNannySetupContext("convert_python_to_jobject", 0);
/* "jnius/jnius_conversion.pxi":343
* cdef int index
*
* if definition[0] == 'V': # <<<<<<<<<<<<<<
* return NULL
* elif definition[0] == 'L':
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_V, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 343, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":344
*
* if definition[0] == 'V':
* return NULL # <<<<<<<<<<<<<<
* elif definition[0] == 'L':
* if obj is None:
*/
__pyx_r = NULL;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":343
* cdef int index
*
* if definition[0] == 'V': # <<<<<<<<<<<<<<
* return NULL
* elif definition[0] == 'L':
*/
}
/* "jnius/jnius_conversion.pxi":345
* if definition[0] == 'V':
* return NULL
* elif definition[0] == 'L': # <<<<<<<<<<<<<<
* if obj is None:
* return NULL
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 345, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 345, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":346
* return NULL
* elif definition[0] == 'L':
* if obj is None: # <<<<<<<<<<<<<<
* return NULL
* elif isinstance(obj, basestring) and jstringy_arg(definition):
*/
__pyx_t_2 = (__pyx_v_obj == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":347
* elif definition[0] == 'L':
* if obj is None:
* return NULL # <<<<<<<<<<<<<<
* elif isinstance(obj, basestring) and jstringy_arg(definition):
* return convert_pystr_to_java(j_env, obj)
*/
__pyx_r = NULL;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":346
* return NULL
* elif definition[0] == 'L':
* if obj is None: # <<<<<<<<<<<<<<
* return NULL
* elif isinstance(obj, basestring) and jstringy_arg(definition):
*/
}
/* "jnius/jnius_conversion.pxi":348
* if obj is None:
* return NULL
* elif isinstance(obj, basestring) and jstringy_arg(definition): # <<<<<<<<<<<<<<
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \
*/
__pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_obj);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = __pyx_f_5jnius_5jnius_jstringy_arg(__pyx_v_definition); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 348, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __pyx_t_4;
__pyx_L5_bool_binop_done:;
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":349
* return NULL
* elif isinstance(obj, basestring) and jstringy_arg(definition):
* return convert_pystr_to_java(j_env, obj) # <<<<<<<<<<<<<<
* elif isinstance(obj, (int, long)) and \
* definition in (
*/
if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_obj))||((__pyx_v_obj) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_obj)->tp_name), 0))) __PYX_ERR(3, 349, __pyx_L1_error)
__pyx_t_5 = __pyx_f_5jnius_5jnius_convert_pystr_to_java(__pyx_v_j_env, ((PyObject*)__pyx_v_obj)); if (unlikely(__pyx_t_5 == NULL)) __PYX_ERR(3, 349, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":348
* if obj is None:
* return NULL
* elif isinstance(obj, basestring) and jstringy_arg(definition): # <<<<<<<<<<<<<<
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \
*/
}
/* "jnius/jnius_conversion.pxi":350
* elif isinstance(obj, basestring) and jstringy_arg(definition):
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \ # <<<<<<<<<<<<<<
* definition in (
* 'Ljava/lang/Integer;',
*/
__pyx_t_2 = PyInt_Check(__pyx_v_obj);
__pyx_t_6 = (__pyx_t_2 != 0);
if (!__pyx_t_6) {
} else {
__pyx_t_4 = __pyx_t_6;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_6 = PyLong_Check(__pyx_v_obj);
__pyx_t_2 = (__pyx_t_6 != 0);
__pyx_t_4 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
__pyx_t_2 = (__pyx_t_4 != 0);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
/* "jnius/jnius_conversion.pxi":351
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \
* definition in ( # <<<<<<<<<<<<<<
* 'Ljava/lang/Integer;',
* 'Ljava/lang/Number;',
*/
__Pyx_INCREF(__pyx_v_definition);
__pyx_t_1 = __pyx_v_definition;
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_Integer, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 351, __pyx_L1_error)
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_Number, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 351, __pyx_L1_error)
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_Long, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 351, __pyx_L1_error)
if (!__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_Ljava_lang_Object, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 351, __pyx_L1_error)
__pyx_t_2 = __pyx_t_4;
__pyx_L11_bool_binop_done:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = (__pyx_t_2 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L7_bool_binop_done:;
/* "jnius/jnius_conversion.pxi":350
* elif isinstance(obj, basestring) and jstringy_arg(definition):
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \ # <<<<<<<<<<<<<<
* definition in (
* 'Ljava/lang/Integer;',
*/
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":356
* 'Ljava/lang/Long;',
* 'Ljava/lang/Object;'):
* j_ret[0].i = obj # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
*/
__pyx_t_7 = __Pyx_PyInt_As_jint(__pyx_v_obj); if (unlikely((__pyx_t_7 == ((jint)-1)) && PyErr_Occurred())) __PYX_ERR(3, 356, __pyx_L1_error)
(__pyx_v_j_ret[0]).i = __pyx_t_7;
/* "jnius/jnius_conversion.pxi":357
* 'Ljava/lang/Object;'):
* j_ret[0].i = obj
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Integer"));
/* "jnius/jnius_conversion.pxi":358
* j_ret[0].i = obj
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V') # <<<<<<<<<<<<<<
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
* return retobject
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(I)V"));
/* "jnius/jnius_conversion.pxi":359
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret) # <<<<<<<<<<<<<<
* return retobject
* elif isinstance(obj, type):
*/
__pyx_v_retobject = (__pyx_v_j_env[0])->NewObjectA(__pyx_v_j_env, __pyx_v_retclass, __pyx_v_retmidinit, __pyx_v_j_ret);
/* "jnius/jnius_conversion.pxi":360
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
* return retobject # <<<<<<<<<<<<<<
* elif isinstance(obj, type):
* jc = obj
*/
__pyx_r = __pyx_v_retobject;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":350
* elif isinstance(obj, basestring) and jstringy_arg(definition):
* return convert_pystr_to_java(j_env, obj)
* elif isinstance(obj, (int, long)) and \ # <<<<<<<<<<<<<<
* definition in (
* 'Ljava/lang/Integer;',
*/
}
/* "jnius/jnius_conversion.pxi":361
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
* return retobject
* elif isinstance(obj, type): # <<<<<<<<<<<<<<
* jc = obj
* return jc.j_cls
*/
__pyx_t_3 = PyType_Check(__pyx_v_obj);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":362
* return retobject
* elif isinstance(obj, type):
* jc = obj # <<<<<<<<<<<<<<
* return jc.j_cls
* elif isinstance(obj, JavaClass):
*/
if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 362, __pyx_L1_error)
__pyx_t_1 = __pyx_v_obj;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":363
* elif isinstance(obj, type):
* jc = obj
* return jc.j_cls # <<<<<<<<<<<<<<
* elif isinstance(obj, JavaClass):
* jc = obj
*/
__pyx_r = __pyx_v_jc->j_cls;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":361
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
* return retobject
* elif isinstance(obj, type): # <<<<<<<<<<<<<<
* jc = obj
* return jc.j_cls
*/
}
/* "jnius/jnius_conversion.pxi":364
* jc = obj
* return jc.j_cls
* elif isinstance(obj, JavaClass): # <<<<<<<<<<<<<<
* jc = obj
* check_assignable_from(j_env, jc, definition[1:-1])
*/
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":365
* return jc.j_cls
* elif isinstance(obj, JavaClass):
* jc = obj # <<<<<<<<<<<<<<
* check_assignable_from(j_env, jc, definition[1:-1])
* return jc.j_self.obj
*/
if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 365, __pyx_L1_error)
__pyx_t_1 = __pyx_v_obj;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":366
* elif isinstance(obj, JavaClass):
* jc = obj
* check_assignable_from(j_env, jc, definition[1:-1]) # <<<<<<<<<<<<<<
* return jc.j_self.obj
* elif isinstance(obj, JavaObject):
*/
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__32, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_f_5jnius_5jnius_check_assignable_from(__pyx_v_j_env, __pyx_v_jc, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 366, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":367
* jc = obj
* check_assignable_from(j_env, jc, definition[1:-1])
* return jc.j_self.obj # <<<<<<<<<<<<<<
* elif isinstance(obj, JavaObject):
* jo = obj
*/
__pyx_r = __pyx_v_jc->j_self->obj;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":364
* jc = obj
* return jc.j_cls
* elif isinstance(obj, JavaClass): # <<<<<<<<<<<<<<
* jc = obj
* check_assignable_from(j_env, jc, definition[1:-1])
*/
}
/* "jnius/jnius_conversion.pxi":368
* check_assignable_from(j_env, jc, definition[1:-1])
* return jc.j_self.obj
* elif isinstance(obj, JavaObject): # <<<<<<<<<<<<<<
* jo = obj
* return jo.obj
*/
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaObject);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":369
* return jc.j_self.obj
* elif isinstance(obj, JavaObject):
* jo = obj # <<<<<<<<<<<<<<
* return jo.obj
* elif isinstance(obj, MetaJavaClass):
*/
if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaObject))))) __PYX_ERR(3, 369, __pyx_L1_error)
__pyx_t_1 = __pyx_v_obj;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_jo = ((struct __pyx_obj_5jnius_5jnius_JavaObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":370
* elif isinstance(obj, JavaObject):
* jo = obj
* return jo.obj # <<<<<<<<<<<<<<
* elif isinstance(obj, MetaJavaClass):
* jcs = obj.__cls_storage
*/
__pyx_r = __pyx_v_jo->obj;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":368
* check_assignable_from(j_env, jc, definition[1:-1])
* return jc.j_self.obj
* elif isinstance(obj, JavaObject): # <<<<<<<<<<<<<<
* jo = obj
* return jo.obj
*/
}
/* "jnius/jnius_conversion.pxi":371
* jo = obj
* return jo.obj
* elif isinstance(obj, MetaJavaClass): # <<<<<<<<<<<<<<
* jcs = obj.__cls_storage
* return jcs.j_cls
*/
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MetaJavaClass); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(3, 371, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":372
* return jo.obj
* elif isinstance(obj, MetaJavaClass):
* jcs = obj.__cls_storage # <<<<<<<<<<<<<<
* return jcs.j_cls
* elif isinstance(obj, PythonJavaClass):
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_cls_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5jnius_5jnius_JavaClassStorage))))) __PYX_ERR(3, 372, __pyx_L1_error)
__pyx_v_jcs = ((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":373
* elif isinstance(obj, MetaJavaClass):
* jcs = obj.__cls_storage
* return jcs.j_cls # <<<<<<<<<<<<<<
* elif isinstance(obj, PythonJavaClass):
* # from python class, get the proxy/python class
*/
__pyx_r = __pyx_v_jcs->j_cls;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":371
* jo = obj
* return jo.obj
* elif isinstance(obj, MetaJavaClass): # <<<<<<<<<<<<<<
* jcs = obj.__cls_storage
* return jcs.j_cls
*/
}
/* "jnius/jnius_conversion.pxi":374
* jcs = obj.__cls_storage
* return jcs.j_cls
* elif isinstance(obj, PythonJavaClass): # <<<<<<<<<<<<<<
* # from python class, get the proxy/python class
* pc = obj
*/
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_PythonJavaClass);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_conversion.pxi":376
* elif isinstance(obj, PythonJavaClass):
* # from python class, get the proxy/python class
* pc = obj # <<<<<<<<<<<<<<
* # get the java class
* jc = pc.j_self
*/
if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_PythonJavaClass))))) __PYX_ERR(3, 376, __pyx_L1_error)
__pyx_t_1 = __pyx_v_obj;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_pc = ((struct __pyx_obj_5jnius_5jnius_PythonJavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":378
* pc = obj
* # get the java class
* jc = pc.j_self # <<<<<<<<<<<<<<
* # get the localref
* return jc.j_self.obj
*/
if (!(likely(((__pyx_v_pc->j_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pc->j_self, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 378, __pyx_L1_error)
__pyx_t_1 = __pyx_v_pc->j_self;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":380
* jc = pc.j_self
* # get the localref
* return jc.j_self.obj # <<<<<<<<<<<<<<
* elif isinstance(obj, (tuple, list)):
* return convert_pyarray_to_java(j_env, definition, obj)
*/
__pyx_r = __pyx_v_jc->j_self->obj;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":374
* jcs = obj.__cls_storage
* return jcs.j_cls
* elif isinstance(obj, PythonJavaClass): # <<<<<<<<<<<<<<
* # from python class, get the proxy/python class
* pc = obj
*/
}
/* "jnius/jnius_conversion.pxi":381
* # get the localref
* return jc.j_self.obj
* elif isinstance(obj, (tuple, list)): # <<<<<<<<<<<<<<
* return convert_pyarray_to_java(j_env, definition, obj)
* else:
*/
__pyx_t_3 = PyTuple_Check(__pyx_v_obj);
__pyx_t_2 = (__pyx_t_3 != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_4 = __pyx_t_2;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_2 = PyList_Check(__pyx_v_obj);
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_4 = __pyx_t_3;
__pyx_L15_bool_binop_done:;
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":382
* return jc.j_self.obj
* elif isinstance(obj, (tuple, list)):
* return convert_pyarray_to_java(j_env, definition, obj) # <<<<<<<<<<<<<<
* else:
* raise JavaException('Invalid python object for this '
*/
__pyx_t_8 = __pyx_f_5jnius_5jnius_convert_pyarray_to_java(__pyx_v_j_env, __pyx_v_definition, __pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 382, __pyx_L1_error)
__pyx_r = __pyx_t_8;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":381
* # get the localref
* return jc.j_self.obj
* elif isinstance(obj, (tuple, list)): # <<<<<<<<<<<<<<
* return convert_pyarray_to_java(j_env, definition, obj)
* else:
*/
}
/* "jnius/jnius_conversion.pxi":384
* return convert_pyarray_to_java(j_env, definition, obj)
* else:
* raise JavaException('Invalid python object for this ' # <<<<<<<<<<<<<<
* 'argument. Want {0!r}, got {1!r}'.format(
* definition[1:-1], obj))
*/
/*else*/ {
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
/* "jnius/jnius_conversion.pxi":385
* else:
* raise JavaException('Invalid python object for this '
* 'argument. Want {0!r}, got {1!r}'.format( # <<<<<<<<<<<<<<
* definition[1:-1], obj))
*
*/
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_python_object_for_this_a, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
/* "jnius/jnius_conversion.pxi":386
* raise JavaException('Invalid python object for this '
* 'argument. Want {0!r}, got {1!r}'.format(
* definition[1:-1], obj)) # <<<<<<<<<<<<<<
*
* elif definition[0] == '[':
*/
__pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__33, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = NULL;
__pyx_t_14 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
if (likely(__pyx_t_13)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_11, function);
__pyx_t_14 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_11)) {
PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_12, __pyx_v_obj};
__pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 385, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_12, __pyx_v_obj};
__pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 385, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
{
__pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
if (__pyx_t_13) {
__Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
}
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_12);
__Pyx_INCREF(__pyx_v_obj);
__Pyx_GIVEREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_v_obj);
__pyx_t_12 = 0;
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
}
}
if (!__pyx_t_11) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
{
__pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __pyx_t_11 = NULL;
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_10);
__pyx_t_10 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(3, 384, __pyx_L1_error)
}
/* "jnius/jnius_conversion.pxi":345
* if definition[0] == 'V':
* return NULL
* elif definition[0] == 'L': # <<<<<<<<<<<<<<
* if obj is None:
* return NULL
*/
}
/* "jnius/jnius_conversion.pxi":388
* definition[1:-1], obj))
*
* elif definition[0] == '[': # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION < 3:
* conversions = {
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 388, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":389
*
* elif definition[0] == '[':
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* conversions = {
* int: 'I',
*/
__pyx_t_3 = ((PY_MAJOR_VERSION < 3) != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":391
* if PY_MAJOR_VERSION < 3:
* conversions = {
* int: 'I', # <<<<<<<<<<<<<<
* bool: 'Z',
* long: 'J',
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyInt_Type)), __pyx_n_s_I) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":392
* conversions = {
* int: 'I',
* bool: 'Z', # <<<<<<<<<<<<<<
* long: 'J',
* float: 'F',
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject*)&PyBool_Type), __pyx_n_s_Z) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":393
* int: 'I',
* bool: 'Z',
* long: 'J', # <<<<<<<<<<<<<<
* float: 'F',
* unicode: 'Ljava/lang/String;',
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyLong_Type)), __pyx_n_s_J) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":394
* bool: 'Z',
* long: 'J',
* float: 'F', # <<<<<<<<<<<<<<
* unicode: 'Ljava/lang/String;',
* bytes: 'Ljava/lang/String;'
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyFloat_Type)), __pyx_n_s_F) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":395
* long: 'J',
* float: 'F',
* unicode: 'Ljava/lang/String;', # <<<<<<<<<<<<<<
* bytes: 'Ljava/lang/String;'
* }
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyUnicode_Type)), __pyx_kp_s_Ljava_lang_String) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":396
* float: 'F',
* unicode: 'Ljava/lang/String;',
* bytes: 'Ljava/lang/String;' # <<<<<<<<<<<<<<
* }
* else:
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyBytes_Type)), __pyx_kp_s_Ljava_lang_String) < 0) __PYX_ERR(3, 391, __pyx_L1_error)
__pyx_v_conversions = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":389
*
* elif definition[0] == '[':
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* conversions = {
* int: 'I',
*/
goto __pyx_L17;
}
/* "jnius/jnius_conversion.pxi":400
* else:
* conversions = {
* int: 'I', # <<<<<<<<<<<<<<
* bool: 'Z',
* long: 'J',
*/
/*else*/ {
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyInt_Type)), __pyx_n_s_I) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":401
* conversions = {
* int: 'I',
* bool: 'Z', # <<<<<<<<<<<<<<
* long: 'J',
* float: 'F',
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject*)&PyBool_Type), __pyx_n_s_Z) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":402
* int: 'I',
* bool: 'Z',
* long: 'J', # <<<<<<<<<<<<<<
* float: 'F',
* unicode: 'Ljava/lang/String;',
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyLong_Type)), __pyx_n_s_J) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":403
* bool: 'Z',
* long: 'J',
* float: 'F', # <<<<<<<<<<<<<<
* unicode: 'Ljava/lang/String;',
* bytes: 'B'
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyFloat_Type)), __pyx_n_s_F) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":404
* long: 'J',
* float: 'F',
* unicode: 'Ljava/lang/String;', # <<<<<<<<<<<<<<
* bytes: 'B'
* }
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyUnicode_Type)), __pyx_kp_s_Ljava_lang_String) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":405
* float: 'F',
* unicode: 'Ljava/lang/String;',
* bytes: 'B' # <<<<<<<<<<<<<<
* }
* retclass = j_env[0].FindClass(j_env, 'java/lang/Object')
*/
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)(&PyBytes_Type)), __pyx_n_s_B) < 0) __PYX_ERR(3, 400, __pyx_L1_error)
__pyx_v_conversions = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
}
__pyx_L17:;
/* "jnius/jnius_conversion.pxi":407
* bytes: 'B'
* }
* retclass = j_env[0].FindClass(j_env, 'java/lang/Object') # <<<<<<<<<<<<<<
* retobject = j_env[0].NewObjectArray(j_env, len(obj), retclass, NULL)
* for index, item in enumerate(obj):
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Object"));
/* "jnius/jnius_conversion.pxi":408
* }
* retclass = j_env[0].FindClass(j_env, 'java/lang/Object')
* retobject = j_env[0].NewObjectArray(j_env, len(obj), retclass, NULL) # <<<<<<<<<<<<<<
* for index, item in enumerate(obj):
* item_definition = conversions.get(type(item), definition[1:])
*/
__pyx_t_16 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(3, 408, __pyx_L1_error)
__pyx_v_retobject = (__pyx_v_j_env[0])->NewObjectArray(__pyx_v_j_env, __pyx_t_16, __pyx_v_retclass, NULL);
/* "jnius/jnius_conversion.pxi":409
* retclass = j_env[0].FindClass(j_env, 'java/lang/Object')
* retobject = j_env[0].NewObjectArray(j_env, len(obj), retclass, NULL)
* for index, item in enumerate(obj): # <<<<<<<<<<<<<<
* item_definition = conversions.get(type(item), definition[1:])
* retsubobject = convert_python_to_jobject(
*/
__pyx_t_14 = 0;
if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
__pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_16 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(3, 409, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_17)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(3, 409, __pyx_L1_error)
#else
__pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
} else {
if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(3, 409, __pyx_L1_error)
#else
__pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
__pyx_t_9 = __pyx_t_17(__pyx_t_1);
if (unlikely(!__pyx_t_9)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(3, 409, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_9);
}
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9);
__pyx_t_9 = 0;
__pyx_v_index = __pyx_t_14;
__pyx_t_14 = (__pyx_t_14 + 1);
/* "jnius/jnius_conversion.pxi":410
* retobject = j_env[0].NewObjectArray(j_env, len(obj), retclass, NULL)
* for index, item in enumerate(obj):
* item_definition = conversions.get(type(item), definition[1:]) # <<<<<<<<<<<<<<
* retsubobject = convert_python_to_jobject(
* j_env, item_definition, item)
*/
__pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__34, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_15 = __Pyx_PyDict_GetItemDefault(__pyx_v_conversions, ((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF_SET(__pyx_v_item_definition, __pyx_t_15);
__pyx_t_15 = 0;
/* "jnius/jnius_conversion.pxi":411
* for index, item in enumerate(obj):
* item_definition = conversions.get(type(item), definition[1:])
* retsubobject = convert_python_to_jobject( # <<<<<<<<<<<<<<
* j_env, item_definition, item)
* j_env[0].SetObjectArrayElement(j_env, retobject, index,
*/
__pyx_t_8 = __pyx_f_5jnius_5jnius_convert_python_to_jobject(__pyx_v_j_env, __pyx_v_item_definition, __pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 411, __pyx_L1_error)
__pyx_v_retsubobject = __pyx_t_8;
/* "jnius/jnius_conversion.pxi":413
* retsubobject = convert_python_to_jobject(
* j_env, item_definition, item)
* j_env[0].SetObjectArrayElement(j_env, retobject, index, # <<<<<<<<<<<<<<
* retsubobject)
* return retobject
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, __pyx_v_retobject, __pyx_v_index, __pyx_v_retsubobject);
/* "jnius/jnius_conversion.pxi":409
* retclass = j_env[0].FindClass(j_env, 'java/lang/Object')
* retobject = j_env[0].NewObjectArray(j_env, len(obj), retclass, NULL)
* for index, item in enumerate(obj): # <<<<<<<<<<<<<<
* item_definition = conversions.get(type(item), definition[1:])
* retsubobject = convert_python_to_jobject(
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_conversion.pxi":415
* j_env[0].SetObjectArrayElement(j_env, retobject, index,
* retsubobject)
* return retobject # <<<<<<<<<<<<<<
*
* elif definition == 'B':
*/
__pyx_r = __pyx_v_retobject;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":388
* definition[1:-1], obj))
*
* elif definition[0] == '[': # <<<<<<<<<<<<<<
* if PY_MAJOR_VERSION < 3:
* conversions = {
*/
}
/* "jnius/jnius_conversion.pxi":417
* return retobject
*
* elif definition == 'B': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Byte')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 417, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":418
*
* elif definition == 'B':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Byte') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
* j_ret[0].b = obj
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Byte"));
/* "jnius/jnius_conversion.pxi":419
* elif definition == 'B':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Byte')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V') # <<<<<<<<<<<<<<
* j_ret[0].b = obj
* elif definition == 'S':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(B)V"));
/* "jnius/jnius_conversion.pxi":420
* retclass = j_env[0].FindClass(j_env, 'java/lang/Byte')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
* j_ret[0].b = obj # <<<<<<<<<<<<<<
* elif definition == 'S':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short')
*/
__pyx_t_18 = __Pyx_PyInt_As_jbyte(__pyx_v_obj); if (unlikely((__pyx_t_18 == ((jbyte)-1)) && PyErr_Occurred())) __PYX_ERR(3, 420, __pyx_L1_error)
(__pyx_v_j_ret[0]).b = __pyx_t_18;
/* "jnius/jnius_conversion.pxi":417
* return retobject
*
* elif definition == 'B': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Byte')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":421
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
* j_ret[0].b = obj
* elif definition == 'S': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 421, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":422
* j_ret[0].b = obj
* elif definition == 'S':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
* j_ret[0].s = obj
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Short"));
/* "jnius/jnius_conversion.pxi":423
* elif definition == 'S':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V') # <<<<<<<<<<<<<<
* j_ret[0].s = obj
* elif definition == 'I':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(S)V"));
/* "jnius/jnius_conversion.pxi":424
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
* j_ret[0].s = obj # <<<<<<<<<<<<<<
* elif definition == 'I':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
*/
__pyx_t_19 = __Pyx_PyInt_As_jshort(__pyx_v_obj); if (unlikely((__pyx_t_19 == ((jshort)-1)) && PyErr_Occurred())) __PYX_ERR(3, 424, __pyx_L1_error)
(__pyx_v_j_ret[0]).s = __pyx_t_19;
/* "jnius/jnius_conversion.pxi":421
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(B)V')
* j_ret[0].b = obj
* elif definition == 'S': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Short')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":425
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
* j_ret[0].s = obj
* elif definition == 'I': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 425, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":426
* j_ret[0].s = obj
* elif definition == 'I':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* j_ret[0].i = int(obj)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Integer"));
/* "jnius/jnius_conversion.pxi":427
* elif definition == 'I':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V') # <<<<<<<<<<<<<<
* j_ret[0].i = int(obj)
* elif definition == 'J':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(I)V"));
/* "jnius/jnius_conversion.pxi":428
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* j_ret[0].i = int(obj) # <<<<<<<<<<<<<<
* elif definition == 'J':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long')
*/
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_PyInt_As_jint(__pyx_t_1); if (unlikely((__pyx_t_7 == ((jint)-1)) && PyErr_Occurred())) __PYX_ERR(3, 428, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
(__pyx_v_j_ret[0]).i = __pyx_t_7;
/* "jnius/jnius_conversion.pxi":425
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(S)V')
* j_ret[0].s = obj
* elif definition == 'I': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Integer')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":429
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* j_ret[0].i = int(obj)
* elif definition == 'J': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_J, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 429, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":430
* j_ret[0].i = int(obj)
* elif definition == 'J':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
* j_ret[0].j = obj
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Long"));
/* "jnius/jnius_conversion.pxi":431
* elif definition == 'J':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V') # <<<<<<<<<<<<<<
* j_ret[0].j = obj
* elif definition == 'F':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(J)V"));
/* "jnius/jnius_conversion.pxi":432
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
* j_ret[0].j = obj # <<<<<<<<<<<<<<
* elif definition == 'F':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float')
*/
__pyx_t_20 = __Pyx_PyInt_As_jlong(__pyx_v_obj); if (unlikely((__pyx_t_20 == ((jlong)-1)) && PyErr_Occurred())) __PYX_ERR(3, 432, __pyx_L1_error)
(__pyx_v_j_ret[0]).j = __pyx_t_20;
/* "jnius/jnius_conversion.pxi":429
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(I)V')
* j_ret[0].i = int(obj)
* elif definition == 'J': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Long')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":433
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
* j_ret[0].j = obj
* elif definition == 'F': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 433, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":434
* j_ret[0].j = obj
* elif definition == 'F':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
* j_ret[0].f = obj
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Float"));
/* "jnius/jnius_conversion.pxi":435
* elif definition == 'F':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V') # <<<<<<<<<<<<<<
* j_ret[0].f = obj
* elif definition == 'D':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(F)V"));
/* "jnius/jnius_conversion.pxi":436
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
* j_ret[0].f = obj # <<<<<<<<<<<<<<
* elif definition == 'D':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double')
*/
__pyx_t_21 = __pyx_PyFloat_AsFloat(__pyx_v_obj); if (unlikely((__pyx_t_21 == ((jfloat)-1)) && PyErr_Occurred())) __PYX_ERR(3, 436, __pyx_L1_error)
(__pyx_v_j_ret[0]).f = __pyx_t_21;
/* "jnius/jnius_conversion.pxi":433
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(J)V')
* j_ret[0].j = obj
* elif definition == 'F': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Float')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":437
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
* j_ret[0].f = obj
* elif definition == 'D': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 437, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":438
* j_ret[0].f = obj
* elif definition == 'D':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
* j_ret[0].d = obj
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Double"));
/* "jnius/jnius_conversion.pxi":439
* elif definition == 'D':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V') # <<<<<<<<<<<<<<
* j_ret[0].d = obj
* elif definition == 'C':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(D)V"));
/* "jnius/jnius_conversion.pxi":440
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
* j_ret[0].d = obj # <<<<<<<<<<<<<<
* elif definition == 'C':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char')
*/
__pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_obj); if (unlikely((__pyx_t_22 == ((jdouble)-1)) && PyErr_Occurred())) __PYX_ERR(3, 440, __pyx_L1_error)
(__pyx_v_j_ret[0]).d = __pyx_t_22;
/* "jnius/jnius_conversion.pxi":437
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(F)V')
* j_ret[0].f = obj
* elif definition == 'D': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Double')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":441
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
* j_ret[0].d = obj
* elif definition == 'C': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 441, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":442
* j_ret[0].d = obj
* elif definition == 'C':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
* j_ret[0].c = ord(obj)
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Char"));
/* "jnius/jnius_conversion.pxi":443
* elif definition == 'C':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V') # <<<<<<<<<<<<<<
* j_ret[0].c = ord(obj)
* elif definition == 'Z':
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(C)V"));
/* "jnius/jnius_conversion.pxi":444
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
* j_ret[0].c = ord(obj) # <<<<<<<<<<<<<<
* elif definition == 'Z':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean')
*/
__pyx_t_23 = __Pyx_PyObject_Ord(__pyx_v_obj); if (unlikely(__pyx_t_23 == (long)(Py_UCS4)-1)) __PYX_ERR(3, 444, __pyx_L1_error)
(__pyx_v_j_ret[0]).c = __pyx_t_23;
/* "jnius/jnius_conversion.pxi":441
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(D)V')
* j_ret[0].d = obj
* elif definition == 'C': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Char')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":445
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
* j_ret[0].c = ord(obj)
* elif definition == 'Z': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(Z)V')
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 445, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":446
* j_ret[0].c = ord(obj)
* elif definition == 'Z':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean') # <<<<<<<<<<<<<<
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(Z)V')
* j_ret[0].z = 1 if obj else 0
*/
__pyx_v_retclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)"java/lang/Boolean"));
/* "jnius/jnius_conversion.pxi":447
* elif definition == 'Z':
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(Z)V') # <<<<<<<<<<<<<<
* j_ret[0].z = 1 if obj else 0
* else:
*/
__pyx_v_retmidinit = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_retclass, ((char const *)"<init>"), ((char const *)"(Z)V"));
/* "jnius/jnius_conversion.pxi":448
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(Z)V')
* j_ret[0].z = 1 if obj else 0 # <<<<<<<<<<<<<<
* else:
* assert(0)
*/
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 448, __pyx_L1_error)
if (__pyx_t_3) {
__pyx_t_24 = 1;
} else {
__pyx_t_24 = 0;
}
(__pyx_v_j_ret[0]).z = __pyx_t_24;
/* "jnius/jnius_conversion.pxi":445
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(C)V')
* j_ret[0].c = ord(obj)
* elif definition == 'Z': # <<<<<<<<<<<<<<
* retclass = j_env[0].FindClass(j_env, 'java/lang/Boolean')
* retmidinit = j_env[0].GetMethodID(j_env, retclass, '<init>', '(Z)V')
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":450
* j_ret[0].z = 1 if obj else 0
* else:
* assert(0) # <<<<<<<<<<<<<<
*
* assert(retclass != NULL)
*/
/*else*/ {
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!0)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(3, 450, __pyx_L1_error)
}
}
#endif
}
__pyx_L3:;
/* "jnius/jnius_conversion.pxi":452
* assert(0)
*
* assert(retclass != NULL) # <<<<<<<<<<<<<<
* # XXX do we need a globalref or something ?
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_retclass != NULL) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(3, 452, __pyx_L1_error)
}
}
#endif
/* "jnius/jnius_conversion.pxi":454
* assert(retclass != NULL)
* # XXX do we need a globalref or something ?
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret) # <<<<<<<<<<<<<<
* return retobject
*
*/
__pyx_v_retobject = (__pyx_v_j_env[0])->NewObjectA(__pyx_v_j_env, __pyx_v_retclass, __pyx_v_retmidinit, __pyx_v_j_ret);
/* "jnius/jnius_conversion.pxi":455
* # XXX do we need a globalref or something ?
* retobject = j_env[0].NewObjectA(j_env, retclass, retmidinit, j_ret)
* return retobject # <<<<<<<<<<<<<<
*
* cdef jstring convert_pystr_to_java(JNIEnv *j_env, basestring py_str) except NULL:
*/
__pyx_r = __pyx_v_retobject;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":332
* return ret
*
* cdef jobject convert_python_to_jobject(JNIEnv *j_env, definition, obj) except *: # <<<<<<<<<<<<<<
* cdef jobject retobject, retsubobject
* cdef jclass retclass
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_AddTraceback("jnius.jnius.convert_python_to_jobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jc);
__Pyx_XDECREF((PyObject *)__pyx_v_jo);
__Pyx_XDECREF((PyObject *)__pyx_v_jcs);
__Pyx_XDECREF((PyObject *)__pyx_v_pc);
__Pyx_XDECREF(__pyx_v_conversions);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XDECREF(__pyx_v_item_definition);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":457
* return retobject
*
* cdef jstring convert_pystr_to_java(JNIEnv *j_env, basestring py_str) except NULL: # <<<<<<<<<<<<<<
* cdef bytes py_bytes
* cdef unicode py_uni
*/
static jstring __pyx_f_5jnius_5jnius_convert_pystr_to_java(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_py_str) {
PyObject *__pyx_v_py_bytes = 0;
PyObject *__pyx_v_py_uni = 0;
jstring __pyx_v_j_str;
jsize __pyx_v_j_strlen;
char *__pyx_v_buff;
jstring __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
char *__pyx_t_4;
Py_ssize_t __pyx_t_5;
size_t __pyx_t_6;
__Pyx_RefNannySetupContext("convert_pystr_to_java", 0);
/* "jnius/jnius_conversion.pxi":464
* cdef char *buff
*
* if isinstance(py_str, bytes): # <<<<<<<<<<<<<<
* py_uni = (<bytes>py_str).decode('utf-8')
* else:
*/
__pyx_t_1 = PyBytes_Check(__pyx_v_py_str);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":465
*
* if isinstance(py_str, bytes):
* py_uni = (<bytes>py_str).decode('utf-8') # <<<<<<<<<<<<<<
* else:
* py_uni = py_str
*/
if (unlikely(__pyx_v_py_str == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
__PYX_ERR(3, 465, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_v_py_str), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 465, __pyx_L1_error)
__pyx_v_py_uni = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_conversion.pxi":464
* cdef char *buff
*
* if isinstance(py_str, bytes): # <<<<<<<<<<<<<<
* py_uni = (<bytes>py_str).decode('utf-8')
* else:
*/
goto __pyx_L3;
}
/* "jnius/jnius_conversion.pxi":467
* py_uni = (<bytes>py_str).decode('utf-8')
* else:
* py_uni = py_str # <<<<<<<<<<<<<<
*
* py_bytes = py_uni.encode('utf-16')
*/
/*else*/ {
if (!(likely(PyUnicode_CheckExact(__pyx_v_py_str))||((__pyx_v_py_str) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_py_str)->tp_name), 0))) __PYX_ERR(3, 467, __pyx_L1_error)
__pyx_t_3 = __pyx_v_py_str;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_py_uni = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
}
__pyx_L3:;
/* "jnius/jnius_conversion.pxi":469
* py_uni = py_str
*
* py_bytes = py_uni.encode('utf-16') # <<<<<<<<<<<<<<
* # skip byte-order mark
* buff = (<char *>py_bytes) + sizeof(jchar)
*/
if (unlikely(__pyx_v_py_uni == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
__PYX_ERR(3, 469, __pyx_L1_error)
}
__pyx_t_3 = PyUnicode_AsUTF16String(__pyx_v_py_uni); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyBytes_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 469, __pyx_L1_error)
__pyx_v_py_bytes = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_conversion.pxi":471
* py_bytes = py_uni.encode('utf-16')
* # skip byte-order mark
* buff = (<char *>py_bytes) + sizeof(jchar) # <<<<<<<<<<<<<<
* j_strlen = len(py_bytes) / sizeof(jchar) - 1
* j_str = j_env[0].NewString(j_env, <jchar *>buff, j_strlen)
*/
__pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_py_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 471, __pyx_L1_error)
__pyx_v_buff = (((char *)__pyx_t_4) + (sizeof(jchar)));
/* "jnius/jnius_conversion.pxi":472
* # skip byte-order mark
* buff = (<char *>py_bytes) + sizeof(jchar)
* j_strlen = len(py_bytes) / sizeof(jchar) - 1 # <<<<<<<<<<<<<<
* j_str = j_env[0].NewString(j_env, <jchar *>buff, j_strlen)
*
*/
if (unlikely(__pyx_v_py_bytes == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(3, 472, __pyx_L1_error)
}
__pyx_t_5 = PyBytes_GET_SIZE(__pyx_v_py_bytes); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 472, __pyx_L1_error)
__pyx_t_6 = (sizeof(jchar));
if (unlikely(__pyx_t_6 == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(3, 472, __pyx_L1_error)
}
__pyx_v_j_strlen = ((__pyx_t_5 / __pyx_t_6) - 1);
/* "jnius/jnius_conversion.pxi":473
* buff = (<char *>py_bytes) + sizeof(jchar)
* j_strlen = len(py_bytes) / sizeof(jchar) - 1
* j_str = j_env[0].NewString(j_env, <jchar *>buff, j_strlen) # <<<<<<<<<<<<<<
*
* if j_str == NULL:
*/
__pyx_v_j_str = (__pyx_v_j_env[0])->NewString(__pyx_v_j_env, ((jchar *)__pyx_v_buff), __pyx_v_j_strlen);
/* "jnius/jnius_conversion.pxi":475
* j_str = j_env[0].NewString(j_env, <jchar *>buff, j_strlen)
*
* if j_str == NULL: # <<<<<<<<<<<<<<
* check_exception(j_env) # raise error as JavaException
* return j_str
*/
__pyx_t_2 = ((__pyx_v_j_str == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":476
*
* if j_str == NULL:
* check_exception(j_env) # raise error as JavaException # <<<<<<<<<<<<<<
* return j_str
*
*/
__pyx_f_5jnius_5jnius_check_exception(__pyx_v_j_env); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 476, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":475
* j_str = j_env[0].NewString(j_env, <jchar *>buff, j_strlen)
*
* if j_str == NULL: # <<<<<<<<<<<<<<
* check_exception(j_env) # raise error as JavaException
* return j_str
*/
}
/* "jnius/jnius_conversion.pxi":477
* if j_str == NULL:
* check_exception(j_env) # raise error as JavaException
* return j_str # <<<<<<<<<<<<<<
*
* cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *:
*/
__pyx_r = __pyx_v_j_str;
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":457
* return retobject
*
* cdef jstring convert_pystr_to_java(JNIEnv *j_env, basestring py_str) except NULL: # <<<<<<<<<<<<<<
* cdef bytes py_bytes
* cdef unicode py_uni
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("jnius.jnius.convert_pystr_to_java", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_py_bytes);
__Pyx_XDECREF(__pyx_v_py_uni);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_conversion.pxi":479
* return j_str
*
* cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *: # <<<<<<<<<<<<<<
* cdef jobject ret = NULL
* cdef int array_size = len(pyarray)
*/
static jobject __pyx_f_5jnius_5jnius_convert_pyarray_to_java(JNIEnv *__pyx_v_j_env, PyObject *__pyx_v_definition, PyObject *__pyx_v_pyarray) {
jobject __pyx_v_ret;
int __pyx_v_array_size;
int __pyx_v_i;
unsigned char __pyx_v_c_tmp;
jboolean __pyx_v_j_boolean;
jbyte __pyx_v_j_byte;
jchar __pyx_v_j_char;
jshort __pyx_v_j_short;
jint __pyx_v_j_int;
jlong __pyx_v_j_long;
jfloat __pyx_v_j_float;
jdouble __pyx_v_j_double;
jstring __pyx_v_j_string;
jclass __pyx_v_j_class;
struct __pyx_obj_5jnius_5jnius_JavaObject *__pyx_v_jo = 0;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc = 0;
struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_a_bytes = 0;
PyObject *__pyx_v_conversions = NULL;
PyObject *__pyx_v__type = NULL;
PyObject *__pyx_v_override = NULL;
PyObject *__pyx_v_defstr = NULL;
PyObject *__pyx_v_arg = NULL;
PyObject *__pyx_v_subdef = NULL;
jobject __pyx_v_eproto;
jobject __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
jboolean __pyx_t_10;
unsigned char __pyx_t_11;
long __pyx_t_12;
jshort __pyx_t_13;
jint __pyx_t_14;
jlong __pyx_t_15;
jfloat __pyx_t_16;
jdouble __pyx_t_17;
char *__pyx_t_18;
PyObject *__pyx_t_19 = NULL;
PyObject *__pyx_t_20 = NULL;
PyObject *__pyx_t_21 = NULL;
PyObject *__pyx_t_22 = NULL;
jstring __pyx_t_23;
int __pyx_t_24;
jobject __pyx_t_25;
__Pyx_RefNannySetupContext("convert_pyarray_to_java", 0);
__Pyx_INCREF(__pyx_v_definition);
/* "jnius/jnius_conversion.pxi":480
*
* cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *:
* cdef jobject ret = NULL # <<<<<<<<<<<<<<
* cdef int array_size = len(pyarray)
* cdef int i
*/
__pyx_v_ret = NULL;
/* "jnius/jnius_conversion.pxi":481
* cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *:
* cdef jobject ret = NULL
* cdef int array_size = len(pyarray) # <<<<<<<<<<<<<<
* cdef int i
* cdef unsigned char c_tmp
*/
__pyx_t_1 = PyObject_Length(__pyx_v_pyarray); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 481, __pyx_L1_error)
__pyx_v_array_size = __pyx_t_1;
/* "jnius/jnius_conversion.pxi":500
*
*
* if definition == 'Ljava/lang/Object;' and len(pyarray) > 0: # <<<<<<<<<<<<<<
* # then the method will accept any array type as param
* # let's be as precise as we can
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_kp_s_Ljava_lang_Object, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 500, __pyx_L1_error)
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = PyObject_Length(__pyx_v_pyarray); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 500, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_1 > 0) != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":503
* # then the method will accept any array type as param
* # let's be as precise as we can
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* conversions = {
* int: 'I',
*/
__pyx_t_2 = ((PY_MAJOR_VERSION < 3) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":505
* if PY_MAJOR_VERSION < 3:
* conversions = {
* int: 'I', # <<<<<<<<<<<<<<
* bool: 'Z',
* long: 'J',
*/
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyInt_Type)), __pyx_n_s_I) < 0) __PYX_ERR(3, 505, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":506
* conversions = {
* int: 'I',
* bool: 'Z', # <<<<<<<<<<<<<<
* long: 'J',
* float: 'F',
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject*)&PyBool_Type), __pyx_n_s_Z) < 0) __PYX_ERR(3, 505, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":507
* int: 'I',
* bool: 'Z',
* long: 'J', # <<<<<<<<<<<<<<
* float: 'F',
* basestring: 'Ljava/lang/String;',
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyLong_Type)), __pyx_n_s_J) < 0) __PYX_ERR(3, 505, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":508
* bool: 'Z',
* long: 'J',
* float: 'F', # <<<<<<<<<<<<<<
* basestring: 'Ljava/lang/String;',
* }
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyFloat_Type)), __pyx_n_s_F) < 0) __PYX_ERR(3, 505, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":509
* long: 'J',
* float: 'F',
* basestring: 'Ljava/lang/String;', # <<<<<<<<<<<<<<
* }
* else:
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyBaseString_Type)), __pyx_kp_s_Ljava_lang_String) < 0) __PYX_ERR(3, 505, __pyx_L1_error)
__pyx_v_conversions = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":503
* # then the method will accept any array type as param
* # let's be as precise as we can
* if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<<
* conversions = {
* int: 'I',
*/
goto __pyx_L6;
}
/* "jnius/jnius_conversion.pxi":513
* else:
* conversions = {
* int: 'I', # <<<<<<<<<<<<<<
* bool: 'Z',
* long: 'J',
*/
/*else*/ {
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 513, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyInt_Type)), __pyx_n_s_I) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":514
* conversions = {
* int: 'I',
* bool: 'Z', # <<<<<<<<<<<<<<
* long: 'J',
* float: 'F',
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject*)&PyBool_Type), __pyx_n_s_Z) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":515
* int: 'I',
* bool: 'Z',
* long: 'J', # <<<<<<<<<<<<<<
* float: 'F',
* bytes: 'B',
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyLong_Type)), __pyx_n_s_J) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":516
* bool: 'Z',
* long: 'J',
* float: 'F', # <<<<<<<<<<<<<<
* bytes: 'B',
* str: 'Ljava/lang/String;',
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyFloat_Type)), __pyx_n_s_F) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":517
* long: 'J',
* float: 'F',
* bytes: 'B', # <<<<<<<<<<<<<<
* str: 'Ljava/lang/String;',
* }
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyBytes_Type)), __pyx_n_s_B) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":518
* float: 'F',
* bytes: 'B',
* str: 'Ljava/lang/String;', # <<<<<<<<<<<<<<
* }
* for _type, override in conversions.iteritems():
*/
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)(&PyString_Type)), __pyx_kp_s_Ljava_lang_String) < 0) __PYX_ERR(3, 513, __pyx_L1_error)
__pyx_v_conversions = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L6:;
/* "jnius/jnius_conversion.pxi":520
* str: 'Ljava/lang/String;',
* }
* for _type, override in conversions.iteritems(): # <<<<<<<<<<<<<<
* if isinstance(pyarray[0], _type):
* definition = override
*/
__pyx_t_1 = 0;
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_conversions, 1, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_4);
__pyx_t_4 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_1, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v__type, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_override, __pyx_t_8);
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":521
* }
* for _type, override in conversions.iteritems():
* if isinstance(pyarray[0], _type): # <<<<<<<<<<<<<<
* definition = override
* break
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pyarray, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_2 = PyObject_IsInstance(__pyx_t_8, __pyx_v__type); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(3, 521, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":522
* for _type, override in conversions.iteritems():
* if isinstance(pyarray[0], _type):
* definition = override # <<<<<<<<<<<<<<
* break
*
*/
__Pyx_INCREF(__pyx_v_override);
__Pyx_DECREF_SET(__pyx_v_definition, __pyx_v_override);
/* "jnius/jnius_conversion.pxi":523
* if isinstance(pyarray[0], _type):
* definition = override
* break # <<<<<<<<<<<<<<
*
* if definition == 'Z':
*/
goto __pyx_L8_break;
/* "jnius/jnius_conversion.pxi":521
* }
* for _type, override in conversions.iteritems():
* if isinstance(pyarray[0], _type): # <<<<<<<<<<<<<<
* definition = override
* break
*/
}
}
__pyx_L8_break:;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":500
*
*
* if definition == 'Ljava/lang/Object;' and len(pyarray) > 0: # <<<<<<<<<<<<<<
* # then the method will accept any array type as param
* # let's be as precise as we can
*/
}
/* "jnius/jnius_conversion.pxi":525
* break
*
* if definition == 'Z': # <<<<<<<<<<<<<<
* ret = j_env[0].NewBooleanArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 525, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":526
*
* if definition == 'Z':
* ret = j_env[0].NewBooleanArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_boolean = 1 if pyarray[i] else 0
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewBooleanArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":527
* if definition == 'Z':
* ret = j_env[0].NewBooleanArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_boolean = 1 if pyarray[i] else 0
* j_env[0].SetBooleanArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":528
* ret = j_env[0].NewBooleanArray(j_env, array_size)
* for i in range(array_size):
* j_boolean = 1 if pyarray[i] else 0 # <<<<<<<<<<<<<<
* j_env[0].SetBooleanArrayRegion(j_env,
* ret, i, 1, &j_boolean)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 528, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 528, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
__pyx_t_10 = 1;
} else {
__pyx_t_10 = 0;
}
__pyx_v_j_boolean = __pyx_t_10;
/* "jnius/jnius_conversion.pxi":529
* for i in range(array_size):
* j_boolean = 1 if pyarray[i] else 0
* j_env[0].SetBooleanArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_boolean)
*
*/
(__pyx_v_j_env[0])->SetBooleanArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_boolean));
}
/* "jnius/jnius_conversion.pxi":525
* break
*
* if definition == 'Z': # <<<<<<<<<<<<<<
* ret = j_env[0].NewBooleanArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":532
* ret, i, 1, &j_boolean)
*
* elif definition == 'B': # <<<<<<<<<<<<<<
* ret = j_env[0].NewByteArray(j_env, array_size)
* if isinstance(pyarray, ByteArray):
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 532, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":533
*
* elif definition == 'B':
* ret = j_env[0].NewByteArray(j_env, array_size) # <<<<<<<<<<<<<<
* if isinstance(pyarray, ByteArray):
* a_bytes = pyarray
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewByteArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":534
* elif definition == 'B':
* ret = j_env[0].NewByteArray(j_env, array_size)
* if isinstance(pyarray, ByteArray): # <<<<<<<<<<<<<<
* a_bytes = pyarray
* j_env[0].SetByteArrayRegion(j_env,
*/
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_pyarray, __pyx_ptype_5jnius_5jnius_ByteArray);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":535
* ret = j_env[0].NewByteArray(j_env, array_size)
* if isinstance(pyarray, ByteArray):
* a_bytes = pyarray # <<<<<<<<<<<<<<
* j_env[0].SetByteArrayRegion(j_env,
* ret, 0, array_size, <const_jbyte *>a_bytes._buf)
*/
if (!(likely(((__pyx_v_pyarray) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pyarray, __pyx_ptype_5jnius_5jnius_ByteArray))))) __PYX_ERR(3, 535, __pyx_L1_error)
__pyx_t_4 = __pyx_v_pyarray;
__Pyx_INCREF(__pyx_t_4);
__pyx_v_a_bytes = ((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_conversion.pxi":536
* if isinstance(pyarray, ByteArray):
* a_bytes = pyarray
* j_env[0].SetByteArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, 0, array_size, <const_jbyte *>a_bytes._buf)
* else:
*/
(__pyx_v_j_env[0])->SetByteArrayRegion(__pyx_v_j_env, __pyx_v_ret, 0, __pyx_v_array_size, ((const jbyte *)__pyx_v_a_bytes->_buf));
/* "jnius/jnius_conversion.pxi":534
* elif definition == 'B':
* ret = j_env[0].NewByteArray(j_env, array_size)
* if isinstance(pyarray, ByteArray): # <<<<<<<<<<<<<<
* a_bytes = pyarray
* j_env[0].SetByteArrayRegion(j_env,
*/
goto __pyx_L13;
}
/* "jnius/jnius_conversion.pxi":539
* ret, 0, array_size, <const_jbyte *>a_bytes._buf)
* else:
* for i in range(array_size): # <<<<<<<<<<<<<<
* c_tmp = pyarray[i]
* j_byte = <signed char>c_tmp
*/
/*else*/ {
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":540
* else:
* for i in range(array_size):
* c_tmp = pyarray[i] # <<<<<<<<<<<<<<
* j_byte = <signed char>c_tmp
* j_env[0].SetByteArrayRegion(j_env,
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 540, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_11 = __Pyx_PyInt_As_unsigned_char(__pyx_t_4); if (unlikely((__pyx_t_11 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 540, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_c_tmp = __pyx_t_11;
/* "jnius/jnius_conversion.pxi":541
* for i in range(array_size):
* c_tmp = pyarray[i]
* j_byte = <signed char>c_tmp # <<<<<<<<<<<<<<
* j_env[0].SetByteArrayRegion(j_env,
* ret, i, 1, &j_byte)
*/
__pyx_v_j_byte = ((signed char)__pyx_v_c_tmp);
/* "jnius/jnius_conversion.pxi":542
* c_tmp = pyarray[i]
* j_byte = <signed char>c_tmp
* j_env[0].SetByteArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_byte)
*
*/
(__pyx_v_j_env[0])->SetByteArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_byte));
}
}
__pyx_L13:;
/* "jnius/jnius_conversion.pxi":532
* ret, i, 1, &j_boolean)
*
* elif definition == 'B': # <<<<<<<<<<<<<<
* ret = j_env[0].NewByteArray(j_env, array_size)
* if isinstance(pyarray, ByteArray):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":545
* ret, i, 1, &j_byte)
*
* elif definition == 'C': # <<<<<<<<<<<<<<
* ret = j_env[0].NewCharArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 545, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":546
*
* elif definition == 'C':
* ret = j_env[0].NewCharArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_char = ord(pyarray[i])
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewCharArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":547
* elif definition == 'C':
* ret = j_env[0].NewCharArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_char = ord(pyarray[i])
* j_env[0].SetCharArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":548
* ret = j_env[0].NewCharArray(j_env, array_size)
* for i in range(array_size):
* j_char = ord(pyarray[i]) # <<<<<<<<<<<<<<
* j_env[0].SetCharArrayRegion(j_env,
* ret, i, 1, &j_char)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 548, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_12 = __Pyx_PyObject_Ord(__pyx_t_4); if (unlikely(__pyx_t_12 == (long)(Py_UCS4)-1)) __PYX_ERR(3, 548, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_char = __pyx_t_12;
/* "jnius/jnius_conversion.pxi":549
* for i in range(array_size):
* j_char = ord(pyarray[i])
* j_env[0].SetCharArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_char)
*
*/
(__pyx_v_j_env[0])->SetCharArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_char));
}
/* "jnius/jnius_conversion.pxi":545
* ret, i, 1, &j_byte)
*
* elif definition == 'C': # <<<<<<<<<<<<<<
* ret = j_env[0].NewCharArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":552
* ret, i, 1, &j_char)
*
* elif definition == 'S': # <<<<<<<<<<<<<<
* ret = j_env[0].NewShortArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 552, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":553
*
* elif definition == 'S':
* ret = j_env[0].NewShortArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_short = pyarray[i]
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewShortArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":554
* elif definition == 'S':
* ret = j_env[0].NewShortArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_short = pyarray[i]
* j_env[0].SetShortArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":555
* ret = j_env[0].NewShortArray(j_env, array_size)
* for i in range(array_size):
* j_short = pyarray[i] # <<<<<<<<<<<<<<
* j_env[0].SetShortArrayRegion(j_env,
* ret, i, 1, &j_short)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_13 = __Pyx_PyInt_As_jshort(__pyx_t_4); if (unlikely((__pyx_t_13 == ((jshort)-1)) && PyErr_Occurred())) __PYX_ERR(3, 555, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_short = __pyx_t_13;
/* "jnius/jnius_conversion.pxi":556
* for i in range(array_size):
* j_short = pyarray[i]
* j_env[0].SetShortArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_short)
*
*/
(__pyx_v_j_env[0])->SetShortArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_short));
}
/* "jnius/jnius_conversion.pxi":552
* ret, i, 1, &j_char)
*
* elif definition == 'S': # <<<<<<<<<<<<<<
* ret = j_env[0].NewShortArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":559
* ret, i, 1, &j_short)
*
* elif definition == 'I': # <<<<<<<<<<<<<<
* ret = j_env[0].NewIntArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 559, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":560
*
* elif definition == 'I':
* ret = j_env[0].NewIntArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_int = pyarray[i]
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewIntArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":561
* elif definition == 'I':
* ret = j_env[0].NewIntArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_int = pyarray[i]
* j_env[0].SetIntArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":562
* ret = j_env[0].NewIntArray(j_env, array_size)
* for i in range(array_size):
* j_int = pyarray[i] # <<<<<<<<<<<<<<
* j_env[0].SetIntArrayRegion(j_env,
* ret, i, 1, <const_jint *>&j_int)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 562, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_14 = __Pyx_PyInt_As_jint(__pyx_t_4); if (unlikely((__pyx_t_14 == ((jint)-1)) && PyErr_Occurred())) __PYX_ERR(3, 562, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_int = __pyx_t_14;
/* "jnius/jnius_conversion.pxi":563
* for i in range(array_size):
* j_int = pyarray[i]
* j_env[0].SetIntArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, <const_jint *>&j_int)
*
*/
(__pyx_v_j_env[0])->SetIntArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, ((const jint *)(&__pyx_v_j_int)));
}
/* "jnius/jnius_conversion.pxi":559
* ret, i, 1, &j_short)
*
* elif definition == 'I': # <<<<<<<<<<<<<<
* ret = j_env[0].NewIntArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":566
* ret, i, 1, <const_jint *>&j_int)
*
* elif definition == 'J': # <<<<<<<<<<<<<<
* ret = j_env[0].NewLongArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_J, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 566, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":567
*
* elif definition == 'J':
* ret = j_env[0].NewLongArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_long = pyarray[i]
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewLongArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":568
* elif definition == 'J':
* ret = j_env[0].NewLongArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_long = pyarray[i]
* j_env[0].SetLongArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":569
* ret = j_env[0].NewLongArray(j_env, array_size)
* for i in range(array_size):
* j_long = pyarray[i] # <<<<<<<<<<<<<<
* j_env[0].SetLongArrayRegion(j_env,
* ret, i, 1, &j_long)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_15 = __Pyx_PyInt_As_jlong(__pyx_t_4); if (unlikely((__pyx_t_15 == ((jlong)-1)) && PyErr_Occurred())) __PYX_ERR(3, 569, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_long = __pyx_t_15;
/* "jnius/jnius_conversion.pxi":570
* for i in range(array_size):
* j_long = pyarray[i]
* j_env[0].SetLongArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_long)
*
*/
(__pyx_v_j_env[0])->SetLongArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_long));
}
/* "jnius/jnius_conversion.pxi":566
* ret, i, 1, <const_jint *>&j_int)
*
* elif definition == 'J': # <<<<<<<<<<<<<<
* ret = j_env[0].NewLongArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":573
* ret, i, 1, &j_long)
*
* elif definition == 'F': # <<<<<<<<<<<<<<
* ret = j_env[0].NewFloatArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 573, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":574
*
* elif definition == 'F':
* ret = j_env[0].NewFloatArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_float = pyarray[i]
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewFloatArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":575
* elif definition == 'F':
* ret = j_env[0].NewFloatArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_float = pyarray[i]
* j_env[0].SetFloatArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":576
* ret = j_env[0].NewFloatArray(j_env, array_size)
* for i in range(array_size):
* j_float = pyarray[i] # <<<<<<<<<<<<<<
* j_env[0].SetFloatArrayRegion(j_env,
* ret, i, 1, &j_float)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_16 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_16 == ((jfloat)-1)) && PyErr_Occurred())) __PYX_ERR(3, 576, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_float = __pyx_t_16;
/* "jnius/jnius_conversion.pxi":577
* for i in range(array_size):
* j_float = pyarray[i]
* j_env[0].SetFloatArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_float)
*
*/
(__pyx_v_j_env[0])->SetFloatArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_float));
}
/* "jnius/jnius_conversion.pxi":573
* ret, i, 1, &j_long)
*
* elif definition == 'F': # <<<<<<<<<<<<<<
* ret = j_env[0].NewFloatArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":580
* ret, i, 1, &j_float)
*
* elif definition == 'D': # <<<<<<<<<<<<<<
* ret = j_env[0].NewDoubleArray(j_env, array_size)
* for i in range(array_size):
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_definition, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 580, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":581
*
* elif definition == 'D':
* ret = j_env[0].NewDoubleArray(j_env, array_size) # <<<<<<<<<<<<<<
* for i in range(array_size):
* j_double = pyarray[i]
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewDoubleArray(__pyx_v_j_env, __pyx_v_array_size);
/* "jnius/jnius_conversion.pxi":582
* elif definition == 'D':
* ret = j_env[0].NewDoubleArray(j_env, array_size)
* for i in range(array_size): # <<<<<<<<<<<<<<
* j_double = pyarray[i]
* j_env[0].SetDoubleArrayRegion(j_env,
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":583
* ret = j_env[0].NewDoubleArray(j_env, array_size)
* for i in range(array_size):
* j_double = pyarray[i] # <<<<<<<<<<<<<<
* j_env[0].SetDoubleArrayRegion(j_env,
* ret, i, 1, &j_double)
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 583, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == ((jdouble)-1)) && PyErr_Occurred())) __PYX_ERR(3, 583, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j_double = __pyx_t_17;
/* "jnius/jnius_conversion.pxi":584
* for i in range(array_size):
* j_double = pyarray[i]
* j_env[0].SetDoubleArrayRegion(j_env, # <<<<<<<<<<<<<<
* ret, i, 1, &j_double)
*
*/
(__pyx_v_j_env[0])->SetDoubleArrayRegion(__pyx_v_j_env, __pyx_v_ret, __pyx_v_i, 1, (&__pyx_v_j_double));
}
/* "jnius/jnius_conversion.pxi":580
* ret, i, 1, &j_float)
*
* elif definition == 'D': # <<<<<<<<<<<<<<
* ret = j_env[0].NewDoubleArray(j_env, array_size)
* for i in range(array_size):
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":587
* ret, i, 1, &j_double)
*
* elif definition[0] == 'L': # <<<<<<<<<<<<<<
* defstr = str_for_c(definition[1:-1])
* j_class = j_env[0].FindClass(
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 587, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":588
*
* elif definition[0] == 'L':
* defstr = str_for_c(definition[1:-1]) # <<<<<<<<<<<<<<
* j_class = j_env[0].FindClass(
* j_env, <bytes>defstr)
*/
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__35, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_defstr = __pyx_t_8;
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":590
* defstr = str_for_c(definition[1:-1])
* j_class = j_env[0].FindClass(
* j_env, <bytes>defstr) # <<<<<<<<<<<<<<
* if j_class == NULL:
* raise JavaException('Cannot create array with a class not '
*/
__pyx_t_18 = __Pyx_PyObject_AsString(__pyx_v_defstr); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(3, 590, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":589
* elif definition[0] == 'L':
* defstr = str_for_c(definition[1:-1])
* j_class = j_env[0].FindClass( # <<<<<<<<<<<<<<
* j_env, <bytes>defstr)
* if j_class == NULL:
*/
__pyx_v_j_class = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, __pyx_t_18);
/* "jnius/jnius_conversion.pxi":591
* j_class = j_env[0].FindClass(
* j_env, <bytes>defstr)
* if j_class == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Cannot create array with a class not '
* 'found {0!r}'.format(definition[1:-1]))
*/
__pyx_t_2 = ((__pyx_v_j_class == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":592
* j_env, <bytes>defstr)
* if j_class == NULL:
* raise JavaException('Cannot create array with a class not ' # <<<<<<<<<<<<<<
* 'found {0!r}'.format(definition[1:-1]))
* ret = j_env[0].NewObjectArray(
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "jnius/jnius_conversion.pxi":593
* if j_class == NULL:
* raise JavaException('Cannot create array with a class not '
* 'found {0!r}'.format(definition[1:-1])) # <<<<<<<<<<<<<<
* ret = j_env[0].NewObjectArray(
* j_env, array_size, j_class, NULL)
*/
__pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_create_array_with_a_class, __pyx_n_s_format); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_20 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__36, 1, 1, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_20);
__pyx_t_21 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
__pyx_t_21 = PyMethod_GET_SELF(__pyx_t_19);
if (likely(__pyx_t_21)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
__Pyx_INCREF(__pyx_t_21);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_19, function);
}
}
if (!__pyx_t_21) {
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_t_20};
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
PyObject *__pyx_temp[2] = {__pyx_t_21, __pyx_t_20};
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
} else
#endif
{
__pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __pyx_t_21 = NULL;
__Pyx_GIVEREF(__pyx_t_20);
PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_20);
__pyx_t_20 = 0;
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
}
}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_19)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_19);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_19) {
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_7};
__pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_7};
__pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
__Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19); __pyx_t_19 = NULL;
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_7);
__pyx_t_7 = 0;
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 592, __pyx_L1_error)
/* "jnius/jnius_conversion.pxi":591
* j_class = j_env[0].FindClass(
* j_env, <bytes>defstr)
* if j_class == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Cannot create array with a class not '
* 'found {0!r}'.format(definition[1:-1]))
*/
}
/* "jnius/jnius_conversion.pxi":594
* raise JavaException('Cannot create array with a class not '
* 'found {0!r}'.format(definition[1:-1]))
* ret = j_env[0].NewObjectArray( # <<<<<<<<<<<<<<
* j_env, array_size, j_class, NULL)
* for i in range(array_size):
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewObjectArray(__pyx_v_j_env, __pyx_v_array_size, __pyx_v_j_class, NULL);
/* "jnius/jnius_conversion.pxi":596
* ret = j_env[0].NewObjectArray(
* j_env, array_size, j_class, NULL)
* for i in range(array_size): # <<<<<<<<<<<<<<
* arg = pyarray[i]
* if arg is None:
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":597
* j_env, array_size, j_class, NULL)
* for i in range(array_size):
* arg = pyarray[i] # <<<<<<<<<<<<<<
* if arg is None:
* j_env[0].SetObjectArrayElement(
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 597, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_8);
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":598
* for i in range(array_size):
* arg = pyarray[i]
* if arg is None: # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, NULL)
*/
__pyx_t_2 = (__pyx_v_arg == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":599
* arg = pyarray[i]
* if arg is None:
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, NULL)
* elif isinstance(arg, basestring):
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, NULL);
/* "jnius/jnius_conversion.pxi":598
* for i in range(array_size):
* arg = pyarray[i]
* if arg is None: # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, NULL)
*/
goto __pyx_L31;
}
/* "jnius/jnius_conversion.pxi":601
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, NULL)
* elif isinstance(arg, basestring): # <<<<<<<<<<<<<<
* j_string = convert_pystr_to_java(j_env, arg)
* j_env[0].SetObjectArrayElement(
*/
__pyx_t_3 = __Pyx_PyBaseString_Check(__pyx_v_arg);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":602
* j_env, <jobjectArray>ret, i, NULL)
* elif isinstance(arg, basestring):
* j_string = convert_pystr_to_java(j_env, arg) # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, j_string)
*/
if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_arg))||((__pyx_v_arg) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_arg)->tp_name), 0))) __PYX_ERR(3, 602, __pyx_L1_error)
__pyx_t_23 = __pyx_f_5jnius_5jnius_convert_pystr_to_java(__pyx_v_j_env, ((PyObject*)__pyx_v_arg)); if (unlikely(__pyx_t_23 == NULL)) __PYX_ERR(3, 602, __pyx_L1_error)
__pyx_v_j_string = __pyx_t_23;
/* "jnius/jnius_conversion.pxi":603
* elif isinstance(arg, basestring):
* j_string = convert_pystr_to_java(j_env, arg)
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, j_string)
* elif isinstance(arg, JavaClass):
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, __pyx_v_j_string);
/* "jnius/jnius_conversion.pxi":601
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, NULL)
* elif isinstance(arg, basestring): # <<<<<<<<<<<<<<
* j_string = convert_pystr_to_java(j_env, arg)
* j_env[0].SetObjectArrayElement(
*/
goto __pyx_L31;
}
/* "jnius/jnius_conversion.pxi":605
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, j_string)
* elif isinstance(arg, JavaClass): # <<<<<<<<<<<<<<
* jc = arg
* check_assignable_from(j_env, jc, definition[1:-1])
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":606
* j_env, <jobjectArray>ret, i, j_string)
* elif isinstance(arg, JavaClass):
* jc = arg # <<<<<<<<<<<<<<
* check_assignable_from(j_env, jc, definition[1:-1])
* j_env[0].SetObjectArrayElement(
*/
if (!(likely(((__pyx_v_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 606, __pyx_L1_error)
__pyx_t_8 = __pyx_v_arg;
__Pyx_INCREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_8));
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":607
* elif isinstance(arg, JavaClass):
* jc = arg
* check_assignable_from(j_env, jc, definition[1:-1]) # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_self.obj)
*/
__pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, -1L, NULL, NULL, &__pyx_slice__37, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_f_5jnius_5jnius_check_assignable_from(__pyx_v_j_env, __pyx_v_jc, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 607, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":608
* jc = arg
* check_assignable_from(j_env, jc, definition[1:-1])
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, jc.j_self.obj)
* elif isinstance(arg, type):
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, __pyx_v_jc->j_self->obj);
/* "jnius/jnius_conversion.pxi":605
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, j_string)
* elif isinstance(arg, JavaClass): # <<<<<<<<<<<<<<
* jc = arg
* check_assignable_from(j_env, jc, definition[1:-1])
*/
goto __pyx_L31;
}
/* "jnius/jnius_conversion.pxi":610
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_self.obj)
* elif isinstance(arg, type): # <<<<<<<<<<<<<<
* jc = arg
* j_env[0].SetObjectArrayElement(
*/
__pyx_t_3 = PyType_Check(__pyx_v_arg);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_conversion.pxi":611
* j_env, <jobjectArray>ret, i, jc.j_self.obj)
* elif isinstance(arg, type):
* jc = arg # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_cls)
*/
if (!(likely(((__pyx_v_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(3, 611, __pyx_L1_error)
__pyx_t_8 = __pyx_v_arg;
__Pyx_INCREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_8));
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":612
* elif isinstance(arg, type):
* jc = arg
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, jc.j_cls)
* elif isinstance(arg, JavaObject):
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, __pyx_v_jc->j_cls);
/* "jnius/jnius_conversion.pxi":610
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_self.obj)
* elif isinstance(arg, type): # <<<<<<<<<<<<<<
* jc = arg
* j_env[0].SetObjectArrayElement(
*/
goto __pyx_L31;
}
/* "jnius/jnius_conversion.pxi":614
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_cls)
* elif isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* jo = arg
* j_env[0].SetObjectArrayElement(
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaObject);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":615
* j_env, <jobjectArray>ret, i, jc.j_cls)
* elif isinstance(arg, JavaObject):
* jo = arg # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jo.obj)
*/
if (!(likely(((__pyx_v_arg) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_5jnius_5jnius_JavaObject))))) __PYX_ERR(3, 615, __pyx_L1_error)
__pyx_t_8 = __pyx_v_arg;
__Pyx_INCREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_jo, ((struct __pyx_obj_5jnius_5jnius_JavaObject *)__pyx_t_8));
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":616
* elif isinstance(arg, JavaObject):
* jo = arg
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, jo.obj)
* else:
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, __pyx_v_jo->obj);
/* "jnius/jnius_conversion.pxi":614
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, jc.j_cls)
* elif isinstance(arg, JavaObject): # <<<<<<<<<<<<<<
* jo = arg
* j_env[0].SetObjectArrayElement(
*/
goto __pyx_L31;
}
/* "jnius/jnius_conversion.pxi":619
* j_env, <jobjectArray>ret, i, jo.obj)
* else:
* raise JavaException('Invalid variable used for L array', definition, pyarray) # <<<<<<<<<<<<<<
*
* elif definition[0] == '[':
*/
/*else*/ {
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_22 = NULL;
__pyx_t_24 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_22 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_22)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_22);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_24 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[4] = {__pyx_t_22, __pyx_kp_s_Invalid_variable_used_for_L_arra, __pyx_v_definition, __pyx_v_pyarray};
__pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_24, 3+__pyx_t_24); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 619, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[4] = {__pyx_t_22, __pyx_kp_s_Invalid_variable_used_for_L_arra, __pyx_v_definition, __pyx_v_pyarray};
__pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_24, 3+__pyx_t_24); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 619, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
{
__pyx_t_7 = PyTuple_New(3+__pyx_t_24); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_22) {
__Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_22); __pyx_t_22 = NULL;
}
__Pyx_INCREF(__pyx_kp_s_Invalid_variable_used_for_L_arra);
__Pyx_GIVEREF(__pyx_kp_s_Invalid_variable_used_for_L_arra);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_24, __pyx_kp_s_Invalid_variable_used_for_L_arra);
__Pyx_INCREF(__pyx_v_definition);
__Pyx_GIVEREF(__pyx_v_definition);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_24, __pyx_v_definition);
__Pyx_INCREF(__pyx_v_pyarray);
__Pyx_GIVEREF(__pyx_v_pyarray);
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_24, __pyx_v_pyarray);
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 619, __pyx_L1_error)
}
__pyx_L31:;
}
/* "jnius/jnius_conversion.pxi":587
* ret, i, 1, &j_double)
*
* elif definition[0] == 'L': # <<<<<<<<<<<<<<
* defstr = str_for_c(definition[1:-1])
* j_class = j_env[0].FindClass(
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":621
* raise JavaException('Invalid variable used for L array', definition, pyarray)
*
* elif definition[0] == '[': # <<<<<<<<<<<<<<
* subdef = definition[1:]
* eproto = convert_pyarray_to_java(j_env, subdef, pyarray[0])
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 621, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_3) {
/* "jnius/jnius_conversion.pxi":622
*
* elif definition[0] == '[':
* subdef = definition[1:] # <<<<<<<<<<<<<<
* eproto = convert_pyarray_to_java(j_env, subdef, pyarray[0])
* ret = j_env[0].NewObjectArray(
*/
__pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_definition, 1, 0, NULL, NULL, &__pyx_slice__38, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_subdef = __pyx_t_8;
__pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":623
* elif definition[0] == '[':
* subdef = definition[1:]
* eproto = convert_pyarray_to_java(j_env, subdef, pyarray[0]) # <<<<<<<<<<<<<<
* ret = j_env[0].NewObjectArray(
* j_env, array_size, j_env[0].GetObjectClass(j_env, eproto), NULL)
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pyarray, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_25 = __pyx_f_5jnius_5jnius_convert_pyarray_to_java(__pyx_v_j_env, __pyx_v_subdef, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_eproto = __pyx_t_25;
/* "jnius/jnius_conversion.pxi":624
* subdef = definition[1:]
* eproto = convert_pyarray_to_java(j_env, subdef, pyarray[0])
* ret = j_env[0].NewObjectArray( # <<<<<<<<<<<<<<
* j_env, array_size, j_env[0].GetObjectClass(j_env, eproto), NULL)
* j_env[0].SetObjectArrayElement(
*/
__pyx_v_ret = (__pyx_v_j_env[0])->NewObjectArray(__pyx_v_j_env, __pyx_v_array_size, (__pyx_v_j_env[0])->GetObjectClass(__pyx_v_j_env, __pyx_v_eproto), NULL);
/* "jnius/jnius_conversion.pxi":626
* ret = j_env[0].NewObjectArray(
* j_env, array_size, j_env[0].GetObjectClass(j_env, eproto), NULL)
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, 0, eproto)
* for i in range(1, array_size):
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), 0, __pyx_v_eproto);
/* "jnius/jnius_conversion.pxi":628
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, 0, eproto)
* for i in range(1, array_size): # <<<<<<<<<<<<<<
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, convert_pyarray_to_java(j_env, subdef, pyarray[i]))
*/
__pyx_t_6 = __pyx_v_array_size;
for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "jnius/jnius_conversion.pxi":630
* for i in range(1, array_size):
* j_env[0].SetObjectArrayElement(
* j_env, <jobjectArray>ret, i, convert_pyarray_to_java(j_env, subdef, pyarray[i])) # <<<<<<<<<<<<<<
*
* else:
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pyarray, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_25 = __pyx_f_5jnius_5jnius_convert_pyarray_to_java(__pyx_v_j_env, __pyx_v_subdef, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 630, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "jnius/jnius_conversion.pxi":629
* j_env, <jobjectArray>ret, 0, eproto)
* for i in range(1, array_size):
* j_env[0].SetObjectArrayElement( # <<<<<<<<<<<<<<
* j_env, <jobjectArray>ret, i, convert_pyarray_to_java(j_env, subdef, pyarray[i]))
*
*/
(__pyx_v_j_env[0])->SetObjectArrayElement(__pyx_v_j_env, ((jobjectArray)__pyx_v_ret), __pyx_v_i, __pyx_t_25);
}
/* "jnius/jnius_conversion.pxi":621
* raise JavaException('Invalid variable used for L array', definition, pyarray)
*
* elif definition[0] == '[': # <<<<<<<<<<<<<<
* subdef = definition[1:]
* eproto = convert_pyarray_to_java(j_env, subdef, pyarray[0])
*/
goto __pyx_L10;
}
/* "jnius/jnius_conversion.pxi":633
*
* else:
* raise JavaException('Invalid array definition', definition, pyarray) # <<<<<<<<<<<<<<
*
* return <jobject>ret
*/
/*else*/ {
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Invalid_array_definition, __pyx_v_definition, __pyx_v_pyarray};
__pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 633, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Invalid_array_definition, __pyx_v_definition, __pyx_v_pyarray};
__pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 633, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else
#endif
{
__pyx_t_22 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_22);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(__pyx_kp_s_Invalid_array_definition);
__Pyx_GIVEREF(__pyx_kp_s_Invalid_array_definition);
PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_6, __pyx_kp_s_Invalid_array_definition);
__Pyx_INCREF(__pyx_v_definition);
__Pyx_GIVEREF(__pyx_v_definition);
PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_6, __pyx_v_definition);
__Pyx_INCREF(__pyx_v_pyarray);
__Pyx_GIVEREF(__pyx_v_pyarray);
PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_6, __pyx_v_pyarray);
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(3, 633, __pyx_L1_error)
}
__pyx_L10:;
/* "jnius/jnius_conversion.pxi":635
* raise JavaException('Invalid array definition', definition, pyarray)
*
* return <jobject>ret # <<<<<<<<<<<<<<
*/
__pyx_r = ((jobject)__pyx_v_ret);
goto __pyx_L0;
/* "jnius/jnius_conversion.pxi":479
* return j_str
*
* cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *: # <<<<<<<<<<<<<<
* cdef jobject ret = NULL
* cdef int array_size = len(pyarray)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_XDECREF(__pyx_t_20);
__Pyx_XDECREF(__pyx_t_21);
__Pyx_XDECREF(__pyx_t_22);
__Pyx_AddTraceback("jnius.jnius.convert_pyarray_to_java", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jo);
__Pyx_XDECREF((PyObject *)__pyx_v_jc);
__Pyx_XDECREF((PyObject *)__pyx_v_a_bytes);
__Pyx_XDECREF(__pyx_v_conversions);
__Pyx_XDECREF(__pyx_v__type);
__Pyx_XDECREF(__pyx_v_override);
__Pyx_XDECREF(__pyx_v_defstr);
__Pyx_XDECREF(__pyx_v_arg);
__Pyx_XDECREF(__pyx_v_subdef);
__Pyx_XDECREF(__pyx_v_definition);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_localref.pxi":4
* cdef jobject obj
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_8LocalRef_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_8LocalRef_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_5jnius_5jnius_8LocalRef___cinit__(((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_8LocalRef___cinit__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_localref.pxi":5
*
* def __cinit__(self):
* self.obj = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->obj = NULL;
/* "jnius/jnius_localref.pxi":4
* cdef jobject obj
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_localref.pxi":7
* self.obj = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self.obj != NULL:
*/
/* Python wrapper */
static void __pyx_pw_5jnius_5jnius_8LocalRef_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5jnius_5jnius_8LocalRef_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_5jnius_5jnius_8LocalRef_2__dealloc__(((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5jnius_5jnius_8LocalRef_2__dealloc__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self) {
JNIEnv *__pyx_v_j_env;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
JNIEnv *__pyx_t_2;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "jnius/jnius_localref.pxi":9
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self.obj != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.obj)
*/
__pyx_t_1 = ((__pyx_v_self->obj != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_localref.pxi":10
* cdef JNIEnv *j_env
* if self.obj != NULL:
* j_env = get_jnienv() # <<<<<<<<<<<<<<
* j_env[0].DeleteGlobalRef(j_env, self.obj)
* self.obj = NULL
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(4, 10, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_2;
/* "jnius/jnius_localref.pxi":11
* if self.obj != NULL:
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.obj) # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
(__pyx_v_j_env[0])->DeleteGlobalRef(__pyx_v_j_env, __pyx_v_self->obj);
/* "jnius/jnius_localref.pxi":9
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self.obj != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.obj)
*/
}
/* "jnius/jnius_localref.pxi":12
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.obj)
* self.obj = NULL # <<<<<<<<<<<<<<
*
* cdef void create(self, JNIEnv *env, jobject obj):
*/
__pyx_v_self->obj = NULL;
/* "jnius/jnius_localref.pxi":7
* self.obj = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self.obj != NULL:
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("jnius.jnius.LocalRef.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_localref.pxi":14
* self.obj = NULL
*
* cdef void create(self, JNIEnv *env, jobject obj): # <<<<<<<<<<<<<<
* self.obj = env[0].NewGlobalRef(env, obj)
*
*/
static void __pyx_f_5jnius_5jnius_8LocalRef_create(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self, JNIEnv *__pyx_v_env, jobject __pyx_v_obj) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create", 0);
/* "jnius/jnius_localref.pxi":15
*
* cdef void create(self, JNIEnv *env, jobject obj):
* self.obj = env[0].NewGlobalRef(env, obj) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__pyx_v_self->obj = (__pyx_v_env[0])->NewGlobalRef(__pyx_v_env, __pyx_v_obj);
/* "jnius/jnius_localref.pxi":14
* self.obj = NULL
*
* cdef void create(self, JNIEnv *env, jobject obj): # <<<<<<<<<<<<<<
* self.obj = env[0].NewGlobalRef(env, obj)
*
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_localref.pxi":17
* self.obj = env[0].NewGlobalRef(env, obj)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return '<LocalRef obj=0x{0:x} at 0x{1:x}>'.format(
* <long><void *>self.obj, id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_8LocalRef_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_8LocalRef_5__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_8LocalRef_4__repr__(((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_8LocalRef_4__repr__(struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "jnius/jnius_localref.pxi":18
*
* def __repr__(self):
* return '<LocalRef obj=0x{0:x} at 0x{1:x}>'.format( # <<<<<<<<<<<<<<
* <long><void *>self.obj, id(self))
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_LocalRef_obj_0x_0_x_at_0x_1_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "jnius/jnius_localref.pxi":19
* def __repr__(self):
* return '<LocalRef obj=0x{0:x} at 0x{1:x}>'.format(
* <long><void *>self.obj, id(self)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_3 = __Pyx_PyInt_From_long(((long)((void *)__pyx_v_self->obj))); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_localref.pxi":17
* self.obj = env[0].NewGlobalRef(env, obj)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return '<LocalRef obj=0x{0:x} at 0x{1:x}>'.format(
* <long><void *>self.obj, id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("jnius.jnius.LocalRef.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_localref.pxi":22
*
*
* cdef LocalRef create_local_ref(JNIEnv *env, jobject obj): # <<<<<<<<<<<<<<
* cdef LocalRef ret = LocalRef()
* ret.create(env, obj)
*/
static struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_f_5jnius_5jnius_create_local_ref(JNIEnv *__pyx_v_env, jobject __pyx_v_obj) {
struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_ret = 0;
struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("create_local_ref", 0);
/* "jnius/jnius_localref.pxi":23
*
* cdef LocalRef create_local_ref(JNIEnv *env, jobject obj):
* cdef LocalRef ret = LocalRef() # <<<<<<<<<<<<<<
* ret.create(env, obj)
* return ret
*/
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5jnius_5jnius_LocalRef), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_localref.pxi":24
* cdef LocalRef create_local_ref(JNIEnv *env, jobject obj):
* cdef LocalRef ret = LocalRef()
* ret.create(env, obj) # <<<<<<<<<<<<<<
* return ret
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_LocalRef *)__pyx_v_ret->__pyx_vtab)->create(__pyx_v_ret, __pyx_v_env, __pyx_v_obj);
/* "jnius/jnius_localref.pxi":25
* cdef LocalRef ret = LocalRef()
* ret.create(env, obj)
* return ret # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
/* "jnius/jnius_localref.pxi":22
*
*
* cdef LocalRef create_local_ref(JNIEnv *env, jobject obj): # <<<<<<<<<<<<<<
* cdef LocalRef ret = LocalRef()
* ret.create(env, obj)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("jnius.jnius.create_local_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":2
*
* cdef python_op(int op, object a, object b): # <<<<<<<<<<<<<<
* if op == 0:
* return a < b
*/
static PyObject *__pyx_f_5jnius_5jnius_python_op(int __pyx_v_op, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("python_op", 0);
/* "jnius/jnius_nativetypes3.pxi":3
*
* cdef python_op(int op, object a, object b):
* if op == 0: # <<<<<<<<<<<<<<
* return a < b
* elif op == 1:
*/
switch (__pyx_v_op) {
case 0:
/* "jnius/jnius_nativetypes3.pxi":4
* cdef python_op(int op, object a, object b):
* if op == 0:
* return a < b # <<<<<<<<<<<<<<
* elif op == 1:
* return a <= b
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":3
*
* cdef python_op(int op, object a, object b):
* if op == 0: # <<<<<<<<<<<<<<
* return a < b
* elif op == 1:
*/
break;
/* "jnius/jnius_nativetypes3.pxi":5
* if op == 0:
* return a < b
* elif op == 1: # <<<<<<<<<<<<<<
* return a <= b
* elif op == 2:
*/
case 1:
/* "jnius/jnius_nativetypes3.pxi":6
* return a < b
* elif op == 1:
* return a <= b # <<<<<<<<<<<<<<
* elif op == 2:
* return a == b
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":5
* if op == 0:
* return a < b
* elif op == 1: # <<<<<<<<<<<<<<
* return a <= b
* elif op == 2:
*/
break;
/* "jnius/jnius_nativetypes3.pxi":7
* elif op == 1:
* return a <= b
* elif op == 2: # <<<<<<<<<<<<<<
* return a == b
* elif op == 3:
*/
case 2:
/* "jnius/jnius_nativetypes3.pxi":8
* return a <= b
* elif op == 2:
* return a == b # <<<<<<<<<<<<<<
* elif op == 3:
* return a >= b
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":7
* elif op == 1:
* return a <= b
* elif op == 2: # <<<<<<<<<<<<<<
* return a == b
* elif op == 3:
*/
break;
/* "jnius/jnius_nativetypes3.pxi":9
* elif op == 2:
* return a == b
* elif op == 3: # <<<<<<<<<<<<<<
* return a >= b
* elif op == 4:
*/
case 3:
/* "jnius/jnius_nativetypes3.pxi":10
* return a == b
* elif op == 3:
* return a >= b # <<<<<<<<<<<<<<
* elif op == 4:
* return a > b
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":9
* elif op == 2:
* return a == b
* elif op == 3: # <<<<<<<<<<<<<<
* return a >= b
* elif op == 4:
*/
break;
/* "jnius/jnius_nativetypes3.pxi":11
* elif op == 3:
* return a >= b
* elif op == 4: # <<<<<<<<<<<<<<
* return a > b
* elif op == 5:
*/
case 4:
/* "jnius/jnius_nativetypes3.pxi":12
* return a >= b
* elif op == 4:
* return a > b # <<<<<<<<<<<<<<
* elif op == 5:
* return a != b
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 12, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":11
* elif op == 3:
* return a >= b
* elif op == 4: # <<<<<<<<<<<<<<
* return a > b
* elif op == 5:
*/
break;
/* "jnius/jnius_nativetypes3.pxi":13
* elif op == 4:
* return a > b
* elif op == 5: # <<<<<<<<<<<<<<
* return a != b
*
*/
case 5:
/* "jnius/jnius_nativetypes3.pxi":14
* return a > b
* elif op == 5:
* return a != b # <<<<<<<<<<<<<<
*
* cdef class ByteArray:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 14, __pyx_L1_error)
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":13
* elif op == 4:
* return a > b
* elif op == 5: # <<<<<<<<<<<<<<
* return a != b
*
*/
break;
default: break;
}
/* "jnius/jnius_nativetypes3.pxi":2
*
* cdef python_op(int op, object a, object b): # <<<<<<<<<<<<<<
* if op == 0:
* return a < b
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("jnius.jnius.python_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":22
* cdef unsigned char[:] _arr
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self._size = 0
* self._buf = NULL
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9ByteArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_9ByteArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray___cinit__(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9ByteArray___cinit__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_nativetypes3.pxi":23
*
* def __cinit__(self):
* self._size = 0 # <<<<<<<<<<<<<<
* self._buf = NULL
* self._arr = None
*/
__pyx_v_self->_size = 0;
/* "jnius/jnius_nativetypes3.pxi":24
* def __cinit__(self):
* self._size = 0
* self._buf = NULL # <<<<<<<<<<<<<<
* self._arr = None
*
*/
__pyx_v_self->_buf = NULL;
/* "jnius/jnius_nativetypes3.pxi":25
* self._size = 0
* self._buf = NULL
* self._arr = None # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(Py_None);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(5, 25, __pyx_L1_error)
__PYX_XDEC_MEMVIEW(&__pyx_v_self->_arr, 0);
__pyx_v_self->_arr = __pyx_t_1;
__pyx_t_1.memview = NULL;
__pyx_t_1.data = NULL;
/* "jnius/jnius_nativetypes3.pxi":22
* cdef unsigned char[:] _arr
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self._size = 0
* self._buf = NULL
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
__Pyx_AddTraceback("jnius.jnius.ByteArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":27
* self._arr = None
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self._buf != NULL:
*/
/* Python wrapper */
static void __pyx_pw_5jnius_5jnius_9ByteArray_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5jnius_5jnius_9ByteArray_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_5jnius_5jnius_9ByteArray_2__dealloc__(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5jnius_5jnius_9ByteArray_2__dealloc__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
JNIEnv *__pyx_v_j_env;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
JNIEnv *__pyx_t_2;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "jnius/jnius_nativetypes3.pxi":29
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self._buf != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].ReleaseByteArrayElements(
*/
__pyx_t_1 = ((__pyx_v_self->_buf != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_nativetypes3.pxi":30
* cdef JNIEnv *j_env
* if self._buf != NULL:
* j_env = get_jnienv() # <<<<<<<<<<<<<<
* j_env[0].ReleaseByteArrayElements(
* j_env, self._jobject.obj, <jbyte *>self._buf, 0)
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(5, 30, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_2;
/* "jnius/jnius_nativetypes3.pxi":31
* if self._buf != NULL:
* j_env = get_jnienv()
* j_env[0].ReleaseByteArrayElements( # <<<<<<<<<<<<<<
* j_env, self._jobject.obj, <jbyte *>self._buf, 0)
* self._buf = NULL
*/
(__pyx_v_j_env[0])->ReleaseByteArrayElements(__pyx_v_j_env, __pyx_v_self->_jobject->obj, ((jbyte *)__pyx_v_self->_buf), 0);
/* "jnius/jnius_nativetypes3.pxi":33
* j_env[0].ReleaseByteArrayElements(
* j_env, self._jobject.obj, <jbyte *>self._buf, 0)
* self._buf = NULL # <<<<<<<<<<<<<<
* self._jobject = None
*
*/
__pyx_v_self->_buf = NULL;
/* "jnius/jnius_nativetypes3.pxi":29
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self._buf != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].ReleaseByteArrayElements(
*/
}
/* "jnius/jnius_nativetypes3.pxi":34
* j_env, self._jobject.obj, <jbyte *>self._buf, 0)
* self._buf = NULL
* self._jobject = None # <<<<<<<<<<<<<<
*
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_jobject);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_jobject));
__pyx_v_self->_jobject = ((struct __pyx_obj_5jnius_5jnius_LocalRef *)Py_None);
/* "jnius/jnius_nativetypes3.pxi":27
* self._arr = None
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self._buf != NULL:
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("jnius.jnius.ByteArray.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_nativetypes3.pxi":36
* self._jobject = None
*
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf): # <<<<<<<<<<<<<<
* if self._buf != NULL:
* raise Exception('Cannot call set_buffer() twice.')
*/
static void __pyx_f_5jnius_5jnius_9ByteArray_set_buffer(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self, JNIEnv *__pyx_v_env, jobject __pyx_v_obj, long __pyx_v_size, jbyte *__pyx_v_buf) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
unsigned char *__pyx_t_3;
struct __pyx_array_obj *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_RefNannySetupContext("set_buffer", 0);
/* "jnius/jnius_nativetypes3.pxi":37
*
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf):
* if self._buf != NULL: # <<<<<<<<<<<<<<
* raise Exception('Cannot call set_buffer() twice.')
* self._jobject = LocalRef()
*/
__pyx_t_1 = ((__pyx_v_self->_buf != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_nativetypes3.pxi":38
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf):
* if self._buf != NULL:
* raise Exception('Cannot call set_buffer() twice.') # <<<<<<<<<<<<<<
* self._jobject = LocalRef()
* self._jobject.create(env, obj)
*/
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(5, 38, __pyx_L1_error)
/* "jnius/jnius_nativetypes3.pxi":37
*
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf):
* if self._buf != NULL: # <<<<<<<<<<<<<<
* raise Exception('Cannot call set_buffer() twice.')
* self._jobject = LocalRef()
*/
}
/* "jnius/jnius_nativetypes3.pxi":39
* if self._buf != NULL:
* raise Exception('Cannot call set_buffer() twice.')
* self._jobject = LocalRef() # <<<<<<<<<<<<<<
* self._jobject.create(env, obj)
* self._size = size
*/
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5jnius_5jnius_LocalRef), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->_jobject);
__Pyx_DECREF(((PyObject *)__pyx_v_self->_jobject));
__pyx_v_self->_jobject = ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_nativetypes3.pxi":40
* raise Exception('Cannot call set_buffer() twice.')
* self._jobject = LocalRef()
* self._jobject.create(env, obj) # <<<<<<<<<<<<<<
* self._size = size
* self._buf = <unsigned char *><signed char *>buf
*/
((struct __pyx_vtabstruct_5jnius_5jnius_LocalRef *)__pyx_v_self->_jobject->__pyx_vtab)->create(__pyx_v_self->_jobject, __pyx_v_env, __pyx_v_obj);
/* "jnius/jnius_nativetypes3.pxi":41
* self._jobject = LocalRef()
* self._jobject.create(env, obj)
* self._size = size # <<<<<<<<<<<<<<
* self._buf = <unsigned char *><signed char *>buf
* if size:
*/
__pyx_v_self->_size = __pyx_v_size;
/* "jnius/jnius_nativetypes3.pxi":42
* self._jobject.create(env, obj)
* self._size = size
* self._buf = <unsigned char *><signed char *>buf # <<<<<<<<<<<<<<
* if size:
* self._arr = <unsigned char[:size]>self._buf
*/
__pyx_v_self->_buf = ((unsigned char *)((signed char *)__pyx_v_buf));
/* "jnius/jnius_nativetypes3.pxi":43
* self._size = size
* self._buf = <unsigned char *><signed char *>buf
* if size: # <<<<<<<<<<<<<<
* self._arr = <unsigned char[:size]>self._buf
*
*/
__pyx_t_1 = (__pyx_v_size != 0);
if (__pyx_t_1) {
/* "jnius/jnius_nativetypes3.pxi":44
* self._buf = <unsigned char *><signed char *>buf
* if size:
* self._arr = <unsigned char[:size]>self._buf # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__pyx_t_3 = __pyx_v_self->_buf;
if (!__pyx_t_3) {
PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
__PYX_ERR(5, 44, __pyx_L1_error)
}
__pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_unsigned_char);
__pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_size));
if (unlikely(!__pyx_t_5 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_5))) __PYX_ERR(5, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __pyx_array_new(__pyx_t_2, sizeof(unsigned char), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(((PyObject *)__pyx_t_4));
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(5, 44, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__PYX_XDEC_MEMVIEW(&__pyx_v_self->_arr, 0);
__pyx_v_self->_arr = __pyx_t_6;
__pyx_t_6.memview = NULL;
__pyx_t_6.data = NULL;
/* "jnius/jnius_nativetypes3.pxi":43
* self._size = size
* self._buf = <unsigned char *><signed char *>buf
* if size: # <<<<<<<<<<<<<<
* self._arr = <unsigned char[:size]>self._buf
*
*/
}
/* "jnius/jnius_nativetypes3.pxi":36
* self._jobject = None
*
* cdef void set_buffer(self, JNIEnv *env, jobject obj, long size, jbyte *buf): # <<<<<<<<<<<<<<
* if self._buf != NULL:
* raise Exception('Cannot call set_buffer() twice.')
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(((PyObject *)__pyx_t_4));
__Pyx_XDECREF(__pyx_t_5);
__PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
__Pyx_WriteUnraisable("jnius.jnius.ByteArray.set_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_nativetypes3.pxi":46
* self._arr = <unsigned char[:size]>self._buf
*
* def __str__(self): # <<<<<<<<<<<<<<
* return '<ByteArray size={} at 0x{}>'.format(
* self._size, id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_4__str__(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_4__str__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "jnius/jnius_nativetypes3.pxi":47
*
* def __str__(self):
* return '<ByteArray size={} at 0x{}>'.format( # <<<<<<<<<<<<<<
* self._size, id(self))
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ByteArray_size_at_0x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "jnius/jnius_nativetypes3.pxi":48
* def __str__(self):
* return '<ByteArray size={} at 0x{}>'.format(
* self._size, id(self)) # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 47, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 47, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":46
* self._arr = <unsigned char[:size]>self._buf
*
* def __str__(self): # <<<<<<<<<<<<<<
* return '<ByteArray size={} at 0x{}>'.format(
* self._size, id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("jnius.jnius.ByteArray.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":50
* self._size, id(self))
*
* def __len__(self): # <<<<<<<<<<<<<<
* return self._size
*
*/
/* Python wrapper */
static Py_ssize_t __pyx_pw_5jnius_5jnius_9ByteArray_7__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_5jnius_5jnius_9ByteArray_7__len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_6__len__(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static Py_ssize_t __pyx_pf_5jnius_5jnius_9ByteArray_6__len__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
/* "jnius/jnius_nativetypes3.pxi":51
*
* def __len__(self):
* return self._size # <<<<<<<<<<<<<<
*
* def __getitem__(self, index):
*/
__pyx_r = __pyx_v_self->_size;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":50
* self._size, id(self))
*
* def __len__(self): # <<<<<<<<<<<<<<
* return self._size
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":53
* return self._size
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* cdef long xx
* if isinstance(index, slice):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_8__getitem__(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_8__getitem__(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self, PyObject *__pyx_v_index) {
long __pyx_v_xx;
PyObject *__pyx_v_val = NULL;
PyObject *__pyx_v_start = NULL;
PyObject *__pyx_v_stop = NULL;
PyObject *__pyx_v_step = NULL;
PyObject *__pyx_v_x = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
PyObject *(*__pyx_t_10)(PyObject *);
long __pyx_t_11;
Py_ssize_t __pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
Py_ssize_t __pyx_t_15;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "jnius/jnius_nativetypes3.pxi":55
* def __getitem__(self, index):
* cdef long xx
* if isinstance(index, slice): # <<<<<<<<<<<<<<
* val = []
* if self._size:
*/
__pyx_t_1 = PySlice_Check(__pyx_v_index);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_nativetypes3.pxi":56
* cdef long xx
* if isinstance(index, slice):
* val = [] # <<<<<<<<<<<<<<
* if self._size:
* (start, stop, step) = index.indices(len(self._arr))
*/
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_val = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_nativetypes3.pxi":57
* if isinstance(index, slice):
* val = []
* if self._size: # <<<<<<<<<<<<<<
* (start, stop, step) = index.indices(len(self._arr))
* for x in range(start, stop, step):
*/
__pyx_t_2 = (__pyx_v_self->_size != 0);
if (__pyx_t_2) {
/* "jnius/jnius_nativetypes3.pxi":58
* val = []
* if self._size:
* (start, stop, step) = index.indices(len(self._arr)) # <<<<<<<<<<<<<<
* for x in range(start, stop, step):
* xx = x
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(!__pyx_v_self->_arr.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(5, 58, __pyx_L1_error)}
__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_7) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(5, 58, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_5 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
index = 2; __pyx_t_5 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 3) < 0) __PYX_ERR(5, 58, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(5, 58, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_start = __pyx_t_4;
__pyx_t_4 = 0;
__pyx_v_stop = __pyx_t_8;
__pyx_t_8 = 0;
__pyx_v_step = __pyx_t_5;
__pyx_t_5 = 0;
/* "jnius/jnius_nativetypes3.pxi":59
* if self._size:
* (start, stop, step) = index.indices(len(self._arr))
* for x in range(start, stop, step): # <<<<<<<<<<<<<<
* xx = x
* val.append(self._arr[xx])
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_start);
__Pyx_GIVEREF(__pyx_v_start);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start);
__Pyx_INCREF(__pyx_v_stop);
__Pyx_GIVEREF(__pyx_v_stop);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_stop);
__Pyx_INCREF(__pyx_v_step);
__Pyx_GIVEREF(__pyx_v_step);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_step);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
__pyx_t_10 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 59, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(5, 59, __pyx_L1_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(5, 59, __pyx_L1_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
__pyx_t_5 = __pyx_t_10(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(5, 59, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
__pyx_t_5 = 0;
/* "jnius/jnius_nativetypes3.pxi":60
* (start, stop, step) = index.indices(len(self._arr))
* for x in range(start, stop, step):
* xx = x # <<<<<<<<<<<<<<
* val.append(self._arr[xx])
* return val
*/
__pyx_t_11 = __Pyx_PyInt_As_long(__pyx_v_x); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(5, 60, __pyx_L1_error)
__pyx_v_xx = __pyx_t_11;
/* "jnius/jnius_nativetypes3.pxi":61
* for x in range(start, stop, step):
* xx = x
* val.append(self._arr[xx]) # <<<<<<<<<<<<<<
* return val
* else:
*/
if (unlikely(!__pyx_v_self->_arr.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(5, 61, __pyx_L1_error)}
__pyx_t_12 = __pyx_v_xx;
__pyx_t_13 = -1;
if (__pyx_t_12 < 0) {
__pyx_t_12 += __pyx_v_self->_arr.shape[0];
if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_12 >= __pyx_v_self->_arr.shape[0])) __pyx_t_13 = 0;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(5, 61, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyInt_From_unsigned_char((*((unsigned char *) ( /* dim=0 */ (__pyx_v_self->_arr.data + __pyx_t_12 * __pyx_v_self->_arr.strides[0]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_val, __pyx_t_5); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(5, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "jnius/jnius_nativetypes3.pxi":59
* if self._size:
* (start, stop, step) = index.indices(len(self._arr))
* for x in range(start, stop, step): # <<<<<<<<<<<<<<
* xx = x
* val.append(self._arr[xx])
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_nativetypes3.pxi":57
* if isinstance(index, slice):
* val = []
* if self._size: # <<<<<<<<<<<<<<
* (start, stop, step) = index.indices(len(self._arr))
* for x in range(start, stop, step):
*/
}
/* "jnius/jnius_nativetypes3.pxi":62
* xx = x
* val.append(self._arr[xx])
* return val # <<<<<<<<<<<<<<
* else:
* xx = index
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_val);
__pyx_r = __pyx_v_val;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":55
* def __getitem__(self, index):
* cdef long xx
* if isinstance(index, slice): # <<<<<<<<<<<<<<
* val = []
* if self._size:
*/
}
/* "jnius/jnius_nativetypes3.pxi":64
* return val
* else:
* xx = index # <<<<<<<<<<<<<<
* return self._arr[xx]
*
*/
/*else*/ {
__pyx_t_11 = __Pyx_PyInt_As_long(__pyx_v_index); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(5, 64, __pyx_L1_error)
__pyx_v_xx = __pyx_t_11;
/* "jnius/jnius_nativetypes3.pxi":65
* else:
* xx = index
* return self._arr[xx] # <<<<<<<<<<<<<<
*
* def __richcmp__(self, other, op):
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(!__pyx_v_self->_arr.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(5, 65, __pyx_L1_error)}
__pyx_t_15 = __pyx_v_xx;
__pyx_t_13 = -1;
if (__pyx_t_15 < 0) {
__pyx_t_15 += __pyx_v_self->_arr.shape[0];
if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
} else if (unlikely(__pyx_t_15 >= __pyx_v_self->_arr.shape[0])) __pyx_t_13 = 0;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
__PYX_ERR(5, 65, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyInt_From_unsigned_char((*((unsigned char *) ( /* dim=0 */ (__pyx_v_self->_arr.data + __pyx_t_15 * __pyx_v_self->_arr.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "jnius/jnius_nativetypes3.pxi":53
* return self._size
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
* cdef long xx
* if isinstance(index, slice):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.ByteArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_val);
__Pyx_XDECREF(__pyx_v_start);
__Pyx_XDECREF(__pyx_v_stop);
__Pyx_XDECREF(__pyx_v_step);
__Pyx_XDECREF(__pyx_v_x);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":67
* return self._arr[xx]
*
* def __richcmp__(self, other, op): # <<<<<<<<<<<<<<
* cdef ByteArray b_other
* if isinstance(other, (list, tuple)):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op) {
PyObject *__pyx_v_op = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
__pyx_v_op = __Pyx_PyInt_From_int(__pyx_arg_op); if (unlikely(!__pyx_v_op)) __PYX_ERR(5, 67, __pyx_L3_error)
__Pyx_GOTREF(__pyx_v_op);
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("jnius.jnius.ByteArray.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_10__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_op));
/* function exit code */
__Pyx_XDECREF(__pyx_v_op);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_10__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_op) {
CYTHON_UNUSED struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_b_other = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__richcmp__", 0);
/* "jnius/jnius_nativetypes3.pxi":69
* def __richcmp__(self, other, op):
* cdef ByteArray b_other
* if isinstance(other, (list, tuple)): # <<<<<<<<<<<<<<
* return python_op(op, self.tolist(), other)
* elif isinstance(other, ByteArray):
*/
__pyx_t_2 = PyList_Check(__pyx_v_other);
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = PyTuple_Check(__pyx_v_other);
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_nativetypes3.pxi":70
* cdef ByteArray b_other
* if isinstance(other, (list, tuple)):
* return python_op(op, self.tolist(), other) # <<<<<<<<<<<<<<
* elif isinstance(other, ByteArray):
* b_other = other
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_op); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 70, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tolist); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (__pyx_t_7) {
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 70, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else {
__pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 70, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __pyx_f_5jnius_5jnius_python_op(__pyx_t_4, __pyx_t_5, __pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":69
* def __richcmp__(self, other, op):
* cdef ByteArray b_other
* if isinstance(other, (list, tuple)): # <<<<<<<<<<<<<<
* return python_op(op, self.tolist(), other)
* elif isinstance(other, ByteArray):
*/
}
/* "jnius/jnius_nativetypes3.pxi":71
* if isinstance(other, (list, tuple)):
* return python_op(op, self.tolist(), other)
* elif isinstance(other, ByteArray): # <<<<<<<<<<<<<<
* b_other = other
* return python_op(op, self.tostring(), other.tostring())
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_5jnius_5jnius_ByteArray);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_nativetypes3.pxi":72
* return python_op(op, self.tolist(), other)
* elif isinstance(other, ByteArray):
* b_other = other # <<<<<<<<<<<<<<
* return python_op(op, self.tostring(), other.tostring())
* else:
*/
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_5jnius_5jnius_ByteArray))))) __PYX_ERR(5, 72, __pyx_L1_error)
__pyx_t_6 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_6);
__pyx_v_b_other = ((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_t_6);
__pyx_t_6 = 0;
/* "jnius/jnius_nativetypes3.pxi":73
* elif isinstance(other, ByteArray):
* b_other = other
* return python_op(op, self.tostring(), other.tostring()) # <<<<<<<<<<<<<<
* else:
* return False
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_op); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 73, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tostring); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
if (__pyx_t_7) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 73, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else {
__pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 73, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_tostring); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
if (__pyx_t_8) {
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 73, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 73, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __pyx_f_5jnius_5jnius_python_op(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":71
* if isinstance(other, (list, tuple)):
* return python_op(op, self.tolist(), other)
* elif isinstance(other, ByteArray): # <<<<<<<<<<<<<<
* b_other = other
* return python_op(op, self.tostring(), other.tostring())
*/
}
/* "jnius/jnius_nativetypes3.pxi":75
* return python_op(op, self.tostring(), other.tostring())
* else:
* return False # <<<<<<<<<<<<<<
*
* def tolist(self):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
}
/* "jnius/jnius_nativetypes3.pxi":67
* return self._arr[xx]
*
* def __richcmp__(self, other, op): # <<<<<<<<<<<<<<
* cdef ByteArray b_other
* if isinstance(other, (list, tuple)):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.ByteArray.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_b_other);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":77
* return False
*
* def tolist(self): # <<<<<<<<<<<<<<
* return list(self[:])
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_13tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_13tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tolist (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_12tolist(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_12tolist(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("tolist", 0);
/* "jnius/jnius_nativetypes3.pxi":78
*
* def tolist(self):
* return list(self[:]) # <<<<<<<<<<<<<<
*
* def tostring(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__40, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":77
* return False
*
* def tolist(self): # <<<<<<<<<<<<<<
* return list(self[:])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("jnius.jnius.ByteArray.tolist", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_nativetypes3.pxi":80
* return list(self[:])
*
* def tostring(self): # <<<<<<<<<<<<<<
* return self._buf[:self._size]
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_15tostring(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9ByteArray_15tostring(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tostring (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9ByteArray_14tostring(((struct __pyx_obj_5jnius_5jnius_ByteArray *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9ByteArray_14tostring(struct __pyx_obj_5jnius_5jnius_ByteArray *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("tostring", 0);
/* "jnius/jnius_nativetypes3.pxi":81
*
* def tostring(self):
* return self._buf[:self._size] # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->_buf) + 0, __pyx_v_self->_size - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_nativetypes3.pxi":80
* return list(self[:])
*
* def tostring(self): # <<<<<<<<<<<<<<
* return self._buf[:self._size]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("jnius.jnius.ByteArray.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_func.pxi":3
* from cpython.version cimport PY_MAJOR_VERSION
*
* def cast(destclass, obj): # <<<<<<<<<<<<<<
* cdef JavaClass jc
* cdef JavaClass jobj = obj
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_3cast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_3cast = {"cast", (PyCFunction)__pyx_pw_5jnius_5jnius_3cast, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5jnius_5jnius_3cast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_destclass = 0;
PyObject *__pyx_v_obj = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("cast (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_destclass,&__pyx_n_s_obj,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_destclass)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("cast", 1, 2, 2, 1); __PYX_ERR(6, 3, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(6, 3, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_destclass = values[0];
__pyx_v_obj = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("cast", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 3, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("jnius.jnius.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_2cast(__pyx_self, __pyx_v_destclass, __pyx_v_obj);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_2cast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_destclass, PyObject *__pyx_v_obj) {
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jc = 0;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_jobj = 0;
PyObject *__pyx_v_autoclass = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("cast", 0);
/* "jnius/jnius_export_func.pxi":5
* def cast(destclass, obj):
* cdef JavaClass jc
* cdef JavaClass jobj = obj # <<<<<<<<<<<<<<
* from .reflect import autoclass
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \
*/
if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(6, 5, __pyx_L1_error)
__pyx_t_1 = __pyx_v_obj;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_jobj = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_export_func.pxi":6
* cdef JavaClass jc
* cdef JavaClass jobj = obj
* from .reflect import autoclass # <<<<<<<<<<<<<<
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)):
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_autoclass);
__Pyx_GIVEREF(__pyx_n_s_autoclass);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_autoclass);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_reflect, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_autoclass); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_autoclass = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "jnius/jnius_export_func.pxi":7
* cdef JavaClass jobj = obj
* from .reflect import autoclass
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \ # <<<<<<<<<<<<<<
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)):
* jc = autoclass(destclass)(noinstance=True)
*/
__pyx_t_4 = ((PY_MAJOR_VERSION < 3) != 0);
if (!__pyx_t_4) {
goto __pyx_L5_next_or;
} else {
}
__pyx_t_4 = __Pyx_PyBaseString_Check(__pyx_v_destclass);
__pyx_t_5 = (__pyx_t_4 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_L5_next_or:;
/* "jnius/jnius_export_func.pxi":8
* from .reflect import autoclass
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)): # <<<<<<<<<<<<<<
* jc = autoclass(destclass)(noinstance=True)
* else:
*/
__pyx_t_5 = ((PY_MAJOR_VERSION >= 3) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = PyString_Check(__pyx_v_destclass);
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
/* "jnius/jnius_export_func.pxi":7
* cdef JavaClass jobj = obj
* from .reflect import autoclass
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \ # <<<<<<<<<<<<<<
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)):
* jc = autoclass(destclass)(noinstance=True)
*/
if (__pyx_t_3) {
/* "jnius/jnius_export_func.pxi":9
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)):
* jc = autoclass(destclass)(noinstance=True) # <<<<<<<<<<<<<<
* else:
* jc = destclass(noinstance=True)
*/
__Pyx_INCREF(__pyx_v_autoclass);
__pyx_t_1 = __pyx_v_autoclass; __pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
if (!__pyx_t_6) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_destclass); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_destclass};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_destclass};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_INCREF(__pyx_v_destclass);
__Pyx_GIVEREF(__pyx_v_destclass);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_destclass);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(6, 9, __pyx_L1_error)
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(6, 9, __pyx_L1_error)
__pyx_v_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_export_func.pxi":7
* cdef JavaClass jobj = obj
* from .reflect import autoclass
* if (PY_MAJOR_VERSION < 3 and isinstance(destclass, basestring)) or \ # <<<<<<<<<<<<<<
* (PY_MAJOR_VERSION >=3 and isinstance(destclass, str)):
* jc = autoclass(destclass)(noinstance=True)
*/
goto __pyx_L3;
}
/* "jnius/jnius_export_func.pxi":11
* jc = autoclass(destclass)(noinstance=True)
* else:
* jc = destclass(noinstance=True) # <<<<<<<<<<<<<<
* jc.instanciate_from(jobj.j_self)
* return jc
*/
/*else*/ {
__pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(6, 11, __pyx_L1_error)
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_destclass, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(6, 11, __pyx_L1_error)
__pyx_v_jc = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_1);
__pyx_t_1 = 0;
}
__pyx_L3:;
/* "jnius/jnius_export_func.pxi":12
* else:
* jc = destclass(noinstance=True)
* jc.instanciate_from(jobj.j_self) # <<<<<<<<<<<<<<
* return jc
*
*/
__pyx_t_1 = ((PyObject *)__pyx_v_jobj->j_self);
__Pyx_INCREF(__pyx_t_1);
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_jc->__pyx_vtab)->instanciate_from(__pyx_v_jc, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_func.pxi":13
* jc = destclass(noinstance=True)
* jc.instanciate_from(jobj.j_self)
* return jc # <<<<<<<<<<<<<<
*
* def find_javaclass(namestr):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_jc));
__pyx_r = ((PyObject *)__pyx_v_jc);
goto __pyx_L0;
/* "jnius/jnius_export_func.pxi":3
* from cpython.version cimport PY_MAJOR_VERSION
*
* def cast(destclass, obj): # <<<<<<<<<<<<<<
* cdef JavaClass jc
* cdef JavaClass jobj = obj
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("jnius.jnius.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jc);
__Pyx_XDECREF((PyObject *)__pyx_v_jobj);
__Pyx_XDECREF(__pyx_v_autoclass);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_func.pxi":15
* return jc
*
* def find_javaclass(namestr): # <<<<<<<<<<<<<<
* namestr = namestr.replace('.', '/')
* cdef bytes name = str_for_c(namestr)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_5find_javaclass(PyObject *__pyx_self, PyObject *__pyx_v_namestr); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_5find_javaclass = {"find_javaclass", (PyCFunction)__pyx_pw_5jnius_5jnius_5find_javaclass, METH_O, 0};
static PyObject *__pyx_pw_5jnius_5jnius_5find_javaclass(PyObject *__pyx_self, PyObject *__pyx_v_namestr) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("find_javaclass (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_4find_javaclass(__pyx_self, ((PyObject *)__pyx_v_namestr));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_4find_javaclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_namestr) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_Class = NULL;
struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_cls = 0;
jclass __pyx_v_jc;
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
JNIEnv *__pyx_t_3;
char *__pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("find_javaclass", 0);
__Pyx_INCREF(__pyx_v_namestr);
/* "jnius/jnius_export_func.pxi":16
*
* def find_javaclass(namestr):
* namestr = namestr.replace('.', '/') # <<<<<<<<<<<<<<
* cdef bytes name = str_for_c(namestr)
* from .reflect import Class
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_namestr, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_namestr, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_export_func.pxi":17
* def find_javaclass(namestr):
* namestr = namestr.replace('.', '/')
* cdef bytes name = str_for_c(namestr) # <<<<<<<<<<<<<<
* from .reflect import Class
* cdef JavaClass cls
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_namestr); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(6, 17, __pyx_L1_error)
__pyx_v_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_export_func.pxi":18
* namestr = namestr.replace('.', '/')
* cdef bytes name = str_for_c(namestr)
* from .reflect import Class # <<<<<<<<<<<<<<
* cdef JavaClass cls
* cdef jclass jc
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_n_s_Class);
__Pyx_GIVEREF(__pyx_n_s_Class);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Class);
__pyx_t_1 = __Pyx_Import(__pyx_n_s_reflect, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Class); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_Class = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_func.pxi":21
* cdef JavaClass cls
* cdef jclass jc
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
*
* jc = j_env[0].FindClass(j_env, name)
*/
__pyx_t_3 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(6, 21, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_3;
/* "jnius/jnius_export_func.pxi":23
* cdef JNIEnv *j_env = get_jnienv()
*
* jc = j_env[0].FindClass(j_env, name) # <<<<<<<<<<<<<<
* if jc == NULL:
* j_env[0].ExceptionClear(j_env)
*/
__pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(6, 23, __pyx_L1_error)
__pyx_v_jc = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, __pyx_t_4);
/* "jnius/jnius_export_func.pxi":24
*
* jc = j_env[0].FindClass(j_env, name)
* if jc == NULL: # <<<<<<<<<<<<<<
* j_env[0].ExceptionClear(j_env)
* raise JavaException('Class not found {0!r}'.format(name))
*/
__pyx_t_5 = ((__pyx_v_jc == NULL) != 0);
if (__pyx_t_5) {
/* "jnius/jnius_export_func.pxi":25
* jc = j_env[0].FindClass(j_env, name)
* if jc == NULL:
* j_env[0].ExceptionClear(j_env) # <<<<<<<<<<<<<<
* raise JavaException('Class not found {0!r}'.format(name))
*
*/
(__pyx_v_j_env[0])->ExceptionClear(__pyx_v_j_env);
/* "jnius/jnius_export_func.pxi":26
* if jc == NULL:
* j_env[0].ExceptionClear(j_env)
* raise JavaException('Class not found {0!r}'.format(name)) # <<<<<<<<<<<<<<
*
* check_exception(j_env)
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Class_not_found_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
if (!__pyx_t_8) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_name};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_name};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_name);
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_7) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(6, 26, __pyx_L1_error)
/* "jnius/jnius_export_func.pxi":24
*
* jc = j_env[0].FindClass(j_env, name)
* if jc == NULL: # <<<<<<<<<<<<<<
* j_env[0].ExceptionClear(j_env)
* raise JavaException('Class not found {0!r}'.format(name))
*/
}
/* "jnius/jnius_export_func.pxi":28
* raise JavaException('Class not found {0!r}'.format(name))
*
* check_exception(j_env) # <<<<<<<<<<<<<<
*
* cls = Class(noinstance=True)
*/
__pyx_f_5jnius_5jnius_check_exception(__pyx_v_j_env); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 28, __pyx_L1_error)
/* "jnius/jnius_export_func.pxi":30
* check_exception(j_env)
*
* cls = Class(noinstance=True) # <<<<<<<<<<<<<<
* cls.instanciate_from(create_local_ref(j_env, jc))
* j_env[0].DeleteLocalRef(j_env, jc)
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 30, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_noinstance, Py_True) < 0) __PYX_ERR(6, 30, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_Class, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 30, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5jnius_5jnius_JavaClass))))) __PYX_ERR(6, 30, __pyx_L1_error)
__pyx_v_cls = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_export_func.pxi":31
*
* cls = Class(noinstance=True)
* cls.instanciate_from(create_local_ref(j_env, jc)) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, jc)
* return cls
*/
__pyx_t_2 = ((PyObject *)__pyx_f_5jnius_5jnius_create_local_ref(__pyx_v_j_env, __pyx_v_jc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_cls->__pyx_vtab)->instanciate_from(__pyx_v_cls, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 31, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "jnius/jnius_export_func.pxi":32
* cls = Class(noinstance=True)
* cls.instanciate_from(create_local_ref(j_env, jc))
* j_env[0].DeleteLocalRef(j_env, jc) # <<<<<<<<<<<<<<
* return cls
*
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_jc);
/* "jnius/jnius_export_func.pxi":33
* cls.instanciate_from(create_local_ref(j_env, jc))
* j_env[0].DeleteLocalRef(j_env, jc)
* return cls # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_cls));
__pyx_r = ((PyObject *)__pyx_v_cls);
goto __pyx_L0;
/* "jnius/jnius_export_func.pxi":15
* return jc
*
* def find_javaclass(namestr): # <<<<<<<<<<<<<<
* namestr = namestr.replace('.', '/')
* cdef bytes name = str_for_c(namestr)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("jnius.jnius.find_javaclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_Class);
__Pyx_XDECREF((PyObject *)__pyx_v_cls);
__Pyx_XDECREF(__pyx_v_namestr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":8
* stacktrace = None # The stack trace of the inner exception
*
* def __init__(self, message, classname=None, innermessage=None, stacktrace=None): # <<<<<<<<<<<<<<
* self.classname = classname
* self.innermessage = innermessage
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_13JavaException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_13JavaException_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5jnius_5jnius_13JavaException_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5jnius_5jnius_13JavaException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_message = 0;
PyObject *__pyx_v_classname = 0;
PyObject *__pyx_v_innermessage = 0;
PyObject *__pyx_v_stacktrace = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_classname,&__pyx_n_s_innermessage,&__pyx_n_s_stacktrace,0};
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)((PyObject *)Py_None));
values[3] = ((PyObject *)((PyObject *)Py_None));
values[4] = ((PyObject *)((PyObject *)Py_None));
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 8, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_classname);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_innermessage);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stacktrace);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 8, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_self = values[0];
__pyx_v_message = values[1];
__pyx_v_classname = values[2];
__pyx_v_innermessage = values[3];
__pyx_v_stacktrace = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 8, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("jnius.jnius.JavaException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_13JavaException___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_classname, __pyx_v_innermessage, __pyx_v_stacktrace);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_13JavaException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_classname, PyObject *__pyx_v_innermessage, PyObject *__pyx_v_stacktrace) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "jnius/jnius_export_class.pxi":9
*
* def __init__(self, message, classname=None, innermessage=None, stacktrace=None):
* self.classname = classname # <<<<<<<<<<<<<<
* self.innermessage = innermessage
* self.stacktrace = stacktrace
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_classname, __pyx_v_classname) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":10
* def __init__(self, message, classname=None, innermessage=None, stacktrace=None):
* self.classname = classname
* self.innermessage = innermessage # <<<<<<<<<<<<<<
* self.stacktrace = stacktrace
* Exception.__init__(self, message)
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_innermessage, __pyx_v_innermessage) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":11
* self.classname = classname
* self.innermessage = innermessage
* self.stacktrace = stacktrace # <<<<<<<<<<<<<<
* Exception.__init__(self, message)
*
*/
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_stacktrace, __pyx_v_stacktrace) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":12
* self.innermessage = innermessage
* self.stacktrace = stacktrace
* Exception.__init__(self, message) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_message};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_message};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(__pyx_v_self);
__Pyx_GIVEREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
__Pyx_INCREF(__pyx_v_message);
__Pyx_GIVEREF(__pyx_v_message);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":8
* stacktrace = None # The stack trace of the inner exception
*
* def __init__(self, message, classname=None, innermessage=None, stacktrace=None): # <<<<<<<<<<<<<<
* self.classname = classname
* self.innermessage = innermessage
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("jnius.jnius.JavaException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":21
* cdef jobject obj
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_10JavaObject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_10JavaObject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_5jnius_5jnius_10JavaObject___cinit__(((struct __pyx_obj_5jnius_5jnius_JavaObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_10JavaObject___cinit__(struct __pyx_obj_5jnius_5jnius_JavaObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_export_class.pxi":22
*
* def __cinit__(self):
* self.obj = NULL # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_self->obj = NULL;
/* "jnius/jnius_export_class.pxi":21
* cdef jobject obj
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":28
* cdef jclass j_cls
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.j_cls = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_16JavaClassStorage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_16JavaClassStorage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_5jnius_5jnius_16JavaClassStorage___cinit__(((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_16JavaClassStorage___cinit__(struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_export_class.pxi":29
*
* def __cinit__(self):
* self.j_cls = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->j_cls = NULL;
/* "jnius/jnius_export_class.pxi":28
* cdef jclass j_cls
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.j_cls = NULL
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":31
* self.j_cls = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self.j_cls != NULL:
*/
/* Python wrapper */
static void __pyx_pw_5jnius_5jnius_16JavaClassStorage_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5jnius_5jnius_16JavaClassStorage_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_5jnius_5jnius_16JavaClassStorage_2__dealloc__(((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5jnius_5jnius_16JavaClassStorage_2__dealloc__(struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_self) {
JNIEnv *__pyx_v_j_env;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
JNIEnv *__pyx_t_2;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "jnius/jnius_export_class.pxi":33
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self.j_cls != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.j_cls)
*/
__pyx_t_1 = ((__pyx_v_self->j_cls != NULL) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_export_class.pxi":34
* cdef JNIEnv *j_env
* if self.j_cls != NULL:
* j_env = get_jnienv() # <<<<<<<<<<<<<<
* j_env[0].DeleteGlobalRef(j_env, self.j_cls)
* self.j_cls = NULL
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(0, 34, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_2;
/* "jnius/jnius_export_class.pxi":35
* if self.j_cls != NULL:
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.j_cls) # <<<<<<<<<<<<<<
* self.j_cls = NULL
*
*/
(__pyx_v_j_env[0])->DeleteGlobalRef(__pyx_v_j_env, __pyx_v_self->j_cls);
/* "jnius/jnius_export_class.pxi":36
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.j_cls)
* self.j_cls = NULL # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_self->j_cls = NULL;
/* "jnius/jnius_export_class.pxi":33
* def __dealloc__(self):
* cdef JNIEnv *j_env
* if self.j_cls != NULL: # <<<<<<<<<<<<<<
* j_env = get_jnienv()
* j_env[0].DeleteGlobalRef(j_env, self.j_cls)
*/
}
/* "jnius/jnius_export_class.pxi":31
* self.j_cls = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env
* if self.j_cls != NULL:
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("jnius.jnius.JavaClassStorage.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":42
*
* class MetaJavaClass(type):
* def __new__(meta, classname, bases, classDict): # <<<<<<<<<<<<<<
* meta.resolve_class(classDict)
* tp = type.__new__(meta, str(classname), bases, classDict)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_13MetaJavaClass_1__new__ = {"__new__", (PyCFunction)__pyx_pw_5jnius_5jnius_13MetaJavaClass_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_meta = 0;
PyObject *__pyx_v_classname = 0;
PyObject *__pyx_v_bases = 0;
PyObject *__pyx_v_classDict = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_meta,&__pyx_n_s_classname,&__pyx_n_s_bases,&__pyx_n_s_classDict,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_meta)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_classname)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 1); __PYX_ERR(0, 42, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bases)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 2); __PYX_ERR(0, 42, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_classDict)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, 3); __PYX_ERR(0, 42, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 42, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_meta = values[0];
__pyx_v_classname = values[1];
__pyx_v_bases = values[2];
__pyx_v_classDict = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__new__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 42, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("jnius.jnius.MetaJavaClass.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_13MetaJavaClass___new__(__pyx_self, __pyx_v_meta, __pyx_v_classname, __pyx_v_bases, __pyx_v_classDict);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_meta, PyObject *__pyx_v_classname, PyObject *__pyx_v_bases, PyObject *__pyx_v_classDict) {
PyObject *__pyx_v_tp = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__new__", 0);
/* "jnius/jnius_export_class.pxi":43
* class MetaJavaClass(type):
* def __new__(meta, classname, bases, classDict):
* meta.resolve_class(classDict) # <<<<<<<<<<<<<<
* tp = type.__new__(meta, str(classname), bases, classDict)
* jclass_register[classDict['__javaclass__']] = tp
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_resolve_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_classDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_classDict};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_classDict};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_v_classDict);
__Pyx_GIVEREF(__pyx_v_classDict);
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_classDict);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":44
* def __new__(meta, classname, bases, classDict):
* meta.resolve_class(classDict)
* tp = type.__new__(meta, str(classname), bases, classDict) # <<<<<<<<<<<<<<
* jclass_register[classDict['__javaclass__']] = tp
* return tp
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_classname);
__Pyx_GIVEREF(__pyx_v_classname);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_classname);
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_meta, __pyx_t_3, __pyx_v_bases, __pyx_v_classDict};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_meta, __pyx_t_3, __pyx_v_bases, __pyx_v_classDict};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_meta);
__Pyx_GIVEREF(__pyx_v_meta);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_meta);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
__Pyx_INCREF(__pyx_v_bases);
__Pyx_GIVEREF(__pyx_v_bases);
PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_bases);
__Pyx_INCREF(__pyx_v_classDict);
__Pyx_GIVEREF(__pyx_v_classDict);
PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_classDict);
__pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_tp = __pyx_t_1;
__pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":45
* meta.resolve_class(classDict)
* tp = type.__new__(meta, str(classname), bases, classDict)
* jclass_register[classDict['__javaclass__']] = tp # <<<<<<<<<<<<<<
* return tp
*
*/
if (unlikely(__pyx_v_5jnius_5jnius_jclass_register == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 45, __pyx_L1_error)
}
__pyx_t_1 = PyObject_GetItem(__pyx_v_classDict, __pyx_n_s_javaclass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely(PyDict_SetItem(__pyx_v_5jnius_5jnius_jclass_register, __pyx_t_1, __pyx_v_tp) < 0)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":46
* tp = type.__new__(meta, str(classname), bases, classDict)
* jclass_register[classDict['__javaclass__']] = tp
* return tp # <<<<<<<<<<<<<<
*
* @staticmethod
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_tp);
__pyx_r = __pyx_v_tp;
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":42
*
* class MetaJavaClass(type):
* def __new__(meta, classname, bases, classDict): # <<<<<<<<<<<<<<
* meta.resolve_class(classDict)
* tp = type.__new__(meta, str(classname), bases, classDict)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("jnius.jnius.MetaJavaClass.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":49
*
* @staticmethod
* def get_javaclass(name): # <<<<<<<<<<<<<<
* return jclass_register.get(name)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_3get_javaclass(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_13MetaJavaClass_3get_javaclass = {"get_javaclass", (PyCFunction)__pyx_pw_5jnius_5jnius_13MetaJavaClass_3get_javaclass, METH_O, 0};
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_3get_javaclass(PyObject *__pyx_self, PyObject *__pyx_v_name) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_javaclass (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_13MetaJavaClass_2get_javaclass(__pyx_self, ((PyObject *)__pyx_v_name));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass_2get_javaclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_javaclass", 0);
/* "jnius/jnius_export_class.pxi":50
* @staticmethod
* def get_javaclass(name):
* return jclass_register.get(name) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_5jnius_5jnius_jclass_register == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
__PYX_ERR(0, 50, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_5jnius_5jnius_jclass_register, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":49
*
* @staticmethod
* def get_javaclass(name): # <<<<<<<<<<<<<<
* return jclass_register.get(name)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("jnius.jnius.MetaJavaClass.get_javaclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":53
*
* @classmethod
* def resolve_class(meta, classDict): # <<<<<<<<<<<<<<
* # search the Java class, and bind to our object
* if not '__javaclass__' in classDict:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_5resolve_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5jnius_5jnius_13MetaJavaClass_5resolve_class = {"resolve_class", (PyCFunction)__pyx_pw_5jnius_5jnius_13MetaJavaClass_5resolve_class, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5jnius_5jnius_13MetaJavaClass_5resolve_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_meta = 0;
PyObject *__pyx_v_classDict = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("resolve_class (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_meta,&__pyx_n_s_classDict,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_meta)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_classDict)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("resolve_class", 1, 2, 2, 1); __PYX_ERR(0, 53, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolve_class") < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_meta = values[0];
__pyx_v_classDict = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("resolve_class", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 53, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("jnius.jnius.MetaJavaClass.resolve_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class(__pyx_self, __pyx_v_meta, __pyx_v_classDict);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_meta, PyObject *__pyx_v_classDict) {
struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_jcs = 0;
PyObject *__pyx_v___javaclass__ = 0;
PyObject *__pyx_v___javainterfaces__ = 0;
PyObject *__pyx_v___javabaseclass__ = 0;
jmethodID __pyx_v_getProxyClass;
jmethodID __pyx_v_getClassLoader;
jclass *__pyx_v_interfaces;
jobject *__pyx_v_jargs;
JNIEnv *__pyx_v_j_env;
jclass __pyx_v_baseclass;
Py_ssize_t __pyx_v_n;
PyObject *__pyx_v_i = NULL;
jobject __pyx_v_classLoader;
PyObject *__pyx_v_class_name = NULL;
struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_jm = 0;
struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_jmm = 0;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_v_value = NULL;
struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_jf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
JNIEnv *__pyx_t_5;
char *__pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *(*__pyx_t_13)(PyObject *);
__Pyx_RefNannySetupContext("resolve_class", 0);
/* "jnius/jnius_export_class.pxi":55
* def resolve_class(meta, classDict):
* # search the Java class, and bind to our object
* if not '__javaclass__' in classDict: # <<<<<<<<<<<<<<
* raise JavaException('__javaclass__ definition missing')
*
*/
__pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_javaclass, __pyx_v_classDict, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 55, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":56
* # search the Java class, and bind to our object
* if not '__javaclass__' in classDict:
* raise JavaException('__javaclass__ definition missing') # <<<<<<<<<<<<<<
*
* cdef JavaClassStorage jcs = JavaClassStorage()
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(0, 56, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":55
* def resolve_class(meta, classDict):
* # search the Java class, and bind to our object
* if not '__javaclass__' in classDict: # <<<<<<<<<<<<<<
* raise JavaException('__javaclass__ definition missing')
*
*/
}
/* "jnius/jnius_export_class.pxi":58
* raise JavaException('__javaclass__ definition missing')
*
* cdef JavaClassStorage jcs = JavaClassStorage() # <<<<<<<<<<<<<<
* cdef bytes __javaclass__ = <bytes>classDict['__javaclass__']
* cdef bytes __javainterfaces__ = <bytes>classDict.get('__javainterfaces__', '')
*/
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5jnius_5jnius_JavaClassStorage), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_jcs = ((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_t_4);
__pyx_t_4 = 0;
/* "jnius/jnius_export_class.pxi":59
*
* cdef JavaClassStorage jcs = JavaClassStorage()
* cdef bytes __javaclass__ = <bytes>classDict['__javaclass__'] # <<<<<<<<<<<<<<
* cdef bytes __javainterfaces__ = <bytes>classDict.get('__javainterfaces__', '')
* cdef bytes __javabaseclass__ = <bytes>classDict.get('__javabaseclass__', '')
*/
__pyx_t_4 = PyObject_GetItem(__pyx_v_classDict, __pyx_n_s_javaclass); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v___javaclass__ = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":60
* cdef JavaClassStorage jcs = JavaClassStorage()
* cdef bytes __javaclass__ = <bytes>classDict['__javaclass__']
* cdef bytes __javainterfaces__ = <bytes>classDict.get('__javainterfaces__', '') # <<<<<<<<<<<<<<
* cdef bytes __javabaseclass__ = <bytes>classDict.get('__javabaseclass__', '')
* cdef jmethodID getProxyClass, getClassLoader
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_classDict, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v___javainterfaces__ = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":61
* cdef bytes __javaclass__ = <bytes>classDict['__javaclass__']
* cdef bytes __javainterfaces__ = <bytes>classDict.get('__javainterfaces__', '')
* cdef bytes __javabaseclass__ = <bytes>classDict.get('__javabaseclass__', '') # <<<<<<<<<<<<<<
* cdef jmethodID getProxyClass, getClassLoader
* cdef jclass *interfaces
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_classDict, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v___javabaseclass__ = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":65
* cdef jclass *interfaces
* cdef jobject *jargs
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
*
* if __javainterfaces__ and __javabaseclass__:
*/
__pyx_t_5 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_5 == NULL)) __PYX_ERR(0, 65, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_5;
/* "jnius/jnius_export_class.pxi":67
* cdef JNIEnv *j_env = get_jnienv()
*
* if __javainterfaces__ and __javabaseclass__: # <<<<<<<<<<<<<<
* baseclass = j_env[0].FindClass(j_env, <char*>__javabaseclass__)
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__))
*/
__pyx_t_1 = (__pyx_v___javainterfaces__ != Py_None) && (PyBytes_GET_SIZE(__pyx_v___javainterfaces__) != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__pyx_v___javabaseclass__ != Py_None) && (PyBytes_GET_SIZE(__pyx_v___javabaseclass__) != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":68
*
* if __javainterfaces__ and __javabaseclass__:
* baseclass = j_env[0].FindClass(j_env, <char*>__javabaseclass__) # <<<<<<<<<<<<<<
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__))
*
*/
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v___javabaseclass__); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error)
__pyx_v_baseclass = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)__pyx_t_6));
/* "jnius/jnius_export_class.pxi":69
* if __javainterfaces__ and __javabaseclass__:
* baseclass = j_env[0].FindClass(j_env, <char*>__javabaseclass__)
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__)) # <<<<<<<<<<<<<<
*
* for n, i in enumerate(__javainterfaces__):
*/
if (unlikely(__pyx_v___javainterfaces__ == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(0, 69, __pyx_L1_error)
}
__pyx_t_7 = PyBytes_GET_SIZE(__pyx_v___javainterfaces__); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
__pyx_v_interfaces = ((jclass *)malloc(((sizeof(jclass)) * __pyx_t_7)));
/* "jnius/jnius_export_class.pxi":71
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__))
*
* for n, i in enumerate(__javainterfaces__): # <<<<<<<<<<<<<<
* interfaces[n] = j_env[0].FindClass(j_env, <char*>i)
*
*/
__pyx_t_7 = 0;
__pyx_t_3 = PyObject_GetIter(__pyx_v___javainterfaces__); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
for (;;) {
{
__pyx_t_4 = __pyx_t_8(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 71, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_v_n = __pyx_t_7;
__pyx_t_7 = (__pyx_t_7 + 1);
/* "jnius/jnius_export_class.pxi":72
*
* for n, i in enumerate(__javainterfaces__):
* interfaces[n] = j_env[0].FindClass(j_env, <char*>i) # <<<<<<<<<<<<<<
*
* getProxyClass = j_env[0].GetStaticMethodID(
*/
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_i); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error)
(__pyx_v_interfaces[__pyx_v_n]) = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)__pyx_t_6));
/* "jnius/jnius_export_class.pxi":71
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__))
*
* for n, i in enumerate(__javainterfaces__): # <<<<<<<<<<<<<<
* interfaces[n] = j_env[0].FindClass(j_env, <char*>i)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":74
* interfaces[n] = j_env[0].FindClass(j_env, <char*>i)
*
* getProxyClass = j_env[0].GetStaticMethodID( # <<<<<<<<<<<<<<
* j_env, baseclass, "getProxyClass",
* "(Ljava/lang/ClassLoader,[Ljava/lang/Class;)Ljava/lang/Class;")
*/
__pyx_v_getProxyClass = (__pyx_v_j_env[0])->GetStaticMethodID(__pyx_v_j_env, __pyx_v_baseclass, ((char const *)"getProxyClass"), ((char const *)"(Ljava/lang/ClassLoader,[Ljava/lang/Class;)Ljava/lang/Class;"));
/* "jnius/jnius_export_class.pxi":78
* "(Ljava/lang/ClassLoader,[Ljava/lang/Class;)Ljava/lang/Class;")
*
* getClassLoader = j_env[0].GetStaticMethodID( # <<<<<<<<<<<<<<
* j_env, baseclass, "getClassLoader", "()Ljava/lang/Class;")
*
*/
__pyx_v_getClassLoader = (__pyx_v_j_env[0])->GetStaticMethodID(__pyx_v_j_env, __pyx_v_baseclass, ((char const *)"getClassLoader"), ((char const *)"()Ljava/lang/Class;"));
/* "jnius/jnius_export_class.pxi":81
* j_env, baseclass, "getClassLoader", "()Ljava/lang/Class;")
*
* with nogil: # <<<<<<<<<<<<<<
* classLoader = j_env[0].CallStaticObjectMethodA(
* j_env, baseclass, getClassLoader, NULL)
*/
{
#ifdef WITH_THREAD
PyThreadState *_save;
Py_UNBLOCK_THREADS
#endif
/*try:*/ {
/* "jnius/jnius_export_class.pxi":82
*
* with nogil:
* classLoader = j_env[0].CallStaticObjectMethodA( # <<<<<<<<<<<<<<
* j_env, baseclass, getClassLoader, NULL)
* jargs = <jobject *>malloc(sizeof(jobject) * 2)
*/
__pyx_v_classLoader = (__pyx_v_j_env[0])->CallStaticObjectMethodA(__pyx_v_j_env, __pyx_v_baseclass, __pyx_v_getClassLoader, NULL);
/* "jnius/jnius_export_class.pxi":84
* classLoader = j_env[0].CallStaticObjectMethodA(
* j_env, baseclass, getClassLoader, NULL)
* jargs = <jobject *>malloc(sizeof(jobject) * 2) # <<<<<<<<<<<<<<
* jargs[0] = <jobject *>classLoader
* jargs[1] = interfaces
*/
__pyx_v_jargs = ((jobject *)malloc(((sizeof(jobject)) * 2)));
/* "jnius/jnius_export_class.pxi":85
* j_env, baseclass, getClassLoader, NULL)
* jargs = <jobject *>malloc(sizeof(jobject) * 2)
* jargs[0] = <jobject *>classLoader # <<<<<<<<<<<<<<
* jargs[1] = interfaces
* jcs.j_cls = j_env[0].CallStaticObjectMethod(
*/
(__pyx_v_jargs[0]) = ((jobject *)__pyx_v_classLoader);
/* "jnius/jnius_export_class.pxi":86
* jargs = <jobject *>malloc(sizeof(jobject) * 2)
* jargs[0] = <jobject *>classLoader
* jargs[1] = interfaces # <<<<<<<<<<<<<<
* jcs.j_cls = j_env[0].CallStaticObjectMethod(
* j_env, baseclass, getProxyClass, jargs)
*/
(__pyx_v_jargs[1]) = __pyx_v_interfaces;
/* "jnius/jnius_export_class.pxi":87
* jargs[0] = <jobject *>classLoader
* jargs[1] = interfaces
* jcs.j_cls = j_env[0].CallStaticObjectMethod( # <<<<<<<<<<<<<<
* j_env, baseclass, getProxyClass, jargs)
*
*/
__pyx_v_jcs->j_cls = (__pyx_v_j_env[0])->CallStaticObjectMethod(__pyx_v_j_env, __pyx_v_baseclass, __pyx_v_getProxyClass, __pyx_v_jargs);
}
/* "jnius/jnius_export_class.pxi":81
* j_env, baseclass, "getClassLoader", "()Ljava/lang/Class;")
*
* with nogil: # <<<<<<<<<<<<<<
* classLoader = j_env[0].CallStaticObjectMethodA(
* j_env, baseclass, getClassLoader, NULL)
*/
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
Py_BLOCK_THREADS
#endif
goto __pyx_L11;
}
__pyx_L11:;
}
}
/* "jnius/jnius_export_class.pxi":90
* j_env, baseclass, getProxyClass, jargs)
*
* j_env[0].DeleteLocalRef(j_env, baseclass) # <<<<<<<<<<<<<<
*
* if jcs.j_cls == NULL:
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_baseclass);
/* "jnius/jnius_export_class.pxi":92
* j_env[0].DeleteLocalRef(j_env, baseclass)
*
* if jcs.j_cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to create the class'
* ' {0}'.format(__javaclass__))
*/
__pyx_t_2 = ((__pyx_v_jcs->j_cls == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":93
*
* if jcs.j_cls == NULL:
* raise JavaException('Unable to create the class' # <<<<<<<<<<<<<<
* ' {0}'.format(__javaclass__))
* else:
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "jnius/jnius_export_class.pxi":94
* if jcs.j_cls == NULL:
* raise JavaException('Unable to create the class'
* ' {0}'.format(__javaclass__)) # <<<<<<<<<<<<<<
* else:
* class_name = str_for_c(__javaclass__)
*/
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_create_the_class_0, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
}
}
if (!__pyx_t_11) {
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v___javaclass__); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v___javaclass__};
__pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_9);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v___javaclass__};
__pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_9);
} else
#endif
{
__pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
__Pyx_INCREF(__pyx_v___javaclass__);
__Pyx_GIVEREF(__pyx_v___javaclass__);
PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v___javaclass__);
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_10) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else
#endif
{
__pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_9);
__pyx_t_9 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(0, 93, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":92
* j_env[0].DeleteLocalRef(j_env, baseclass)
*
* if jcs.j_cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to create the class'
* ' {0}'.format(__javaclass__))
*/
}
/* "jnius/jnius_export_class.pxi":67
* cdef JNIEnv *j_env = get_jnienv()
*
* if __javainterfaces__ and __javabaseclass__: # <<<<<<<<<<<<<<
* baseclass = j_env[0].FindClass(j_env, <char*>__javabaseclass__)
* interfaces = <jclass *>malloc(sizeof(jclass) * len(__javainterfaces__))
*/
goto __pyx_L4;
}
/* "jnius/jnius_export_class.pxi":96
* ' {0}'.format(__javaclass__))
* else:
* class_name = str_for_c(__javaclass__) # <<<<<<<<<<<<<<
* jcs.j_cls = j_env[0].FindClass(j_env,
* <char *>class_name)
*/
/*else*/ {
__pyx_t_3 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v___javaclass__); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_class_name = __pyx_t_3;
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":98
* class_name = str_for_c(__javaclass__)
* jcs.j_cls = j_env[0].FindClass(j_env,
* <char *>class_name) # <<<<<<<<<<<<<<
* if jcs.j_cls == NULL:
* raise JavaException('Unable to find the class'
*/
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_class_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":97
* else:
* class_name = str_for_c(__javaclass__)
* jcs.j_cls = j_env[0].FindClass(j_env, # <<<<<<<<<<<<<<
* <char *>class_name)
* if jcs.j_cls == NULL:
*/
__pyx_v_jcs->j_cls = (__pyx_v_j_env[0])->FindClass(__pyx_v_j_env, ((char *)__pyx_t_6));
/* "jnius/jnius_export_class.pxi":99
* jcs.j_cls = j_env[0].FindClass(j_env,
* <char *>class_name)
* if jcs.j_cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to find the class'
* ' {0}'.format(__javaclass__))
*/
__pyx_t_2 = ((__pyx_v_jcs->j_cls == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":100
* <char *>class_name)
* if jcs.j_cls == NULL:
* raise JavaException('Unable to find the class' # <<<<<<<<<<<<<<
* ' {0}'.format(__javaclass__))
*
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "jnius/jnius_export_class.pxi":101
* if jcs.j_cls == NULL:
* raise JavaException('Unable to find the class'
* ' {0}'.format(__javaclass__)) # <<<<<<<<<<<<<<
*
* # XXX do we need to grab a ref here?
*/
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_find_the_class_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
}
}
if (!__pyx_t_10) {
__pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v___javaclass__); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v___javaclass__};
__pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_12);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v___javaclass__};
__pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_12);
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_INCREF(__pyx_v___javaclass__);
__Pyx_GIVEREF(__pyx_v___javaclass__);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v___javaclass__);
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_9) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_12};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_12};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_12);
__pyx_t_12 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(0, 100, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":99
* jcs.j_cls = j_env[0].FindClass(j_env,
* <char *>class_name)
* if jcs.j_cls == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to find the class'
* ' {0}'.format(__javaclass__))
*/
}
}
__pyx_L4:;
/* "jnius/jnius_export_class.pxi":106
* # -> Yes, according to http://developer.android.com/training/articles/perf-jni.html
* # in the section Local and Global References
* jcs.j_cls = j_env[0].NewGlobalRef(j_env, jcs.j_cls) # <<<<<<<<<<<<<<
*
* classDict['__cls_storage'] = jcs
*/
__pyx_v_jcs->j_cls = (__pyx_v_j_env[0])->NewGlobalRef(__pyx_v_j_env, __pyx_v_jcs->j_cls);
/* "jnius/jnius_export_class.pxi":108
* jcs.j_cls = j_env[0].NewGlobalRef(j_env, jcs.j_cls)
*
* classDict['__cls_storage'] = jcs # <<<<<<<<<<<<<<
*
* # search all the static JavaMethod within our class, and resolve them
*/
if (unlikely(PyObject_SetItem(__pyx_v_classDict, __pyx_n_s_cls_storage, ((PyObject *)__pyx_v_jcs)) < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":113
* cdef JavaMethod jm
* cdef JavaMultipleMethod jmm
* for name, value in items_compat(classDict): # <<<<<<<<<<<<<<
* if isinstance(value, JavaMethod):
* jm = value
*/
__pyx_t_3 = __pyx_f_5jnius_5jnius_items_compat(__pyx_v_classDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_4))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_8(__pyx_t_4);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 113, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 113, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_11 = PyList_GET_ITEM(sequence, 0);
__pyx_t_12 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_12);
#else
__pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L16_unpacking_failed;
__Pyx_GOTREF(__pyx_t_11);
index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_12)) goto __pyx_L16_unpacking_failed;
__Pyx_GOTREF(__pyx_t_12);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
__pyx_t_13 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L17_unpacking_done;
__pyx_L16_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_13 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 113, __pyx_L1_error)
__pyx_L17_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_11);
__pyx_t_11 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_12);
__pyx_t_12 = 0;
/* "jnius/jnius_export_class.pxi":114
* cdef JavaMultipleMethod jmm
* for name, value in items_compat(classDict):
* if isinstance(value, JavaMethod): # <<<<<<<<<<<<<<
* jm = value
* if not jm.is_static:
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMethod);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_export_class.pxi":115
* for name, value in items_compat(classDict):
* if isinstance(value, JavaMethod):
* jm = value # <<<<<<<<<<<<<<
* if not jm.is_static:
* continue
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMethod))))) __PYX_ERR(0, 115, __pyx_L1_error)
__pyx_t_3 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_jm, ((struct __pyx_obj_5jnius_5jnius_JavaMethod *)__pyx_t_3));
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":116
* if isinstance(value, JavaMethod):
* jm = value
* if not jm.is_static: # <<<<<<<<<<<<<<
* continue
* jm.set_resolve_info(j_env, jcs.j_cls, None,
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_jm->is_static); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":117
* jm = value
* if not jm.is_static:
* continue # <<<<<<<<<<<<<<
* jm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__))
*/
goto __pyx_L14_continue;
/* "jnius/jnius_export_class.pxi":116
* if isinstance(value, JavaMethod):
* jm = value
* if not jm.is_static: # <<<<<<<<<<<<<<
* continue
* jm.set_resolve_info(j_env, jcs.j_cls, None,
*/
}
/* "jnius/jnius_export_class.pxi":119
* continue
* jm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__)) # <<<<<<<<<<<<<<
* elif isinstance(value, JavaMultipleMethod):
* jmm = value
*/
__pyx_t_3 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_12 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v___javaclass__); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
/* "jnius/jnius_export_class.pxi":118
* if not jm.is_static:
* continue
* jm.set_resolve_info(j_env, jcs.j_cls, None, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(__javaclass__))
* elif isinstance(value, JavaMultipleMethod):
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaMethod *)__pyx_v_jm->__pyx_vtab)->set_resolve_info(__pyx_v_jm, __pyx_v_j_env, __pyx_v_jcs->j_cls, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)Py_None), __pyx_t_3, __pyx_t_12);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "jnius/jnius_export_class.pxi":114
* cdef JavaMultipleMethod jmm
* for name, value in items_compat(classDict):
* if isinstance(value, JavaMethod): # <<<<<<<<<<<<<<
* jm = value
* if not jm.is_static:
*/
goto __pyx_L18;
}
/* "jnius/jnius_export_class.pxi":120
* jm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__))
* elif isinstance(value, JavaMultipleMethod): # <<<<<<<<<<<<<<
* jmm = value
* jmm.set_resolve_info(j_env, jcs.j_cls, None,
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMultipleMethod);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "jnius/jnius_export_class.pxi":121
* str_for_c(name), str_for_c(__javaclass__))
* elif isinstance(value, JavaMultipleMethod):
* jmm = value # <<<<<<<<<<<<<<
* jmm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__))
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMultipleMethod))))) __PYX_ERR(0, 121, __pyx_L1_error)
__pyx_t_12 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_12);
__Pyx_XDECREF_SET(__pyx_v_jmm, ((struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *)__pyx_t_12));
__pyx_t_12 = 0;
/* "jnius/jnius_export_class.pxi":123
* jmm = value
* jmm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_12 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
if (!(likely(PyBytes_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 123, __pyx_L1_error)
__pyx_t_3 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v___javaclass__); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 123, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":122
* elif isinstance(value, JavaMultipleMethod):
* jmm = value
* jmm.set_resolve_info(j_env, jcs.j_cls, None, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(__javaclass__))
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaMultipleMethod *)__pyx_v_jmm->__pyx_vtab)->set_resolve_info(__pyx_v_jmm, __pyx_v_j_env, __pyx_v_jcs->j_cls, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)Py_None), ((PyObject*)__pyx_t_12), ((PyObject*)__pyx_t_3));
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":120
* jm.set_resolve_info(j_env, jcs.j_cls, None,
* str_for_c(name), str_for_c(__javaclass__))
* elif isinstance(value, JavaMultipleMethod): # <<<<<<<<<<<<<<
* jmm = value
* jmm.set_resolve_info(j_env, jcs.j_cls, None,
*/
}
__pyx_L18:;
/* "jnius/jnius_export_class.pxi":113
* cdef JavaMethod jm
* cdef JavaMultipleMethod jmm
* for name, value in items_compat(classDict): # <<<<<<<<<<<<<<
* if isinstance(value, JavaMethod):
* jm = value
*/
__pyx_L14_continue:;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "jnius/jnius_export_class.pxi":128
* # search all the static JavaField within our class, and resolve them
* cdef JavaField jf
* for name, value in items_compat(classDict): # <<<<<<<<<<<<<<
* if not isinstance(value, JavaField):
* continue
*/
__pyx_t_4 = __pyx_f_5jnius_5jnius_items_compat(__pyx_v_classDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
#else
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
} else {
__pyx_t_4 = __pyx_t_8(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 128, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_4);
}
if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
PyObject* sequence = __pyx_t_4;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 128, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_12 = PyList_GET_ITEM(sequence, 0);
__pyx_t_11 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_11);
#else
__pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_12 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_12)) goto __pyx_L22_unpacking_failed;
__Pyx_GOTREF(__pyx_t_12);
index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L22_unpacking_failed;
__Pyx_GOTREF(__pyx_t_11);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
__pyx_t_13 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L23_unpacking_done;
__pyx_L22_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_13 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 128, __pyx_L1_error)
__pyx_L23_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_12);
__pyx_t_12 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
__pyx_t_11 = 0;
/* "jnius/jnius_export_class.pxi":129
* cdef JavaField jf
* for name, value in items_compat(classDict):
* if not isinstance(value, JavaField): # <<<<<<<<<<<<<<
* continue
* jf = value
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaField);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":130
* for name, value in items_compat(classDict):
* if not isinstance(value, JavaField):
* continue # <<<<<<<<<<<<<<
* jf = value
* if not jf.is_static:
*/
goto __pyx_L20_continue;
/* "jnius/jnius_export_class.pxi":129
* cdef JavaField jf
* for name, value in items_compat(classDict):
* if not isinstance(value, JavaField): # <<<<<<<<<<<<<<
* continue
* jf = value
*/
}
/* "jnius/jnius_export_class.pxi":131
* if not isinstance(value, JavaField):
* continue
* jf = value # <<<<<<<<<<<<<<
* if not jf.is_static:
* continue
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaField))))) __PYX_ERR(0, 131, __pyx_L1_error)
__pyx_t_4 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_jf, ((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_t_4));
__pyx_t_4 = 0;
/* "jnius/jnius_export_class.pxi":132
* continue
* jf = value
* if not jf.is_static: # <<<<<<<<<<<<<<
* continue
* jf.set_resolve_info(j_env, jcs.j_cls,
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_jf->is_static); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
__pyx_t_1 = ((!__pyx_t_2) != 0);
if (__pyx_t_1) {
/* "jnius/jnius_export_class.pxi":133
* jf = value
* if not jf.is_static:
* continue # <<<<<<<<<<<<<<
* jf.set_resolve_info(j_env, jcs.j_cls,
* str_for_c(name), str_for_c(__javaclass__))
*/
goto __pyx_L20_continue;
/* "jnius/jnius_export_class.pxi":132
* continue
* jf = value
* if not jf.is_static: # <<<<<<<<<<<<<<
* continue
* jf.set_resolve_info(j_env, jcs.j_cls,
*/
}
/* "jnius/jnius_export_class.pxi":135
* continue
* jf.set_resolve_info(j_env, jcs.j_cls,
* str_for_c(name), str_for_c(__javaclass__)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_11 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v___javaclass__); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
/* "jnius/jnius_export_class.pxi":134
* if not jf.is_static:
* continue
* jf.set_resolve_info(j_env, jcs.j_cls, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(__javaclass__))
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_jf->__pyx_vtab)->set_resolve_info(__pyx_v_jf, __pyx_v_j_env, __pyx_v_jcs->j_cls, __pyx_t_4, __pyx_t_11);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* "jnius/jnius_export_class.pxi":128
* # search all the static JavaField within our class, and resolve them
* cdef JavaField jf
* for name, value in items_compat(classDict): # <<<<<<<<<<<<<<
* if not isinstance(value, JavaField):
* continue
*/
__pyx_L20_continue:;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":53
*
* @classmethod
* def resolve_class(meta, classDict): # <<<<<<<<<<<<<<
* # search the Java class, and bind to our object
* if not '__javaclass__' in classDict:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("jnius.jnius.MetaJavaClass.resolve_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jcs);
__Pyx_XDECREF(__pyx_v___javaclass__);
__Pyx_XDECREF(__pyx_v___javainterfaces__);
__Pyx_XDECREF(__pyx_v___javabaseclass__);
__Pyx_XDECREF(__pyx_v_i);
__Pyx_XDECREF(__pyx_v_class_name);
__Pyx_XDECREF((PyObject *)__pyx_v_jm);
__Pyx_XDECREF((PyObject *)__pyx_v_jmm);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XDECREF((PyObject *)__pyx_v_jf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":146
* cdef LocalRef j_self
*
* def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* self.j_cls = NULL
* self.j_self = None
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9JavaClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_9JavaClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_args = 0;
CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaClass___cinit__(((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9JavaClass___cinit__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_export_class.pxi":147
*
* def __cinit__(self, *args, **kwargs):
* self.j_cls = NULL # <<<<<<<<<<<<<<
* self.j_self = None
*
*/
__pyx_v_self->j_cls = NULL;
/* "jnius/jnius_export_class.pxi":148
* def __cinit__(self, *args, **kwargs):
* self.j_cls = NULL
* self.j_self = None # <<<<<<<<<<<<<<
*
* def __init__(self, *args, **kwargs):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->j_self);
__Pyx_DECREF(((PyObject *)__pyx_v_self->j_self));
__pyx_v_self->j_self = ((struct __pyx_obj_5jnius_5jnius_LocalRef *)Py_None);
/* "jnius/jnius_export_class.pxi":146
* cdef LocalRef j_self
*
* def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* self.j_cls = NULL
* self.j_self = None
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":150
* self.j_self = None
*
* def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* super(JavaClass, self).__init__()
* # copy the current attribute in the storage to our class
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9JavaClass_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_9JavaClass_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaClass_2__init__(((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9JavaClass_2__init__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
struct __pyx_obj_5jnius_5jnius_JavaClassStorage *__pyx_v_jcs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
jclass __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__init__", 0);
/* "jnius/jnius_export_class.pxi":151
*
* def __init__(self, *args, **kwargs):
* super(JavaClass, self).__init__() # <<<<<<<<<<<<<<
* # copy the current attribute in the storage to our class
* cdef JavaClassStorage jcs = self.__cls_storage
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_5jnius_5jnius_JavaClass));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_5jnius_5jnius_JavaClass));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5jnius_5jnius_JavaClass));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":153
* super(JavaClass, self).__init__()
* # copy the current attribute in the storage to our class
* cdef JavaClassStorage jcs = self.__cls_storage # <<<<<<<<<<<<<<
* self.j_cls = jcs.j_cls
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5jnius_5jnius_JavaClassStorage))))) __PYX_ERR(0, 153, __pyx_L1_error)
__pyx_v_jcs = ((struct __pyx_obj_5jnius_5jnius_JavaClassStorage *)__pyx_t_1);
__pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":154
* # copy the current attribute in the storage to our class
* cdef JavaClassStorage jcs = self.__cls_storage
* self.j_cls = jcs.j_cls # <<<<<<<<<<<<<<
*
* if 'noinstance' not in kwargs:
*/
__pyx_t_4 = __pyx_v_jcs->j_cls;
__pyx_v_self->j_cls = __pyx_t_4;
/* "jnius/jnius_export_class.pxi":156
* self.j_cls = jcs.j_cls
*
* if 'noinstance' not in kwargs: # <<<<<<<<<<<<<<
* self.call_constructor(args)
* self.resolve_methods()
*/
__pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_noinstance, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "jnius/jnius_export_class.pxi":157
*
* if 'noinstance' not in kwargs:
* self.call_constructor(args) # <<<<<<<<<<<<<<
* self.resolve_methods()
* self.resolve_fields()
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_self->__pyx_vtab)->call_constructor(__pyx_v_self, __pyx_v_args); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":158
* if 'noinstance' not in kwargs:
* self.call_constructor(args)
* self.resolve_methods() # <<<<<<<<<<<<<<
* self.resolve_fields()
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_self->__pyx_vtab)->resolve_methods(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":159
* self.call_constructor(args)
* self.resolve_methods()
* self.resolve_fields() # <<<<<<<<<<<<<<
*
* cdef void instanciate_from(self, LocalRef j_self) except *:
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_self->__pyx_vtab)->resolve_fields(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":156
* self.j_cls = jcs.j_cls
*
* if 'noinstance' not in kwargs: # <<<<<<<<<<<<<<
* self.call_constructor(args)
* self.resolve_methods()
*/
}
/* "jnius/jnius_export_class.pxi":150
* self.j_self = None
*
* def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* super(JavaClass, self).__init__()
* # copy the current attribute in the storage to our class
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("jnius.jnius.JavaClass.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jcs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":161
* self.resolve_fields()
*
* cdef void instanciate_from(self, LocalRef j_self) except *: # <<<<<<<<<<<<<<
* self.j_self = j_self
* self.resolve_methods()
*/
static void __pyx_f_5jnius_5jnius_9JavaClass_instanciate_from(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, struct __pyx_obj_5jnius_5jnius_LocalRef *__pyx_v_j_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("instanciate_from", 0);
/* "jnius/jnius_export_class.pxi":162
*
* cdef void instanciate_from(self, LocalRef j_self) except *:
* self.j_self = j_self # <<<<<<<<<<<<<<
* self.resolve_methods()
* self.resolve_fields()
*/
__Pyx_INCREF(((PyObject *)__pyx_v_j_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_j_self));
__Pyx_GOTREF(__pyx_v_self->j_self);
__Pyx_DECREF(((PyObject *)__pyx_v_self->j_self));
__pyx_v_self->j_self = __pyx_v_j_self;
/* "jnius/jnius_export_class.pxi":163
* cdef void instanciate_from(self, LocalRef j_self) except *:
* self.j_self = j_self
* self.resolve_methods() # <<<<<<<<<<<<<<
* self.resolve_fields()
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_self->__pyx_vtab)->resolve_methods(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":164
* self.j_self = j_self
* self.resolve_methods()
* self.resolve_fields() # <<<<<<<<<<<<<<
*
* cdef void call_constructor(self, args) except *:
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaClass *)__pyx_v_self->__pyx_vtab)->resolve_fields(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":161
* self.resolve_fields()
*
* cdef void instanciate_from(self, LocalRef j_self) except *: # <<<<<<<<<<<<<<
* self.j_self = j_self
* self.resolve_methods()
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("jnius.jnius.JavaClass.instanciate_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":166
* self.resolve_fields()
*
* cdef void call_constructor(self, args) except *: # <<<<<<<<<<<<<<
* # the goal is to find the class constructor, and call it with the
* # correct arguments.
*/
static void __pyx_f_5jnius_5jnius_9JavaClass_call_constructor(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self, PyObject *__pyx_v_args) {
jvalue *__pyx_v_j_args;
jobject __pyx_v_j_self;
jmethodID __pyx_v_constructor;
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_v_definitions = NULL;
PyObject *__pyx_v_definition = NULL;
PyObject *__pyx_v_is_varargs = NULL;
PyObject *__pyx_v_d_ret = NULL;
PyObject *__pyx_v_d_args = NULL;
PyObject *__pyx_v_args_ = NULL;
PyObject *__pyx_v_scores = NULL;
PyObject *__pyx_v_score = NULL;
PyObject *__pyx_v_defstr = NULL;
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
Py_ssize_t __pyx_t_10;
PyObject *(*__pyx_t_11)(PyObject *);
PyObject *__pyx_t_12 = NULL;
int __pyx_t_13;
int __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
char *__pyx_t_17;
int __pyx_t_18;
char const *__pyx_t_19;
PyObject *__pyx_t_20 = NULL;
PyObject *__pyx_t_21 = NULL;
PyObject *__pyx_t_22 = NULL;
PyObject *__pyx_t_23 = NULL;
PyObject *__pyx_t_24 = NULL;
PyObject *__pyx_t_25 = NULL;
__Pyx_RefNannySetupContext("call_constructor", 0);
/* "jnius/jnius_export_class.pxi":169
* # the goal is to find the class constructor, and call it with the
* # correct arguments.
* cdef jvalue *j_args = NULL # <<<<<<<<<<<<<<
* cdef jobject j_self = NULL
* cdef jmethodID constructor = NULL
*/
__pyx_v_j_args = NULL;
/* "jnius/jnius_export_class.pxi":170
* # correct arguments.
* cdef jvalue *j_args = NULL
* cdef jobject j_self = NULL # <<<<<<<<<<<<<<
* cdef jmethodID constructor = NULL
* cdef JNIEnv *j_env = get_jnienv()
*/
__pyx_v_j_self = NULL;
/* "jnius/jnius_export_class.pxi":171
* cdef jvalue *j_args = NULL
* cdef jobject j_self = NULL
* cdef jmethodID constructor = NULL # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env = get_jnienv()
*
*/
__pyx_v_constructor = NULL;
/* "jnius/jnius_export_class.pxi":172
* cdef jobject j_self = NULL
* cdef jmethodID constructor = NULL
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
*
* # get the constructor definition if exist
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 172, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":175
*
* # get the constructor definition if exist
* definitions = [('()V', False)] # <<<<<<<<<<<<<<
* if hasattr(self, '__javaconstructor__'):
* definitions = self.__javaconstructor__
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_tuple__45);
__Pyx_GIVEREF(__pyx_tuple__45);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__45);
__pyx_v_definitions = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":176
* # get the constructor definition if exist
* definitions = [('()V', False)]
* if hasattr(self, '__javaconstructor__'): # <<<<<<<<<<<<<<
* definitions = self.__javaconstructor__
* if isinstance(definitions, basestring):
*/
__pyx_t_3 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_javaconstructor); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 176, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":177
* definitions = [('()V', False)]
* if hasattr(self, '__javaconstructor__'):
* definitions = self.__javaconstructor__ # <<<<<<<<<<<<<<
* if isinstance(definitions, basestring):
* definitions = [definitions]
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaconstructor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_definitions, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":176
* # get the constructor definition if exist
* definitions = [('()V', False)]
* if hasattr(self, '__javaconstructor__'): # <<<<<<<<<<<<<<
* definitions = self.__javaconstructor__
* if isinstance(definitions, basestring):
*/
}
/* "jnius/jnius_export_class.pxi":178
* if hasattr(self, '__javaconstructor__'):
* definitions = self.__javaconstructor__
* if isinstance(definitions, basestring): # <<<<<<<<<<<<<<
* definitions = [definitions]
*
*/
__pyx_t_4 = __Pyx_PyBaseString_Check(__pyx_v_definitions);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":179
* definitions = self.__javaconstructor__
* if isinstance(definitions, basestring):
* definitions = [definitions] # <<<<<<<<<<<<<<
*
* if len(definitions) == 0:
*/
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_definitions);
__Pyx_GIVEREF(__pyx_v_definitions);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_definitions);
__Pyx_DECREF_SET(__pyx_v_definitions, __pyx_t_2);
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":178
* if hasattr(self, '__javaconstructor__'):
* definitions = self.__javaconstructor__
* if isinstance(definitions, basestring): # <<<<<<<<<<<<<<
* definitions = [definitions]
*
*/
}
/* "jnius/jnius_export_class.pxi":181
* definitions = [definitions]
*
* if len(definitions) == 0: # <<<<<<<<<<<<<<
* raise JavaException('No constructor available')
*
*/
__pyx_t_5 = PyObject_Length(__pyx_v_definitions); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 181, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_5 == 0) != 0);
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":182
*
* if len(definitions) == 0:
* raise JavaException('No constructor available') # <<<<<<<<<<<<<<
*
* elif len(definitions) == 1:
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(0, 182, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":181
* definitions = [definitions]
*
* if len(definitions) == 0: # <<<<<<<<<<<<<<
* raise JavaException('No constructor available')
*
*/
}
/* "jnius/jnius_export_class.pxi":184
* raise JavaException('No constructor available')
*
* elif len(definitions) == 1: # <<<<<<<<<<<<<<
* definition, is_varargs = definitions[0]
* d_ret, d_args = parse_definition(definition)
*/
__pyx_t_5 = PyObject_Length(__pyx_v_definitions); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 184, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_5 == 1) != 0);
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":185
*
* elif len(definitions) == 1:
* definition, is_varargs = definitions[0] # <<<<<<<<<<<<<<
* d_ret, d_args = parse_definition(definition)
*
*/
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_definitions, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 185, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 185, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_definition = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_is_varargs = __pyx_t_7;
__pyx_t_7 = 0;
/* "jnius/jnius_export_class.pxi":186
* elif len(definitions) == 1:
* definition, is_varargs = definitions[0]
* d_ret, d_args = parse_definition(definition) # <<<<<<<<<<<<<<
*
* if is_varargs:
*/
__pyx_t_6 = __pyx_f_5jnius_5jnius_parse_definition(__pyx_v_definition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 186, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_2);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 186, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_d_ret = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_d_args = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":188
* d_ret, d_args = parse_definition(definition)
*
* if is_varargs: # <<<<<<<<<<<<<<
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
*/
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_varargs); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":189
*
* if is_varargs:
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],) # <<<<<<<<<<<<<<
* else:
* args_ = args
*/
__pyx_t_5 = PyObject_Length(__pyx_v_d_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 189, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_args, 0, (__pyx_t_5 - 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyObject_Length(__pyx_v_d_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 189, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_args, (__pyx_t_5 - 1), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_args_ = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":188
* d_ret, d_args = parse_definition(definition)
*
* if is_varargs: # <<<<<<<<<<<<<<
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
*/
goto __pyx_L10;
}
/* "jnius/jnius_export_class.pxi":191
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
* args_ = args # <<<<<<<<<<<<<<
* if len(args or ()) != len(d_args or ()):
* raise JavaException('Invalid call, number of argument'
*/
/*else*/ {
__Pyx_INCREF(__pyx_v_args);
__pyx_v_args_ = __pyx_v_args;
}
__pyx_L10:;
/* "jnius/jnius_export_class.pxi":192
* else:
* args_ = args
* if len(args or ()) != len(d_args or ()): # <<<<<<<<<<<<<<
* raise JavaException('Invalid call, number of argument'
* ' mismatch for constructor')
*/
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
if (!__pyx_t_3) {
} else {
__Pyx_INCREF(__pyx_v_args);
__pyx_t_2 = __pyx_v_args;
goto __pyx_L12_bool_binop_done;
}
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_t_2 = __pyx_empty_tuple;
__pyx_L12_bool_binop_done:;
__pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_d_args); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
if (!__pyx_t_3) {
} else {
__Pyx_INCREF(__pyx_v_d_args);
__pyx_t_2 = __pyx_v_d_args;
goto __pyx_L14_bool_binop_done;
}
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_t_2 = __pyx_empty_tuple;
__pyx_L14_bool_binop_done:;
__pyx_t_10 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = ((__pyx_t_5 != __pyx_t_10) != 0);
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":193
* args_ = args
* if len(args or ()) != len(d_args or ()):
* raise JavaException('Invalid call, number of argument' # <<<<<<<<<<<<<<
* ' mismatch for constructor')
* else:
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(0, 193, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":192
* else:
* args_ = args
* if len(args or ()) != len(d_args or ()): # <<<<<<<<<<<<<<
* raise JavaException('Invalid call, number of argument'
* ' mismatch for constructor')
*/
}
/* "jnius/jnius_export_class.pxi":184
* raise JavaException('No constructor available')
*
* elif len(definitions) == 1: # <<<<<<<<<<<<<<
* definition, is_varargs = definitions[0]
* d_ret, d_args = parse_definition(definition)
*/
goto __pyx_L5;
}
/* "jnius/jnius_export_class.pxi":196
* ' mismatch for constructor')
* else:
* scores = [] # <<<<<<<<<<<<<<
* for definition, is_varargs in definitions:
* d_ret, d_args = parse_definition(definition)
*/
/*else*/ {
__pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_scores = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_export_class.pxi":197
* else:
* scores = []
* for definition, is_varargs in definitions: # <<<<<<<<<<<<<<
* d_ret, d_args = parse_definition(definition)
* if is_varargs:
*/
if (likely(PyList_CheckExact(__pyx_v_definitions)) || PyTuple_CheckExact(__pyx_v_definitions)) {
__pyx_t_7 = __pyx_v_definitions; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
__pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_definitions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_11)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
__pyx_t_2 = __pyx_t_11(__pyx_t_7);
if (unlikely(!__pyx_t_2)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 197, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_2);
}
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 197, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_12)->tp_iternext;
index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L18_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_12), 2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L19_unpacking_done;
__pyx_L18_unpacking_failed:;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 197, __pyx_L1_error)
__pyx_L19_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_definition, __pyx_t_6);
__pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_is_varargs, __pyx_t_8);
__pyx_t_8 = 0;
/* "jnius/jnius_export_class.pxi":198
* scores = []
* for definition, is_varargs in definitions:
* d_ret, d_args = parse_definition(definition) # <<<<<<<<<<<<<<
* if is_varargs:
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
*/
__pyx_t_2 = __pyx_f_5jnius_5jnius_parse_definition(__pyx_v_definition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 198, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_8 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_12)->tp_iternext;
index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L20_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L20_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_12), 2) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L21_unpacking_done;
__pyx_L20_unpacking_failed:;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 198, __pyx_L1_error)
__pyx_L21_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_d_ret, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_d_args, __pyx_t_6);
__pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":199
* for definition, is_varargs in definitions:
* d_ret, d_args = parse_definition(definition)
* if is_varargs: # <<<<<<<<<<<<<<
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
*/
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_varargs); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 199, __pyx_L1_error)
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":200
* d_ret, d_args = parse_definition(definition)
* if is_varargs:
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],) # <<<<<<<<<<<<<<
* else:
* args_ = args
*/
__pyx_t_5 = PyObject_Length(__pyx_v_d_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 200, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_args, 0, (__pyx_t_5 - 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_Length(__pyx_v_d_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 200, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_args, (__pyx_t_5 - 1), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_args_, __pyx_t_6);
__pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":199
* for definition, is_varargs in definitions:
* d_ret, d_args = parse_definition(definition)
* if is_varargs: # <<<<<<<<<<<<<<
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
*/
goto __pyx_L22;
}
/* "jnius/jnius_export_class.pxi":202
* args_ = args[:len(d_args) - 1] + (args[len(d_args) - 1:],)
* else:
* args_ = args # <<<<<<<<<<<<<<
*
* score = calculate_score(d_args, args)
*/
/*else*/ {
__Pyx_INCREF(__pyx_v_args);
__Pyx_XDECREF_SET(__pyx_v_args_, __pyx_v_args);
}
__pyx_L22:;
/* "jnius/jnius_export_class.pxi":204
* args_ = args
*
* score = calculate_score(d_args, args) # <<<<<<<<<<<<<<
* if score == -1:
* continue
*/
__pyx_t_13 = __pyx_f_5jnius_5jnius_calculate_score(__pyx_v_d_args, __pyx_v_args, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_6);
__pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":205
*
* score = calculate_score(d_args, args)
* if score == -1: # <<<<<<<<<<<<<<
* continue
* scores.append((score, definition, d_ret, d_args, args_))
*/
__pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_score, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_3) {
/* "jnius/jnius_export_class.pxi":206
* score = calculate_score(d_args, args)
* if score == -1:
* continue # <<<<<<<<<<<<<<
* scores.append((score, definition, d_ret, d_args, args_))
* if not scores:
*/
goto __pyx_L16_continue;
/* "jnius/jnius_export_class.pxi":205
*
* score = calculate_score(d_args, args)
* if score == -1: # <<<<<<<<<<<<<<
* continue
* scores.append((score, definition, d_ret, d_args, args_))
*/
}
/* "jnius/jnius_export_class.pxi":207
* if score == -1:
* continue
* scores.append((score, definition, d_ret, d_args, args_)) # <<<<<<<<<<<<<<
* if not scores:
* raise JavaException('No constructor matching your arguments')
*/
__pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_score);
__Pyx_GIVEREF(__pyx_v_score);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_score);
__Pyx_INCREF(__pyx_v_definition);
__Pyx_GIVEREF(__pyx_v_definition);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_definition);
__Pyx_INCREF(__pyx_v_d_ret);
__Pyx_GIVEREF(__pyx_v_d_ret);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_d_ret);
__Pyx_INCREF(__pyx_v_d_args);
__Pyx_GIVEREF(__pyx_v_d_args);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_d_args);
__Pyx_INCREF(__pyx_v_args_);
__Pyx_GIVEREF(__pyx_v_args_);
PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_args_);
__pyx_t_14 = __Pyx_PyList_Append(__pyx_v_scores, __pyx_t_6); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":197
* else:
* scores = []
* for definition, is_varargs in definitions: # <<<<<<<<<<<<<<
* d_ret, d_args = parse_definition(definition)
* if is_varargs:
*/
__pyx_L16_continue:;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "jnius/jnius_export_class.pxi":208
* continue
* scores.append((score, definition, d_ret, d_args, args_))
* if not scores: # <<<<<<<<<<<<<<
* raise JavaException('No constructor matching your arguments')
* scores.sort()
*/
__pyx_t_3 = (__pyx_v_scores != Py_None) && (PyList_GET_SIZE(__pyx_v_scores) != 0);
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":209
* scores.append((score, definition, d_ret, d_args, args_))
* if not scores:
* raise JavaException('No constructor matching your arguments') # <<<<<<<<<<<<<<
* scores.sort()
* score, definition, d_ret, d_args, args_ = scores[-1]
*/
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(0, 209, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":208
* continue
* scores.append((score, definition, d_ret, d_args, args_))
* if not scores: # <<<<<<<<<<<<<<
* raise JavaException('No constructor matching your arguments')
* scores.sort()
*/
}
/* "jnius/jnius_export_class.pxi":210
* if not scores:
* raise JavaException('No constructor matching your arguments')
* scores.sort() # <<<<<<<<<<<<<<
* score, definition, d_ret, d_args, args_ = scores[-1]
*
*/
__pyx_t_14 = PyList_Sort(__pyx_v_scores); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":211
* raise JavaException('No constructor matching your arguments')
* scores.sort()
* score, definition, d_ret, d_args, args_ = scores[-1] # <<<<<<<<<<<<<<
*
* try:
*/
__pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_scores, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 211, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_15 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_2 = PyList_GET_ITEM(sequence, 2);
__pyx_t_12 = PyList_GET_ITEM(sequence, 3);
__pyx_t_15 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_15);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_2,&__pyx_t_12,&__pyx_t_15};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_2,&__pyx_t_12,&__pyx_t_15};
__pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_16)->tp_iternext;
for (index=0; index < 5; index++) {
PyObject* item = __pyx_t_9(__pyx_t_16); if (unlikely(!item)) goto __pyx_L25_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_16), 5) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
goto __pyx_L26_unpacking_done;
__pyx_L25_unpacking_failed:;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 211, __pyx_L1_error)
__pyx_L26_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_definition, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_d_ret, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_d_args, __pyx_t_12);
__pyx_t_12 = 0;
__Pyx_XDECREF_SET(__pyx_v_args_, __pyx_t_15);
__pyx_t_15 = 0;
}
__pyx_L5:;
/* "jnius/jnius_export_class.pxi":213
* score, definition, d_ret, d_args, args_ = scores[-1]
*
* try: # <<<<<<<<<<<<<<
* # convert python arguments to java arguments
* if len(args):
*/
/*try:*/ {
/* "jnius/jnius_export_class.pxi":215
* try:
* # convert python arguments to java arguments
* if len(args): # <<<<<<<<<<<<<<
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args))
* if j_args == NULL:
*/
__pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 215, __pyx_L28_error)
__pyx_t_4 = (__pyx_t_10 != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":216
* # convert python arguments to java arguments
* if len(args):
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args)) # <<<<<<<<<<<<<<
* if j_args == NULL:
* raise MemoryError('Unable to allocate memory for java args')
*/
__pyx_t_10 = PyObject_Length(__pyx_v_d_args); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 216, __pyx_L28_error)
__pyx_v_j_args = ((jvalue *)malloc(((sizeof(jvalue)) * __pyx_t_10)));
/* "jnius/jnius_export_class.pxi":217
* if len(args):
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args))
* if j_args == NULL: # <<<<<<<<<<<<<<
* raise MemoryError('Unable to allocate memory for java args')
* populate_args(j_env, d_args, j_args, args_)
*/
__pyx_t_4 = ((__pyx_v_j_args == NULL) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":218
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args))
* if j_args == NULL:
* raise MemoryError('Unable to allocate memory for java args') # <<<<<<<<<<<<<<
* populate_args(j_env, d_args, j_args, args_)
*
*/
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(0, 218, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":217
* if len(args):
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args))
* if j_args == NULL: # <<<<<<<<<<<<<<
* raise MemoryError('Unable to allocate memory for java args')
* populate_args(j_env, d_args, j_args, args_)
*/
}
/* "jnius/jnius_export_class.pxi":219
* if j_args == NULL:
* raise MemoryError('Unable to allocate memory for java args')
* populate_args(j_env, d_args, j_args, args_) # <<<<<<<<<<<<<<
*
* # get the java constructor
*/
if (!(likely(PyTuple_CheckExact(__pyx_v_d_args))||((__pyx_v_d_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_d_args)->tp_name), 0))) __PYX_ERR(0, 219, __pyx_L28_error)
__pyx_f_5jnius_5jnius_populate_args(__pyx_v_j_env, ((PyObject*)__pyx_v_d_args), __pyx_v_j_args, __pyx_v_args_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":215
* try:
* # convert python arguments to java arguments
* if len(args): # <<<<<<<<<<<<<<
* j_args = <jvalue *>malloc(sizeof(jvalue) * len(d_args))
* if j_args == NULL:
*/
}
/* "jnius/jnius_export_class.pxi":222
*
* # get the java constructor
* defstr = str_for_c(definition) # <<<<<<<<<<<<<<
* constructor = j_env[0].GetMethodID(
* j_env, self.j_cls, '<init>', <char *><bytes>defstr)
*/
__pyx_t_6 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_definition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_v_defstr = __pyx_t_6;
__pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":224
* defstr = str_for_c(definition)
* constructor = j_env[0].GetMethodID(
* j_env, self.j_cls, '<init>', <char *><bytes>defstr) # <<<<<<<<<<<<<<
* if constructor == NULL:
* raise JavaException('Unable to found the constructor'
*/
__pyx_t_17 = __Pyx_PyObject_AsString(__pyx_v_defstr); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":223
* # get the java constructor
* defstr = str_for_c(definition)
* constructor = j_env[0].GetMethodID( # <<<<<<<<<<<<<<
* j_env, self.j_cls, '<init>', <char *><bytes>defstr)
* if constructor == NULL:
*/
__pyx_v_constructor = (__pyx_v_j_env[0])->GetMethodID(__pyx_v_j_env, __pyx_v_self->j_cls, ((char const *)"<init>"), ((char *)__pyx_t_17));
/* "jnius/jnius_export_class.pxi":225
* constructor = j_env[0].GetMethodID(
* j_env, self.j_cls, '<init>', <char *><bytes>defstr)
* if constructor == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the constructor'
* ' for {0}'.format(self.__javaclass__))
*/
__pyx_t_4 = ((__pyx_v_constructor == NULL) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":226
* j_env, self.j_cls, '<init>', <char *><bytes>defstr)
* if constructor == NULL:
* raise JavaException('Unable to found the constructor' # <<<<<<<<<<<<<<
* ' for {0}'.format(self.__javaclass__))
*
*/
__pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_15);
/* "jnius/jnius_export_class.pxi":227
* if constructor == NULL:
* raise JavaException('Unable to found the constructor'
* ' for {0}'.format(self.__javaclass__)) # <<<<<<<<<<<<<<
*
* # create the object
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_found_the_constructor, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_7) {
__pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_12);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
__pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
__pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_16);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_15, function);
}
}
if (!__pyx_t_2) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_15)) {
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_12};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_12};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
{
__pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_16);
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); __pyx_t_2 = NULL;
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_12);
__pyx_t_12 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(0, 226, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":225
* constructor = j_env[0].GetMethodID(
* j_env, self.j_cls, '<init>', <char *><bytes>defstr)
* if constructor == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the constructor'
* ' for {0}'.format(self.__javaclass__))
*/
}
/* "jnius/jnius_export_class.pxi":230
*
* # create the object
* j_self = j_env[0].NewObjectA(j_env, self.j_cls, # <<<<<<<<<<<<<<
* constructor, j_args)
*
*/
__pyx_v_j_self = (__pyx_v_j_env[0])->NewObjectA(__pyx_v_j_env, __pyx_v_self->j_cls, __pyx_v_constructor, __pyx_v_j_args);
/* "jnius/jnius_export_class.pxi":234
*
* # release our arguments
* release_args(j_env, d_args, j_args, args_) # <<<<<<<<<<<<<<
*
* check_exception(j_env)
*/
if (!(likely(PyTuple_CheckExact(__pyx_v_d_args))||((__pyx_v_d_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_d_args)->tp_name), 0))) __PYX_ERR(0, 234, __pyx_L28_error)
__pyx_f_5jnius_5jnius_release_args(__pyx_v_j_env, ((PyObject*)__pyx_v_d_args), __pyx_v_j_args, __pyx_v_args_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":236
* release_args(j_env, d_args, j_args, args_)
*
* check_exception(j_env) # <<<<<<<<<<<<<<
* if j_self == NULL:
* raise JavaException('Unable to instanciate {0}'.format(
*/
__pyx_f_5jnius_5jnius_check_exception(__pyx_v_j_env); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":237
*
* check_exception(j_env)
* if j_self == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to instanciate {0}'.format(
* self.__javaclass__))
*/
__pyx_t_4 = ((__pyx_v_j_self == NULL) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":238
* check_exception(j_env)
* if j_self == NULL:
* raise JavaException('Unable to instanciate {0}'.format( # <<<<<<<<<<<<<<
* self.__javaclass__))
*
*/
__pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_instanciate_0, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_12);
/* "jnius/jnius_export_class.pxi":239
* if j_self == NULL:
* raise JavaException('Unable to instanciate {0}'.format(
* self.__javaclass__)) # <<<<<<<<<<<<<<
*
* self.j_self = create_local_ref(j_env, j_self)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_12, function);
}
}
if (!__pyx_t_8) {
__pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_16);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_12)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
__pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
__pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_15, function);
}
}
if (!__pyx_t_12) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_15)) {
PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_16};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_16};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
} else
#endif
{
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
__Pyx_GIVEREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_16);
__pyx_t_16 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(0, 238, __pyx_L28_error)
/* "jnius/jnius_export_class.pxi":237
*
* check_exception(j_env)
* if j_self == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to instanciate {0}'.format(
* self.__javaclass__))
*/
}
/* "jnius/jnius_export_class.pxi":241
* self.__javaclass__))
*
* self.j_self = create_local_ref(j_env, j_self) # <<<<<<<<<<<<<<
* j_env[0].DeleteLocalRef(j_env, j_self)
* finally:
*/
__pyx_t_6 = ((PyObject *)__pyx_f_5jnius_5jnius_create_local_ref(__pyx_v_j_env, __pyx_v_j_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L28_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_self->j_self);
__Pyx_DECREF(((PyObject *)__pyx_v_self->j_self));
__pyx_v_self->j_self = ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_6);
__pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":242
*
* self.j_self = create_local_ref(j_env, j_self)
* j_env[0].DeleteLocalRef(j_env, j_self) # <<<<<<<<<<<<<<
* finally:
* if j_args != NULL:
*/
(__pyx_v_j_env[0])->DeleteLocalRef(__pyx_v_j_env, __pyx_v_j_self);
}
/* "jnius/jnius_export_class.pxi":244
* j_env[0].DeleteLocalRef(j_env, j_self)
* finally:
* if j_args != NULL: # <<<<<<<<<<<<<<
* free(j_args)
*
*/
/*finally:*/ {
/*normal exit:*/{
__pyx_t_4 = ((__pyx_v_j_args != NULL) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":245
* finally:
* if j_args != NULL:
* free(j_args) # <<<<<<<<<<<<<<
*
* cdef void resolve_methods(self) except *:
*/
free(__pyx_v_j_args);
/* "jnius/jnius_export_class.pxi":244
* j_env[0].DeleteLocalRef(j_env, j_self)
* finally:
* if j_args != NULL: # <<<<<<<<<<<<<<
* free(j_args)
*
*/
}
goto __pyx_L29;
}
/*exception exit:*/{
__Pyx_PyThreadState_declare
__pyx_L28_error:;
__pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
__Pyx_XGOTREF(__pyx_t_20);
__Pyx_XGOTREF(__pyx_t_21);
__Pyx_XGOTREF(__pyx_t_22);
__Pyx_XGOTREF(__pyx_t_23);
__Pyx_XGOTREF(__pyx_t_24);
__Pyx_XGOTREF(__pyx_t_25);
__pyx_t_13 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
{
__pyx_t_4 = ((__pyx_v_j_args != NULL) != 0);
if (__pyx_t_4) {
/* "jnius/jnius_export_class.pxi":245
* finally:
* if j_args != NULL:
* free(j_args) # <<<<<<<<<<<<<<
*
* cdef void resolve_methods(self) except *:
*/
free(__pyx_v_j_args);
/* "jnius/jnius_export_class.pxi":244
* j_env[0].DeleteLocalRef(j_env, j_self)
* finally:
* if j_args != NULL: # <<<<<<<<<<<<<<
* free(j_args)
*
*/
}
}
__Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_23);
__Pyx_XGIVEREF(__pyx_t_24);
__Pyx_XGIVEREF(__pyx_t_25);
__Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
}
__Pyx_XGIVEREF(__pyx_t_20);
__Pyx_XGIVEREF(__pyx_t_21);
__Pyx_XGIVEREF(__pyx_t_22);
__Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
__pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
__pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19;
goto __pyx_L1_error;
}
__pyx_L29:;
}
/* "jnius/jnius_export_class.pxi":166
* self.resolve_fields()
*
* cdef void call_constructor(self, args) except *: # <<<<<<<<<<<<<<
* # the goal is to find the class constructor, and call it with the
* # correct arguments.
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_AddTraceback("jnius.jnius.JavaClass.call_constructor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_definitions);
__Pyx_XDECREF(__pyx_v_definition);
__Pyx_XDECREF(__pyx_v_is_varargs);
__Pyx_XDECREF(__pyx_v_d_ret);
__Pyx_XDECREF(__pyx_v_d_args);
__Pyx_XDECREF(__pyx_v_args_);
__Pyx_XDECREF(__pyx_v_scores);
__Pyx_XDECREF(__pyx_v_score);
__Pyx_XDECREF(__pyx_v_defstr);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":247
* free(j_args)
*
* cdef void resolve_methods(self) except *: # <<<<<<<<<<<<<<
* # search all the JavaMethod within our class, and resolve them
* cdef JavaMethod jm
*/
static void __pyx_f_5jnius_5jnius_9JavaClass_resolve_methods(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self) {
struct __pyx_obj_5jnius_5jnius_JavaMethod *__pyx_v_jm = 0;
struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *__pyx_v_jmm = 0;
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_v_value = NULL;
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
PyObject *(*__pyx_t_5)(PyObject *);
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
int __pyx_t_10;
int __pyx_t_11;
__Pyx_RefNannySetupContext("resolve_methods", 0);
/* "jnius/jnius_export_class.pxi":251
* cdef JavaMethod jm
* cdef JavaMultipleMethod jmm
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
* for name, value in items_compat(self.__class__.__dict__):
* if isinstance(value, JavaMethod):
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 251, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":252
* cdef JavaMultipleMethod jmm
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__): # <<<<<<<<<<<<<<
* if isinstance(value, JavaMethod):
* jm = value
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __pyx_f_5jnius_5jnius_items_compat(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 252, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_2);
}
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 252, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 252, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
__pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_export_class.pxi":253
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__):
* if isinstance(value, JavaMethod): # <<<<<<<<<<<<<<
* jm = value
* if jm.is_static:
*/
__pyx_t_10 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMethod);
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
/* "jnius/jnius_export_class.pxi":254
* for name, value in items_compat(self.__class__.__dict__):
* if isinstance(value, JavaMethod):
* jm = value # <<<<<<<<<<<<<<
* if jm.is_static:
* continue
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMethod))))) __PYX_ERR(0, 254, __pyx_L1_error)
__pyx_t_2 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_jm, ((struct __pyx_obj_5jnius_5jnius_JavaMethod *)__pyx_t_2));
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":255
* if isinstance(value, JavaMethod):
* jm = value
* if jm.is_static: # <<<<<<<<<<<<<<
* continue
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
*/
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_jm->is_static); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
if (__pyx_t_11) {
/* "jnius/jnius_export_class.pxi":256
* jm = value
* if jm.is_static:
* continue # <<<<<<<<<<<<<<
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__))
*/
goto __pyx_L3_continue;
/* "jnius/jnius_export_class.pxi":255
* if isinstance(value, JavaMethod):
* jm = value
* if jm.is_static: # <<<<<<<<<<<<<<
* continue
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
*/
}
/* "jnius/jnius_export_class.pxi":257
* if jm.is_static:
* continue
* jm.set_resolve_info(j_env, self.j_cls, self.j_self, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(self.__javaclass__))
* elif isinstance(value, JavaMultipleMethod):
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->j_self);
__Pyx_INCREF(__pyx_t_2);
/* "jnius/jnius_export_class.pxi":258
* continue
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__)) # <<<<<<<<<<<<<<
* elif isinstance(value, JavaMultipleMethod):
* jmm = value
*/
__pyx_t_7 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":257
* if jm.is_static:
* continue
* jm.set_resolve_info(j_env, self.j_cls, self.j_self, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(self.__javaclass__))
* elif isinstance(value, JavaMultipleMethod):
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaMethod *)__pyx_v_jm->__pyx_vtab)->set_resolve_info(__pyx_v_jm, __pyx_v_j_env, __pyx_v_self->j_cls, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_2), __pyx_t_7, __pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "jnius/jnius_export_class.pxi":253
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__):
* if isinstance(value, JavaMethod): # <<<<<<<<<<<<<<
* jm = value
* if jm.is_static:
*/
goto __pyx_L7;
}
/* "jnius/jnius_export_class.pxi":259
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__))
* elif isinstance(value, JavaMultipleMethod): # <<<<<<<<<<<<<<
* jmm = value
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self,
*/
__pyx_t_11 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMultipleMethod);
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
/* "jnius/jnius_export_class.pxi":260
* str_for_c(name), str_for_c(self.__javaclass__))
* elif isinstance(value, JavaMultipleMethod):
* jmm = value # <<<<<<<<<<<<<<
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__))
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaMultipleMethod))))) __PYX_ERR(0, 260, __pyx_L1_error)
__pyx_t_8 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_jmm, ((struct __pyx_obj_5jnius_5jnius_JavaMultipleMethod *)__pyx_t_8));
__pyx_t_8 = 0;
/* "jnius/jnius_export_class.pxi":261
* elif isinstance(value, JavaMultipleMethod):
* jmm = value
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(self.__javaclass__))
*
*/
__pyx_t_8 = ((PyObject *)__pyx_v_self->j_self);
__Pyx_INCREF(__pyx_t_8);
/* "jnius/jnius_export_class.pxi":262
* jmm = value
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__)) # <<<<<<<<<<<<<<
*
* cdef void resolve_fields(self) except *:
*/
__pyx_t_7 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_v_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 262, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 262, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":261
* elif isinstance(value, JavaMultipleMethod):
* jmm = value
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self, # <<<<<<<<<<<<<<
* str_for_c(name), str_for_c(self.__javaclass__))
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaMultipleMethod *)__pyx_v_jmm->__pyx_vtab)->set_resolve_info(__pyx_v_jmm, __pyx_v_j_env, __pyx_v_self->j_cls, ((struct __pyx_obj_5jnius_5jnius_LocalRef *)__pyx_t_8), ((PyObject*)__pyx_t_7), ((PyObject*)__pyx_t_6));
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "jnius/jnius_export_class.pxi":259
* jm.set_resolve_info(j_env, self.j_cls, self.j_self,
* str_for_c(name), str_for_c(self.__javaclass__))
* elif isinstance(value, JavaMultipleMethod): # <<<<<<<<<<<<<<
* jmm = value
* jmm.set_resolve_info(j_env, self.j_cls, self.j_self,
*/
}
__pyx_L7:;
/* "jnius/jnius_export_class.pxi":252
* cdef JavaMultipleMethod jmm
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__): # <<<<<<<<<<<<<<
* if isinstance(value, JavaMethod):
* jm = value
*/
__pyx_L3_continue:;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":247
* free(j_args)
*
* cdef void resolve_methods(self) except *: # <<<<<<<<<<<<<<
* # search all the JavaMethod within our class, and resolve them
* cdef JavaMethod jm
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.JavaClass.resolve_methods", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jm);
__Pyx_XDECREF((PyObject *)__pyx_v_jmm);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":264
* str_for_c(name), str_for_c(self.__javaclass__))
*
* cdef void resolve_fields(self) except *: # <<<<<<<<<<<<<<
* # search all the JavaField within our class, and resolve them
* cdef JavaField jf
*/
static void __pyx_f_5jnius_5jnius_9JavaClass_resolve_fields(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self) {
struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_jf = 0;
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_v_value = NULL;
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
PyObject *(*__pyx_t_5)(PyObject *);
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
int __pyx_t_10;
int __pyx_t_11;
__Pyx_RefNannySetupContext("resolve_fields", 0);
/* "jnius/jnius_export_class.pxi":267
* # search all the JavaField within our class, and resolve them
* cdef JavaField jf
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
* for name, value in items_compat(self.__class__.__dict__):
* if not isinstance(value, JavaField):
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 267, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":268
* cdef JavaField jf
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__): # <<<<<<<<<<<<<<
* if not isinstance(value, JavaField):
* continue
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __pyx_f_5jnius_5jnius_items_compat(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
#else
__pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(0, 268, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_2);
}
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 268, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 268, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
__pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
__pyx_t_7 = 0;
/* "jnius/jnius_export_class.pxi":269
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__):
* if not isinstance(value, JavaField): # <<<<<<<<<<<<<<
* continue
* jf = value
*/
__pyx_t_10 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaField);
__pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
if (__pyx_t_11) {
/* "jnius/jnius_export_class.pxi":270
* for name, value in items_compat(self.__class__.__dict__):
* if not isinstance(value, JavaField):
* continue # <<<<<<<<<<<<<<
* jf = value
* if jf.is_static:
*/
goto __pyx_L3_continue;
/* "jnius/jnius_export_class.pxi":269
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__):
* if not isinstance(value, JavaField): # <<<<<<<<<<<<<<
* continue
* jf = value
*/
}
/* "jnius/jnius_export_class.pxi":271
* if not isinstance(value, JavaField):
* continue
* jf = value # <<<<<<<<<<<<<<
* if jf.is_static:
* continue
*/
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5jnius_5jnius_JavaField))))) __PYX_ERR(0, 271, __pyx_L1_error)
__pyx_t_2 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_jf, ((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_t_2));
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":272
* continue
* jf = value
* if jf.is_static: # <<<<<<<<<<<<<<
* continue
* jf.set_resolve_info(j_env, self.j_cls,
*/
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_jf->is_static); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
if (__pyx_t_11) {
/* "jnius/jnius_export_class.pxi":273
* jf = value
* if jf.is_static:
* continue # <<<<<<<<<<<<<<
* jf.set_resolve_info(j_env, self.j_cls,
* name, self.__javaclass__)
*/
goto __pyx_L3_continue;
/* "jnius/jnius_export_class.pxi":272
* continue
* jf = value
* if jf.is_static: # <<<<<<<<<<<<<<
* continue
* jf.set_resolve_info(j_env, self.j_cls,
*/
}
/* "jnius/jnius_export_class.pxi":275
* continue
* jf.set_resolve_info(j_env, self.j_cls,
* name, self.__javaclass__) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "jnius/jnius_export_class.pxi":274
* if jf.is_static:
* continue
* jf.set_resolve_info(j_env, self.j_cls, # <<<<<<<<<<<<<<
* name, self.__javaclass__)
*
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_jf->__pyx_vtab)->set_resolve_info(__pyx_v_jf, __pyx_v_j_env, __pyx_v_self->j_cls, __pyx_v_name, __pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":268
* cdef JavaField jf
* cdef JNIEnv *j_env = get_jnienv()
* for name, value in items_compat(self.__class__.__dict__): # <<<<<<<<<<<<<<
* if not isinstance(value, JavaField):
* continue
*/
__pyx_L3_continue:;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":264
* str_for_c(name), str_for_c(self.__javaclass__))
*
* cdef void resolve_fields(self) except *: # <<<<<<<<<<<<<<
* # search all the JavaField within our class, and resolve them
* cdef JavaField jf
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.JavaClass.resolve_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_jf);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":277
* name, self.__javaclass__)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return '<{0} at 0x{1:x} jclass={2} jself={3}>'.format(
* self.__class__.__name__,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9JavaClass_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9JavaClass_5__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaClass_4__repr__(((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9JavaClass_4__repr__(struct __pyx_obj_5jnius_5jnius_JavaClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "jnius/jnius_export_class.pxi":278
*
* def __repr__(self):
* return '<{0} at 0x{1:x} jclass={2} jself={3}>'.format( # <<<<<<<<<<<<<<
* self.__class__.__name__,
* id(self),
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_at_0x_1_x_jclass_2_jself_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "jnius/jnius_export_class.pxi":279
* def __repr__(self):
* return '<{0} at 0x{1:x} jclass={2} jself={3}>'.format(
* self.__class__.__name__, # <<<<<<<<<<<<<<
* id(self),
* self.__javaclass__,
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":280
* return '<{0} at 0x{1:x} jclass={2} jself={3}>'.format(
* self.__class__.__name__,
* id(self), # <<<<<<<<<<<<<<
* self.__javaclass__,
* self.j_self)
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":281
* self.__class__.__name__,
* id(self),
* self.__javaclass__, # <<<<<<<<<<<<<<
* self.j_self)
*
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_javaclass); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
/* "jnius/jnius_export_class.pxi":282
* id(self),
* self.__javaclass__,
* self.j_self) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_6 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_self->j_self)};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_self->j_self)};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self->j_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->j_self));
PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, ((PyObject *)__pyx_v_self->j_self));
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":277
* name, self.__javaclass__)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return '<{0} at 0x{1:x} jclass={2} jself={3}>'.format(
* self.__class__.__name__,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("jnius.jnius.JavaClass.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":294
* cdef definition
*
* def __cinit__(self, definition, **kwargs): # <<<<<<<<<<<<<<
* self.j_field = NULL
* self.j_cls = NULL
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9JavaField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_9JavaField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_definition = 0;
CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_definition,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_definition)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 294, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_definition = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 294, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("jnius.jnius.JavaField.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaField___cinit__(((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_v_self), __pyx_v_definition, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9JavaField___cinit__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_definition, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "jnius/jnius_export_class.pxi":295
*
* def __cinit__(self, definition, **kwargs):
* self.j_field = NULL # <<<<<<<<<<<<<<
* self.j_cls = NULL
*
*/
__pyx_v_self->j_field = NULL;
/* "jnius/jnius_export_class.pxi":296
* def __cinit__(self, definition, **kwargs):
* self.j_field = NULL
* self.j_cls = NULL # <<<<<<<<<<<<<<
*
* def __init__(self, definition, **kwargs):
*/
__pyx_v_self->j_cls = NULL;
/* "jnius/jnius_export_class.pxi":294
* cdef definition
*
* def __cinit__(self, definition, **kwargs): # <<<<<<<<<<<<<<
* self.j_field = NULL
* self.j_cls = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":298
* self.j_cls = NULL
*
* def __init__(self, definition, **kwargs): # <<<<<<<<<<<<<<
* super(JavaField, self).__init__()
* self.definition = definition
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9JavaField_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5jnius_5jnius_9JavaField_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_definition = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_definition,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_definition)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 298, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_definition = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 298, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("jnius.jnius.JavaField.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaField_2__init__(((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_v_self), __pyx_v_definition, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9JavaField_2__init__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_definition, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "jnius/jnius_export_class.pxi":299
*
* def __init__(self, definition, **kwargs):
* super(JavaField, self).__init__() # <<<<<<<<<<<<<<
* self.definition = definition
* self.is_static = kwargs.get('static', False)
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_5jnius_5jnius_JavaField));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_5jnius_5jnius_JavaField));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5jnius_5jnius_JavaField));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":300
* def __init__(self, definition, **kwargs):
* super(JavaField, self).__init__()
* self.definition = definition # <<<<<<<<<<<<<<
* self.is_static = kwargs.get('static', False)
*
*/
__Pyx_INCREF(__pyx_v_definition);
__Pyx_GIVEREF(__pyx_v_definition);
__Pyx_GOTREF(__pyx_v_self->definition);
__Pyx_DECREF(__pyx_v_self->definition);
__pyx_v_self->definition = __pyx_v_definition;
/* "jnius/jnius_export_class.pxi":301
* super(JavaField, self).__init__()
* self.definition = definition
* self.is_static = kwargs.get('static', False) # <<<<<<<<<<<<<<
*
* cdef void set_resolve_info(self, JNIEnv *j_env, jclass j_cls,
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_static, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->is_static);
__Pyx_DECREF(__pyx_v_self->is_static);
__pyx_v_self->is_static = __pyx_t_1;
__pyx_t_1 = 0;
/* "jnius/jnius_export_class.pxi":298
* self.j_cls = NULL
*
* def __init__(self, definition, **kwargs): # <<<<<<<<<<<<<<
* super(JavaField, self).__init__()
* self.definition = definition
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("jnius.jnius.JavaField.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":303
* self.is_static = kwargs.get('static', False)
*
* cdef void set_resolve_info(self, JNIEnv *j_env, jclass j_cls, # <<<<<<<<<<<<<<
* name, classname):
* j_env = get_jnienv()
*/
static void __pyx_f_5jnius_5jnius_9JavaField_set_resolve_info(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, CYTHON_UNUSED JNIEnv *__pyx_v_j_env, jclass __pyx_v_j_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_classname) {
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
__Pyx_RefNannySetupContext("set_resolve_info", 0);
/* "jnius/jnius_export_class.pxi":305
* cdef void set_resolve_info(self, JNIEnv *j_env, jclass j_cls,
* name, classname):
* j_env = get_jnienv() # <<<<<<<<<<<<<<
* self.name = name
* self.classname = classname
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 305, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":306
* name, classname):
* j_env = get_jnienv()
* self.name = name # <<<<<<<<<<<<<<
* self.classname = classname
* self.j_cls = j_cls
*/
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
/* "jnius/jnius_export_class.pxi":307
* j_env = get_jnienv()
* self.name = name
* self.classname = classname # <<<<<<<<<<<<<<
* self.j_cls = j_cls
*
*/
__Pyx_INCREF(__pyx_v_classname);
__Pyx_GIVEREF(__pyx_v_classname);
__Pyx_GOTREF(__pyx_v_self->classname);
__Pyx_DECREF(__pyx_v_self->classname);
__pyx_v_self->classname = __pyx_v_classname;
/* "jnius/jnius_export_class.pxi":308
* self.name = name
* self.classname = classname
* self.j_cls = j_cls # <<<<<<<<<<<<<<
*
* cdef void ensure_field(self) except *:
*/
__pyx_v_self->j_cls = __pyx_v_j_cls;
/* "jnius/jnius_export_class.pxi":303
* self.is_static = kwargs.get('static', False)
*
* cdef void set_resolve_info(self, JNIEnv *j_env, jclass j_cls, # <<<<<<<<<<<<<<
* name, classname):
* j_env = get_jnienv()
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("jnius.jnius.JavaField.set_resolve_info", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":310
* self.j_cls = j_cls
*
* cdef void ensure_field(self) except *: # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env = get_jnienv()
* if self.j_field != NULL:
*/
static void __pyx_f_5jnius_5jnius_9JavaField_ensure_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self) {
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_v_defstr = NULL;
PyObject *__pyx_v_namestr = NULL;
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
char *__pyx_t_5;
char *__pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("ensure_field", 0);
/* "jnius/jnius_export_class.pxi":311
*
* cdef void ensure_field(self) except *:
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
* if self.j_field != NULL:
* return
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 311, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":312
* cdef void ensure_field(self) except *:
* cdef JNIEnv *j_env = get_jnienv()
* if self.j_field != NULL: # <<<<<<<<<<<<<<
* return
* if self.is_static:
*/
__pyx_t_2 = ((__pyx_v_self->j_field != NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":313
* cdef JNIEnv *j_env = get_jnienv()
* if self.j_field != NULL:
* return # <<<<<<<<<<<<<<
* if self.is_static:
* defstr = str_for_c(self.definition)
*/
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":312
* cdef void ensure_field(self) except *:
* cdef JNIEnv *j_env = get_jnienv()
* if self.j_field != NULL: # <<<<<<<<<<<<<<
* return
* if self.is_static:
*/
}
/* "jnius/jnius_export_class.pxi":314
* if self.j_field != NULL:
* return
* if self.is_static: # <<<<<<<<<<<<<<
* defstr = str_for_c(self.definition)
* self.j_field = j_env[0].GetStaticFieldID(
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->is_static); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":315
* return
* if self.is_static:
* defstr = str_for_c(self.definition) # <<<<<<<<<<<<<<
* self.j_field = j_env[0].GetStaticFieldID(
* j_env, self.j_cls, <char *>self.name,
*/
__pyx_t_3 = __pyx_v_self->definition;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_defstr = __pyx_t_4;
__pyx_t_4 = 0;
/* "jnius/jnius_export_class.pxi":317
* defstr = str_for_c(self.definition)
* self.j_field = j_env[0].GetStaticFieldID(
* j_env, self.j_cls, <char *>self.name, # <<<<<<<<<<<<<<
* <char *>defstr)
* else:
*/
__pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":318
* self.j_field = j_env[0].GetStaticFieldID(
* j_env, self.j_cls, <char *>self.name,
* <char *>defstr) # <<<<<<<<<<<<<<
* else:
* defstr = str_for_c(self.definition)
*/
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_defstr); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":316
* if self.is_static:
* defstr = str_for_c(self.definition)
* self.j_field = j_env[0].GetStaticFieldID( # <<<<<<<<<<<<<<
* j_env, self.j_cls, <char *>self.name,
* <char *>defstr)
*/
__pyx_v_self->j_field = (__pyx_v_j_env[0])->GetStaticFieldID(__pyx_v_j_env, __pyx_v_self->j_cls, ((char *)__pyx_t_5), ((char *)__pyx_t_6));
/* "jnius/jnius_export_class.pxi":314
* if self.j_field != NULL:
* return
* if self.is_static: # <<<<<<<<<<<<<<
* defstr = str_for_c(self.definition)
* self.j_field = j_env[0].GetStaticFieldID(
*/
goto __pyx_L4;
}
/* "jnius/jnius_export_class.pxi":320
* <char *>defstr)
* else:
* defstr = str_for_c(self.definition) # <<<<<<<<<<<<<<
* namestr = str_for_c(self.name)
* self.j_field = j_env[0].GetFieldID(
*/
/*else*/ {
__pyx_t_4 = __pyx_v_self->definition;
__Pyx_INCREF(__pyx_t_4);
__pyx_t_3 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_defstr = __pyx_t_3;
__pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":321
* else:
* defstr = str_for_c(self.definition)
* namestr = str_for_c(self.name) # <<<<<<<<<<<<<<
* self.j_field = j_env[0].GetFieldID(
* j_env, self.j_cls, <char *>namestr,
*/
__pyx_t_3 = __pyx_v_self->name;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_5jnius_5jnius_str_for_c(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_namestr = __pyx_t_4;
__pyx_t_4 = 0;
/* "jnius/jnius_export_class.pxi":323
* namestr = str_for_c(self.name)
* self.j_field = j_env[0].GetFieldID(
* j_env, self.j_cls, <char *>namestr, # <<<<<<<<<<<<<<
* <char *>defstr)
* if self.j_field == NULL:
*/
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_namestr); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":324
* self.j_field = j_env[0].GetFieldID(
* j_env, self.j_cls, <char *>namestr,
* <char *>defstr) # <<<<<<<<<<<<<<
* if self.j_field == NULL:
* raise JavaException('Unable to found the field {0}'.format(self.name))
*/
__pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_defstr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":322
* defstr = str_for_c(self.definition)
* namestr = str_for_c(self.name)
* self.j_field = j_env[0].GetFieldID( # <<<<<<<<<<<<<<
* j_env, self.j_cls, <char *>namestr,
* <char *>defstr)
*/
__pyx_v_self->j_field = (__pyx_v_j_env[0])->GetFieldID(__pyx_v_j_env, __pyx_v_self->j_cls, ((char *)__pyx_t_6), ((char *)__pyx_t_5));
}
__pyx_L4:;
/* "jnius/jnius_export_class.pxi":325
* j_env, self.j_cls, <char *>namestr,
* <char *>defstr)
* if self.j_field == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the field {0}'.format(self.name))
*
*/
__pyx_t_2 = ((__pyx_v_self->j_field == NULL) != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":326
* <char *>defstr)
* if self.j_field == NULL:
* raise JavaException('Unable to found the field {0}'.format(self.name)) # <<<<<<<<<<<<<<
*
* def __get__(self, obj, objtype):
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_JavaException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_found_the_field_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
if (!__pyx_t_9) {
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_self->name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_self->name};
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_self->name};
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else
#endif
{
__pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_self->name);
__Pyx_GIVEREF(__pyx_v_self->name);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_self->name);
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_8) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
__pyx_t_7 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(0, 326, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":325
* j_env, self.j_cls, <char *>namestr,
* <char *>defstr)
* if self.j_field == NULL: # <<<<<<<<<<<<<<
* raise JavaException('Unable to found the field {0}'.format(self.name))
*
*/
}
/* "jnius/jnius_export_class.pxi":310
* self.j_cls = j_cls
*
* cdef void ensure_field(self) except *: # <<<<<<<<<<<<<<
* cdef JNIEnv *j_env = get_jnienv()
* if self.j_field != NULL:
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("jnius.jnius.JavaField.ensure_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_defstr);
__Pyx_XDECREF(__pyx_v_namestr);
__Pyx_RefNannyFinishContext();
}
/* "jnius/jnius_export_class.pxi":328
* raise JavaException('Unable to found the field {0}'.format(self.name))
*
* def __get__(self, obj, objtype): # <<<<<<<<<<<<<<
* cdef jobject j_self
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5jnius_5jnius_9JavaField_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype); /*proto*/
static PyObject *__pyx_pw_5jnius_5jnius_9JavaField_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaField_4__get__(((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_objtype));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5jnius_5jnius_9JavaField_4__get__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_objtype) {
jobject __pyx_v_j_self;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
jobject __pyx_t_4;
__Pyx_RefNannySetupContext("__get__", 0);
/* "jnius/jnius_export_class.pxi":331
* cdef jobject j_self
*
* self.ensure_field() # <<<<<<<<<<<<<<
* if obj is None:
* return self.read_static_field()
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_self->__pyx_vtab)->ensure_field(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":332
*
* self.ensure_field()
* if obj is None: # <<<<<<<<<<<<<<
* return self.read_static_field()
*
*/
__pyx_t_1 = (__pyx_v_obj == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":333
* self.ensure_field()
* if obj is None:
* return self.read_static_field() # <<<<<<<<<<<<<<
*
* j_self = (<JavaClass?>obj).j_self.obj
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = ((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_self->__pyx_vtab)->read_static_field(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":332
*
* self.ensure_field()
* if obj is None: # <<<<<<<<<<<<<<
* return self.read_static_field()
*
*/
}
/* "jnius/jnius_export_class.pxi":335
* return self.read_static_field()
*
* j_self = (<JavaClass?>obj).j_self.obj # <<<<<<<<<<<<<<
* return self.read_field(j_self)
*
*/
if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass)))) __PYX_ERR(0, 335, __pyx_L1_error)
__pyx_t_4 = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_v_obj)->j_self->obj;
__pyx_v_j_self = __pyx_t_4;
/* "jnius/jnius_export_class.pxi":336
*
* j_self = (<JavaClass?>obj).j_self.obj
* return self.read_field(j_self) # <<<<<<<<<<<<<<
*
* def __set__(self, obj, value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = ((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_self->__pyx_vtab)->read_field(__pyx_v_self, __pyx_v_j_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "jnius/jnius_export_class.pxi":328
* raise JavaException('Unable to found the field {0}'.format(self.name))
*
* def __get__(self, obj, objtype): # <<<<<<<<<<<<<<
* cdef jobject j_self
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("jnius.jnius.JavaField.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":338
* return self.read_field(j_self)
*
* def __set__(self, obj, value): # <<<<<<<<<<<<<<
* cdef jobject j_self
*
*/
/* Python wrapper */
static int __pyx_pw_5jnius_5jnius_9JavaField_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5jnius_5jnius_9JavaField_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5jnius_5jnius_9JavaField_6__set__(((struct __pyx_obj_5jnius_5jnius_JavaField *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5jnius_5jnius_9JavaField_6__set__(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) {
jobject __pyx_v_j_self;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
jobject __pyx_t_4;
__Pyx_RefNannySetupContext("__set__", 0);
/* "jnius/jnius_export_class.pxi":341
* cdef jobject j_self
*
* self.ensure_field() # <<<<<<<<<<<<<<
* if obj is None:
* # set not implemented for static fields
*/
((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_self->__pyx_vtab)->ensure_field(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":342
*
* self.ensure_field()
* if obj is None: # <<<<<<<<<<<<<<
* # set not implemented for static fields
* raise NotImplementedError()
*/
__pyx_t_1 = (__pyx_v_obj == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "jnius/jnius_export_class.pxi":344
* if obj is None:
* # set not implemented for static fields
* raise NotImplementedError() # <<<<<<<<<<<<<<
*
* j_self = (<JavaClass?>obj).j_self.obj
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(0, 344, __pyx_L1_error)
/* "jnius/jnius_export_class.pxi":342
*
* self.ensure_field()
* if obj is None: # <<<<<<<<<<<<<<
* # set not implemented for static fields
* raise NotImplementedError()
*/
}
/* "jnius/jnius_export_class.pxi":346
* raise NotImplementedError()
*
* j_self = (<JavaClass?>obj).j_self.obj # <<<<<<<<<<<<<<
* self.write_field(j_self, value)
*
*/
if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5jnius_5jnius_JavaClass)))) __PYX_ERR(0, 346, __pyx_L1_error)
__pyx_t_4 = ((struct __pyx_obj_5jnius_5jnius_JavaClass *)__pyx_v_obj)->j_self->obj;
__pyx_v_j_self = __pyx_t_4;
/* "jnius/jnius_export_class.pxi":347
*
* j_self = (<JavaClass?>obj).j_self.obj
* self.write_field(j_self, value) # <<<<<<<<<<<<<<
*
* cdef write_field(self, jobject j_self, value):
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_5jnius_5jnius_JavaField *)__pyx_v_self->__pyx_vtab)->write_field(__pyx_v_self, __pyx_v_j_self, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "jnius/jnius_export_class.pxi":338
* return self.read_field(j_self)
*
* def __set__(self, obj, value): # <<<<<<<<<<<<<<
* cdef jobject j_self
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("jnius.jnius.JavaField.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "jnius/jnius_export_class.pxi":349
* self.write_field(j_self, value)
*
* cdef write_field(self, jobject j_self, value): # <<<<<<<<<<<<<<
* cdef jboolean j_boolean
* cdef jbyte j_byte
*/
static PyObject *__pyx_f_5jnius_5jnius_9JavaField_write_field(struct __pyx_obj_5jnius_5jnius_JavaField *__pyx_v_self, jobject __pyx_v_j_self, PyObject *__pyx_v_value) {
jboolean __pyx_v_j_boolean;
jbyte __pyx_v_j_byte;
jchar __pyx_v_j_char;
jshort __pyx_v_j_short;
jint __pyx_v_j_int;
jlong __pyx_v_j_long;
jfloat __pyx_v_j_float;
jdouble __pyx_v_j_double;
jobject __pyx_v_j_object;
JNIEnv *__pyx_v_j_env;
PyObject *__pyx_v_r = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
JNIEnv *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
jboolean __pyx_t_4;
jbyte __pyx_t_5;
jchar __pyx_t_6;
jshort __pyx_t_7;
jint __pyx_t_8;
jlong __pyx_t_9;
jfloat __pyx_t_10;
jdouble __pyx_t_11;
jobject __pyx_t_12;
__Pyx_RefNannySetupContext("write_field", 0);
/* "jnius/jnius_export_class.pxi":359
* cdef jdouble j_double
* cdef jobject j_object
* cdef JNIEnv *j_env = get_jnienv() # <<<<<<<<<<<<<<
*
* # type of the java field
*/
__pyx_t_1 = __pyx_f_5jnius_5jnius_get_jnienv(); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 359, __pyx_L1_error)
__pyx_v_j_env = __pyx_t_1;
/* "jnius/jnius_export_class.pxi":362
*
* # type of the java field
* r = self.definition[0] # <<<<<<<<<<<<<<
*
* # set the java field; implemented only for primitive types
*/
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->definition, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_r = __pyx_t_2;
__pyx_t_2 = 0;
/* "jnius/jnius_export_class.pxi":365
*
* # set the java field; implemented only for primitive types
* if r == 'Z': # <<<<<<<<<<<<<<
* j_boolean = <jboolean>value
* j_env[0].SetBooleanField(j_env, j_self, self.j_field, j_boolean)
*/
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_r, __pyx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment