Simplify code
Motivation: Code can be simplified Modification: Refactor code to remove extra branching Result: Cleaner code.
This commit is contained in:
parent
ed37cf20ef
commit
e58095c4f2
@ -107,14 +107,8 @@ public class DefaultThreadFactory implements ThreadFactory {
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread t = newThread(new DefaultRunnableDecorator(r), prefix + nextId.incrementAndGet());
|
||||
try {
|
||||
if (t.isDaemon()) {
|
||||
if (!daemon) {
|
||||
t.setDaemon(false);
|
||||
}
|
||||
} else {
|
||||
if (daemon) {
|
||||
t.setDaemon(true);
|
||||
}
|
||||
if (t.isDaemon() != daemon) {
|
||||
t.setDaemon(daemon);
|
||||
}
|
||||
|
||||
if (t.getPriority() != priority) {
|
||||
|
Loading…
Reference in New Issue
Block a user