diff --git a/pmd-java/src/main/resources/category/java/multithreading.xml b/pmd-java/src/main/resources/category/java/multithreading.xml index d5db6eb8c2..3a26eb7a07 100644 --- a/pmd-java/src/main/resources/category/java/multithreading.xml +++ b/pmd-java/src/main/resources/category/java/multithreading.xml @@ -147,10 +147,28 @@ public class UsingThread extends Thread { } // Neither this, -public class OtherThread implements Runnable { - // Nor this ... - public void methode() { - Runnable thread = new Thread(); thread.run(); +public class UsingExecutorService { + + public void methodX() { + ExecutorService executorService = Executors.newFixedThreadPool(5); + } +} + +// Nor this, +public class Example implements ExecutorService { + +} + +// Nor this, +public class Example extends AbstractExecutorService { + +} + +// Nor this +public class UsingExecutors { + + public void methodX() { + Executors.newSingleThreadExecutor().submit(() -> System.out.println("Hello!")); } } ]]>