去掉jdk17中被标记为废弃的安全管理器
This commit is contained in:
+1
-3
@@ -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-";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user