@Test public void testToString() { Frame<String> frame = new Frame<String>(1) { @Override public String getValue(int n) { return "value"; } }; assertThat(frame.toString(), is(equalTo("[value]"))); }
@Override public String toString() { if (isTop()) { return "[TOP]"; } if (isBottom()) { return "[BOTTOM]"; } StringBuilder buf = new StringBuilder(); buf.append('['); int numSlots = getNumSlots(); int start = STACK_ONLY ? getNumLocals() : 0; for (int i = start; i < numSlots; ++i) { if (!STACK_ONLY && i == getNumLocals()) { int last = buf.length() - 1; if (last >= 0 && buf.charAt(last) == ',') { buf.deleteCharAt(last); } buf.append('|'); } String value = valueToString(getValue(i)); if (i == numSlots - 1 && value.endsWith(",")) { value = value.substring(0, value.length() - 1); } buf.append(value); } buf.append(']'); return buf.toString(); }
Frame { @Override public String toString() { if (isTop()) { return "[TOP]"; } if (isBottom()) { return "[BOTTOM]"; } StringBuilder buf = new StringBuilder(); buf.append('['); int numSlots = getNumSlots(); int start = STACK_ONLY ? getNumLocals() : 0; for (int i = start; i < numSlots; ++i) { if (!STACK_ONLY && i == getNumLocals()) { int last = buf.length() - 1; if (last >= 0 && buf.charAt(last) == ',') { buf.deleteCharAt(last); } buf.append('|'); } String value = valueToString(getValue(i)); if (i == numSlots - 1 && value.endsWith(",")) { value = value.substring(0, value.length() - 1); } buf.append(value); } buf.append(']'); return buf.toString(); } }
Frame { @Override public String toString() { if (isTop()) { return "[TOP]"; } if (isBottom()) { return "[BOTTOM]"; } StringBuilder buf = new StringBuilder(); buf.append('['); int numSlots = getNumSlots(); int start = STACK_ONLY ? getNumLocals() : 0; for (int i = start; i < numSlots; ++i) { if (!STACK_ONLY && i == getNumLocals()) { int last = buf.length() - 1; if (last >= 0 && buf.charAt(last) == ',') { buf.deleteCharAt(last); } buf.append('|'); } String value = valueToString(getValue(i)); if (i == numSlots - 1 && value.endsWith(",")) { value = value.substring(0, value.length() - 1); } buf.append(value); } buf.append(']'); return buf.toString(); } Frame(int numLocals); }
Frame { @Override public String toString() { if (isTop()) { return "[TOP]"; } if (isBottom()) { return "[BOTTOM]"; } StringBuilder buf = new StringBuilder(); buf.append('['); int numSlots = getNumSlots(); int start = STACK_ONLY ? getNumLocals() : 0; for (int i = start; i < numSlots; ++i) { if (!STACK_ONLY && i == getNumLocals()) { int last = buf.length() - 1; if (last >= 0 && buf.charAt(last) == ',') { buf.deleteCharAt(last); } buf.append('|'); } String value = valueToString(getValue(i)); if (i == numSlots - 1 && value.endsWith(",")) { value = value.substring(0, value.length() - 1); } buf.append(value); } buf.append(']'); return buf.toString(); } Frame(int numLocals); boolean isTop(); void setTop(); boolean isBottom(); void setBottom(); void setValid(); boolean isValid(); void pushValue(ValueType value); ValueType popValue(); ValueType getTopValue(); void getTopStackWords(ValueType[] valueList); ValueType getStackValue(int loc); int getStackLocation(int loc); ValueType getInstance(Instruction ins, ConstantPoolGen cpg); int getInstanceStackLocation(Instruction ins, ConstantPoolGen cpg); int getInstanceSlot(Instruction ins, ConstantPoolGen cpg); int getNumArguments(InvokeInstruction ins, ConstantPoolGen cpg); int getNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg); @Deprecated ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments); ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, SignatureParser sigParser); int getArgumentSlot(int i, int numArguments); ValueType getOperand(StackConsumer ins, ConstantPoolGen cpg, int i); BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser); void clearStack(); int getStackDepth(); int getNumLocals(); int getNumSlots(); boolean contains(ValueType value); ValueType getValue(int n); void setValue(int n, ValueType value); boolean sameAs(Frame<ValueType> other); void copyFrom(Frame<ValueType> other); @Override String toString(); Collection<ValueType> allSlots(); void setLastUpdateTimestamp(int lastUpdateTimestamp); int getLastUpdateTimestamp(); }
Frame { @Override public String toString() { if (isTop()) { return "[TOP]"; } if (isBottom()) { return "[BOTTOM]"; } StringBuilder buf = new StringBuilder(); buf.append('['); int numSlots = getNumSlots(); int start = STACK_ONLY ? getNumLocals() : 0; for (int i = start; i < numSlots; ++i) { if (!STACK_ONLY && i == getNumLocals()) { int last = buf.length() - 1; if (last >= 0 && buf.charAt(last) == ',') { buf.deleteCharAt(last); } buf.append('|'); } String value = valueToString(getValue(i)); if (i == numSlots - 1 && value.endsWith(",")) { value = value.substring(0, value.length() - 1); } buf.append(value); } buf.append(']'); return buf.toString(); } Frame(int numLocals); boolean isTop(); void setTop(); boolean isBottom(); void setBottom(); void setValid(); boolean isValid(); void pushValue(ValueType value); ValueType popValue(); ValueType getTopValue(); void getTopStackWords(ValueType[] valueList); ValueType getStackValue(int loc); int getStackLocation(int loc); ValueType getInstance(Instruction ins, ConstantPoolGen cpg); int getInstanceStackLocation(Instruction ins, ConstantPoolGen cpg); int getInstanceSlot(Instruction ins, ConstantPoolGen cpg); int getNumArguments(InvokeInstruction ins, ConstantPoolGen cpg); int getNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg); @Deprecated ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments); ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, SignatureParser sigParser); int getArgumentSlot(int i, int numArguments); ValueType getOperand(StackConsumer ins, ConstantPoolGen cpg, int i); BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser); void clearStack(); int getStackDepth(); int getNumLocals(); int getNumSlots(); boolean contains(ValueType value); ValueType getValue(int n); void setValue(int n, ValueType value); boolean sameAs(Frame<ValueType> other); void copyFrom(Frame<ValueType> other); @Override String toString(); Collection<ValueType> allSlots(); void setLastUpdateTimestamp(int lastUpdateTimestamp); int getLastUpdateTimestamp();  }