<commit_before>package gui.tabbedPanels;

import java.awt.Color;
import java.awt.Cursor;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;

@SuppressWarnings("serial")
public class ErrorPanel extends JPanel
{
    public ErrorPanel()
    {
        super();
        initialize();
    }
    
    private JTextArea errorTextArea;
    
    private void initialize()
    {
        setLayout(null);
        
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setBackground(Color.WHITE);
        scrollPane.setBorder(new EmptyBorder(0, 3, 0, 3));
        scrollPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        scrollPane.setBounds(0, 0, 497, 168);
        add(scrollPane);
        
        errorTextArea = new JTextArea();
        errorTextArea.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
        errorTextArea.setEditable(false);
        errorTextArea.setLineWrap(true);
        errorTextArea.setWrapStyleWord(true);
        scrollPane.setViewportView(errorTextArea);
    }
    
    public void clear()
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            @Override
            public void run()
            {
                errorTextArea.setText("");
            }
        });
    }
    
    public String getLog()
    {
        return errorTextArea.getText();
    }
    
    public void print(String str)
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            @Override
            public void run()
            {
                errorTextArea.append(str + "\n");
            }
        });
    }
}
<commit_msg>comments for ErrorPanel<commit_after>package gui.tabbedPanels;

import java.awt.Color;
import java.awt.Cursor;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;

/**
 * JPanel to handle error logging
 * TODO modularize - make base class for Audit & Error Panel
 * @author <NAME>
 */
@SuppressWarnings("serial")
public class ErrorPanel extends JPanel
{
    /**
     * Initializes a JPanel with a JTextArea
     */
    public ErrorPanel()
    {
        super();
        initialize();
    }
    
    /**
     * JTextArea for error logs
     */
    private JTextArea errorTextArea;

    /**
     * Initialize the contents of the view.
     */
    private void initialize()
    {
        setLayout(null);
        
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setBackground(Color.WHITE);
        scrollPane.setBorder(new EmptyBorder(0, 3, 0, 3));
        scrollPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        scrollPane.setBounds(0, 0, 497, 168);
        add(scrollPane);
        
        errorTextArea = new JTextArea();
        errorTextArea.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
        errorTextArea.setEditable(false);
        errorTextArea.setLineWrap(true);
        errorTextArea.setWrapStyleWord(true);
        scrollPane.setViewportView(errorTextArea);
    }
    
    /**
     * Clears the logs
     */
    public void clear()
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            @Override
            public void run()
            {
                errorTextArea.setText("");
            }
        });
    }
    
    /**
     * Append text to the textArea in the panel
     * @param str Text to be added
     */
    public void print(String str)
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            @Override
            public void run()
            {
                errorTextArea.append(str + "\n");
            }
        });
    }
    
    // ~~~~~ Getters & Setters ~~~~~~ //
    /**
     * @return The entire log in the textArea
     */
    public String getLog()
    {
        return errorTextArea.getText();
    }
}

{'fraction_non_alphanumeric': 0.10337922403003755, 'fraction_numerical': 0.006007509386733416, 'mean_word_length': 2.0295678544351783, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4900332', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1146, 'n_words': 228}