<commit_before>package com.matthewtamlin.mixtape.example.data;

import android.os.AsyncTask;
import android.os.Environment;

import com.matthewtamlin.java_utilities.file.FileFinder;
import com.matthewtamlin.mixtape.library.data.ListDataSourceAdapter;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import static android.os.Environment.getExternalStoragePublicDirectory;

public class Mp3SongDataSource extends ListDataSourceAdapter<Mp3Song> {
	private List<Mp3Song> songs = null;

	@Override
	public void loadData(final boolean forceRefresh,
			final DataLoadedListener<List<Mp3Song>> callback) {
		final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
			@Override
			protected Void doInBackground(final Void... params) {
				if (songs == null || forceRefresh) {
					songs = loadMp3SongsFromMusicDirectory();
				}

				return null;
			}

			@Override
			protected void onPostExecute(final Void aVoid) {
				callback.onDataLoaded(Mp3SongDataSource.this, songs);
			}
		};

		task.execute();
	}

	private List<Mp3Song> loadMp3SongsFromMusicDirectory() {
		final List<Mp3Song> mp3Songs = new ArrayList<>();

		final File musicDir = getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC);
		final Set<File> filesInMusicDir = FileFinder.searchDownTreeFrom(musicDir);

		for (final File file : filesInMusicDir) {
			final String[] splitName = file.getName().split(".");

			if (splitName[splitName.length - 1].toLowerCase().equals("mp3")) {
				mp3Songs.add(new Mp3Song(file));
			}
		}

		return mp3Songs;
	}
}<commit_msg>Added null check on callback<commit_after>package com.matthewtamlin.mixtape.example.data;

import android.os.AsyncTask;
import android.os.Environment;

import com.matthewtamlin.java_utilities.file.FileFinder;
import com.matthewtamlin.mixtape.library.data.ListDataSourceAdapter;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import static android.os.Environment.getExternalStoragePublicDirectory;

public class Mp3SongDataSource extends ListDataSourceAdapter<Mp3Song> {
	private List<Mp3Song> songs = null;

	@Override
	public void loadData(final boolean forceRefresh,
			final DataLoadedListener<List<Mp3Song>> callback) {
		final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
			@Override
			protected Void doInBackground(final Void... params) {
				if (songs == null || forceRefresh) {
					songs = loadMp3SongsFromMusicDirectory();
				}

				return null;
			}

			@Override
			protected void onPostExecute(final Void aVoid) {
				if (callback != null) {
					callback.onDataLoaded(Mp3SongDataSource.this, songs);
				}
			}
		};

		task.execute();
	}

	private List<Mp3Song> loadMp3SongsFromMusicDirectory() {
		final List<Mp3Song> mp3Songs = new ArrayList<>();

		final File musicDir = getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC);
		final Set<File> filesInMusicDir = FileFinder.searchDownTreeFrom(musicDir);

		for (final File file : filesInMusicDir) {
			final String[] splitName = file.getName().split(".");

			if (splitName[splitName.length - 1].toLowerCase().equals("mp3")) {
				mp3Songs.add(new Mp3Song(file));
			}
		}

		return mp3Songs;
	}
}
{'fraction_non_alphanumeric': 0.11015384615384616, 'fraction_numerical': 0.009230769230769232, 'mean_word_length': 4.847122302158273, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5220985', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1031, 'n_words': 213}