From c7fee7bb07fbd040aaa0d0fdee899203344a48d4 Mon Sep 17 00:00:00 2001 From: GVSharma Date: Sat, 26 Oct 2019 21:20:47 +0530 Subject: [PATCH] local variable type inference changes (#1042) * local variable type inference changes local variable type inference changes for thread pool design pattern * local variable type inference changes local variable type inference changes for ThreadPool design pattern --- thread-pool/src/main/java/com/iluwatar/threadpool/App.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thread-pool/src/main/java/com/iluwatar/threadpool/App.java b/thread-pool/src/main/java/com/iluwatar/threadpool/App.java index a4c1887d3..9fe16d36a 100644 --- a/thread-pool/src/main/java/com/iluwatar/threadpool/App.java +++ b/thread-pool/src/main/java/com/iluwatar/threadpool/App.java @@ -81,13 +81,13 @@ public class App { // unbounded queue. At any point, at most nThreads threads will be active processing // tasks. If additional tasks are submitted when all threads are active, they will wait // in the queue until a thread is available. - ExecutorService executor = Executors.newFixedThreadPool(3); + var executor = Executors.newFixedThreadPool(3); // Allocate new worker for each task // The worker is executed when a thread becomes // available in the thread pool for (int i = 0; i < tasks.size(); i++) { - Runnable worker = new Worker(tasks.get(i)); + var worker = new Worker(tasks.get(i)); executor.execute(worker); } // All tasks were executed, now shutdown