diff --git a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java index 19c6d08c2d..62a6359a34 100644 --- a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java +++ b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java @@ -2,8 +2,8 @@ package com.baeldung.concurrent.threadlifecycle; public class BlockedState { public static void main(String[] args) throws InterruptedException { - Thread t1 = new Thread(new DemoThreadB()); - Thread t2 = new Thread(new DemoThreadB()); + Thread t1 = new Thread(new DemoBlockedRunnable()); + Thread t2 = new Thread(new DemoBlockedRunnable()); t1.start(); t2.start(); @@ -15,7 +15,7 @@ public class BlockedState { } } -class DemoThreadB implements Runnable { +class DemoBlockedRunnable implements Runnable { @Override public void run() { commonResource(); diff --git a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java index 8d005352eb..1ba9625e93 100644 --- a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java +++ b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java @@ -2,8 +2,8 @@ package com.baeldung.concurrent.threadlifecycle; public class TimedWaitingState { public static void main(String[] args) throws InterruptedException { - DemoThread obj1 = new DemoThread(); - Thread t1 = new Thread(obj1); + DemoTimeWaitingRunnable runnable = new DemoTimeWaitingRunnable(); + Thread t1 = new Thread(runnable); t1.start(); // The following sleep will give enough time for ThreadScheduler // to start processing of thread t1 @@ -12,13 +12,14 @@ public class TimedWaitingState { } } -class DemoThread implements Runnable { +class DemoTimeWaitingRunnable implements Runnable { @Override public void run() { try { Thread.sleep(5000); } catch (InterruptedException e) { - Thread.currentThread().interrupt(); + Thread.currentThread() + .interrupt(); e.printStackTrace(); } } diff --git a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java index 98a6844309..b5cdbb31db 100644 --- a/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java +++ b/core-java-modules/core-java-concurrency-simple/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java @@ -9,7 +9,7 @@ public class WaitingState implements Runnable { } public void run() { - Thread t2 = new Thread(new DemoThreadWS()); + Thread t2 = new Thread(new DemoWaitingStateRunnable()); t2.start(); try { @@ -21,7 +21,7 @@ public class WaitingState implements Runnable { } } -class DemoThreadWS implements Runnable { +class DemoWaitingStateRunnable implements Runnable { public void run() { try { Thread.sleep(1000);