< prev index next >

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

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


 233         assert bootstrapMethod.invocationType().parameterType(1).equals(CD_String);
 234         MethodHandle bsm = (MethodHandle) bootstrapMethod.resolveConstantDesc(lookup);
 235         Object[] args = new Object[bootstrapArgs.length + 3];
 236         args[0] = lookup;
 237         args[1] = invocationName;
 238         args[2] = invocationType.resolveConstantDesc(lookup);
 239         System.arraycopy(bootstrapArgs, 0, args, 3, bootstrapArgs.length);
 240         return (CallSite) bsm.invokeWithArguments(args);
 241     }
 242 
 243     /**
 244      * Compares the specified object with this descriptor for equality.  Returns
 245      * {@code true} if and only if the specified object is also a
 246      * {@linkplain DynamicCallSiteDesc}, and both descriptors have equal
 247      * bootstrap methods, bootstrap argument lists, invocation name, and
 248      * invocation type.
 249      *
 250      * @param o the {@code DynamicCallSiteDesc} to compare to this
 251      *       {@code DynamicCallSiteDesc}
 252      * @return {@code true} if the specified {@code DynamicCallSiteDesc} is
 253      *      equals to this {@code DynamicCallSiteDesc}.
 254      */
 255     @Override
 256     public final boolean equals(Object o) {
 257         if (this == o) return true;
 258         if (o == null || getClass() != o.getClass()) return false;
 259         DynamicCallSiteDesc specifier = (DynamicCallSiteDesc) o;
 260         return Objects.equals(bootstrapMethod, specifier.bootstrapMethod) &&
 261                Arrays.equals(bootstrapArgs, specifier.bootstrapArgs) &&
 262                Objects.equals(invocationName, specifier.invocationName) &&
 263                Objects.equals(invocationType, specifier.invocationType);
 264     }
 265 
 266     @Override
 267     public final int hashCode() {
 268         int result = Objects.hash(bootstrapMethod, invocationName, invocationType);
 269         result = 31 * result + Arrays.hashCode(bootstrapArgs);
 270         return result;
 271     }
 272 
 273     /**


 233         assert bootstrapMethod.invocationType().parameterType(1).equals(CD_String);
 234         MethodHandle bsm = (MethodHandle) bootstrapMethod.resolveConstantDesc(lookup);
 235         Object[] args = new Object[bootstrapArgs.length + 3];
 236         args[0] = lookup;
 237         args[1] = invocationName;
 238         args[2] = invocationType.resolveConstantDesc(lookup);
 239         System.arraycopy(bootstrapArgs, 0, args, 3, bootstrapArgs.length);
 240         return (CallSite) bsm.invokeWithArguments(args);
 241     }
 242 
 243     /**
 244      * Compares the specified object with this descriptor for equality.  Returns
 245      * {@code true} if and only if the specified object is also a
 246      * {@linkplain DynamicCallSiteDesc}, and both descriptors have equal
 247      * bootstrap methods, bootstrap argument lists, invocation name, and
 248      * invocation type.
 249      *
 250      * @param o the {@code DynamicCallSiteDesc} to compare to this
 251      *       {@code DynamicCallSiteDesc}
 252      * @return {@code true} if the specified {@code DynamicCallSiteDesc} is
 253      *      equal to this {@code DynamicCallSiteDesc}.
 254      */
 255     @Override
 256     public final boolean equals(Object o) {
 257         if (this == o) return true;
 258         if (o == null || getClass() != o.getClass()) return false;
 259         DynamicCallSiteDesc specifier = (DynamicCallSiteDesc) o;
 260         return Objects.equals(bootstrapMethod, specifier.bootstrapMethod) &&
 261                Arrays.equals(bootstrapArgs, specifier.bootstrapArgs) &&
 262                Objects.equals(invocationName, specifier.invocationName) &&
 263                Objects.equals(invocationType, specifier.invocationType);
 264     }
 265 
 266     @Override
 267     public final int hashCode() {
 268         int result = Objects.hash(bootstrapMethod, invocationName, invocationType);
 269         result = 31 * result + Arrays.hashCode(bootstrapArgs);
 270         return result;
 271     }
 272 
 273     /**
< prev index next >