<commit_before>package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public final class MainPanel extends JPanel {
    private MainPanel() {
        super(new BorderLayout());

        final JProgressBar progressBar = new JProgressBar();
        progressBar.setIndeterminate(true);
        JPanel p = new JPanel(new GridBagLayout());
        p.add(progressBar);

        int cycleTime = UIManager.getInt("ProgressBar.cycleTime");
        final JSpinner cycleTimeSpinner = new JSpinner(new SpinnerNumberModel(cycleTime, 1000, 10000, 100));

        int repaintInterval = UIManager.getInt("ProgressBar.repaintInterval");
        final JSpinner repaintIntervalSpinner = new JSpinner(new SpinnerNumberModel(repaintInterval, 10, 100, 10));

        Box box = Box.createHorizontalBox();
        box.add(Box.createHorizontalGlue());
        box.add(new JButton(new AbstractAction("UIManager.put") {
            @Override public void actionPerformed(ActionEvent e) {
                progressBar.setIndeterminate(false);
                UIManager.put("ProgressBar.repaintInterval", (Integer) repaintIntervalSpinner.getValue());
                UIManager.put("ProgressBar.cycleTime", (Integer) cycleTimeSpinner.getValue());
                progressBar.setIndeterminate(true);
            }
        }));

        JPanel sp = new JPanel(new GridLayout(3, 2, 5, 5));
        sp.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        sp.add(new JLabel("ProgressBar.cycleTime:", SwingConstants.RIGHT));
        sp.add(cycleTimeSpinner);
        sp.add(new JLabel("ProgressBar.repaintInterval:", SwingConstants.RIGHT));
        sp.add(repaintIntervalSpinner);
        sp.add(Box.createHorizontalStrut(5));
        sp.add(box);

        add(sp, BorderLayout.NORTH);
        add(p);
        //add(box, BorderLayout.SOUTH);
        setPreferredSize(new Dimension(320, 240));
    }
    public static void main(String... args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException | InstantiationException
               | IllegalAccessException | UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
<commit_msg>refactor: use a lambda expression instead of an anonymous class(ActionListener)<commit_after>package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public final class MainPanel extends JPanel {
    private MainPanel() {
        super(new BorderLayout());

        JProgressBar progressBar = new JProgressBar();
        progressBar.setIndeterminate(true);
        JPanel p = new JPanel(new GridBagLayout());
        p.add(progressBar);

        int cycleTime = UIManager.getInt("ProgressBar.cycleTime");
        JSpinner cycleTimeSpinner = new JSpinner(new SpinnerNumberModel(cycleTime, 1000, 10000, 100));

        int repaintInterval = UIManager.getInt("ProgressBar.repaintInterval");
        JSpinner repaintIntervalSpinner = new JSpinner(new SpinnerNumberModel(repaintInterval, 10, 100, 10));

        JButton button = new JButton("UIManager.put");
        button.addActionListener(e -> {
            progressBar.setIndeterminate(false);
            UIManager.put("ProgressBar.repaintInterval", (Integer) repaintIntervalSpinner.getValue());
            UIManager.put("ProgressBar.cycleTime", (Integer) cycleTimeSpinner.getValue());
            progressBar.setIndeterminate(true);
        });

        Box box = Box.createHorizontalBox();
        box.add(Box.createHorizontalGlue());
        box.add(button);

        JPanel sp = new JPanel(new GridLayout(3, 2, 5, 5));
        sp.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        sp.add(new JLabel("ProgressBar.cycleTime:", SwingConstants.RIGHT));
        sp.add(cycleTimeSpinner);
        sp.add(new JLabel("ProgressBar.repaintInterval:", SwingConstants.RIGHT));
        sp.add(repaintIntervalSpinner);
        sp.add(Box.createHorizontalStrut(5));
        sp.add(box);

        add(sp, BorderLayout.NORTH);
        add(p);
        //add(box, BorderLayout.SOUTH);
        setPreferredSize(new Dimension(320, 240));
    }
    public static void main(String... args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException | InstantiationException
               | IllegalAccessException | UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

{'fraction_non_alphanumeric': 0.1184656556645852, 'fraction_numerical': 0.012845673505798395, 'mean_word_length': 2.8608815426997247, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1884794', 'n_tokens_mistral': 1640, 'n_tokens_neox': 1574, 'n_words': 292}