Code example for TreeSet

Methods: toStringclearcontains

    public synchronized String getString(final String key) {
        final String retval = (String) this.cache.get(key);
        if (retval != null) {
            return retval;
        return internalGetString(key);
     * Performs the lookup for the given key. If the key points to a link the link is 
     * resolved and that key is looked up instead. 
     * @param key the key for the string 
     * @return the string for the given key 
    protected String internalGetString(final String key) {
        if (this.lookupPath.contains(key)) {
            throw new MissingResourceException
                ("InfiniteLoop in resource lookup", 
                    getResourceBase(), this.lookupPath.toString());
        final String fromResBundle = this.resources.getString(key);
        if (fromResBundle.startsWith("@@")) {
            // global forward ... 
            final int idx = fromResBundle.indexOf('@', 2);
Experience pair programming with AI  Get Codota for Java