< prev index next >

src/java.base/share/classes/java/lang/constant/MethodTypeDescImpl.java

Print this page
rev 58428 : [mq]: XXXXXXX-typos


 142             }
 143         });
 144 
 145         // let's check that the lookup has access to all the types in the method type
 146         lookup.accessClass(mtype.returnType());
 147         for (Class<?> paramType: mtype.parameterArray()) {
 148             lookup.accessClass(paramType);
 149         }
 150         return mtype;
 151     }
 152 
 153     /**
 154      * Returns {@code true} if this {@linkplain MethodTypeDescImpl} is
 155      * equal to another {@linkplain MethodTypeDescImpl}.  Equality is
 156      * determined by the two descriptors having equal return types and argument
 157      * types.
 158      *
 159      * @param o the {@code MethodTypeDescImpl} to compare to this
 160      *       {@code MethodTypeDescImpl}
 161      * @return {@code true} if the specified {@code MethodTypeDescImpl} is
 162      *      equals to this {@code MethodTypeDescImpl}.
 163      */
 164     @Override
 165     public boolean equals(Object o) {
 166         if (this == o) return true;
 167         if (o == null || getClass() != o.getClass()) return false;
 168 
 169         MethodTypeDescImpl constant = (MethodTypeDescImpl) o;
 170 
 171         return returnType.equals(constant.returnType)
 172                && Arrays.equals(argTypes, constant.argTypes);
 173     }
 174 
 175     @Override
 176     public int hashCode() {
 177         int result = returnType.hashCode();
 178         result = 31 * result + Arrays.hashCode(argTypes);
 179         return result;
 180     }
 181 
 182     @Override


 142             }
 143         });
 144 
 145         // let's check that the lookup has access to all the types in the method type
 146         lookup.accessClass(mtype.returnType());
 147         for (Class<?> paramType: mtype.parameterArray()) {
 148             lookup.accessClass(paramType);
 149         }
 150         return mtype;
 151     }
 152 
 153     /**
 154      * Returns {@code true} if this {@linkplain MethodTypeDescImpl} is
 155      * equal to another {@linkplain MethodTypeDescImpl}.  Equality is
 156      * determined by the two descriptors having equal return types and argument
 157      * types.
 158      *
 159      * @param o the {@code MethodTypeDescImpl} to compare to this
 160      *       {@code MethodTypeDescImpl}
 161      * @return {@code true} if the specified {@code MethodTypeDescImpl} is
 162      *      equal to this {@code MethodTypeDescImpl}.
 163      */
 164     @Override
 165     public boolean equals(Object o) {
 166         if (this == o) return true;
 167         if (o == null || getClass() != o.getClass()) return false;
 168 
 169         MethodTypeDescImpl constant = (MethodTypeDescImpl) o;
 170 
 171         return returnType.equals(constant.returnType)
 172                && Arrays.equals(argTypes, constant.argTypes);
 173     }
 174 
 175     @Override
 176     public int hashCode() {
 177         int result = returnType.hashCode();
 178         result = 31 * result + Arrays.hashCode(argTypes);
 179         return result;
 180     }
 181 
 182     @Override
< prev index next >