@Override public int hashCode() { return getLocation().hashCode() + 3 * streamBase.hashCode() + 7 * getResourceClass().hashCode() + 11 * instanceParam; }
@Override public boolean equals(Object o) { if (!(o instanceof Stream)) { return false; } Stream other = (Stream) o; if (!getLocation().equals(other.getLocation())) { return false; } if (!streamBase.equals(other.streamBase)) { return false; } if (!getResourceClass().equals(other.getResourceClass())) { return false; } if (instanceParam != other.instanceParam) { return false; } return true; }
return cmp; cmp = getResourceClass().compareTo(other.getResourceClass()); if (cmp != 0) { return cmp;
public boolean isStreamOpen(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg, ResourceValueFrame frame) { if (isOpenOnCreation) { return false; } Instruction ins = handle.getInstruction(); if (!(ins instanceof INVOKESPECIAL)) { return false; } // Does this instruction open the stream? INVOKESPECIAL inv = (INVOKESPECIAL) ins; return frame.isValid() && getInstanceValue(frame, inv, cpg).isInstance() && matchMethod(inv, cpg, this.getResourceClass(), Const.CONSTRUCTOR_NAME); }
@Override public int hashCode() { return getLocation().hashCode() + 3 * streamBase.hashCode() + 7 * getResourceClass().hashCode() + 11 * instanceParam; }
@Override public boolean equals(Object o) { if (!(o instanceof Stream)) { return false; } Stream other = (Stream) o; if (!getLocation().equals(other.getLocation())) { return false; } if (!streamBase.equals(other.streamBase)) { return false; } if (!getResourceClass().equals(other.getResourceClass())) { return false; } if (instanceParam != other.instanceParam) { return false; } return true; }
return cmp; cmp = getResourceClass().compareTo(other.getResourceClass()); if (cmp != 0) { return cmp;
public boolean isStreamOpen(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg, ResourceValueFrame frame) { if (isOpenOnCreation) { return false; } Instruction ins = handle.getInstruction(); if (!(ins instanceof INVOKESPECIAL)) { return false; } // Does this instruction open the stream? INVOKESPECIAL inv = (INVOKESPECIAL) ins; return frame.isValid() && getInstanceValue(frame, inv, cpg).isInstance() && matchMethod(inv, cpg, this.getResourceClass(), "<init>"); }