internal object ToMethodOrConstructor(bool copy)
{
#if FIRST_PASS
return null;
#else
object method = reflectionMethod;
if (method == null)
{
TypeWrapper[] argTypes = GetParameters();
java.lang.Class[] parameterTypes = new java.lang.Class[argTypes.Length];
for (int i = 0; i < argTypes.Length; i++)
{
parameterTypes[i] = argTypes[i].ClassObject;
}
java.lang.Class[] checkedExceptions = GetExceptions();
if (this.Name == StringConstants.INIT)
{
method = new java.lang.reflect.Constructor(
this.DeclaringType.ClassObject,
parameterTypes,
checkedExceptions,
(int)this.Modifiers | (this.IsInternal ? 0x40000000 : 0),
Array.IndexOf(this.DeclaringType.GetMethods(), this),
this.DeclaringType.GetGenericMethodSignature(this),
null,
null
);
}
else
{
method = new java.lang.reflect.Method(
this.DeclaringType.ClassObject,
this.Name,
parameterTypes,
this.ReturnType.ClassObject,
checkedExceptions,
(int)this.Modifiers | (this.IsInternal ? 0x40000000 : 0),
Array.IndexOf(this.DeclaringType.GetMethods(), this),
this.DeclaringType.GetGenericMethodSignature(this),
null,
null,
null
);
}
lock (this)
{
if (reflectionMethod == null)
{
reflectionMethod = method;
}
else
{
method = reflectionMethod;
}
}
}
if (copy)
{
java.lang.reflect.Constructor ctor = method as java.lang.reflect.Constructor;
if (ctor != null)
{
return ctor.copy();
}
return ((java.lang.reflect.Method)method).copy();
}
return method;
#endif
}