<commit_before>package me.xephore.virustotal2bind;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.io.IOException;
import java.net.MalformedURLException;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import me.xephore.virustotal2bind.events.ButtonEvent;
import me.xephore.virustotal2bind.events.TextFieldEvent;

public class Gui extends JFrame implements GuiApi {

	private static final long serialVersionUID = 3409741954230432504L;
	
	private JButton button;
	private JTextField textfield;
	private JTextArea textarea;
	private JLabel status;
	private JLabel detections;
	
	public Gui(String title) {
		super(title);
	}
	
	public void buildContainer() {
		setResizable(false);
		setPreferredSize(new Dimension(500, 300));
		setMaximumSize(new Dimension(500, 300));
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Image img = null;
		try {
			img = ImageIO.read(this.getClass().getResource("resources/scan.png"));
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		setIconImage(img);
		pack();
		setVisible(true);
	}
	
	
	public void createLayout() {
		
		setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS));
		JPanel p1 = new JPanel();
		p1.setSize(getContentPane().getWidth(), 80);
		
		this.textfield = new JTextField("example.org");
		
		textfield.setBackground(Color.WHITE);
		textfield.setPreferredSize(new Dimension(200, 30));
		textfield.setHorizontalAlignment(JTextField.CENTER);
		
		this.button = new JButton("convert!");
		
		p1.add(textfield);
		p1.add(button);
		add(p1);
	
		JPanel p2 = new JPanel();
		this.textarea = new JTextArea();
		textarea.setPreferredSize(new Dimension(450, 290));
		textarea.setMaximumSize(new Dimension(450, 290));
		textarea.setAutoscrolls(true);
		textarea.setLineWrap(true);
		textarea.setEditable(false);
		textarea.setAlignmentX(JTextArea.CENTER_ALIGNMENT);
		
		p2.add(textarea);
		add(p2);
		
		JPanel p3 = new JPanel();
		p3.setSize(getContentPane().getWidth(), 40);
		this.status = new JLabel("status: idle...");
		this.detections = new JLabel("detections: 0");
		p3.add(status);
		p3.add(detections);
		add(p3);
	}
	
	public void startListeners() {
		button.addActionListener(new ButtonEvent(this));
		textfield.addKeyListener(new TextFieldEvent(this));
	}

	@Override
	public JButton getButton() {
		return button;
	}

	@Override
	public JTextField getTextField() {
		return textfield;
	}

	@Override
	public JTextArea getTextArea() {
		return textarea;
	}

	@Override
	public JLabel getStatus() {
		return status;
	}

	@Override
	public JLabel getDetections() {
		return detections;
	}
	
	
}<commit_msg>made both methods getStatus and getDetections synchronized<commit_after>package me.xephore.virustotal2bind;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.io.IOException;
import java.net.MalformedURLException;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import me.xephore.virustotal2bind.events.ButtonEvent;
import me.xephore.virustotal2bind.events.TextFieldEvent;

public class Gui extends JFrame implements GuiApi {

	private static final long serialVersionUID = 3409741954230432504L;
	
	private JButton button;
	private JTextField textfield;
	private JTextArea textarea;
	private JLabel status;
	private JLabel detections;
	
	public Gui(String title) {
		super(title);
	}
	
	public void buildContainer() {
		setResizable(false);
		setPreferredSize(new Dimension(500, 300));
		setMaximumSize(new Dimension(500, 300));
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Image img = null;
		try {
			img = ImageIO.read(this.getClass().getResource("resources/scan.png"));
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		setIconImage(img);
		pack();
		setVisible(true);
	}
	
	
	public void createLayout() {
		
		setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS));
		JPanel p1 = new JPanel();
		p1.setSize(getContentPane().getWidth(), 80);
		
		this.textfield = new JTextField("example.org");
		
		textfield.setBackground(Color.WHITE);
		textfield.setPreferredSize(new Dimension(200, 30));
		textfield.setHorizontalAlignment(JTextField.CENTER);
		
		this.button = new JButton("convert!");
		
		p1.add(textfield);
		p1.add(button);
		add(p1);
	
		JPanel p2 = new JPanel();
		this.textarea = new JTextArea();
		textarea.setPreferredSize(new Dimension(450, 290));
		textarea.setMaximumSize(new Dimension(450, 290));
		textarea.setAutoscrolls(true);
		textarea.setLineWrap(true);
		textarea.setEditable(false);
		textarea.setAlignmentX(JTextArea.CENTER_ALIGNMENT);
		
		p2.add(textarea);
		add(p2);
		
		JPanel p3 = new JPanel();
		p3.setSize(getContentPane().getWidth(), 40);
		this.status = new JLabel("status: idle...");
		this.detections = new JLabel("detections: 0");
		p3.add(status);
		p3.add(detections);
		add(p3);
	}
	
	public void startListeners() {
		button.addActionListener(new ButtonEvent(this));
		textfield.addKeyListener(new TextFieldEvent(this));
	}

	@Override
	public JButton getButton() {
		return button;
	}

	@Override
	public JTextField getTextField() {
		return textfield;
	}

	@Override
	public JTextArea getTextArea() {
		return textarea;
	}

	@Override
	public synchronized JLabel getStatus() {
		return status;
	}

	@Override
	public synchronized JLabel getDetections() {
		return detections;
	}
	
	
}
{'fraction_non_alphanumeric': 0.11901108269394714, 'fraction_numerical': 0.023529411764705882, 'mean_word_length': 4.931243680485339, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2387000', 'n_tokens_mistral': 2231, 'n_tokens_neox': 1934, 'n_words': 392}