You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-commits@lucene.apache.org by va...@apache.org on 2010/04/05 22:52:13 UTC

svn commit: r930958 - in /lucene/pylucene/trunk/jcc: ./ _jcc/java/lang/ jcc/ jcc/sources/

Author: vajda
Date: Mon Apr  5 20:52:13 2010
New Revision: 930958

URL: http://svn.apache.org/viewvc?rev=930958&view=rev
Log:
   - parameterized return values are now unboxed

Added:
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp   (with props)
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h   (with props)
Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.cpp
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.h
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp
    lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h
    lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp
    lucene/pylucene/trunk/jcc/jcc/python.py
    lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp
    lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.h
    lucene/pylucene/trunk/jcc/jcc/sources/functions.cpp
    lucene/pylucene/trunk/jcc/jcc/sources/functions.h

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Mon Apr  5 20:52:13 2010
@@ -10,6 +10,7 @@ Version 2.5 ->
  - fixed bug with not inheriting type parameters to inner parameterized classes
  - added support for of_() method to set instance type parameters
  - fixed bug with not heeding type parameter for --sequence get method
+ - parameterized return values are now unboxed
  - 
 
 Version 2.4 -> 2.5

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.cpp (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.cpp Mon Apr  5 20:52:13 2010
@@ -22,6 +22,7 @@ namespace java {
     namespace lang {
 
         enum {
+            mid_booleanValue,
             max_mid
         };
 
@@ -37,7 +38,11 @@ namespace java {
             {
                 jclass cls = env->findClass("java/lang/Boolean");
 
-                _mids = NULL;
+                _mids = new jmethodID[max_mid];
+                _mids[mid_booleanValue] =
+                    env->getMethodID(cls, "booleanValue",
+                                     "()Z");
+
                 class$ = (Class *) new JObject(cls);
 
                 FALSE = new Boolean(env->getStaticObjectField(cls, "FALSE", "Ljava/lang/Boolean;"));
@@ -46,6 +51,11 @@ namespace java {
 
             return (jclass) class$->this$;
         }
+
+        int Boolean::booleanValue() const
+        {
+            return (int) env->callBooleanMethod(this$, _mids[mid_booleanValue]);
+        }
     }
 }
 

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.h (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Boolean.h Mon Apr  5 20:52:13 2010
@@ -32,6 +32,8 @@ namespace java {
                 initializeClass();
             }
 
+            int booleanValue() const;
+
             static Boolean *TRUE;
             static Boolean *FALSE;
         };

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp Mon Apr  5 20:52:13 2010
@@ -0,0 +1,71 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Byte.h"
+
+namespace java {
+    namespace lang {
+
+        enum {
+            mid_byteValue,
+            max_mid
+        };
+
+        Class *Byte::class$ = NULL;
+        jmethodID *Byte::_mids = NULL;
+
+        jclass Byte::initializeClass()
+        {
+            if (!class$)
+            {
+                jclass cls = env->findClass("java/lang/Byte");
+
+                _mids = new jmethodID[max_mid];
+                _mids[mid_byteValue] =
+                    env->getMethodID(cls, "byteValue",
+                                     "()B");
+
+                class$ = (Class *) new JObject(cls);
+            }
+
+            return (jclass) class$->this$;
+        }
+
+        jbyte Byte::byteValue() const
+        {
+            return env->callByteMethod(this$, _mids[mid_byteValue]);
+        }
+    }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+    namespace lang {
+
+        static PyMethodDef t_Byte__methods_[] = {
+            { NULL, NULL, 0, NULL }
+        };
+
+        DECLARE_TYPE(Byte, t_Byte, Object, java::lang::Byte,
+                     abstract_init, 0, 0, 0, 0, 0);
+    }
+}

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h Mon Apr  5 20:52:13 2010
@@ -0,0 +1,50 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#ifndef _Byte_H
+#define _Byte_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+    namespace lang {
+
+        class Byte : public Object {
+        public:
+            static Class *class$;
+            static jmethodID *_mids;
+            static jclass initializeClass();
+
+            explicit Byte(jobject obj) : Object(obj) {
+                initializeClass();
+            }
+
+            jbyte byteValue() const;
+        };
+
+        extern PyTypeObject Byte$$Type;
+
+        class t_Byte {
+        public:
+            PyObject_HEAD
+            Byte object;
+            static PyObject *wrap_Object(const Byte& object);
+            static PyObject *wrap_jobject(const jobject& object);
+        };
+    }
+}
+
+#endif /* _Byte_H */

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Byte.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp Mon Apr  5 20:52:13 2010
@@ -0,0 +1,71 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Character.h"
+
+namespace java {
+    namespace lang {
+
+        enum {
+            mid_charValue,
+            max_mid
+        };
+
+        Class *Character::class$ = NULL;
+        jmethodID *Character::_mids = NULL;
+
+        jclass Character::initializeClass()
+        {
+            if (!class$)
+            {
+                jclass cls = env->findClass("java/lang/Character");
+
+                _mids = new jmethodID[max_mid];
+                _mids[mid_charValue] =
+                    env->getMethodID(cls, "charValue",
+                                     "()C");
+
+                class$ = (Class *) new JObject(cls);
+            }
+
+            return (jclass) class$->this$;
+        }
+
+        jchar Character::charValue() const
+        {
+            return env->callCharMethod(this$, _mids[mid_charValue]);
+        }
+    }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+    namespace lang {
+
+        static PyMethodDef t_Character__methods_[] = {
+            { NULL, NULL, 0, NULL }
+        };
+
+        DECLARE_TYPE(Character, t_Character, Object, java::lang::Character,
+                     abstract_init, 0, 0, 0, 0, 0);
+    }
+}

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h Mon Apr  5 20:52:13 2010
@@ -0,0 +1,50 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#ifndef _Character_H
+#define _Character_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+    namespace lang {
+
+        class Character : public Object {
+        public:
+            static Class *class$;
+            static jmethodID *_mids;
+            static jclass initializeClass();
+
+            explicit Character(jobject obj) : Object(obj) {
+                initializeClass();
+            }
+
+            jchar charValue() const;
+        };
+
+        extern PyTypeObject Character$$Type;
+
+        class t_Character {
+        public:
+            PyObject_HEAD
+            Character object;
+            static PyObject *wrap_Object(const Character& object);
+            static PyObject *wrap_jobject(const jobject& object);
+        };
+    }
+}
+
+#endif /* _Character_H */

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Character.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp Mon Apr  5 20:52:13 2010
@@ -23,6 +23,7 @@ namespace java {
 
         enum {
             mid__init_,
+            mid_doubleValue,
             max_mid
         };
 
@@ -37,6 +38,8 @@ namespace java {
 
                 _mids = new jmethodID[max_mid];
                 _mids[mid__init_] = env->getMethodID(cls, "<init>", "(D)V");
+                _mids[mid_doubleValue] =
+                    env->getMethodID(cls, "doubleValue", "()D");
 
                 class$ = (Class *) new JObject(cls);
             }
@@ -46,6 +49,11 @@ namespace java {
 
         Double::Double(jdouble n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
         }
+
+        jdouble Double::doubleValue() const
+        {
+            return env->callDoubleMethod(this$, _mids[mid_doubleValue]);
+        }
     }
 }
 

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h Mon Apr  5 20:52:13 2010
@@ -32,6 +32,8 @@ namespace java {
                 initializeClass();
             }
             Double(jdouble);
