从缓存中查找指定类型的线程池，如果存在那么直接返回，如果不存在那么创建返回

@param type   线程池类型
@param format 线程名格式，格式为：format-%d，其中%d将被替换为从0开始的数字序列，不能为null
@return 指定类型的线程池
543308
public static ExecutorService getOrCreatePool(PoolType type, String format) {
        ExecutorService service = cache.get(type);
        if (service == null || service.isTerminated() || service.isShutdown()) {
            //检查是否符合格式
            String.format(format, 0);

            synchronized (cache) {
                if (service == null || service.isTerminated() || service.isShutdown()) {
                    ThreadFactory factory = build(format);

                    service = build(type, factory);
                    cache.put(type, service);
                }
            }
        }
        return service;
    }
609456
public static String getIndexedFormat(int index, String format) {
		if (index < 1)
			throw new IllegalArgumentException();
		if (format == null)
			throw new NullPointerException();
		if (format.length() == 0)
			throw new IllegalArgumentException();
		return String.format(INDEXED_FORMAT, index, format);
	}
1149927
public static String format(final Date date, final String format) {
		return format(date.getTime(), format);
	}
1276993
public static PactDslRootValue time(String format) {
    FastDateFormat instance = FastDateFormat.getInstance(format);
    PactDslRootValue value = new PactDslRootValue();
    value.generators.addGenerator(Category.BODY, "", new TimeGenerator(format));
    value.setValue(instance.format(new Date(DATE_2000)));
    value.setMatcher(value.matchTime(format));
    return value;
  }
401119
@Trivial
    public void setFormatString(String format) {
        this.stringFormat = format;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Set access format to " + format);
        }
        parseFormat();
    }
974268
public void setGWTFormat(final String format) {
        this.format = toBootstrapDateFormat(format);

        // Get the old value
        final Date oldValue = getValue();

        // Make the new DateTimeFormat
        this.dateTimeFormat = DateTimeFormat.getFormat(format);

        if (oldValue != null) {
            setValue(oldValue);
        }
    }
671647
public static Marshaller getMarshaller(MarshallingFormat format, ClassLoader classLoader) {
        return getMarshaller(null, format, classLoader);
    }
706895
public final String formatStart(Format format) {
        if (format != null) {
            Long minStart = interval.getMinStart();
            if (minStart != null) {
                return format.format(minStart);
            } else {
                return null;
            }
        } else {
            Long minStart = interval.getMinStart();
            if (minStart != null) {
                return numberFormat.get().format(minStart);
            } else {
                return null;
            }
        }
    }
1107337
public static String convertFormat(String format) {
		if (format == null)
			return null;
		else {
			// day of week
			format = format.replaceAll("EEE", "D");
			// year
			format = format.replaceAll("yy", "y");

			// month
			if (format.indexOf("MMM") != -1) {
				format = format.replaceAll("MMM", "M");
			} else {
				format = format.replaceAll("M", "m");
			}
			return format;
		}
	}
390166
public static ExecutorService createPool(PoolType type, String format) {
        //检查是否符合格式
        String.format(format, 0);
        //线程工厂
        ThreadFactory factory = new ThreadFactory() {
            AtomicInteger counter = new AtomicInteger(0);

            @Override
            public Thread newThread(Runnable r) {
                return new Thread(r, String.format(format, counter.getAndAdd(1)));
            }
        };

        return build(type, factory);
    }
18859
private static Date toDateWithFormatString(String date, String format) {
    if (date == null) {
      return null;
    }

    try {
      return strategy.formatFor(format).parse(date);
    } catch (ParseException e) {
      UTILS_LOGGER.trace("Unable to parse date '{}' using format string '{}': {}", date, format, e);

      return null;
    }
  }
786061
public static PactDslJsonRootValue date(String format) {
    FastDateFormat instance = FastDateFormat.getInstance(format);
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    value.generators.addGenerator(Category.BODY, "", new DateGenerator(format));
    value.setValue(instance.format(new Date(DATE_2000)));
    value.setMatcher(value.matchDate(format));
    return value;
  }
1182259
public Date getDate(String name, String format) {
        Object value = get(name);
        if (value instanceof Date) {
            return (Date)value;
        }
        
        if (value != null) {
            try {
                return new SimpleDateFormat(format).parse(value.toString());
            } catch (ParseException e) {
                // ignore
            }
        }
        return null;
    }
377310
public static void v(String format, Object... args) {
    assertInitialization();
    sLogger.v(format, args);
  }
693078
public PactDslJsonArray timestamp(String format) {
      FastDateFormat instance = FastDateFormat.getInstance(format);
      body.put(instance.format(new Date(DATE_2000)));
      generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(0), new DateTimeGenerator(format));
      matchers.addRule(rootPath + appendArrayIndex(0), matchTimestamp(format));
      return this;
    }
776919
public static void logPrintf(String format, String... v) {
        if (enableLog) {
            String tmp = String.format(format, (Object[]) v);
            logger.log(Level.INFO, tmp);
        }
    }
1029315
public static ImageWriter getWriterForFormat(String format) throws SlickException
	{
		ImageWriter writer = (ImageWriter) writers.get(format);
		if (writer != null) {
			return writer;
		}
		
		writer = (ImageWriter) writers.get(format.toLowerCase());
		if (writer != null) {
			return writer;
		}
		
		writer = (ImageWriter) writers.get(format.toUpperCase());
		if (writer != null) {
			return writer;
		}
		
		throw new SlickException("No image writer available for: "+format);
	}