ScheduledExecutorService executorService = Executors.newScheduledThreadPool(100);
以上代码阿里的代码规范插件会提示手动创建线程池,用以下方式创建线程池
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("---thread-%d").build();
int size = 50;
ExecutorService executorService = new ThreadPoolExecutor(size,size,0L,TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(),namedThreadFactory);