+
+            jdouble doubleValue() const;
         };
 
         extern PyTypeObject Double$$Type;

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp Mon Apr  5 20:52:13 2010
@@ -0,0 +1,71 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Float.h"
+
+namespace java {
+    namespace lang {
+
+        enum {
+            mid_floatValue,
+            max_mid
+        };
+
+        Class *Float::class$ = NULL;
+        jmethodID *Float::_mids = NULL;
+
+        jclass Float::initializeClass()
+        {
+            if (!class$)
+            {
+                jclass cls = env->findClass("java/lang/Float");
+
+                _mids = new jmethodID[max_mid];
+                _mids[mid_floatValue] =
+                    env->getMethodID(cls, "floatValue",
+                                     "()F");
+
+                class$ = (Class *) new JObject(cls);
+            }
+
+            return (jclass) class$->this$;
+        }
+
+        jfloat Float::floatValue() const
+        {
+            return env->callFloatMethod(this$, _mids[mid_floatValue]);
+        }
+    }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+    namespace lang {
+
+        static PyMethodDef t_Float__methods_[] = {
+            { NULL, NULL, 0, NULL }
+        };
+
+        DECLARE_TYPE(Float, t_Float, Object, java::lang::Float,
+                     abstract_init, 0, 0, 0, 0, 0);
+    }
+}

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h Mon Apr  5 20:52:13 2010
@@ -0,0 +1,50 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#ifndef _Float_H
+#define _Float_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+    namespace lang {
+
+        class Float : public Object {
+        public:
+            static Class *class$;
+            static jmethodID *_mids;
+            static jclass initializeClass();
+
+            explicit Float(jobject obj) : Object(obj) {
+                initializeClass();
+            }
+
+            jfloat floatValue() const;
+        };
+
+        extern PyTypeObject Float$$Type;
+
+        class t_Float {
+        public:
+            PyObject_HEAD
+            Float object;
+            static PyObject *wrap_Object(const Float& object);
+            static PyObject *wrap_jobject(const jobject& object);
+        };
+    }
+}
+
+#endif /* _Float_H */

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Float.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp Mon Apr  5 20:52:13 2010
@@ -23,6 +23,7 @@ namespace java {
 
         enum {
             mid__init_,
+            mid_intValue,
             max_mid
         };
 
@@ -37,6 +38,8 @@ namespace java {
 
                 _mids = new jmethodID[max_mid];
                 _mids[mid__init_] = env->getMethodID(cls, "<init>", "(I)V");
+                _mids[mid_intValue] =
+                    env->getMethodID(cls, "intValue", "()I");
 
                 class$ = (Class *) new JObject(cls);
             }
@@ -46,6 +49,11 @@ namespace java {
 
         Integer::Integer(jint n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
         }
+
+        jint Integer::intValue() const
+        {
+            return env->callIntMethod(this$, _mids[mid_intValue]);
+        }
     }
 }
 

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h Mon Apr  5 20:52:13 2010
@@ -32,6 +32,8 @@ namespace java {
                 initializeClass();
             }
             Integer(jint);
