Update DoNotUseThreads rule documentation

Fixes #2313 [java] Documentation for DoNotUseThreads is outdated
This commit is contained in:
Saikat
2020-04-05 11:46:51 +05:30
parent 0356895cc2
commit dcde4258b3

View File

@ -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!"));
}
}
]]>