去掉jdk17中被标记为废弃的安全管理器

This commit is contained in:
aoshiguchen
2024-01-24 21:03:03 +08:00
parent 5f39869400
commit 9dc6f0d479
@@ -35,9 +35,7 @@ public class CustomThreadFactory implements ThreadFactory {
private final String namePrefix;
public CustomThreadFactory(String prefix) {
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
group = Thread.currentThread().getThreadGroup();
namePrefix = prefix + "-thread-";
}