Widening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4683 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -35,17 +35,15 @@ import com.threerings.presents.Log;
|
||||
public class ClassUtil
|
||||
{
|
||||
/**
|
||||
* Locates and returns the first method in the supplied class whose
|
||||
* name is equal to the specified name. If a method is located, it
|
||||
* will be cached in the supplied cache so that subsequent requests
|
||||
* will immediately return the method from the cache rather than
|
||||
* Locates and returns the first method in the supplied class whose name is equal to the
|
||||
* specified name. If a method is located, it will be cached in the supplied cache so that
|
||||
* subsequent requests will immediately return the method from the cache rather than
|
||||
* re-reflecting.
|
||||
*
|
||||
* @return the method with the specified name or null if no method
|
||||
* with that name could be found.
|
||||
* @return the method with the specified name or null if no method with that name could be
|
||||
* found.
|
||||
*/
|
||||
public static Method getMethod (
|
||||
String name, Object target, HashMap<String,Method> cache)
|
||||
public static Method getMethod (String name, Object target, HashMap<String,Method> cache)
|
||||
{
|
||||
Class tclass = target.getClass();
|
||||
String key = tclass.getName() + ":" + name;
|
||||
@@ -62,14 +60,12 @@ public class ClassUtil
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the method on the specified object that has a signature
|
||||
* that matches the supplied arguments array. This is very expensive,
|
||||
* so you shouldn't be doing this for something that happens
|
||||
* frequently.
|
||||
* Looks up the method on the specified object that has a signature that matches the supplied
|
||||
* arguments array. This is very expensive, so you shouldn't be doing this for something that
|
||||
* happens frequently.
|
||||
*
|
||||
* @return the best matching method with the specified name that
|
||||
* accepts the supplied arguments, or null if no method could be
|
||||
* found.
|
||||
* @return the best matching method with the specified name that accepts the supplied
|
||||
* arguments, or null if no method could be found.
|
||||
*
|
||||
* @see MethodFinder
|
||||
*/
|
||||
@@ -84,14 +80,11 @@ public class ClassUtil
|
||||
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
// nothing to do here but fall through and return null
|
||||
Log.info("No such method [name=" + name +
|
||||
", tclass=" + tclass.getName() +
|
||||
", args=" + StringUtil.toString(args) +
|
||||
", error=" + nsme + "].");
|
||||
Log.info("No such method [name=" + name + ", tclass=" + tclass.getName() +
|
||||
", args=" + StringUtil.toString(args) + ", error=" + nsme + "].");
|
||||
|
||||
} catch (SecurityException se) {
|
||||
Log.warning("Unable to look up method? " +
|
||||
"[tclass=" + tclass.getName() +
|
||||
Log.warning("Unable to look up method? [tclass=" + tclass.getName() +
|
||||
", mname=" + name + "].");
|
||||
}
|
||||
|
||||
@@ -99,11 +92,11 @@ public class ClassUtil
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates and returns the first method in the supplied class whose
|
||||
* name is equal to the specified name.
|
||||
* Locates and returns the first method in the supplied class whose name is equal to the
|
||||
* specified name.
|
||||
*
|
||||
* @return the method with the specified name or null if no method
|
||||
* with that name could be found.
|
||||
* @return the method with the specified name or null if no method with that name could be
|
||||
* found.
|
||||
*/
|
||||
public static Method findMethod (Class clazz, String name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user