+
+            jint intValue() const;
         };
 
         extern PyTypeObject Integer$$Type;

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp Mon Apr  5 20:52:13 2010
@@ -23,6 +23,7 @@ namespace java {
 
         enum {
             mid__init_,
+            mid_longValue,
             max_mid
         };
 
@@ -37,6 +38,8 @@ namespace java {
 
                 _mids = new jmethodID[max_mid];
                 _mids[mid__init_] = env->getMethodID(cls, "<init>", "(J)V");
+                _mids[mid_longValue] =
+                    env->getMethodID(cls, "longValue", "()J");
 
                 class$ = (Class *) new JObject(cls);
             }
@@ -46,6 +49,11 @@ namespace java {
 
         Long::Long(jlong n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
         }
+
+        jlong Long::longValue() const
+        {
+            return env->callLongMethod(this$, _mids[mid_longValue]);
+        }
     }
 }
 

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h Mon Apr  5 20:52:13 2010
@@ -32,6 +32,8 @@ namespace java {
                 initializeClass();
             }
             Long(jlong);
+
+            jlong longValue() const;
         };
 
         extern PyTypeObject Long$$Type;

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp Mon Apr  5 20:52:13 2010
@@ -0,0 +1,71 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Short.h"
+
+namespace java {
+    namespace lang {
+
+        enum {
+            mid_shortValue,
+            max_mid
+        };
+
+        Class *Short::class$ = NULL;
+        jmethodID *Short::_mids = NULL;
+
+        jclass Short::initializeClass()
+        {
+            if (!class$)
+            {
+                jclass cls = env->findClass("java/lang/Short");
+
+                _mids = new jmethodID[max_mid];
+                _mids[mid_shortValue] =
+                    env->getMethodID(cls, "shortValue",
+                                     "()S");
+
+                class$ = (Class *) new JObject(cls);
+            }
+
+            return (jclass) class$->this$;
+        }
+
+        jshort Short::shortValue() const
+        {
+            return env->callShortMethod(this$, _mids[mid_shortValue]);
+        }
+    }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+    namespace lang {
+
+        static PyMethodDef t_Short__methods_[] = {
+            { NULL, NULL, 0, NULL }
+        };
+
+        DECLARE_TYPE(Short, t_Short, Object, java::lang::Short,
+                     abstract_init, 0, 0, 0, 0, 0);
+    }
+}

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h?rev=930958&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h Mon Apr  5 20:52:13 2010
@@ -0,0 +1,50 @@
+/*
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#ifndef _Short_H
+#define _Short_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+    namespace lang {
+
+        class Short : public Object {
+        public:
+            static Class *class$;
+            static jmethodID *_mids;
+            static jclass initializeClass();
+
+            explicit Short(jobject obj) : Object(obj) {
+                initializeClass();
+            }
+
+            jshort shortValue() const;
+        };
+
+        extern PyTypeObject Short$$Type;
+
+        class t_Short {
+        public:
+            PyObject_HEAD
+            Short object;
+            static PyObject *wrap_Object(const Short& object);
+            static PyObject *wrap_jobject(const jobject& object);
+        };
+    }
+}
+
+#endif /* _Short_H */

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Short.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp (original)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp Mon Apr  5 20:52:13 2010
@@ -25,9 +25,13 @@ namespace java {
         extern PyTypeObject Exception$$Type;
         extern PyTypeObject RuntimeException$$Type;
         extern PyTypeObject Boolean$$Type;
+        extern PyTypeObject Byte$$Type;
+        extern PyTypeObject Character$$Type;
         extern PyTypeObject Integer$$Type;
-        extern PyTypeObject Long$$Type;
         extern PyTypeObject Double$$Type;
+        extern PyTypeObject Float$$Type;
+        extern PyTypeObject Long$$Type;
+        extern PyTypeObject Short$$Type;
         
         namespace reflect {
             void __install__(PyObject *module);
@@ -42,9 +46,13 @@ namespace java {
             INSTALL_TYPE(Exception, m);
             INSTALL_TYPE(RuntimeException, m);
             INSTALL_TYPE(Boolean, m);
+            INSTALL_TYPE(Byte, m);
+            INSTALL_TYPE(Character, m);
+            INSTALL_TYPE(Double, m);
+            INSTALL_TYPE(Float, m);
             INSTALL_TYPE(Integer, m);
             INSTALL_TYPE(Long, m);
-            INSTALL_TYPE(Double, m);
+            INSTALL_TYPE(Short, m);
             reflect::__install__(m);
         }
     }

Modified: lucene/pylucene/trunk/jcc/jcc/python.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/python.py?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/python.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/python.py Mon Apr  5 20:52:13 2010
@@ -32,7 +32,7 @@ if python_ver < '2.4':
 
 
 RESULTS = { 'boolean': 'Py_RETURN_BOOL(%s);',
-            'byte': 'return PyInt_FromLong(%s);',
+            'byte': 'return PyInt_FromLong((long) %s);',
             'char': 'return PyUnicode_FromUnicode((Py_UNICODE *) &%s, 1);',
             'double': 'return PyFloat_FromDouble((double) %s);',
             'float': 'return PyFloat_FromDouble((double) %s);',
@@ -51,6 +51,16 @@ CALLARGS = { 'boolean': ('O', '(%s ? Py_
              'short': ('i', '(int) %s', False),
              'java.lang.String': ('O', 'env->fromJString((jstring) %s, 0)', True) }
 
+BOXED = set(('java.lang.Boolean',
+             'java.lang.Byte',
+             'java.lang.Char',
+             'java.lang.Double',
+             'java.lang.Float',
+             'java.lang.Integer',
+             'java.lang.Long',
+             'java.lang.Short',
+             'java.lang.String'))
+
 
 def getTypeParameters(cls):
 
@@ -971,8 +981,12 @@ def python(env, out_h, out, cls, superCl
     line(out, indent, '{')
     line(out, indent + 1, 'PyDict_SetItemString(%s$$Type.tp_dict, "class_", make_descriptor(%s::initializeClass, %s));',
          names[-1], cppname(names[-1]), generics and 1 or 0)
-    line(out, indent + 1, 'PyDict_SetItemString(%s$$Type.tp_dict, "wrapfn_", make_descriptor(t_%s::wrap_jobject));',
-         names[-1], names[-1])
+
+    if cls.getName() in BOXED:
+        wrapfn_ = "unbox%s" %(names[-1])
+    else:
+        wrapfn_ = "t_%s::wrap_jobject" %(names[-1])
+    line(out, indent + 1, 'PyDict_SetItemString(%s$$Type.tp_dict, "wrapfn_", make_descriptor(%s));', names[-1], wrapfn_)
 
     if isExtension:
         line(out, indent + 1, 'jclass cls = %s::initializeClass();',

Modified: lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp Mon Apr  5 20:52:13 2010
@@ -89,6 +89,16 @@ void JCCEnv::set_vm(JavaVM *vm, JNIEnv *
 #else
     _thr = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/RuntimeException"));
 #endif
+
+    _Boolean = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Boolean"));
+    _Byte = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Byte"));
+    _Character = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Character"));
+    _Double = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Double"));
+    _Float = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Float"));
+    _Integer = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Integer"));
+    _Long = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Long"));
+    _Short = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/Short"));
+
     _mids = new jmethodID[max_mid];
 
     _mids[mid_sys_identityHashCode] =
@@ -116,6 +126,23 @@ void JCCEnv::set_vm(JavaVM *vm, JNIEnv *
     _mids[mid_enumeration_nextElement] =
         vm_env->GetMethodID(vm_env->FindClass("java/util/Enumeration"),
                             "nextElement", "()Ljava/lang/Object;");
+
+    _mids[mid_Boolean_booleanValue] =
+        vm_env->GetMethodID(_Boolean, "booleanValue", "()Z");
+    _mids[mid_Byte_byteValue] = 
+        vm_env->GetMethodID(_Byte, "byteValue", "()B");
+    _mids[mid_Character_charValue] =
+        vm_env->GetMethodID(_Character, "charValue", "()C");
+    _mids[mid_Double_doubleValue] = 
+        vm_env->GetMethodID(_Double, "doubleValue", "()D");
+    _mids[mid_Float_floatValue] =
+        vm_env->GetMethodID(_Float, "floatValue", "()F");
+    _mids[mid_Integer_intValue] = 
+        vm_env->GetMethodID(_Integer, "intValue", "()I");
+    _mids[mid_Long_longValue] = 
+        vm_env->GetMethodID(_Long, "longValue", "()J");
+    _mids[mid_Short_shortValue] = 
+        vm_env->GetMethodID(_Short, "shortValue", "()S");
 }
 
 #if defined(_MSC_VER) || defined(__WIN32)
@@ -160,7 +187,7 @@ jobject JCCEnv::enumerationNext(jobject 
     return callObjectMethod(obj, _mids[mid_enumeration_nextElement]);
 }
 
-jboolean JCCEnv::isInstanceOf(jobject obj, jclass (*initializeClass)())
+jboolean JCCEnv::isInstanceOf(jobject obj, getclassfn initializeClass) const
 {
     return get_vm_env()->IsInstanceOf(obj, (*initializeClass)());
 }
@@ -290,7 +317,7 @@ jobject JCCEnv::deleteGlobalRef(jobject 
     return NULL;
 }
 
-jobject JCCEnv::newObject(jclass (*initializeClass)(), jmethodID **mids,
+jobject JCCEnv::newObject(getclassfn initializeClass, jmethodID **mids,
                           int m, ...)
 {
     jclass cls = (*initializeClass)();
@@ -507,6 +534,47 @@ void JCCEnv::callStaticVoidMethod(jclass
 }
 
 
+jboolean JCCEnv::booleanValue(jobject obj) const
+{
+    return get_vm_env()->CallBooleanMethod(obj, _mids[mid_Boolean_booleanValue]);
+}
+
+jbyte JCCEnv::byteValue(jobject obj) const
+{
+    return get_vm_env()->CallByteMethod(obj, _mids[mid_Byte_byteValue]);
+}
+
+jchar JCCEnv::charValue(jobject obj) const
+{
+    return get_vm_env()->CallCharMethod(obj, _mids[mid_Character_charValue]);
+}
+
+jdouble JCCEnv::doubleValue(jobject obj) const
+{
+    return get_vm_env()->CallDoubleMethod(obj, _mids[mid_Double_doubleValue]);
+}
+
+jfloat JCCEnv::floatValue(jobject obj) const
+{
+    return get_vm_env()->CallFloatMethod(obj, _mids[mid_Float_floatValue]);
+}
+
+jint JCCEnv::intValue(jobject obj) const
+{
+    return get_vm_env()->CallIntMethod(obj, _mids[mid_Integer_intValue]);
+}
+
+jlong JCCEnv::longValue(jobject obj) const
+{
+    return get_vm_env()->CallLongMethod(obj, _mids[mid_Long_longValue]);
+}
+
+jshort JCCEnv::shortValue(jobject obj) const
+{
+    return get_vm_env()->CallShortMethod(obj, _mids[mid_Short_shortValue]);
+}
+
+
 jmethodID JCCEnv::getMethodID(jclass cls, const char *name,
                               const char *signature) const
 {

Modified: lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.h (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.h Mon Apr  5 20:52:13 2010
@@ -67,6 +67,7 @@ extern JCCEnv *env;
 
 #endif
 
+typedef jclass (*getclassfn)(void);
 
 class countedRef {
 public:
@@ -77,6 +78,7 @@ public:
 class _DLL_EXPORT JCCEnv {
 protected:
     jclass _sys, _obj, _thr;
+    jclass _Boolean, _Byte, _Character, _Double, _Float, _Integer, _Long, _Short;
     jmethodID *_mids;
 
     enum {
@@ -88,6 +90,14 @@ protected:
         mid_obj_getClass,
         mid_iterator_next,
         mid_enumeration_nextElement,
+        mid_Boolean_booleanValue,
+        mid_Byte_byteValue,
+        mid_Character_charValue,
+        mid_Double_doubleValue,
+        mid_Float_floatValue,
+        mid_Integer_intValue,
+        mid_Long_longValue,
+        mid_Short_shortValue,
         max_mid
     };
 
@@ -137,7 +147,8 @@ public:
     virtual jstring getJavaVersion() const;
 
     virtual jclass findClass(const char *className) const;
-    virtual jboolean isInstanceOf(jobject obj, jclass (*initializeClass)());
+    virtual jboolean isInstanceOf(jobject obj,
+                                  getclassfn initializeClass) const;
 
     virtual void registerNatives(jclass cls, JNINativeMethod *methods,
                                  int n) const;
@@ -148,7 +159,7 @@ public:
     virtual jobject newGlobalRef(jobject obj, int id);
     virtual jobject deleteGlobalRef(jobject obj, int id);
 
-    virtual jobject newObject(jclass (*initializeClass)(), jmethodID **mids,
+    virtual jobject newObject(getclassfn initializeClass, jmethodID **mids,
                               int m, ...);
 
     virtual jobjectArray newObjectArray(jclass cls, int size);
@@ -212,6 +223,15 @@ public:
     virtual void callStaticVoidMethod(jclass cls,
                                       jmethodID mid, ...) const;
 
+    virtual jboolean booleanValue(jobject obj) const;
+    virtual jbyte byteValue(jobject obj) const;
+    virtual jchar charValue(jobject obj) const;
+    virtual jdouble doubleValue(jobject obj) const;
+    virtual jfloat floatValue(jobject obj) const;
+    virtual jint intValue(jobject obj) const;
+    virtual jlong longValue(jobject obj) const;
+    virtual jshort shortValue(jobject obj) const;
+
     virtual jmethodID getMethodID(jclass cls, const char *name,
                                   const char *signature) const;
     virtual jfieldID getFieldID(jclass cls, const char *name,

Modified: lucene/pylucene/trunk/jcc/jcc/sources/functions.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/functions.cpp?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/functions.cpp (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/functions.cpp Mon Apr  5 20:52:13 2010
@@ -20,9 +20,13 @@
 #include "java/lang/String.h"
 #include "java/lang/Throwable.h"
 #include "java/lang/Boolean.h"
+#include "java/lang/Byte.h"
+#include "java/lang/Character.h"
+#include "java/lang/Double.h"
+#include "java/lang/Float.h"
 #include "java/lang/Integer.h"
 #include "java/lang/Long.h"
-#include "java/lang/Double.h"
+#include "java/lang/Short.h"
 #include "java/util/Iterator.h"
 #include "JArray.h"
 #include "functions.h"
@@ -1156,26 +1160,12 @@ PyObject *castCheck(PyObject *obj, getcl
 
     jobject jobj = ((t_Object *) obj)->object.this$;
 
-    if (jobj)
+    if (jobj && !env->isInstanceOf(jobj, initializeClass))
     {
-        jclass cls;
-
-        try {
-            cls = (*initializeClass)();
-        } catch (JCCEnv::pythonError e) {
-            return NULL;
-        } catch (JCCEnv::exception e) {
-            PyErr_SetJavaError(e.throwable);
-            return NULL;
-        }
-
-        if (!env->get_vm_env()->IsInstanceOf(jobj, cls))
-        {
-            if (reportError)
-                PyErr_SetObject(PyExc_TypeError, obj);
+        if (reportError)
+            PyErr_SetObject(PyExc_TypeError, obj);
 
-            return NULL;
-        }
+        return NULL;
     }
 
     return obj;
@@ -1291,6 +1281,163 @@ PyObject *wrapType(PyTypeObject *type, c
     return wrapfn(obj);
 }
 
+PyObject *unboxBoolean(const jobject& obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Boolean::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Boolean$$Type);
+            return NULL;
+        }
+        
+        if (env->booleanValue(obj))
+            Py_RETURN_TRUE;
+
+        Py_RETURN_FALSE;
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxByte(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Byte::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Byte$$Type);
+            return NULL;
+        }
+        
+        return PyInt_FromLong((long) env->byteValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxChar(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Character::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Character$$Type);
+            return NULL;
+        }
+        
+        jchar c = env->charValue(obj);
+        return PyUnicode_FromUnicode((Py_UNICODE *) &c, 1);
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxDouble(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Double::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Double$$Type);
+            return NULL;
+        }
+        
+        return PyFloat_FromDouble((double) env->doubleValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxFloat(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Float::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Float$$Type);
+            return NULL;
+        }
+        
+        return PyFloat_FromDouble((double) env->floatValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxInteger(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Integer::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Integer$$Type);
+            return NULL;
+        }
+        
+        return PyInt_FromLong((long) env->intValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxLong(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Long::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Long$$Type);
+            return NULL;
+        }
+        
+        return PyLong_FromLongLong((PY_LONG_LONG) env->longValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxShort(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::Short::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::Short$$Type);
+            return NULL;
+        }
+        
+        return PyInt_FromLong((long) env->shortValue(obj));
+    }
+
+    Py_RETURN_NONE;
+}
+
+PyObject *unboxString(const jobject &obj)
+{
+    if (obj != NULL)
+    {
+        if (!env->isInstanceOf(obj, java::lang::String::initializeClass))
+        {
+            PyErr_SetObject(PyExc_TypeError,
+                            (PyObject *) &java::lang::String$$Type);
+            return NULL;
+        }
+        
+        return env->fromJString((jstring) obj, 0);
+    }
+
+    Py_RETURN_NONE;
+}
+
 #ifdef _java_generics
 PyObject *typeParameters(PyTypeObject *types[], size_t size)
 {

Modified: lucene/pylucene/trunk/jcc/jcc/sources/functions.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/functions.h?rev=930958&r1=930957&r2=930958&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/functions.h (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/functions.h Mon Apr  5 20:52:13 2010
@@ -30,7 +30,6 @@ typedef intobjargproc ssizeobjargproc;
 typedef intintobjargproc ssizessizeobjargproc;
 #endif
 
-typedef jclass (*getclassfn)(void);
 typedef PyTypeObject **(*getparametersfn)(void *);
 
 PyObject *PyErr_SetArgsError(char *name, PyObject *args);
@@ -72,6 +71,16 @@ int _parseArgs(PyObject **args, unsigned
 int abstract_init(PyObject *self, PyObject *args, PyObject *kwds);
 PyObject *wrapType(PyTypeObject *type, const jobject& obj);
 
+PyObject *unboxBoolean(const jobject& obj);
+PyObject *unboxByte(const jobject &obj);
+PyObject *unboxChar(const jobject &obj);
+PyObject *unboxDouble(const jobject &obj);
+PyObject *unboxFloat(const jobject &obj);
+PyObject *unboxInteger(const jobject &obj);
+PyObject *unboxLong(const jobject &obj);
+PyObject *unboxShort(const jobject &obj);
+PyObject *unboxString(const jobject &obj);
+
 PyObject *j2p(const java::lang::String& js);
 java::lang::String p2j(PyObject *object);