コード例 #1
0
  public static String getString(String val) {

    if (val == null || val.length() > maxStringLength) {
      return val;
    }

    synchronized (stringPool) {
      return stringPool.getOrAddString(val);
    }
  }
コード例 #2
0
  public static String getSubString(String val, int start, int limit) {

    synchronized (stringPool) {
      return stringPool.getOrAddString(val.substring(start, limit));
    }
  }