<commit_before>package net.fusejna;

import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import com.sun.jna.Function;
import com.sun.jna.Pointer;

public final class DirectoryFiller
{
	private static final String currentDirectory = ".";
	private static final String parentDirectory = "..";
	private final Pointer buf;
	private final Function nativeFunction;
	private final Set<String> addedFiles = new HashSet<String>();

	DirectoryFiller(final Pointer buf, final Function nativeFunction)
	{
		this.buf = buf;
		this.nativeFunction = nativeFunction;
		add(currentDirectory, parentDirectory);
	}

	public final boolean add(final Iterable<String> files)
	{
		int result;
		for (String file : files) {
			if (file.contains(File.separator)) {
				file = new File(file).getName(); // Keep only the name component
			}
			if (addedFiles.add(file)) {
				final Object[] args = { buf, file, null, 0 };
				result = nativeFunction.invokeInt(args);
				if (result != 0) {
					return false;
				}
			}
		}
		return true;
	}

	public final boolean add(final String... files)
	{
		return add(Arrays.asList(files));
	}

	@Override
	public String toString()
	{
		final StringBuilder output = new StringBuilder();
		int count = 0;
		for (final String file : addedFiles) {
			output.append(file);
			if (count < addedFiles.size() - 1) {
				output.append(", ");
			}
			count++;
		}
		return output.toString();
	}
}<commit_msg>Fixed bug in readdir() in 32-bit JVMs<commit_after>package net.fusejna;

import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import net.fusejna.types.TypeOff;

import com.sun.jna.Function;
import com.sun.jna.Pointer;

public final class DirectoryFiller
{
	private static final String currentDirectory = ".";
	private static final String parentDirectory = "..";
	private final Pointer buf;
	private final Function nativeFunction;
	private final Set<String> addedFiles = new HashSet<String>();

	DirectoryFiller(final Pointer buf, final Function nativeFunction)
	{
		this.buf = buf;
		this.nativeFunction = nativeFunction;
		add(currentDirectory, parentDirectory);
	}

	public final boolean add(final Iterable<String> files)
	{
		int result;
		for (String file : files) {
			if (file == null) {
				continue;
			}
			if (file.contains(File.separator)) {
				file = new File(file).getName(); // Keep only the name component
			}
			if (addedFiles.add(file)) {
				final Object[] args = { buf, file, null, new TypeOff(0L) };
				result = nativeFunction.invokeInt(args);
				if (result != 0) {
					return false;
				}
			}
		}
		return true;
	}

	public final boolean add(final String... files)
	{
		return add(Arrays.asList(files));
	}

	@Override
	public String toString()
	{
		final StringBuilder output = new StringBuilder();
		int count = 0;
		for (final String file : addedFiles) {
			output.append(file);
			if (count < addedFiles.size() - 1) {
				output.append(", ");
			}
			count++;
		}
		return output.toString();
	}
}
{'fraction_non_alphanumeric': 0.12239497188223619, 'fraction_numerical': 0.0033079722130334105, 'mean_word_length': 3.638036809815951, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '5984601', 'n_tokens_mistral': 1075, 'n_tokens_neox': 948, 'n_words': 269}