diff options
-rw-r--r-- | runtime/openjdk/sun.reflect.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/openjdk/sun.reflect.cs b/runtime/openjdk/sun.reflect.cs index fda18623..b6a1fffa 100644 --- a/runtime/openjdk/sun.reflect.cs +++ b/runtime/openjdk/sun.reflect.cs @@ -140,14 +140,11 @@ static class Java_sun_reflect_Reflection #if FIRST_PASS return null; #else - int i = 3; - if (realFramesToSkip <= 1) + if (realFramesToSkip <= 0) { - i = 1; - realFramesToSkip = Math.Max(realFramesToSkip + 2, 2); + return ikvm.@internal.ClassLiteral<sun.reflect.Reflection>.Value; } - realFramesToSkip--; - for (; ; ) + for (int i = 2; ; ) { MethodBase method = new StackFrame(i++, false).GetMethod(); if (method == null) @@ -158,6 +155,12 @@ static class Java_sun_reflect_Reflection { continue; } + // HACK we skip HideFromJavaFlags.StackTrace too because we want to skip the LambdaForm methods + // that are used by late binding + if ((GetHideFromJavaFlags(method) & HideFromJavaFlags.StackTrace) != 0) + { + continue; + } if (--realFramesToSkip == 0) { return ClassLoaderWrapper.GetWrapperFromType(method.DeclaringType).ClassObject; |