public static String getString(String val) { if (val == null || val.length() > maxStringLength) { return val; } synchronized (stringPool) { return stringPool.getOrAddString(val); } }
public static String getSubString(String val, int start, int limit) { synchronized (stringPool) { return stringPool.getOrAddString(val.substring(start, limit)); } }