Example usage for org.objectweb.asm Handle hashCode

List of usage examples for org.objectweb.asm Handle hashCode

Introduction

In this page you can find the example usage for org.objectweb.asm Handle hashCode.

Prototype

@Override
    public int hashCode() 

Source Link

Usage

From source file:com.geeksaga.light.profiler.util.Constant.java

License:Apache License

/**
 * Set this item to an InvokeDynamic item.
 *
 * @param name    invokedynamic's name.// w w  w  .  ja  va2 s .  co  m
 * @param desc    invokedynamic's descriptor.
 * @param bsm     bootstrap method.
 * @param bsmArgs bootstrap method constant arguments.
 */
void set(final String name, final String desc, final Handle bsm, final Object[] bsmArgs) {
    this.type = 'y';
    this.strVal1 = name;
    this.strVal2 = desc;
    this.objVal3 = bsm;
    this.objVals = bsmArgs;

    int hashCode = 'y' + name.hashCode() * desc.hashCode() * bsm.hashCode();
    for (int i = 0; i < bsmArgs.length; i++) {
        hashCode *= bsmArgs[i].hashCode();
    }
    this.hashCode = 0x7FFFFFFF & hashCode;
}