<commit_before>/**
 * Copyright 2013 <NAME>
 */
package org.mini2Dx.core.screen.util;

/**
 *
 * @author <NAME>
 */
public class ArrayUtils extends org.apache.commons.lang3.ArrayUtils {

	public static <T> T[] insert(T[] array, T item) {
		for(int i = 0; i < array.length; i++) {
			if(array[i] == null) {
				array[i] = item;
				return array;
			}
		}
		return add(array, item);
	}
}<commit_msg>Added non-null counting method to ArrayUtils<commit_after>/**
 * Copyright 2013 <NAME>
 */
package org.mini2Dx.core.screen.util;

/**
 *
 * @author <NAME>
 */
public class ArrayUtils extends org.apache.commons.lang3.ArrayUtils {

	public static <T> T[] insert(T[] array, T item) {
		for(int i = 0; i < array.length; i++) {
			if(array[i] == null) {
				array[i] = item;
				return array;
			}
		}
		return add(array, item);
	}
	
	public static <T> int getNumberOfElements(T[] array) {
		int result = 0;
		for(int i = 0; i < array.length; i++) {
			if(array[i] != null) {
				result++;
			}
		}
		return result;
	}
}
{'fraction_non_alphanumeric': 0.17391304347826086, 'fraction_numerical': 0.015810276679841896, 'mean_word_length': 3.052, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 10, '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': '5526502', 'n_tokens_mistral': 433, 'n_tokens_neox': 376, 'n_words': 97}