@Test(expected = IllegalArgumentException.class) public void infiniloopTest() { testCase.runIn(new TransactionRunnable().runIn(testCase)); }
public <U extends T> TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable) { if (this.parent != null) { throw new IllegalStateException("This TransactionRunnable is already scheduled to run inside " + this.parent.toString() + " and cannot be run in " + parentRunnable.toString() + " too."); } if (parentRunnable.hasPreRun) { throw new IllegalStateException("This TransactionRunnable cannot be runIn() " + parentRunnable + " because it has already started 'the ship has set sail'"); } parentRunnable.assertNoLoop(this); this.parent = (TransactionRunnable<T>) parentRunnable; parentRunnable.allRunnables.add(this); return (TransactionRunnable<U>) this; }
TransactionRunnable { public <U extends T> TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable) { if (this.parent != null) { throw new IllegalStateException("This TransactionRunnable is already scheduled to run inside " + this.parent.toString() + " and cannot be run in " + parentRunnable.toString() + " too."); } if (parentRunnable.hasPreRun) { throw new IllegalStateException("This TransactionRunnable cannot be runIn() " + parentRunnable + " because it has already started 'the ship has set sail'"); } parentRunnable.assertNoLoop(this); this.parent = (TransactionRunnable<T>) parentRunnable; parentRunnable.allRunnables.add(this); return (TransactionRunnable<U>) this; } }
TransactionRunnable { public <U extends T> TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable) { if (this.parent != null) { throw new IllegalStateException("This TransactionRunnable is already scheduled to run inside " + this.parent.toString() + " and cannot be run in " + parentRunnable.toString() + " too."); } if (parentRunnable.hasPreRun) { throw new IllegalStateException("This TransactionRunnable cannot be runIn() " + parentRunnable + " because it has already started 'the ship has set sail'"); } parentRunnable.assertNoLoop(this); this.parent = (TransactionRunnable<T>) parentRunnable; parentRunnable.allRunnables.add(this); return (TransactionRunnable<U>) this; }  }
TransactionRunnable { public <U extends T> TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable) { if (this.parent != null) { throw new IllegalStateException("This TransactionRunnable is already scheduled to run inside " + this.parent.toString() + " and cannot be run in " + parentRunnable.toString() + " too."); } if (parentRunnable.hasPreRun) { throw new IllegalStateException("This TransactionRunnable cannot be runIn() " + parentRunnable + " because it has already started 'the ship has set sail'"); } parentRunnable.assertNoLoop(this); this.parent = (TransactionRunnable<T>) parentRunnable; parentRunnable.allRunnables.add(this); return (TransactionRunnable<U>) this; }  TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable); }
TransactionRunnable { public <U extends T> TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable) { if (this.parent != null) { throw new IllegalStateException("This TransactionRunnable is already scheduled to run inside " + this.parent.toString() + " and cannot be run in " + parentRunnable.toString() + " too."); } if (parentRunnable.hasPreRun) { throw new IllegalStateException("This TransactionRunnable cannot be runIn() " + parentRunnable + " because it has already started 'the ship has set sail'"); } parentRunnable.assertNoLoop(this); this.parent = (TransactionRunnable<T>) parentRunnable; parentRunnable.allRunnables.add(this); return (TransactionRunnable<U>) this; }  TransactionRunnable<U> runIn(final TransactionRunnable<U> parentRunnable);  }