Commit e9cf8998 authored by Emmanuel Arias's avatar Emmanuel Arias

New upstream version 3.5

parent 5c89a664
Version 3.4 -> 3.5
------------------
- fixed bug PYLUCENE-46
Version 3.3 -> 3.4
------------------
- added NAN to the list of reserved words
Version 3.2 -> 3.3
------------------
- fixed bug PYLUCENE-43
- fixed bug PYLUCENE-41
Version 3.1 -> 3.2
------------------
- added missing 'const' breaking build with Python 3.7 (Aric Coady)
- fixed bug with not skipping META-INF/ entries in .jar files
Version 3.0 -> 3.1
------------------
- fixed bug PYLUCENE-36 (Paulo Villegas)
- reworked type construction to use PyType_FromSpecWithBases (Python 3)
- added 'm' suffix to linux -lpython statement for shared jcc lib
- fixed bug with using split instead of rpartition on path (Petrus Hyvnen)
- fixed bug PYLUCENE-38 (Aric Coady)
- fixed bug PYLUCENE-39
Version 2.23 -> 3.0 Version 2.23 -> 3.0
------------------- -------------------
- added support for Python 3 (3.3+) (with Rdiger Meier and Thomas Koch) - added support for Python 3 (3.3+) (with Rdiger Meier and Thomas Koch)
......
Please see doc/jcc/documentation/install.html or Please see http://lucene.apache.org/pylucene/jcc/install.html
http://lucene.apache.org/pylucene/jcc/install.html
Metadata-Version: 1.1 Metadata-Version: 1.1
Name: JCC Name: JCC
Version: 3.0 Version: 3.5
Summary: a C++ code generator for calling Java from C++/Python Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN Home-page: UNKNOWN
Author: Andi Vajda Author: Andi Vajda
......
Metadata-Version: 1.1 Metadata-Version: 1.1
Name: JCC Name: JCC
Version: 3.0 Version: 3.5
Summary: a C++ code generator for calling Java from C++/Python Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN Home-page: UNKNOWN
Author: Andi Vajda Author: Andi Vajda
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "java/lang/RuntimeException.h" #include "java/lang/RuntimeException.h"
#include "macros.h" #include "macros.h"
extern PyTypeObject PY_TYPE(JObject), PY_TYPE(ConstVariableDescriptor); extern PyTypeObject *PY_TYPE(JObject), *PY_TYPE(ConstVariableDescriptor);
PyObject *initJCC(PyObject *module); PyObject *initJCC(PyObject *module);
PyObject *initVM(PyObject *self, PyObject *args, PyObject *kwds); PyObject *initVM(PyObject *self, PyObject *args, PyObject *kwds);
...@@ -70,8 +70,10 @@ static struct PyModuleDef _jccmodule = { ...@@ -70,8 +70,10 @@ static struct PyModuleDef _jccmodule = {
initJCC(m); initJCC(m);
INSTALL_TYPE(JObject, m); INSTALL_STATIC_TYPE(JObject, m);
INSTALL_TYPE(ConstVariableDescriptor, m); PY_TYPE_DEF(JObject).type = PY_TYPE(JObject);
INSTALL_STATIC_TYPE(ConstVariableDescriptor, m);
java::lang::__install__(m); java::lang::__install__(m);
java::io::__install__(m); java::io::__install__(m);
......
...@@ -67,9 +67,18 @@ namespace java { ...@@ -67,9 +67,18 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(PrintWriter, t_PrintWriter, Writer, static PyType_Slot PY_TYPE_SLOTS(PrintWriter)[] = {
java::io::PrintWriter, t_PrintWriter_init, { Py_tp_methods, t_PrintWriter__methods_ },
0, 0, 0, 0, 0); { Py_tp_init, (void *) t_PrintWriter_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(PrintWriter)[] = {
&PY_TYPE_DEF(Writer),
NULL
};
DEFINE_TYPE(PrintWriter, t_PrintWriter, java::io::PrintWriter);
static int t_PrintWriter_init(t_PrintWriter *self, static int t_PrintWriter_init(t_PrintWriter *self,
PyObject *args, PyObject *kwds) PyObject *args, PyObject *kwds)
......
...@@ -35,7 +35,7 @@ namespace java { ...@@ -35,7 +35,7 @@ namespace java {
PrintWriter(const PrintWriter& obj) : Writer(obj) {} PrintWriter(const PrintWriter& obj) : Writer(obj) {}
}; };
extern PyTypeObject PY_TYPE(PrintWriter); DECLARE_TYPE(PrintWriter);
class t_PrintWriter { class t_PrintWriter {
public: public:
......
...@@ -66,9 +66,18 @@ namespace java { ...@@ -66,9 +66,18 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(StringWriter, t_StringWriter, Writer, static PyType_Slot PY_TYPE_SLOTS(StringWriter)[] = {
java::io::StringWriter, t_StringWriter_init, { Py_tp_methods, t_StringWriter__methods_ },
0, 0, 0, 0, 0); { Py_tp_init, (void *) t_StringWriter_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(StringWriter)[] = {
&PY_TYPE_DEF(Writer),
NULL
};
DEFINE_TYPE(StringWriter, t_StringWriter, java::io::StringWriter);
static int t_StringWriter_init(t_StringWriter *self, static int t_StringWriter_init(t_StringWriter *self,
PyObject *args, PyObject *kwds) PyObject *args, PyObject *kwds)
...@@ -81,7 +90,7 @@ namespace java { ...@@ -81,7 +90,7 @@ namespace java {
PyErr_SetString(PyExc_ValueError, "invalid args"); PyErr_SetString(PyExc_ValueError, "invalid args");
return -1; return -1;
} }
return 0; return 0;
} }
} }
......
...@@ -35,7 +35,7 @@ namespace java { ...@@ -35,7 +35,7 @@ namespace java {
StringWriter(const StringWriter& obj) : Writer(obj) {} StringWriter(const StringWriter& obj) : Writer(obj) {}
}; };
extern PyTypeObject PY_TYPE(StringWriter); DECLARE_TYPE(StringWriter);
class t_StringWriter { class t_StringWriter {
public: public:
......
...@@ -57,7 +57,17 @@ namespace java { ...@@ -57,7 +57,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Writer, t_Writer, java::lang::Object, Writer, static PyType_Slot PY_TYPE_SLOTS(Writer)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Writer__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Writer)[] = {
&PY_TYPE_DEF(java::lang::Object),
NULL
};
DEFINE_TYPE(Writer, t_Writer, java::io::Writer);
} }
} }
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <Python.h> #include <Python.h>
#include "java/lang/Object.h" #include "java/lang/Object.h"
#include "java/lang/Class.h" #include "java/lang/Class.h"
#include "JArray.h"
namespace java { namespace java {
namespace io { namespace io {
...@@ -34,7 +33,7 @@ namespace java { ...@@ -34,7 +33,7 @@ namespace java {
} }
}; };
extern PyTypeObject PY_TYPE(Writer); DECLARE_TYPE(Writer);
class t_Writer { class t_Writer {
public: public:
......
...@@ -15,13 +15,16 @@ ...@@ -15,13 +15,16 @@
#include <Python.h> #include <Python.h>
#include "macros.h" #include "macros.h"
void installType(PyTypeObject **type, PyType_Def *def, PyObject *module,
char *name, int isExtension);
namespace java { namespace java {
namespace io { namespace io {
extern PyTypeObject PY_TYPE(Writer); DECLARE_TYPE(Writer);
extern PyTypeObject PY_TYPE(StringWriter); DECLARE_TYPE(StringWriter);
extern PyTypeObject PY_TYPE(PrintWriter); DECLARE_TYPE(PrintWriter);
namespace reflect { namespace reflect {
void __install__(PyObject *module); void __install__(PyObject *module);
} }
......
...@@ -32,7 +32,7 @@ namespace java { ...@@ -32,7 +32,7 @@ namespace java {
Boolean *Boolean::TRUE = NULL; Boolean *Boolean::TRUE = NULL;
Boolean *Boolean::FALSE = NULL; Boolean *Boolean::FALSE = NULL;
jclass Boolean::initializeClass(bool getOnly) jclass Boolean::initializeClass(bool getOnly)
{ {
if (getOnly) if (getOnly)
...@@ -77,7 +77,17 @@ namespace java { ...@@ -77,7 +77,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Boolean, t_Boolean, Object, java::lang::Boolean, static PyType_Slot PY_TYPE_SLOTS(Boolean)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Boolean__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Boolean)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Boolean, t_Boolean, java::lang::Boolean);
} }
} }
...@@ -39,7 +39,7 @@ namespace java { ...@@ -39,7 +39,7 @@ namespace java {
static Boolean *FALSE; static Boolean *FALSE;
}; };
extern PyTypeObject PY_TYPE(Boolean); DECLARE_TYPE(Boolean);
class t_Boolean { class t_Boolean {
public: public:
......
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Byte, t_Byte, Object, java::lang::Byte, static PyType_Slot PY_TYPE_SLOTS(Byte)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Byte__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Byte)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Byte, t_Byte, java::lang::Byte);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jbyte byteValue() const; jbyte byteValue() const;
}; };
extern PyTypeObject PY_TYPE(Byte); DECLARE_TYPE(Byte);
class t_Byte { class t_Byte {
public: public:
......
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Character, t_Character, Object, java::lang::Character, static PyType_Slot PY_TYPE_SLOTS(Character)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Character__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Character)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Character, t_Character, java::lang::Character);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jchar charValue() const; jchar charValue() const;
}; };
extern PyTypeObject PY_TYPE(Character); DECLARE_TYPE(Character);
class t_Character { class t_Character {
public: public:
......
...@@ -367,8 +367,19 @@ namespace java { ...@@ -367,8 +367,19 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Class, t_Class, Object, java::lang::Class, static PyType_Slot PY_TYPE_SLOTS(Class)[] = {
abstract_init, 0, 0, t_Class__fields_, 0, 0); { Py_tp_methods, t_Class__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ Py_tp_getset, t_Class__fields_ },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Class)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Class, t_Class, java::lang::Class);
#ifdef _java_generics #ifdef _java_generics
PyObject *t_Class::wrap_Object(const Class& object, PyTypeObject *T) PyObject *t_Class::wrap_Object(const Class& object, PyTypeObject *T)
...@@ -511,7 +522,7 @@ namespace java { ...@@ -511,7 +522,7 @@ namespace java {
static PyObject *t_Class_isAssignableFrom(t_Class *self, PyObject *arg) static PyObject *t_Class_isAssignableFrom(t_Class *self, PyObject *arg)
{ {
if (!PyObject_TypeCheck(arg, &PY_TYPE(Class))) if (!PyObject_TypeCheck(arg, PY_TYPE(Class)))
{ {
PyErr_SetObject(PyExc_TypeError, arg); PyErr_SetObject(PyExc_TypeError, arg);
return NULL; return NULL;
......
...@@ -71,7 +71,7 @@ namespace java { ...@@ -71,7 +71,7 @@ namespace java {
#endif #endif
}; };
extern PyTypeObject PY_TYPE(Class); DECLARE_TYPE(Class);
class t_Class { class t_Class {
public: public:
......
...@@ -29,7 +29,7 @@ namespace java { ...@@ -29,7 +29,7 @@ namespace java {
Class *Double::class$ = NULL; Class *Double::class$ = NULL;
jmethodID *Double::_mids = NULL; jmethodID *Double::_mids = NULL;
jclass Double::initializeClass(bool getOnly) jclass Double::initializeClass(bool getOnly)
{ {
if (getOnly) if (getOnly)
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Double, t_Double, Object, java::lang::Double, static PyType_Slot PY_TYPE_SLOTS(Double)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Double__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Double)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Double, t_Double, java::lang::Double);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jdouble doubleValue() const; jdouble doubleValue() const;
}; };
extern PyTypeObject PY_TYPE(Double); DECLARE_TYPE(Double);
class t_Double { class t_Double {
public: public:
......
...@@ -56,7 +56,17 @@ namespace java { ...@@ -56,7 +56,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Exception, t_Exception, Throwable, Exception, static PyType_Slot PY_TYPE_SLOTS(Exception)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Exception__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Exception)[] = {
&PY_TYPE_DEF(Throwable),
NULL
};
DEFINE_TYPE(Exception, t_Exception, java::lang::Exception);
} }
} }
...@@ -34,7 +34,7 @@ namespace java { ...@@ -34,7 +34,7 @@ namespace java {
} }
}; };
extern PyTypeObject PY_TYPE(Exception); DECLARE_TYPE(Exception);
class t_Exception { class t_Exception {
public: public:
......
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Float, t_Float, Object, java::lang::Float, static PyType_Slot PY_TYPE_SLOTS(Float)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Float__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Float)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Float, t_Float, java::lang::Float);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jfloat floatValue() const; jfloat floatValue() const;
}; };
extern PyTypeObject PY_TYPE(Float); DECLARE_TYPE(Float);
class t_Float { class t_Float {
public: public:
......
...@@ -29,7 +29,7 @@ namespace java { ...@@ -29,7 +29,7 @@ namespace java {
Class *Integer::class$ = NULL; Class *Integer::class$ = NULL;
jmethodID *Integer::_mids = NULL; jmethodID *Integer::_mids = NULL;
jclass Integer::initializeClass(bool getOnly) jclass Integer::initializeClass(bool getOnly)
{ {
if (getOnly) if (getOnly)
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Integer, t_Integer, Object, java::lang::Integer, static PyType_Slot PY_TYPE_SLOTS(Integer)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Integer__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Integer)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Integer, t_Integer, java::lang::Integer);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jint intValue() const; jint intValue() const;
}; };
extern PyTypeObject PY_TYPE(Integer); DECLARE_TYPE(Integer);
class t_Integer { class t_Integer {
public: public:
......
...@@ -29,7 +29,7 @@ namespace java { ...@@ -29,7 +29,7 @@ namespace java {
Class *Long::class$ = NULL; Class *Long::class$ = NULL;
jmethodID *Long::_mids = NULL; jmethodID *Long::_mids = NULL;
jclass Long::initializeClass(bool getOnly) jclass Long::initializeClass(bool getOnly)
{ {
if (getOnly) if (getOnly)
...@@ -71,7 +71,17 @@ namespace java { ...@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Long, t_Long, Object, java::lang::Long, static PyType_Slot PY_TYPE_SLOTS(Long)[] = {
abstract_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Long__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Long)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Long, t_Long, java::lang::Long);
} }
} }
...@@ -36,7 +36,7 @@ namespace java { ...@@ -36,7 +36,7 @@ namespace java {
jlong longValue() const; jlong longValue() const;
}; };
extern PyTypeObject PY_TYPE(Long); DECLARE_TYPE(Long);
class t_Long { class t_Long {
public: public:
......
...@@ -103,8 +103,18 @@ namespace java { ...@@ -103,8 +103,18 @@ namespace java {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
DECLARE_TYPE(Object, t_Object, JObject, java::lang::Object, static PyType_Slot PY_TYPE_SLOTS(Object)[] = {
t_Object_init, 0, 0, 0, 0, 0); { Py_tp_methods, t_Object__methods_ },
{ Py_tp_init, (void *) t_Object_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Object)[] = {
&PY_TYPE_DEF(JObject),
NULL
};
DEFINE_TYPE(Object, t_Object, java::lang::Object);
static int t_Object_init(t_Object *self, static int t_Object_init(t_Object *self,
PyObject *args, PyObject *kwds) PyObject *args, PyObject *kwds)
...@@ -117,7 +127,7 @@ namespace java { ...@@ -117,7 +127,7 @@ namespace java {