@@ -792,23 +792,20 @@ private <E extends RecordedEntity> List<Callable<Object>> groupEntitiesByChannel
792
792
list .add (entity );
793
793
}
794
794
// now create a runnable per channel
795
- final List <Callable <Object >> callables = new ArrayList <Callable < Object > >();
795
+ final List <Callable <Object >> callables = new ArrayList <>();
796
796
for (final List <E > entityList : map .values ()) {
797
- callables .add (Executors .callable (new Runnable () {
798
- @ Override
799
- public void run () {
800
- for (final E entity : entityList ) {
801
- if (entity instanceof RecordedExchange ) {
802
- recoverExchange ((RecordedExchange )entity );
803
- } else if (entity instanceof RecordedQueue ) {
804
- final RecordedQueue q = (RecordedQueue ) entity ;
805
- recoverQueue (q .getName (), q );
806
- } else if (entity instanceof RecordedBinding ) {
807
- recoverBinding ((RecordedBinding ) entity );
808
- } else if (entity instanceof RecordedConsumer ) {
809
- final RecordedConsumer c = (RecordedConsumer ) entity ;
810
- recoverConsumer (c .getConsumerTag (), c );
811
- }
797
+ callables .add (Executors .callable (() -> {
798
+ for (final E entity : entityList ) {
799
+ if (entity instanceof RecordedExchange ) {
800
+ recoverExchange ((RecordedExchange )entity );
801
+ } else if (entity instanceof RecordedQueue ) {
802
+ final RecordedQueue q = (RecordedQueue ) entity ;
803
+ recoverQueue (q .getName (), q );
804
+ } else if (entity instanceof RecordedBinding ) {
805
+ recoverBinding ((RecordedBinding ) entity );
806
+ } else if (entity instanceof RecordedConsumer ) {
807
+ final RecordedConsumer c = (RecordedConsumer ) entity ;
808
+ recoverConsumer (c .getConsumerTag (), c );
812
809
}
813
810
}
814
811
}));
0 commit comments