Closed FrederikPM closed 3 years ago
public void addAfterOrTop(PStm item, PStm... commands){ int index = block.getBody().indexOf(item); int insertAt = index + 1; if (insertAt > block.getBody().size()) { add(commands); } else { addAll(insertAt, commands); } }
Fixed in https://github.com/INTO-CPS-Association/maestro/commit/954047f425e083e2c698f87cc31fe572d0ffa6c4
public void addAfterOrTop(PStm item, PStm... commands){ int index = block.getBody().indexOf(item); int insertAt = index + 1; if (insertAt > block.getBody().size()) { add(commands); } else { addAll(insertAt, commands); } }