Title: Only methods present at class creation time added to proxy classes
Type: Severity: normal
Components: Versions: Jython 2.7, Jython 2.5
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, crankycoder, fwierzbicki, zyasoft
Priority: Keywords:

Created on 2009-04-27.01:04:51 by cgroves, last changed 2014-06-18.19:38:40 by zyasoft.

msg4599 (view) Author: Charlie Groves (cgroves) Date: 2009-04-27.01:04:51
When Java proxy classes are generated for python classes, they only create overriding Java methods for method names 
present in the Python class at the time of creation.  This means if someone adds methods to an instance of a Python 
subclass of a Java class and expects them to be called from Java as it would be from a regular python class, it won't 
happen.  It also means __getattr__ and the like won't work for overriding Java methods unless the name was present at 
the time of creation.

This has been the case since the beginning of time, and fixing it would slowdown Python subclasses of Java -- this 
would cause a Python lookup every time a method is invoked in Java -- but it seems like the right thing to do to keep 
from surprising people.  The obvious thing to do is to eliminate addMethod in JavaMaker, and add some checking to 
ProxyMaker to keep it from generating overriding methods for the proxy methods it already adds.  Unfortunately this 
generates some stack-busting recursion in constructors that I haven't looked into, and it's probably too close to 2.5 
to do this anyway.
msg8509 (view) Author: Jim Baker (zyasoft) Date: 2014-05-21.23:55:41
This should be addressed with Clamp instead.
Date User Action Args
2014-06-18 19:38:40zyasoftsetstatus: open -> closed
resolution: wont fix
2014-05-21 23:55:41zyasoftsetmessages: + msg8509
2014-05-04 20:39:01zyasoftsetnosy: + zyasoft
2013-02-19 18:22:22fwierzbickisetversions: + Jython 2.5, Jython 2.7
2009-08-18 21:29:10crankycodersetnosy: + crankycoder
2009-08-06 02:14:18fwierzbickisetnosy: + fwierzbicki
2009-04-27 01:04:51cgrovescreate