Commit 742a2b94 authored by Ludovico Cavedon's avatar Ludovico Cavedon

Imported Upstream version 1.9

parents
For bug <NUM>, see http://bugzilla.osafoundation.org/show_bug.cgi?id=<NUM>
Version 1.8 -> 1.9
------------------
- fixed code generation for clone() broken by finalization proxy work
- added 'union' to the list of reserved words
- fixed castCheck() to work with finalization proxies
- --compile no longer installs by default
- fixed bug in __init__.cpp #include statements for package-less classes
- fixed line ending bug on Windows
- fixed multiple JCC-built extensions in same process problem
- removed env argument from initVM() as it's redundant with the libjcc.dylib
- reimplemented env->setClassPath() in terms of system URLClassLoader hack
- added support for --include option
- added 'NULL' to list of reserved words
- added support for building shared libjcc library on Mac OS X and Linux
- fixed bug with generating wrappers for abstract Enumeration implementations
- added support for --install-dir and --use-distutils options
- copy jcc runtime sources into extension source tree before compiling
- added detection of invalid command line args
- fixed double-free bug when passing in vmargs
- added defines to enable building with MinGW (Bill Janssen)
- added support for --bdist
- added support for --compiler
- fixed crasher on Windows with virtual JObject.weaken$()
- fixed bug not checking return value from initVM()
- fixed bug with findClass() not catching C++ exception when class not found
- added missing code in parseArgs() to handle double[], float[] and long[]
Version 1.7 -> 1.8
------------------
- fixed bug using the wrong field modifiers for setter (Bill Janssen)
- added missing calls for generating wrappers for ancestors of Exception
- added missing call for generating wrappers for String
- added note about --classpath to README
Version 1.6 -> 1.7
------------------
- fixed memory leak when calling inherited methods via callSuper()
- added support for building on Solaris with Sun Studio C++ (Solaris 11)
- fixed leak of local refs of jstring when converting to an array of String
- automated finalization of extensions via proxy for breaking ref cycle
- added Py_CLEAR and Py_VISIT macros for Python 2.3.5 compilation
Earlier versions (changes included in PyLucene versions < 2.3)
--------------------------------------------------------------
- see http://svn.osafoundation.org/pylucene/trunk/jcc/CHANGES
JCC is a C++ code generator for producing the glue code necessary to call
into Java classes from CPython via Java's Native Invocation Interface (JNI).
JCC generates C++ wrapper classes that hide all the gory details of JNI
access as well Java memory and object reference management.
JCC generates CPython types that make these C++ classes accessible from a
Python interpreter. JCC attempts to make these Python types pythonic by
detecting iterators and property accessors. Iterators and mappings may also
be declared to JCC.
JCC has been built on Python 2.3, 2.4 and 2.5 and has been used with various
Java Runtime Environments such as Sun Java 1.4, 1.5 and 1.6, Apple's Java
1.4 and 1.5 on Mac OS X and open source Java OpenJDK 1.7 builds.
JCC is known to work on Intel and PowerPC Mac OS X 10.3, 10.4 and 10.5,
Ubuntu Linux Dapper, Feisty and Gutsy, Sun Solaris Express, Windows 2000 and
Windows XP.
JCC is written in C++ and Python. It uses Java's reflection API to do its
job and needs a Java Runtime Environment to be present to operate.
JCC is built with distutils::
python setup.py build
sudo python setup.py install
The setuptools package is required to build JCC on Python 2.3.
Except for Mac OS X - where Apple's Java comes pre-installed in a known
framework location - JCC's setup.py file needs to be edited before being
built to specify the location of the Java Runtime Environment's header files
and libraries.
The svn sources for JCC are available at:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/
For more information about JCC see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/INSTALL
For the changes since earlier releases, see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/CHANGES
INSTALL file for JCC build
--------------------------
Contents
--------
- Building JCC
- Requirements
- Notes for Mac OS X
- Notes for Linux
- Notes for Solaris
- Notes for Windows
- Notes for Python 2.3
Building JCC
------------
JCC is a Python extension written in Python and C++. it requires a Java
Runtime Environment to operate as it uses Java's reflection APIs to do
its work. It is built and installed via distutils.
1. Edit setup.py and review that values in the INCLUDE, CFLAGS and LFLAGS
are correct for your system. These values are also going to be compiled
into JCC's config.py file and are going to be used by JCC when invoking
disutils to compile extensions it generated code for.
2. At the command line, enter:
> python setup.py build
> sudo python setup.py install
Requirements
------------
JCC requires a Java Development Kit to be present. It uses the Java Native
Invocation Interface and expects <jni.h> and the Java libraries to be
present at build and runtime.
Notes for Mac OS X
------------------
On Mac OS X, Java is installed by Apple's setup as a framework.
The values for INCLUDE and LFLAGS for 'darwin' should be correct and
ready to use.
Notes for Linux
---------------
At this time, JCC has been built and tested only on Linux on Ubuntu 6.06.
Sun Java 1.5 was installed and made the default Java environment with:
- sudo apt-get install sun-java5-jdk
- sudo update-java-alternatives -s java-1.5.0-sun
The Java Runtime libraries and Java VM are found at runtime by either:
. adding '-Wl,-rpath=/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client' to the LFLAGS['linux2]'
linker argument list in setup.py or by
. setting LD_LIBRARY_PATH (not recommended for security reasons)
- export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client:$LD_LIBRARY_PATH
Notes for Solaris
-----------------
At this time, JCC has been built and tested only on Solaris 11 with Sun
Studio C++ 12, Java 1.6 and Python 2.4.
Because JCC is written in C++, Python's distutils must be nudged a bit to
invoke the correct compiler. Sun Studio's C compiler is called 'cc' while
its C++ compiler is called 'CC'. To build JCC, use the following shell
command to ensure that the C++ compiler is used:
$ CC=CC python setup.py build
Notes for Windows
-----------------
At this time, JCC has been built and tested only on Win2k with Python
2.5.1 and Sun Java 1.6. Python was downloaded as an .msi installer from
http://www.python.org.
- adding the Python25 directory to PATH is recommended.
- adding the Java directories containing the necessary DLLs to PATH is
a must.
Notes for Python 2.3
--------------------
To use JCC with Python 2.3, setuptools is required:
- download setuptools from http://python.org/pypi
- edit the downloaded setuptools egg file to use python2.3 instead of
python2.4
- sudo sh setuptools-0.6c7-py2.4.egg
Metadata-Version: 1.0
Name: JCC
Version: 1.9
Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN
Author: Andi Vajda
Author-email: vajda@osafoundation.org
License: UNKNOWN
Description:
JCC is a C++ code generator for producing the glue code necessary to call
into Java classes from CPython via Java's Native Invocation Interface (JNI).
JCC generates C++ wrapper classes that hide all the gory details of JNI
access as well Java memory and object reference management.
JCC generates CPython types that make these C++ classes accessible from a
Python interpreter. JCC attempts to make these Python types pythonic by
detecting iterators and property accessors. Iterators and mappings may also
be declared to JCC.
JCC has been built on Python 2.3, 2.4 and 2.5 and has been used with various
Java Runtime Environments such as Sun Java 1.4, 1.5 and 1.6, Apple's Java
1.4 and 1.5 on Mac OS X and open source Java OpenJDK 1.7 builds.
JCC is known to work on Intel and PowerPC Mac OS X 10.3, 10.4 and 10.5,
Ubuntu Linux Dapper, Feisty and Gutsy, Sun Solaris Express, Windows 2000 and
Windows XP.
JCC is written in C++ and Python. It uses Java's reflection API to do its
job and needs a Java Runtime Environment to be present to operate.
JCC is built with distutils::
python setup.py build
sudo python setup.py install
The setuptools package is required to build JCC on Python 2.3.
Except for Mac OS X - where Apple's Java comes pre-installed in a known
framework location - JCC's setup.py file needs to be edited before being
built to specify the location of the Java Runtime Environment's header files
and libraries.
The svn sources for JCC are available at:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/
For more information about JCC see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/INSTALL
For the changes since earlier releases, see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/CHANGES
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C++
Classifier: Programming Language :: Java
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Java Libraries
CHANGES
DESCRIPTION
INSTALL
LICENSE
README
setup.py
JCC.egg-info/PKG-INFO
JCC.egg-info/SOURCES.txt
JCC.egg-info/dependency_links.txt
JCC.egg-info/native_libs.txt
JCC.egg-info/not-zip-safe
JCC.egg-info/top_level.txt
_jcc/boot.cpp
_jcc/java/lang/Boolean.cpp
_jcc/java/lang/Boolean.h
_jcc/java/lang/Class.cpp
_jcc/java/lang/Class.h
_jcc/java/lang/Double.cpp
_jcc/java/lang/Double.h
_jcc/java/lang/Exception.cpp
_jcc/java/lang/Exception.h
_jcc/java/lang/Integer.cpp
_jcc/java/lang/Integer.h
_jcc/java/lang/Long.cpp
_jcc/java/lang/Long.h
_jcc/java/lang/Object.cpp
_jcc/java/lang/Object.h
_jcc/java/lang/RuntimeException.cpp
_jcc/java/lang/RuntimeException.h
_jcc/java/lang/String.cpp
_jcc/java/lang/String.h
_jcc/java/lang/Throwable.cpp
_jcc/java/lang/Throwable.h
_jcc/java/lang/__init__.cpp
_jcc/java/lang/reflect/Constructor.cpp
_jcc/java/lang/reflect/Constructor.h
_jcc/java/lang/reflect/Field.cpp
_jcc/java/lang/reflect/Field.h
_jcc/java/lang/reflect/Method.cpp
_jcc/java/lang/reflect/Method.h
_jcc/java/lang/reflect/Modifier.cpp
_jcc/java/lang/reflect/Modifier.h
_jcc/java/lang/reflect/__init__.cpp
_jcc/java/util/Enumeration.cpp
_jcc/java/util/Enumeration.h
_jcc/java/util/Iterator.cpp
_jcc/java/util/Iterator.h
jcc/__init__.py
jcc/config.py
jcc/cpp.py
jcc/python.py
jcc/sources/JArray.h
jcc/sources/JCCEnv.cpp
jcc/sources/JCCEnv.h
jcc/sources/JObject.cpp
jcc/sources/JObject.h
jcc/sources/functions.cpp
jcc/sources/functions.h
jcc/sources/jcc.cpp
jcc/sources/jccfuncs.h
jcc/sources/macros.h
jcc/sources/types.cpp
libjcc.dylib
jcc/_jcc.so
/* ====================================================================
* Copyright (c) 2004 - 2007 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Metadata-Version: 1.0
Name: JCC
Version: 1.9
Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN
Author: Andi Vajda
Author-email: vajda@osafoundation.org
License: UNKNOWN
Description:
JCC is a C++ code generator for producing the glue code necessary to call
into Java classes from CPython via Java's Native Invocation Interface (JNI).
JCC generates C++ wrapper classes that hide all the gory details of JNI
access as well Java memory and object reference management.
JCC generates CPython types that make these C++ classes accessible from a
Python interpreter. JCC attempts to make these Python types pythonic by
detecting iterators and property accessors. Iterators and mappings may also
be declared to JCC.
JCC has been built on Python 2.3, 2.4 and 2.5 and has been used with various
Java Runtime Environments such as Sun Java 1.4, 1.5 and 1.6, Apple's Java
1.4 and 1.5 on Mac OS X and open source Java OpenJDK 1.7 builds.
JCC is known to work on Intel and PowerPC Mac OS X 10.3, 10.4 and 10.5,
Ubuntu Linux Dapper, Feisty and Gutsy, Sun Solaris Express, Windows 2000 and
Windows XP.
JCC is written in C++ and Python. It uses Java's reflection API to do its
job and needs a Java Runtime Environment to be present to operate.
JCC is built with distutils::
python setup.py build
sudo python setup.py install
The setuptools package is required to build JCC on Python 2.3.
Except for Mac OS X - where Apple's Java comes pre-installed in a known
framework location - JCC's setup.py file needs to be edited before being
built to specify the location of the Java Runtime Environment's header files
and libraries.
The svn sources for JCC are available at:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/
For more information about JCC see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/INSTALL
For the changes since earlier releases, see:
http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/CHANGES
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C++
Classifier: Programming Language :: Java
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Java Libraries
This diff is collapsed.
#include <jni.h>
#include <Python.h>
#include "java/lang/Class.h"
#include "java/lang/RuntimeException.h"
#include "macros.h"
extern PyTypeObject JObjectType, JCCEnvType, ConstVariableDescriptorType;
PyObject *initVM(PyObject *self, PyObject *args, PyObject *kwds);
namespace java {
namespace lang {
void __install__(PyObject *m);
}
}
PyObject *__initialize__(PyObject *module, PyObject *args, PyObject *kwds)
{
PyObject *env = initVM(module, args, kwds);
if (env == NULL)
return NULL;
java::lang::Class::initializeClass();
java::lang::RuntimeException::initializeClass();
return env;
}
#include "jccfuncs.h"
extern "C" {
void init_jcc(void)
{
PyObject *m = Py_InitModule3("_jcc", jcc_funcs, "_jcc");
INSTALL_TYPE(JObject, m);
INSTALL_TYPE(JCCEnv, m);
INSTALL_TYPE(ConstVariableDescriptor, m);
java::lang::__install__(m);
}
}
/* ====================================================================
* Copyright (c) 2007-2007 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
#include <jni.h>
#include "JCCEnv.h"
#include "java/lang/Object.h"
#include "java/lang/Class.h"
#include "java/lang/Boolean.h"
namespace java {
namespace lang {
enum {
max_mid
};
Class *Boolean::class$ = NULL;
jmethodID *Boolean::_mids = NULL;
Boolean *Boolean::TRUE = NULL;
Boolean *Boolean::FALSE = NULL;
jclass Boolean::initializeClass()
{
if (!class$)
{
jclass cls = env->findClass("java/lang/Boolean");
_mids = new jmethodID[max_mid];
class$ = (Class *) new JObject(cls);
FALSE = new Boolean(env->getStaticObjectField(cls, "FALSE", "Ljava/lang/Boolean;"));
TRUE = new Boolean(env->getStaticObjectField(cls, "TRUE", "Ljava/lang/Boolean;"));
}
return (jclass) class$->this$;
}
}
}
#include "structmember.h"
#include "functions.h"
#include "macros.h"
namespace java {
namespace lang {
static PyMethodDef t_Boolean__methods_[] = {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Boolean, t_Boolean, Object, java::lang::Boolean,
abstract_init, 0, 0, 0, 0, 0);
}
}
/* ====================================================================
* Copyright (c) 2007-2007 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
#ifndef _Boolean_H
#define _Boolean_H
#include <Python.h>
#include "java/lang/Object.h"
#include "java/lang/Class.h"
namespace java {
namespace lang {
class Boolean : public Object {
public:
static Class *class$;
static jmethodID *_mids;
static jclass initializeClass();
explicit Boolean(jobject obj) : Object(obj) {
initializeClass();
}
static Boolean *TRUE;
static Boolean *FALSE;
};
extern PyTypeObject BooleanType;
class t_Boolean {
public:
PyObject_HEAD
Boolean object;
static PyObject *wrapObject(const Boolean& object);
};
}
}
#endif /* _Boolean_H */
This diff is collapsed.
/* ====================================================================
* Copyright (c) 2007-2007 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
#ifndef _Class_H
#define _Class_H
#include <Python.h>
#include "JArray.h"
#include "java/lang/Object.h"
namespace java {
namespace lang {
namespace reflect {
class Method;
class Constructor;
class Field;
}
using namespace reflect;
class Class : public Object {
public:
static Class *class$;
static jmethodID *_mids;
static jclass initializeClass();
explicit Class(jobject obj) : Object(obj) {
initializeClass();
}
Class(const Class& obj) : Object(obj) {}
static Class forName(const String& className);
JArray<Method> getDeclaredMethods() const;
JArray<Method> getMethods() const;
Method getMethod(const String &name, const JArray<Class>& params) const;
Method getDeclaredMethod(const String &name, const JArray<Class>& params) const;
JArray<Constructor> getDeclaredConstructors() const;
JArray<Field> getDeclaredFields() const;
JArray<Class> getDeclaredClasses() const;
int isArray() const;
int isPrimitive() const;
int isInterface() const;
int isAssignableFrom(const Class& obj) const;
Class getComponentType() const;
Class getSuperclass() const;
JArray<Class> getInterfaces() const;
String getName() const;
int getModifiers() const;
int isInstance(const Object &obj) const;
};
extern PyTypeObject ClassType;
class t_Class {
public:
PyObject_HEAD
Class object;
static PyObject *wrapObject(const Class& object);
};
}
}
#endif /* _Class_H */
/* ====================================================================
* Copyright (c) 2007-2007 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
#include <jni.h>
#include "JCCEnv.h"
#include "java/lang/Object.h"
#include "java/lang/Class.h"
#include "java/lang/Double.h"
namespace java {
namespace lang {
enum {
mid__init_,
max_mid
};
Class *Double::class$ = NULL;
jmethodID *Double::_mids = NULL;
jclass Double::initializeClass()
{
if (!class$)
{
jclass cls = env->findClass("java/lang/Double");
_mids = new jmethodID[max_mid];
_mids[mid__init_] = env->getMethodID(cls, "<init>", "(D)V");
class$ = (Class *) new JObject(cls);
}
return (jclass) class$->this$;
}
Double::Double(jdouble n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
}