Message5885

Author zyasoft
Recipients zyasoft
Date 2010-07-09.14:47:43
SpamBayes Score 0.028312635
Marked as misclassified No
Message-id <1278686864.08.0.336875225827.issue1631@psf.upfronthosting.co.za>
In-reply-to
Content
Workaround as discussed in my email on jython-users:

from java.util import LinkedHashMap

def monkeypatch_method_if_not_set(cls):
    def decorator(func):
        if not hasattr(cls, func.__name__):
            setattr(cls, func.__name__, func)
        return func
    return decorator

@monkeypatch_method_if_not_set(LinkedHashMap)
def iteritems(self):
    return ((entry.getKey(), entry.getValue()) for entry in self.entrySet())

# equivalent functionality - we will do a similar type of guard
try:
    LinkedHashMap.update
except AttributeError:
    LinkedHashMap.update = LinkedHashMap.putAll
    LinkedHashMap.iterkeys = LinkedHashMap.keySet
    LinkedHashMap.itervalues = LinkedHashMap.values

# etc

Implement something like this directly in the proxy generation.
History
Date User Action Args
2010-07-09 14:47:44zyasoftsetrecipients: + zyasoft
2010-07-09 14:47:44zyasoftsetmessageid: <1278686864.08.0.336875225827.issue1631@psf.upfronthosting.co.za>
2010-07-09 14:47:44zyasoftlinkissue1631 messages
2010-07-09 14:47:43zyasoftcreate