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

Print this page

        

*** 192,201 **** --- 192,203 ---- } /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. + * @param rtype the return type + * @param ptypes the parameter types * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class} */ public static
*** 212,221 **** --- 214,226 ---- /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The leading parameter type is prepended to the remaining array. + * @param rtype the return type + * @param ptype0 the first parameter type + * @param ptypes the remaining parameter types * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null * @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class} */ public static
*** 228,237 **** --- 233,243 ---- /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has no parameter types. + * @param rtype the return type * @return a method type with the given return value * @throws NullPointerException if {@code rtype} is null */ public static MethodType methodType(Class<?> rtype) {
*** 240,249 **** --- 246,257 ---- /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has the single given parameter type. + * @param rtype the return type + * @param ptype0 the parameter type * @return a method type with the given return value and parameter type * @throws NullPointerException if {@code rtype} or {@code ptype0} is null * @throws IllegalArgumentException if {@code ptype0} is {@code void.class} */ public static
*** 254,263 **** --- 262,274 ---- /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has the same parameter types as {@code ptypes}, * and the specified return type. + * @param rtype the return type + * @param ptypes the method type which supplies the parameter types + * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptypes} is null */ public static MethodType methodType(Class<?> rtype, MethodType ptypes) { return makeImpl(rtype, ptypes.ptypes, true);
*** 936,946 **** * <p> * The deserialized field values are checked as if they were * provided to the factory method {@link #methodType(Class,Class[]) methodType}. * For example, null values, or {@code void} parameter types, * will lead to exceptions during deserialization. ! * @param the stream to write the object to */ private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); // requires serialPersistentFields to be an empty array s.writeObject(returnType()); s.writeObject(parameterArray()); --- 947,958 ---- * <p> * The deserialized field values are checked as if they were * provided to the factory method {@link #methodType(Class,Class[]) methodType}. * For example, null values, or {@code void} parameter types, * will lead to exceptions during deserialization. ! * @param s the stream to write the object to ! * @throws java.io.IOException if there is a problem writing the object */ private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); // requires serialPersistentFields to be an empty array s.writeObject(returnType()); s.writeObject(parameterArray());
*** 951,961 **** * deserialize it). * This instance is a scratch object with bogus final fields. * It provides the parameters to the factory method called by * {@link #readResolve readResolve}. * After that call it is discarded. ! * @param the stream to read the object from * @see #MethodType() * @see #readResolve * @see #writeObject */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { --- 963,975 ---- * deserialize it). * This instance is a scratch object with bogus final fields. * It provides the parameters to the factory method called by * {@link #readResolve readResolve}. * After that call it is discarded. ! * @param s the stream to read the object from ! * @throws java.io.IOException if there is a problem reading the object ! * @throws ClassNotFoundException if one of the component classes cannot be resolved * @see #MethodType() * @see #readResolve * @see #writeObject */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {