Update of /cvsroot/ikvm/ikvm/runtime
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13826
Modified Files:
JniInterface.cs
Log Message:
Filter out HideFromReflection members.
Index: JniInterface.cs
===================================================================
RCS file: /cvsroot/ikvm/ikvm/runtime/JniInterface.cs,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** JniInterface.cs 29 Feb 2008 07:06:07 -0000 1.59
--- JniInterface.cs 14 Mar 2008 09:16:31 -0000 1.60
***************
*** 1,4 ****
/*
! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters
This software is provided 'as-is', without any express or implied
--- 1,4 ----
/*
! Copyright (C) 2002-2008 Jeroen Frijters
This software is provided 'as-is', without any express or implied
***************
*** 1721,1724 ****
--- 1721,1741 ----
}
+ private static MethodWrapper GetMethodImpl(TypeWrapper tw, string name, string sig)
+ {
+ for(;;)
+ {
+ MethodWrapper mw = tw.GetMethodWrapper(name, sig, true);
+ if(mw == null || !mw.IsHideFromReflection)
+ {
+ return mw;
+ }
+ tw = mw.DeclaringType.BaseTypeWrapper;
+ if(tw == null)
+ {
+ return null;
+ }
+ }
+ }
+
private static jmethodID FindMethodID(JNIEnv* pEnv, jclass clazz, byte* name, byte* sig, bool isstatic)
{
***************
*** 1731,1735 ****
if(methodsig.IndexOf('.') < 0)
{
! MethodWrapper mw = wrapper.GetMethodWrapper(StringFromUTF8(name), methodsig.Replace('/', '.'), true);
if(mw != null)
{
--- 1748,1752 ----
if(methodsig.IndexOf('.') < 0)
{
! MethodWrapper mw = GetMethodImpl(wrapper, StringFromUTF8(name), methodsig.Replace('/', '.'));
if(mw != null)
{
***************
*** 1939,1942 ****
--- 1956,1976 ----
}
+ private static FieldWrapper GetFieldImpl(TypeWrapper tw, string name, string sig)
+ {
+ for(;;)
+ {
+ FieldWrapper fw = tw.GetFieldWrapper(name, sig);
+ if(fw == null || !fw.IsHideFromReflection)
+ {
+ return fw;
+ }
+ tw = fw.DeclaringType.BaseTypeWrapper;
+ if(tw == null)
+ {
+ return null;
+ }
+ }
+ }
+
private static jfieldID FindFieldID(JNIEnv* pEnv, jclass clazz, byte* name, byte* sig, bool isstatic)
{
***************
*** 1949,1953 ****
if(fieldsig.IndexOf('.') < 0)
{
! FieldWrapper fw = wrapper.GetFieldWrapper(StringFromUTF8(name), fieldsig.Replace('/', '.'));
if(fw != null)
{
--- 1983,1987 ----
if(fieldsig.IndexOf('.') < 0)
{
! FieldWrapper fw = GetFieldImpl(wrapper, StringFromUTF8(name), fieldsig.Replace('/', '.'));
if(fw != null)
{
|