diff --git a/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/exchanger/ExchangerPipeLineManualTest.java b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/exchanger/ExchangerPipeLineManualTest.java index 093580654b..af8b8b9aa1 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/exchanger/ExchangerPipeLineManualTest.java +++ b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/exchanger/ExchangerPipeLineManualTest.java @@ -40,15 +40,15 @@ public class ExchangerPipeLineManualTest { Runnable processor = () -> { Queue processorBuffer = new ConcurrentLinkedQueue<>(); - Queue writterBuffer = new ConcurrentLinkedQueue<>(); + Queue writerBuffer = new ConcurrentLinkedQueue<>(); try { processorBuffer = readerExchanger.exchange(processorBuffer); while (true) { - writterBuffer.add(processorBuffer.poll()); + writerBuffer.add(processorBuffer.poll()); if (processorBuffer.isEmpty()) { try { processorBuffer = readerExchanger.exchange(processorBuffer); - writterBuffer = writerExchanger.exchange(writterBuffer); + writerBuffer = writerExchanger.exchange(writerBuffer); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); @@ -62,13 +62,13 @@ public class ExchangerPipeLineManualTest { }; Runnable writer = () -> { - Queue writterBuffer = new ConcurrentLinkedQueue<>(); + Queue writerBuffer = new ConcurrentLinkedQueue<>(); try { - writterBuffer = writerExchanger.exchange(writterBuffer); + writerBuffer = writerExchanger.exchange(writerBuffer); while (true) { - System.out.println(writterBuffer.poll()); - if (writterBuffer.isEmpty()) { - writterBuffer = writerExchanger.exchange(writterBuffer); + System.out.println(writerBuffer.poll()); + if (writerBuffer.isEmpty()) { + writerBuffer = writerExchanger.exchange(writerBuffer); } } } catch (InterruptedException e) {