All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xapi.bytecode.InvokeDynamicInfo Maven / Gradle / Ivy

Go to download

This module exists solely to package all other gwt modules into a single uber jar. This makes deploying to non-mavenized targets much easier. Of course, you would be wise to inherit your dependencies individually; the uber jar is intended for projects like collide, which have complex configuration, and adding many jars would be a pain.

The newest version!
/**
 *
 */
package xapi.bytecode;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;

class InvokeDynamicInfo extends ConstInfo {
  static final int tag = 18;
  int bootstrap, nameAndType;

  public InvokeDynamicInfo(final DataInput in, final int index) throws IOException {
    bootstrap = in.readUnsignedShort();
    nameAndType = in.readUnsignedShort();
  }

  public InvokeDynamicInfo(final int bootstrapMethod, final int ntIndex, final int index) {
    bootstrap = bootstrapMethod;
    nameAndType = ntIndex;
  }

  @Override
  @SuppressWarnings("rawtypes")
  public int copy(final ConstPool src, final ConstPool dest, final Map map) {
    return dest.addInvokeDynamicInfo(bootstrap,
        src.getItem(nameAndType).copy(src, dest, map));
  }

  @Override
  public boolean equals(final Object obj) {
    if (obj instanceof InvokeDynamicInfo) {
      final InvokeDynamicInfo iv = (InvokeDynamicInfo)obj;
      return iv.bootstrap == bootstrap && iv.nameAndType == nameAndType;
    } else {
      return false;
    }
  }

  @Override
  public int getTag() { return tag; }

  @Override
  public int hashCode() { return bootstrap << 16 ^ nameAndType; }

  @Override
  public void print(final PrintWriter out) {
    out.print("InvokeDynamic #");
    out.print(bootstrap);
    out.print(", name&type #");
    out.println(nameAndType);
  }

  @Override
  public void write(final DataOutput out) throws IOException {
    out.writeByte(tag);
    out.writeShort(bootstrap);
    out.writeShort(nameAndType);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy