@@ -792,23 +792,20 @@ private <E extends RecordedEntity> List<Callable<Object>> groupEntitiesByChannel
792792 list .add (entity );
793793 }
794794 // now create a runnable per channel
795- final List <Callable <Object >> callables = new ArrayList <Callable < Object > >();
795+ final List <Callable <Object >> callables = new ArrayList <>();
796796 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 );
812809 }
813810 }
814811 }));
0 commit comments