@SuppressWarnings("unchecked") @Test(expected = IllegalStateException.class) public void testFinishCalledTwiceThrows() { combiner.finish(p1); combiner.finish(p1); }
public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } } }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  @Deprecated void add(Promise promise); @SuppressWarnings({ "unchecked", "rawtypes" }) void add(Future future); @Deprecated void addAll(Promise... promises); @SuppressWarnings({ "unchecked", "rawtypes" }) void addAll(Future... futures); void finish(Promise<Void> aggregatePromise); }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  @Deprecated void add(Promise promise); @SuppressWarnings({ "unchecked", "rawtypes" }) void add(Future future); @Deprecated void addAll(Promise... promises); @SuppressWarnings({ "unchecked", "rawtypes" }) void addAll(Future... futures); void finish(Promise<Void> aggregatePromise);  }