< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodType.java

Print this page

  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang.invoke;
  27 
  28 import java.lang.constant.ClassDesc;
  29 import java.lang.constant.Constable;
  30 import java.lang.constant.MethodTypeDesc;
  31 import java.lang.ref.Reference;
  32 import java.lang.ref.ReferenceQueue;
  33 import java.lang.ref.WeakReference;
  34 import java.util.Arrays;
  35 import java.util.Collections;
  36 import java.util.function.Supplier;
  37 import java.util.List;
  38 import java.util.Map;
  39 import java.util.NoSuchElementException;
  40 import java.util.Objects;
  41 import java.util.Optional;
  42 import java.util.StringJoiner;
  43 import java.util.concurrent.ConcurrentHashMap;
  44 import java.util.concurrent.ConcurrentMap;
  45 import java.util.stream.Stream;
  46 
  47 import jdk.internal.util.ReferencedKeySet;
  48 import jdk.internal.util.ReferenceKey;
  49 import jdk.internal.vm.annotation.Stable;
  50 import sun.invoke.util.BytecodeDescriptor;
  51 import sun.invoke.util.VerifyType;
  52 import sun.invoke.util.Wrapper;
  53 import sun.security.util.SecurityConstants;
  54 
  55 import static java.lang.invoke.MethodHandleStatics.UNSAFE;
  56 import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException;
  57 
  58 /**
  59  * A method type represents the arguments and return type accepted and
  60  * returned by a method handle, or the arguments and return type passed
  61  * and expected  by a method handle caller.  Method types must be properly
  62  * matched between a method handle and all its callers,
  63  * and the JVM's operations enforce this matching at, specifically
  64  * during calls to {@link MethodHandle#invokeExact MethodHandle.invokeExact}

  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang.invoke;
  27 
  28 import java.lang.constant.ClassDesc;
  29 import java.lang.constant.Constable;
  30 import java.lang.constant.MethodTypeDesc;



  31 import java.util.Arrays;
  32 import java.util.Collections;
  33 import java.util.function.Supplier;
  34 import java.util.List;
  35 import java.util.Map;
  36 import java.util.NoSuchElementException;
  37 import java.util.Objects;
  38 import java.util.Optional;
  39 import java.util.StringJoiner;
  40 import java.util.concurrent.ConcurrentHashMap;

  41 import java.util.stream.Stream;
  42 
  43 import jdk.internal.util.ReferencedKeySet;
  44 import jdk.internal.util.ReferenceKey;
  45 import jdk.internal.vm.annotation.Stable;
  46 import sun.invoke.util.BytecodeDescriptor;
  47 import sun.invoke.util.VerifyType;
  48 import sun.invoke.util.Wrapper;
  49 import sun.security.util.SecurityConstants;
  50 
  51 import static java.lang.invoke.MethodHandleStatics.UNSAFE;
  52 import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException;
  53 
  54 /**
  55  * A method type represents the arguments and return type accepted and
  56  * returned by a method handle, or the arguments and return type passed
  57  * and expected  by a method handle caller.  Method types must be properly
  58  * matched between a method handle and all its callers,
  59  * and the JVM's operations enforce this matching at, specifically
  60  * during calls to {@link MethodHandle#invokeExact MethodHandle.invokeExact}
< prev index next >