lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1514986 - in /lucene/pylucene/branches/pylucene_4_3/jcc: CHANGES _jcc/java/lang/reflect/Method.cpp _jcc/java/lang/reflect/Method.h jcc/cpp.py
Date Sat, 17 Aug 2013 12:35:14 GMT
Author: vajda
Date: Sat Aug 17 12:35:13 2013
New Revision: 1514986

URL: http://svn.apache.org/r1514986
Log:
 - added skipping of synthetic methods

Modified:
    lucene/pylucene/branches/pylucene_4_3/jcc/CHANGES
    lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.cpp
    lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.h
    lucene/pylucene/branches/pylucene_4_3/jcc/jcc/cpp.py

Modified: lucene/pylucene/branches/pylucene_4_3/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_3/jcc/CHANGES?rev=1514986&r1=1514985&r2=1514986&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_3/jcc/CHANGES (original)
+++ lucene/pylucene/branches/pylucene_4_3/jcc/CHANGES Sat Aug 17 12:35:13 2013
@@ -1,6 +1,7 @@
 Version 2.16 -> 2.17
 --------------------
  - added support for detecting and running with Oracle JDK 7 on Mac OS X
+ - added skipping of synthetic methods
  - 
 
 Version 2.15 -> 2.16

Modified: lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.cpp?rev=1514986&r1=1514985&r2=1514986&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.cpp (original)
+++ lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.cpp Sat Aug 17
12:35:13 2013
@@ -36,6 +36,8 @@ namespace java {
                 mid_getParameterTypes,
                 mid_getExceptionTypes,
                 mid_getDeclaringClass,
+                mid_isSynthetic,
+                mid_isBridge,
 #ifdef _java_generics
                 mid_getTypeParameters,
                 mid_getGenericExceptionTypes,
@@ -76,6 +78,12 @@ namespace java {
                     _mids[mid_getDeclaringClass] =
                         env->getMethodID(cls, "getDeclaringClass",
                                          "()Ljava/lang/Class;");
+                    _mids[mid_isSynthetic] =
+                        env->getMethodID(cls, "isSynthetic",
+                                         "()Z");
+                    _mids[mid_isBridge] =
+                        env->getMethodID(cls, "isBridge",
+                                         "()Z");
 #ifdef _java_generics
                     _mids[mid_getTypeParameters] =
                         env->getMethodID(cls, "getTypeParameters",
@@ -133,6 +141,16 @@ namespace java {
                 return Class(env->callObjectMethod(this$, _mids[mid_getDeclaringClass]));
             }
 
+            bool Method::isSynthetic() const
+            {
+                return env->callBooleanMethod(this$, _mids[mid_isSynthetic]);
+            }
+
+            bool Method::isBridge() const
+            {
+                return env->callBooleanMethod(this$, _mids[mid_isBridge]);
+            }
+
 #ifdef _java_generics
             JArray<TypeVariable> Method::getTypeParameters() const
             {
@@ -175,6 +193,8 @@ namespace java {
             static PyObject *t_Method_getParameterTypes(t_Method *self);
             static PyObject *t_Method_getExceptionTypes(t_Method *self);
             static PyObject *t_Method_getDeclaringClass(t_Method *self);
+            static PyObject *t_Method_isSynthetic(t_Method *self);
+            static PyObject *t_Method_isBridge(t_Method *self);
 #ifdef _java_generics
             static PyObject *t_Method_getTypeParameters(t_Method *self);
             static PyObject *t_Method_getGenericExceptionTypes(t_Method *self);
@@ -191,6 +211,8 @@ namespace java {
                 DECLARE_METHOD(t_Method, getParameterTypes, METH_NOARGS),
                 DECLARE_METHOD(t_Method, getExceptionTypes, METH_NOARGS),
                 DECLARE_METHOD(t_Method, getDeclaringClass, METH_NOARGS),
+                DECLARE_METHOD(t_Method, isSynthetic, METH_NOARGS),
+                DECLARE_METHOD(t_Method, isBridge, METH_NOARGS),
 #ifdef _java_generics
                 DECLARE_METHOD(t_Method, getTypeParameters, METH_NOARGS),
                 DECLARE_METHOD(t_Method, getGenericExceptionTypes, METH_NOARGS),
@@ -265,6 +287,22 @@ namespace java {
                 return t_Class::wrap_Object(cls);
             }
 
+            static PyObject *t_Method_isSynthetic(t_Method *self)
+            {
+                int isSynthetic;
+
+                OBJ_CALL(isSynthetic = self->object.isSynthetic());
+                Py_RETURN_BOOL(isSynthetic);
+            }
+
+            static PyObject *t_Method_isBridge(t_Method *self)
+            {
+                int isBridge;
+
+                OBJ_CALL(isBridge = self->object.isBridge());
+                Py_RETURN_BOOL(isBridge);
+            }
+
 #ifdef _java_generics
             static PyObject *t_Method_getTypeParameters(t_Method *self)
             {

Modified: lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.h?rev=1514986&r1=1514985&r2=1514986&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.h (original)
+++ lucene/pylucene/branches/pylucene_4_3/jcc/_jcc/java/lang/reflect/Method.h Sat Aug 17 12:35:13
2013
@@ -46,6 +46,8 @@ namespace java {
                 JArray<Class> getParameterTypes() const;
                 JArray<Class> getExceptionTypes() const;
                 Class getDeclaringClass() const;
+                bool isSynthetic() const;
+                bool isBridge() const;
 #ifdef _java_generics
                 JArray<TypeVariable> getTypeParameters() const;
                 JArray<Type> getGenericExceptionTypes() const;

Modified: lucene/pylucene/branches/pylucene_4_3/jcc/jcc/cpp.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_3/jcc/jcc/cpp.py?rev=1514986&r1=1514985&r2=1514986&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_3/jcc/jcc/cpp.py (original)
+++ lucene/pylucene/branches/pylucene_4_3/jcc/jcc/cpp.py Sat Aug 17 12:35:13 2013
@@ -776,6 +776,8 @@ def header(env, out, cls, typeset, packa
     methods = {}
     protectedMethods = []
     for method in cls.getDeclaredMethods():
+        if method.isSynthetic():
+            continue
         modifiers = method.getModifiers()
         if (Modifier.isPublic(modifiers) or
             method.getName() in listedMethodNames):



Mime
View raw message