Skip to content

Commit

Permalink
fix : add synchronized review
Browse files Browse the repository at this point in the history
Signed-off-by: Samir Romdhani <samir.romdhani@rte-france.com>
  • Loading branch information
samirromdhani committed Sep 23, 2024
1 parent acdc404 commit 418a9c9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,9 @@ void copySclElement_should_succeed_when_syncRead() throws ExecutionException, In
tln.setLnType("T1");
tln.getLnClass().add(TLLN0Enum.LLN_0.value());
ExecutorService service = Executors.newFixedThreadPool(2);
Callable<TLN> copySclElementTlnCallable = new Callable<TLN>() {
@Override
public TLN call() {
return copySclElement(tln, TLN.class);
}
};
Callable<TLN> copySclElementTlnCallable = () -> copySclElement(tln, TLN.class);
// When
List<Future<TLN>> result = service.invokeAll(Arrays.asList(copySclElementTlnCallable, copySclElementTlnCallable));
List<Future<TLN>> result = service.invokeAll(List.of(copySclElementTlnCallable, copySclElementTlnCallable));
service.shutdown();
TLN[] tlns = new TLN[]{result.getFirst().get(), result.getLast().get()};
// Then
Expand Down

0 comments on commit 418a9c9

Please sign in to comment.