public String addSymbol(String buffer, int offset, int len, int hash, boolean replace) {
        final int bucket = hash & indexMask;

        String symbol = symbols[bucket];
        if (symbol != null) {
            if (hash == symbol.hashCode() // 
                    && len == symbol.length() //
                    && buffer.startsWith(symbol, offset)) {
                return symbol;
            }

            String str = subString(buffer, offset, len);

            if (replace) {
                symbols[bucket] = str;
            }

            return str;
        }
        
        symbol = len == buffer.length() //
            ? buffer //
            : subString(buffer, offset, len);
        symbol = symbol.intern();
        symbols[bucket] = symbol;
        return symbol;
    }
Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already
exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain
unique.

@param buffer The buffer containing the new symbol.
@param offset The offset into the buffer of the new symbol.
@param len The length of the new symbol in the buffer.
src/main/java/com/alibaba/fastjson/parser/SymbolTable.java