- final List<DataTreeListenerInfo> listenerInfoList = new ArrayList<>();
- Await.result(Futures.sequence(futureList, ExecutionContext.Implicits$.MODULE$.global()),
- timeout.duration()).forEach(obj -> listenerInfoList.add((DataTreeListenerInfo) obj));
- return listenerInfoList;
- } catch (Exception e) {
- throw new RuntimeException(e);
+ listenerInfos = Await.result(Futures.sequence(futureList, ExecutionContext.Implicits$.MODULE$.global()),
+ timeout.duration());
+ } catch (TimeoutException | InterruptedException e) {
+ throw new IllegalStateException("Failed to acquire listeners", e);