Skip to content

Instantly share code, notes, and snippets.

@kevinherron
Created February 24, 2012 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinherron/c385f90afc6f0dd3c9cf to your computer and use it in GitHub Desktop.
Save kevinherron/c385f90afc6f0dd3c9cf to your computer and use it in GitHub Desktop.
PyReflectedFunction Fix
public static class ReflectedFunction extends PyReflectedFunction {
private final PyObject self;
/**
* Constructor for use with a static Java method.
*
* @param m
* A static Java method.
*/
public ReflectedFunction(Method m) {
this(m, new Object());
}
/**
* Constructor for use with an instance Java method.
*
* @param m
* An instance Java method.
* @param self
* The instance the method belongs to.
**/
public ReflectedFunction(Method m, Object self) {
super(m);
this.self = PyJavaType.wrapJavaObject(self);
}
@Override
public PyObject __call__(PyObject[] args, String[] keywords) {
return __call__(self, args, keywords);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment