<commit_before>package com.matthewtamlin.spyglass.library.handler_adapters;

import android.content.res.TypedArray;

import com.matthewtamlin.spyglass.library.handler_annotations.StringHandler;

import static com.matthewtamlin.java_utilities.checkers.NullChecker.checkNotNull;

public class StringHandlerAdapter implements HandlerAdapter<String, StringHandler> {
	@Override
	public boolean attributeValueIsAvailable(
			final TypedArray attrs,
			final StringHandler annotation) {

		checkNotNull(attrs, "Argument \'attrs\' cannot be null.");
		checkNotNull(annotation, "Argument \'annotation\' cannot be null.");

		return attrs.hasValue(annotation.attributeId());
	}

	@Override
	public String getAttributeValue(final TypedArray attrs, final StringHandler annotation) {
		checkNotNull(attrs, "Argument \'attrs\' cannot be null.");
		checkNotNull(annotation, "Argument \'annotation\' cannot be null.");

		if (attributeValueIsAvailable(attrs, annotation)) {
			return attrs.getString(annotation.attributeId());
		} else {
			throw new RuntimeException("No attribute found for ID " + annotation.attributeId());
		}
	}

	@Override
	public boolean attributeIsMandatory(final StringHandler annotation) {
		return annotation.mandatory();
	}
}<commit_msg>Added missing null check<commit_after>package com.matthewtamlin.spyglass.library.handler_adapters;

import android.content.res.TypedArray;

import com.matthewtamlin.spyglass.library.handler_annotations.StringHandler;

import static com.matthewtamlin.java_utilities.checkers.NullChecker.checkNotNull;

public class StringHandlerAdapter implements HandlerAdapter<String, StringHandler> {
	@Override
	public boolean attributeValueIsAvailable(
			final TypedArray attrs,
			final StringHandler annotation) {

		checkNotNull(attrs, "Argument \'attrs\' cannot be null.");
		checkNotNull(annotation, "Argument \'annotation\' cannot be null.");

		return attrs.hasValue(annotation.attributeId());
	}

	@Override
	public String getAttributeValue(final TypedArray attrs, final StringHandler annotation) {
		checkNotNull(attrs, "Argument \'attrs\' cannot be null.");
		checkNotNull(annotation, "Argument \'annotation\' cannot be null.");

		if (attributeValueIsAvailable(attrs, annotation)) {
			return attrs.getString(annotation.attributeId());
		} else {
			throw new RuntimeException("No attribute found for ID " + annotation.attributeId());
		}
	}

	@Override
	public boolean attributeIsMandatory(final StringHandler annotation) {
		checkNotNull(annotation, "Argument \'annotation\' cannot be null.");

		return annotation.mandatory();
	}
}
{'fraction_non_alphanumeric': 0.10181958962446767, 'fraction_numerical': 0.0, 'mean_word_length': 5.946236559139785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4675204', 'n_tokens_mistral': 755, 'n_tokens_neox': 688, 'n_words': 182}