From b2632cd0bc52b4783b4ec94020ff97c0cef6f238 Mon Sep 17 00:00:00 2001 From: Gabriel Pettier Date: Sun, 8 Dec 2019 00:00:50 +0100 Subject: [PATCH] Avoid replacing existing fields with getter methods from @dschiller & @jianbing https://github.com/kivy/pyjnius/issues/405 --- jnius/reflect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jnius/reflect.py b/jnius/reflect.py index 003e7fb..a43325a 100644 --- a/jnius/reflect.py +++ b/jnius/reflect.py @@ -239,8 +239,9 @@ def autoclass(clsname): classDict[name] = (JavaStaticMethod if static else JavaMethod)(sig, varargs=varargs) if name != 'getClass' and bean_getter(name) and len(method.getParameterTypes()) == 0: lowername = lower_name(name[2 if name.startswith('is') else 3:]) - classDict[lowername] = (lambda n: property(lambda self: getattr(self, n)()))(name) - continue + if lowername not in methods_name: + classDict[lowername] = (lambda n: property(lambda self: getattr(self, n)()))(name) + continue # multiple signatures signatures = []