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/12/09 22:44:46 UTC
svn commit: r1044137 - in /lucene/pylucene/trunk/jcc: CHANGES
jcc/sources/JCCEnv.cpp
Author: vajda
Date: Thu Dec 9 21:44:46 2010
New Revision: 1044137
URL: http://svn.apache.org/viewvc?rev=1044137&view=rev
Log:
- fixed bug with faulty Java version logic causing crashes with Java 1.5
Modified:
lucene/pylucene/trunk/jcc/CHANGES
lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp
Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=1044137&r1=1044136&r2=1044137&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Thu Dec 9 21:44:46 2010
@@ -5,6 +5,7 @@ Version 2.6 -> 2.7
- improved --exclude logic to also exclude inner classes of excluded classes
- changed darwin Java headers default location to path under /Developer
- moved --find-jvm-dll logic to __init__.py to accomodate Python 2.7
+ - fixed bug with faulty Java version logic causing crashes with Java 1.5
Version 2.5 -> 2.6
------------------
Modified: lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp?rev=1044137&r1=1044136&r2=1044137&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/JCCEnv.cpp Thu Dec 9 21:44:46 2010
@@ -110,20 +110,25 @@ void JCCEnv::set_vm(JavaVM *vm, JNIEnv *
vm_env->GetMethodID(_obj, "getClass",
"()Ljava/lang/Class;");
- if (vm_env->GetVersion() >= 0x00010005)
+
+ jclass iterable = vm_env->FindClass("java/lang/Iterable");
+
+ if (iterable == NULL) /* JDK < 1.5 */
+ {
+ vm_env->ExceptionClear();
+ _mids[mid_iterator] = NULL;
+ _mids[mid_iterator_next] = NULL;
+ }
+ else
{
_mids[mid_iterator] =
- vm_env->GetMethodID(vm_env->FindClass("java/lang/Iterable"),
+ vm_env->GetMethodID(iterable,
"iterator", "()Ljava/util/Iterator;");
_mids[mid_iterator_next] =
vm_env->GetMethodID(vm_env->FindClass("java/util/Iterator"),
"next", "()Ljava/lang/Object;");
}
- else
- {
- _mids[mid_iterator] = NULL;
- _mids[mid_iterator_next] = NULL;
- }
+
_mids[mid_enumeration_nextElement] =
vm_env->GetMethodID(vm_env->FindClass("java/util/Enumeration"),