<commit_before>import java.awt.AWTException;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import javax.imageio.ImageIO;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Sergio
 */
public class SystemTrayMenu {
	private ScreenshotUploader s;
	private PartialScreen cp;
	private CompleteScreen c;
	private Clipboard clpbrd;
	private StringSelection stringSelection;

	public SystemTrayMenu(final String ip, final String id, final String pass)
			throws AWTException, IOException, UnsupportedAudioFileException,
			LineUnavailableException {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException ex) {
			System.err.println(ex.toString());
		}
		if (SystemTray.isSupported()) {
			clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
			final SystemTray st = SystemTray.getSystemTray();

			final TrayIcon trayIcon = new TrayIcon(ImageIO.read(getClass()
					.getResource("/res/icona.jpg")), "ownPuush");
			trayIcon.setImageAutoSize(true);

			final JPopupMenu p = new JPopupMenu();
			JMenuItem catturaArea = new JMenuItem("Cattura area");
			JMenuItem catturaDesktop = new JMenuItem("Cattura Desktop");
			JMenuItem esci = new JMenuItem("Esci");
			p.add(catturaArea);
			p.add(catturaDesktop);
			p.add(esci);

			final Clip clip = AudioSystem.getClip();
			clip.open(AudioSystem.getAudioInputStream(getClass().getResource(
					"/res/complete.wav")));

			catturaArea.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {

					p.setVisible(false);
					cp = new PartialScreen();
					try {
						s = new ScreenshotUploader(cp.getSelection(), ip);
						s.send(id, pass);
						trayIcon.displayMessage("<NAME>!", s.getLink(),
								TrayIcon.MessageType.INFO);
						stringSelection = new StringSelection(s.getLink());
						clpbrd.setContents(stringSelection, null);
					} catch (IOException | AWTException ex) {
						System.err.println(ex.toString());
					}
					clip.start();
					clip.setFramePosition(0);
				}
			});

			catturaDesktop.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					p.setVisible(false);
					try {
						c = new CompleteScreen();
						s = new ScreenshotUploader(c.getImg(), ip);
						s.send(id, pass);
						trayIcon.displayMessage("<NAME>!", s.getLink(),
								TrayIcon.MessageType.INFO);
						stringSelection = new StringSelection(s.getLink());
						clpbrd.setContents(stringSelection, null);
					} catch (IOException ex) {
						System.err.println(ex.toString());
					}
					clip.start();
					clip.setFramePosition(0);
				}
			});

			esci.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					SystemTray.getSystemTray().remove(trayIcon);
					System.exit(0);
				}
			});

			MouseAdapter mouseAdapter = new MouseAdapter() {

				@Override
				public void mouseClicked(MouseEvent e) {
					if (e.getButton() == 3) {
						p.show(e.getComponent(), e.getX(), e.getY() - 70);
					}
				}
			};

			trayIcon.addMouseListener(mouseAdapter);
			st.add(trayIcon);
		}
	}

	public static void main(String[] args) throws InterruptedException,
			InvocationTargetException, AWTException, IOException,
			UnsupportedAudioFileException, LineUnavailableException {
		LoadConfig l = new LoadConfig();
		SystemTrayMenu st = new SystemTrayMenu(l.getIp(), l.getId(),
				l.getPass());
	}

}
<commit_msg>Fix glitch audio<commit_after>import java.awt.AWTException;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import javax.imageio.ImageIO;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Sergio
 */
public class SystemTrayMenu {
	private ScreenshotUploader s;
	private PartialScreen cp;
	private CompleteScreen c;
	private Clipboard clpbrd;
	private StringSelection stringSelection;

	public SystemTrayMenu(final String ip, final String id, final String pass)
			throws AWTException, IOException, UnsupportedAudioFileException,
			LineUnavailableException {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException ex) {
			System.err.println(ex.toString());
		}
		if (SystemTray.isSupported()) {
			clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
			final SystemTray st = SystemTray.getSystemTray();

			final TrayIcon trayIcon = new TrayIcon(ImageIO.read(getClass()
					.getResource("/res/icona.jpg")), "ownPuush");
			trayIcon.setImageAutoSize(true);

			final JPopupMenu p = new JPopupMenu();
			JMenuItem catturaArea = new JMenuItem("Cattura area");
			JMenuItem catturaDesktop = new JMenuItem("Cattura Desktop");
			JMenuItem esci = new JMenuItem("Esci");
			p.add(catturaArea);
			p.add(catturaDesktop);
			p.add(esci);

			final Clip clip = AudioSystem.getClip();
			clip.open(AudioSystem.getAudioInputStream(getClass().getResource(
					"/res/complete.wav")));

			catturaArea.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {

					p.setVisible(false);
					cp = new PartialScreen();
					try {
						s = new ScreenshotUploader(cp.getSelection(), ip);
						s.send(id, pass);
						trayIcon.displayMessage("Pu<NAME>!", s.getLink(),
								TrayIcon.MessageType.INFO);
						stringSelection = new StringSelection(s.getLink());
						clpbrd.setContents(stringSelection, null);
					} catch (IOException | AWTException ex) {
						System.err.println(ex.toString());
					}
					clip.start();
					clip.setFramePosition(0);
					clip.flush();
				}
			});

			catturaDesktop.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					p.setVisible(false);
					try {
						c = new CompleteScreen();
						s = new ScreenshotUploader(c.getImg(), ip);
						s.send(id, pass);
						trayIcon.displayMessage("Pu<NAME>!", s.getLink(),
								TrayIcon.MessageType.INFO);
						stringSelection = new StringSelection(s.getLink());
						clpbrd.setContents(stringSelection, null);
					} catch (IOException ex) {
						System.err.println(ex.toString());
					}
					clip.start();
					clip.setFramePosition(0);
					clip.flush();
				}
			});

			esci.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					SystemTray.getSystemTray().remove(trayIcon);
					System.exit(0);
				}
			});

			MouseAdapter mouseAdapter = new MouseAdapter() {

				@Override
				public void mouseClicked(MouseEvent e) {
					if (e.getButton() == 3) {
						p.show(e.getComponent(), e.getX(), e.getY() - 70);
					}
				}
			};

			trayIcon.addMouseListener(mouseAdapter);
			st.add(trayIcon);
		}
	}

	public static void main(String[] args) throws InterruptedException,
			InvocationTargetException, AWTException, IOException,
			UnsupportedAudioFileException, LineUnavailableException {
		LoadConfig l = new LoadConfig();
		SystemTrayMenu st = new SystemTrayMenu(l.getIp(), l.getId(),
				l.getPass());
	}

}

{'fraction_non_alphanumeric': 0.11815458358298382, 'fraction_numerical': 0.001437986818454164, 'mean_word_length': 4.1742095474271546, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4003192', 'n_tokens_mistral': 3142, 'n_tokens_neox': 2603, 'n_words': 486}