lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1422457 - in /lucene/pylucene/trunk/jcc: CHANGES jcc/cpp.py
Date Sun, 16 Dec 2012 02:40:53 GMT
Author: vajda
Date: Sun Dec 16 02:40:52 2012
New Revision: 1422457

URL: http://svn.apache.org/viewvc?rev=1422457&view=rev
Log:
 - fixed bug with wrapping wrong clone() method in python extensions classes

Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/jcc/cpp.py

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=1422457&r1=1422456&r2=1422457&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Sun Dec 16 02:40:52 2012
@@ -3,6 +3,7 @@ Version 2.14 ->
  - improved JCC build on Linux by mokey patching setuptools (Caleb Burns)
  - fixed bug with wrapping arrays coming out of generic iterators
  - added support for wrapping non-public methods by listing them as class:method
+ - fixed bug with wrapping wrong clone() method in python extensions classes
  - 
 
 Version 2.13 -> 2.14

Modified: lucene/pylucene/trunk/jcc/jcc/cpp.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/cpp.py?rev=1422457&r1=1422456&r2=1422457&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/cpp.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/cpp.py Sun Dec 16 02:40:52 2012
@@ -787,6 +787,9 @@ def header(env, out, cls, typeset, packa
                          generics):
                 continue
             sig = "%s:%s" %(method.getName(), signature(method, True))
+            # Apparently, overridden clone() methods are still returned via
+            # getDeclaredMethods(), so keep the one with the more precise
+            # return type, equal to cls.
             if sig in methods and returnType != cls:
                 continue
             if generics:
@@ -1133,6 +1136,7 @@ def code(env, out, cls, superCls, constr
             this = 'cls'
             midns = ''
             const = ''
+            sig = signature(method)
         else:
             isStatic = False
             if superMethod is not None:
@@ -1140,13 +1144,14 @@ def code(env, out, cls, superCls, constr
                 this = 'this$, (jclass) %s::class$->this$' %(absname(cppnames(superNames)))
                 declaringClass = superMethod.getDeclaringClass()
                 midns = '%s::' %(typename(declaringClass, cls, False))
+                sig = signature(superMethod)
             else:
                 qualifier = ''
                 this = 'this$'
                 midns = ''
+                sig = signature(method)
             const = ' const'
 
-        sig = signature(method)
         decls, args = argnames(params, cls)
 
         line(out)



Mime
View raw message