Example #1
0
        private static void DynamicLoadMethodTypeImpl(ref java.lang.invoke.MethodType cache, string sig, [email protected] callerID)
        {
#if !FIRST_PASS
            try
            {
                ClassLoaderWrapper loader = ClassLoaderWrapper.FromCallerID(callerID);
                TypeWrapper[]      args   = loader.ArgTypeWrapperListFromSig(sig, LoadMode.LoadOrThrow);
                java.lang.Class[]  ptypes = new java.lang.Class[args.Length];
                for (int i = 0; i < ptypes.Length; i++)
                {
                    ptypes[i] = args[i].ClassObject;
                }
                Interlocked.CompareExchange(ref cache, java.lang.invoke.MethodType.methodType(loader.RetTypeWrapperFromSig(sig, LoadMode.LoadOrThrow).ClassObject, ptypes), null);
            }
            catch (RetargetableJavaException x)
            {
                throw x.ToJava();
            }
#endif
        }