<commit_before>package org.hrg.javawatcher;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;

import org.hrg.javawatcher.FileChangeEntry;
import org.hrg.javawatcher.FileMatchGlob;
import org.hrg.javawatcher.FolderWatcher;

/**
 *  Incomplete example showing how to compile sass file on change.
 *  The compilation step is omitted to make it simple to understand
 *  what this library does.
 * */
public class SimpleCompileExample {

	public static void main(String[] args) {
		
		FolderWatcher<FileMatchGlob> folderWatcher = new FolderWatcher<>();
		// create matcher on current folder without checking sub-folders
		FileMatchGlob matcher = new FileMatchGlob(Paths.get("./"), false);

		// if we do not define rules, then any file found will be accepted
		// match any .scss file in root folder
		matcher.addIncludes("*.scss");

		folderWatcher.add(matcher);
		
		//start watching, no configuration should happen after this as it wil give unexpected results
		folderWatcher.init(true);
		
		while(!Thread.interrupted()){
			Collection<FileChangeEntry<FileMatchGlob>> changedFiles = folderWatcher.take();
			
			for (FileChangeEntry<FileMatchGlob> changed : changedFiles) {
				compileSass(changed.getPath());
			}
		}
	}

	static void compileSass(Path sassFile){
		System.out.println("compile: "+sassFile);
		// implement compilation here
	}
}
<commit_msg>refactor<commit_after>package org.hrg.javawatcher;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;

import org.hrg.javawatcher.FileChangeEntry;
import org.hrg.javawatcher.FileMatchGlob;
import org.hrg.javawatcher.FolderWatcher;

/**
 *  Incomplete example showing how to compile sass file on change.
 *  The compilation step is omitted to make it simple to understand
 *  what this library does.
 * */
public class SimpleCompileExample {

	public static void main(String[] args) {
		
		FolderWatcher<FileMatchGlob> folderWatcher = new FolderWatcher<>();
		// create matcher on current folder without checking sub-folders
		FileMatchGlob matcher = new FileMatchGlob(Paths.get("./"), false);

		// if we do not define rules, then any file found will be accepted
		// match any .scss file in root folder
		matcher.includes("*.scss");

		folderWatcher.add(matcher);
		
		//start watching, no configuration should happen after this as it wil give unexpected results
		folderWatcher.init(true);
		
		while(!Thread.interrupted()){
			Collection<FileChangeEntry<FileMatchGlob>> changedFiles = folderWatcher.take();
			
			for (FileChangeEntry<FileMatchGlob> changed : changedFiles) {
				compileSass(changed.getPath());
			}
		}
	}

	static void compileSass(Path sassFile){
		System.out.println("compile: "+sassFile);
		// implement compilation here
	}
}

{'fraction_non_alphanumeric': 0.10158501440922191, 'fraction_numerical': 0.0, 'mean_word_length': 4.371373307543521, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '7389761', 'n_tokens_mistral': 909, 'n_tokens_neox': 825, 'n_words': 238}