Ejemplo n.º 1
0
        /// <summary>
        /// Make a call site object equipped with an initial target method handle. </summary>
        /// <param name="targetType"> the desired type of the call site </param>
        /// <param name="createTargetHook"> a hook which will bind the call site to the target method handle </param>
        /// <exception cref="WrongMethodTypeException"> if the hook cannot be invoked on the required arguments,
        ///         or if the target returned by the hook is not of the given {@code targetType} </exception>
        /// <exception cref="NullPointerException"> if the hook returns a null value </exception>
        /// <exception cref="ClassCastException"> if the hook returns something other than a {@code MethodHandle} </exception>
        /// <exception cref="Throwable"> anything else thrown by the hook function </exception>
        /*package-private*/
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: CallSite(MethodType targetType, MethodHandle createTargetHook) throws Throwable
        internal CallSite(MethodType targetType, MethodHandle createTargetHook) : this(targetType)
        {
            ConstantCallSite selfCCS     = (ConstantCallSite)this;
            MethodHandle     boundTarget = (MethodHandle)createTargetHook.InvokeWithArguments(selfCCS);
            CheckTargetChange(this.Target_Renamed, boundTarget);
            this.Target_Renamed = boundTarget;
        }