Message9024

Author zyasoft
Recipients akong, cgroves, fwierzbicki, pjenvey, seanj, zyasoft
Date 2014-09-24.03:36:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411529781.54.0.0643434020189.issue1561@psf.upfronthosting.co.za>
In-reply-to
Content
Let's look at the output of the proxy maker for a class implementing Callable:

    public Object call() throws Exception {
        final PyObject findPython = ProxyMaker.findPython((PyProxy)this, "call");
        if (findPython != null) {
            final PyObject pyObject = findPython;
            try {
                return Py.tojava(pyObject._jcallexc((Object[])Py.EmptyObjects), (Class)Class.forName("java.lang.Object"));
            }
            catch (Exception ex) {
                throw ex;
            }
            catch (Throwable t) {
                pyObject._jthrow(t);
                return null;
            }
        }
        return null;
    }

(See the decompilation example in https://github.com/jimbaker/clamped#writing-a-python-class-to-use-clamp)

That last `return null` is where the problem occurs. Although this is a somewhat big change for existing code, it's an appropriate one and is likely hiding bugs. In particular:

exception NotImplementedError
This exception is derived from RuntimeError. In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method.

This Python-specific exception is likely a better exception than UnsupportedOperationException; in either case, it's derived from RuntimeException
History
Date User Action Args
2014-09-24 03:36:21zyasoftsetmessageid: <1411529781.54.0.0643434020189.issue1561@psf.upfronthosting.co.za>
2014-09-24 03:36:21zyasoftsetrecipients: + zyasoft, cgroves, fwierzbicki, pjenvey, akong, seanj
2014-09-24 03:36:21zyasoftlinkissue1561 messages
2014-09-24 03:36:21zyasoftcreate