Remove deprecated securitymanager
This commit is contained in:
parent
e4ba8dcd68
commit
1c4c49c24c
@ -49,9 +49,7 @@ public class ShortNamedThreadFactory implements ThreadFactory {
|
|||||||
* @param threadNamePrefix the name prefix assigned to each thread created.
|
* @param threadNamePrefix the name prefix assigned to each thread created.
|
||||||
*/
|
*/
|
||||||
public ShortNamedThreadFactory(String threadNamePrefix) {
|
public ShortNamedThreadFactory(String threadNamePrefix) {
|
||||||
final SecurityManager s = System.getSecurityManager();
|
group = Thread.currentThread().getThreadGroup();
|
||||||
group = (s != null) ? s.getThreadGroup() : Thread.currentThread()
|
|
||||||
.getThreadGroup();
|
|
||||||
this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN,
|
this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN,
|
||||||
checkPrefix(threadNamePrefix), threadPoolNumber[(threadNamePrefix.hashCode() % POOL_NUMBERS_COUNT / 2) + POOL_NUMBERS_COUNT / 2].getAndIncrement());
|
checkPrefix(threadNamePrefix), threadPoolNumber[(threadNamePrefix.hashCode() % POOL_NUMBERS_COUNT / 2) + POOL_NUMBERS_COUNT / 2].getAndIncrement());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user