String () { CharSequence text = myText; if (text.length() > 1000 && !(text instanceof String)) { // e.g. a large text file String cachedText = dereference(getUserData(CACHED_TEXT)); if (cachedText == null) { cachedText = text.toString(); putUserData(CACHED_TEXT, new SoftReference<>(cachedText)); } return cachedText; } return text.toString(); }