From: <cg...@us...> - 2008-12-01 01:09:00
|
Revision: 5668 http://jython.svn.sourceforge.net/jython/?rev=5668&view=rev Author: cgroves Date: 2008-12-01 01:08:51 +0000 (Mon, 01 Dec 2008) Log Message: ----------- Go ahead and take multiple methods in PyReflectedFunction's constructor Modified Paths: -------------- branches/newstyle-java-types/Lib/test/test_joverload.py branches/newstyle-java-types/src/org/python/core/PyReflectedFunction.java Modified: branches/newstyle-java-types/Lib/test/test_joverload.py =================================================================== --- branches/newstyle-java-types/Lib/test/test_joverload.py 2008-12-01 01:06:33 UTC (rev 5667) +++ branches/newstyle-java-types/Lib/test/test_joverload.py 2008-12-01 01:08:51 UTC (rev 5668) @@ -11,9 +11,7 @@ class PyReflFuncEnvl: def __init__(self,name,meths): - self.reflfunc = PyReflectedFunction(meths[0]) - for meth in meths[1:]: - self.reflfunc.addMethod(meth) + self.reflfunc = PyReflectedFunction(meths) def __call__(self,inst,args): return self.reflfunc(inst,*args) Modified: branches/newstyle-java-types/src/org/python/core/PyReflectedFunction.java =================================================================== --- branches/newstyle-java-types/src/org/python/core/PyReflectedFunction.java 2008-12-01 01:06:33 UTC (rev 5667) +++ branches/newstyle-java-types/src/org/python/core/PyReflectedFunction.java 2008-12-01 01:08:51 UTC (rev 5668) @@ -21,12 +21,16 @@ __name__ = name; } - public PyReflectedFunction(Method method) { - this(method.getName()); - addMethod(method); + public PyReflectedFunction(Method... methods) { + this(methods[0].getName()); + for (Method meth : methods) { + addMethod(meth); + } if (nargs == 0) { String msg = String.format("Attempted to make Java method visible, but it isn't " - + "callable[method=%s, class=%s]", method.getName(), method.getDeclaringClass()); + + "callable[method=%s, class=%s]", + methods[0].getName(), + methods[0].getDeclaringClass()); throw Py.SystemError(msg); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |