<commit_before>package com.puresol.license.api;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This value object represents a single licenser.
 * 
 * @author <NAME>
 */
public class Licenser {

	private final String name;
	private final String email;

	public Licenser(String name, String email) {
		super();
		if ((name == null) || (name.isEmpty())) {
			throw new IllegalArgumentException(
					"The name of the licenser must no be null or empty.");
		}
		this.name = name;
		if ((email == null) || (email.isEmpty())) {
			throw new IllegalArgumentException(
					"The email of the licenser must no be null or empty.");
		}
		// EmailValidator emailValidator = EmailValidator.getInstance();
		// if (!emailValidator.isValid(email)) {
		// throw new IllegalArgumentException("The email '" + email
		// + "' is invalid.");
		// }
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public String getEmail() {
		return email;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Licenser other = (Licenser) obj;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return name + " (" + email + ")";
	}

	/**
	 * This method parses the provided string an created a new {@link Licenser}
	 * object.
	 * 
	 * @param licenserString
	 * @return A {@link Licenser} object is returned.
	 */
	public static Licenser fromString(String licenserString) {
		Pattern pattern = Pattern.compile("^(.+)\\s+\\((\\S+)\\)");
		Matcher matcher = pattern.matcher(licenserString);
		if (!matcher.matches()) {
			throw new IllegalArgumentException("String '" + licenserString
					+ "' is not a valid licenser.");
		}
		String name = matcher.group(1);
		String email = matcher.group(2);
		return new Licenser(name, email);
	}
}
<commit_msg>Fixed test.<commit_after>package com.puresol.license.api;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This value object represents a single licenser.
 * 
 * @author <NAME>
 */
public class Licenser {

	private final String name;
	private final String email;

	public Licenser(String name, String email) {
		super();
		if ((name == null) || (name.isEmpty())) {
			throw new IllegalArgumentException(
					"The name of the licenser must no be null or empty.");
		}
		this.name = name;
		if ((email == null) || (email.isEmpty())) {
			throw new IllegalArgumentException(
					"The email of the licenser must no be null or empty.");
		}
		// EmailValidator emailValidator = EmailValidator.getInstance();
		// if (!emailValidator.isValid(email)) {
		// throw new IllegalArgumentException("The email '" + email
		// + "' is invalid.");
		// }
		if (!Pattern.matches("^\\S+@\\S+\\.\\S+$", email)) {
			throw new IllegalArgumentException("The email '" + email
					+ "' is invalid.");
		}
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public String getEmail() {
		return email;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Licenser other = (Licenser) obj;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return name + " (" + email + ")";
	}

	/**
	 * This method parses the provided string an created a new {@link Licenser}
	 * object.
	 * 
	 * @param licenserString
	 * @return A {@link Licenser} object is returned.
	 */
	public static Licenser fromString(String licenserString) {
		Pattern pattern = Pattern.compile("^(.+)\\s+\\((\\S+)\\)");
		Matcher matcher = pattern.matcher(licenserString);
		if (!matcher.matches()) {
			throw new IllegalArgumentException("String '" + licenserString
					+ "' is not a valid licenser.");
		}
		String name = matcher.group(1);
		String email = matcher.group(2);
		return new Licenser(name, email);
	}
}

{'fraction_non_alphanumeric': 0.14900122299225438, 'fraction_numerical': 0.0028536485935589076, 'mean_word_length': 3.2374784110535404, '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': '2894338', 'n_tokens_mistral': 1750, 'n_tokens_neox': 1549, 'n_words': 479}