[Pydev-cvs] org.python.pydev.core/src/org/python/pydev/core REF.java,1.10,1.11
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-02-19 21:35:21
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24065/src/org/python/pydev/core Modified Files: REF.java Log Message: Index: REF.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/REF.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** REF.java 16 Jan 2006 18:00:33 -0000 1.10 --- REF.java 19 Feb 2006 21:35:16 -0000 1.11 *************** *** 225,230 **** //the args are not checked for the class because if a subclass is passed, the method is not correctly gotten //another method might do it... try { ! Method[] methods = obj.getClass().getMethods(); for (Method method : methods) { --- 225,248 ---- //the args are not checked for the class because if a subclass is passed, the method is not correctly gotten //another method might do it... + Method m = findMethod(obj, name, args); + return invoke(obj, m, args); + } + + + public static Object invoke(Object obj, Method m, Object... args) { try { ! return m.invoke(obj, args); ! } catch (Exception e) { ! throw new RuntimeException(e); ! } ! } ! ! public static Method findMethod(Object obj, String name, Object... args) { ! return findMethod(obj.getClass(), name, args); ! } ! ! public static Method findMethod(Class class_, String name, Object... args) { ! try { ! Method[] methods = class_.getMethods(); for (Method method : methods) { *************** *** 240,244 **** } //invoke it ! return method.invoke(obj, args); } } --- 258,262 ---- } //invoke it ! return method; } } |