if (target == void.class) return null;
if (dataGetStruct() instanceof JavaObject) {
// for interface impls
JavaObject innerWrapper = (JavaObject)dataGetStruct();
// ensure the object is associated with the wrapper we found it in,
// so that if it comes back we don't re-wrap it
if (target.isAssignableFrom(innerWrapper.getValue().getClass())) {
getRuntime().getJavaSupport().getObjectProxyCache().put(innerWrapper.getValue(), this);
return innerWrapper.getValue();
}
} else if (JavaUtil.isDuckTypeConvertable(getClass(), target)) {
if (!respondsTo("java_object")) {
return JavaUtil.convertProcToInterface(getRuntime().getCurrentContext(), this, target);
}