@Nonnull @Override public List<BuilderTryBlock> getTryBlocks() { if (fixInstructions) { fixInstructions(); } return Collections.unmodifiableList(tryBlocks); }
@Nonnull public List<BuilderInstruction> getInstructions() { if (fixInstructions) { fixInstructions(); } return new AbstractList<BuilderInstruction>() { @Override public BuilderInstruction get(int i) { if (i >= size()) { throw new IndexOutOfBoundsException(); } if (fixInstructions) { fixInstructions(); } return instructionList.get(i).instruction; } @Override public int size() { if (fixInstructions) { fixInstructions(); } // don't include the last MethodLocation, which always has a null instruction return instructionList.size() - 1; } }; }
@Nonnull @Override public Iterable<? extends DebugItem> getDebugItems() { if (fixInstructions) { fixInstructions(); } return Iterables.concat( Iterables.transform(instructionList, new Function<MethodLocation, Iterable<? extends DebugItem>>() { @Nullable @Override public Iterable<? extends DebugItem> apply(@Nullable MethodLocation input) { assert input != null; if (fixInstructions) { throw new IllegalStateException("This iterator was invalidated by a change to" + " this MutableMethodImplementation."); } return input.getDebugItems(); } })); }
@Nonnull @Override public List<BuilderTryBlock> getTryBlocks() { if (fixInstructions) { fixInstructions(); } return Collections.unmodifiableList(tryBlocks); }
@Nonnull public List<BuilderInstruction> getInstructions() { if (fixInstructions) { fixInstructions(); } return new AbstractList<BuilderInstruction>() { @Override public BuilderInstruction get(int i) { if (i >= size()) { throw new IndexOutOfBoundsException(); } if (fixInstructions) { fixInstructions(); } return instructionList.get(i).instruction; } @Override public int size() { if (fixInstructions) { fixInstructions(); } // don't include the last MethodLocation, which always has a null instruction return instructionList.size() - 1; } }; }
@Nonnull @Override public Iterable<? extends DebugItem> getDebugItems() { if (fixInstructions) { fixInstructions(); } return Iterables.concat( Iterables.transform(instructionList, new Function<MethodLocation, Iterable<? extends DebugItem>>() { @Nullable @Override public Iterable<? extends DebugItem> apply(@Nullable MethodLocation input) { assert input != null; if (fixInstructions) { throw new IllegalStateException("This iterator was invalidated by a change to" + " this MutableMethodImplementation."); } return input.getDebugItems(); } })); }