<commit_before>// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@

package example;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;

public final class MainPanel extends JPanel {
  private final String[] columnNames = {"String", "Integer", "Boolean"};
  private final Object[][] data = {
    {"aaa", 12, true}, {"bbb", 5, false},
    {"CCC", 92, true}, {"DDD", 0, false}
  };
  private final TableModel model = new DefaultTableModel(data, columnNames) {
    @Override public Class<?> getColumnClass(int column) {
      return getValueAt(0, column).getClass();
    }

    @Override public boolean isCellEditable(int row, int column) {
      return column != 0;
    }
  };

  private MainPanel() {
    super(new BorderLayout());
    int targetColIdx = 0;

    JTable table1 = new JTable(model) {
      @Override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
        if (convertColumnIndexToModel(columnIndex) != targetColIdx) {
          return;
        }
        super.changeSelection(rowIndex, columnIndex, toggle, extend);
      }

      @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
        if (convertColumnIndexToModel(column) != targetColIdx) {
          return renderer.getTableCellRendererComponent(this, getValueAt(row, column), false, false, row, column);
        }
        return super.prepareRenderer(renderer, row, column);
      }
    };

    JTable table2 = new JTable(model) {
      @Override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
        if (convertColumnIndexToModel(columnIndex) != targetColIdx) {
          return;
        }
        super.changeSelection(rowIndex, columnIndex, toggle, extend);
      }<commit_msg>refactor: field can be converted to a local variable<commit_after>// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@

package example;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;

public final class MainPanel extends JPanel {
  private MainPanel() {
    super(new BorderLayout());
    int targetColIdx = 0;

    String[] columnNames = {"String", "Integer", "Boolean"};
    Object[][] data = {
      {"aaa", 12, true}, {"bbb", 5, false},
      {"CCC", 92, true}, {"DDD", 0, false}
    };
    TableModel model = new DefaultTableModel(data, columnNames) {
      @Override public Class<?> getColumnClass(int column) {
        return getValueAt(0, column).getClass();
      }

      @Override public boolean isCellEditable(int row, int column) {
        return column != 0;
      }
    };

    JTable table1 = new JTable(model) {
      @Override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
        if (convertColumnIndexToModel(columnIndex) != targetColIdx) {
          return;
        }
        super.changeSelection(rowIndex, columnIndex, toggle, extend);
      }

      @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
        if (convertColumnIndexToModel(column) != targetColIdx) {
          return renderer.getTableCellRendererComponent(this, getValueAt(row, column), false, false, row, column);
        }
        return super.prepareRenderer(renderer, row, column);
      }
    };

    JTable table2 = new JTable(model) {
      @Override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
        if (convertColumnIndexToModel(columnIndex) != targetColIdx) {
          return;
        }
        super.changeSelection(rowIndex, columnIndex, toggle, extend);
      }
{'fraction_non_alphanumeric': 0.1175109282591926, 'fraction_numerical': 0.006685523270763692, 'mean_word_length': 3.365881032547699, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5932000', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1077, 'n_words': 300}