<commit_before>/*
 * Created on 03/09/2005
 */
package org.python.pydev.core.docutils;

import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import javax.swing.text.html.HTMLEditorKit;

import org.python.pydev.core.Tuple;
import org.python.pydev.core.structure.FastStringBuffer;

public class StringUtils {

    /**
     * Formats a string, replacing %s with the arguments passed.
     * 
     * @param str string to be formatted
     * @param args arguments passed
     * @return a string with the %s replaced by the arguments passed
     */
    public static String format(String str, Object... args) {
        FastStringBuffer buffer = new FastStringBuffer(str.length()+(16*args.length));
        int j = 0;

        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c == '%' && i + 1 < str.length()) {
                char nextC = str.charAt(i + 1);
                if (nextC == 's') {
                    buffer.append(args[j].toString());
                    j++;
                    i++;
                } else if (nextC == '%') {
                    buffer.append('%');
                    j++;
                    i++;
                }<commit_msg>Changing things needed to compile with latest version.<commit_after>/*
 * Created on 03/09/2005
 */
package org.python.pydev.core.docutils;

import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import javax.swing.text.html.HTMLEditorKit;

import org.python.pydev.core.Tuple;
import org.python.pydev.core.structure.FastStringBuffer;

public class StringUtils {

    public static final Object EMPTY = "";

    /**
     * Formats a string, replacing %s with the arguments passed.
     * 
     * @param str string to be formatted
     * @param args arguments passed
     * @return a string with the %s replaced by the arguments passed
     */
    public static String format(String str, Object... args) {
        FastStringBuffer buffer = new FastStringBuffer(str.length()+(16*args.length));
        int j = 0;

        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c == '%' && i + 1 < str.length()) {
                char nextC = str.charAt(i + 1);
                if (nextC == 's') {
                    buffer.append(args[j].toString());
                    j++;
                    i++;
                } else if (nextC == '%') {
                    buffer.append('%');
                    j++;
                    i++;
                }
{'fraction_non_alphanumeric': 0.12880733944954129, 'fraction_numerical': 0.010275229357798165, 'mean_word_length': 1.8846560846560847, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1894296', 'n_tokens_mistral': 817, 'n_tokens_neox': 766, 'n_words': 216}