<commit_before>package org.skyve.domain.messages;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 */
public class ValidationException extends DomainException implements MessageException {
	/**
	 * For Serialization
	 */
	private static final long serialVersionUID = -2033700648810378214L;

	protected List<Message> messages = new ArrayList<>();

	public ValidationException() {
	}
	
	/**
	 * 
	 * @param message
	 */
	public ValidationException(Message message) {
		messages.add(message);
	}

	@Override
	public List<Message> getMessages() {
		return messages;
	}

	@Override
	public String toString() {
		StringBuilder result = new StringBuilder(super.toString());
		for (Message message : messages) {
			result.append('\n').append(message.toString());
		}
		
		return result.toString();
	}

	@Override
	public String getMessage() {
		return toString();
	}<commit_msg>Remove infinite recursive calls through Throwable involving ValidationException.toString() and ValidationException.getMessage().<commit_after>package org.skyve.domain.messages;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 */
public class ValidationException extends DomainException implements MessageException {
	/**
	 * For Serialization
	 */
	private static final long serialVersionUID = -2033700648810378214L;

	protected List<Message> messages = new ArrayList<>();

	public ValidationException() {
	}
	
	/**
	 * 
	 * @param message
	 */
	public ValidationException(Message message) {
		messages.add(message);
	}

	@Override
	public List<Message> getMessages() {
		return messages;
	}

	@Override
	public String getMessage() {
		String superMessage = super.getMessage();
		StringBuilder result = new StringBuilder((superMessage == null) ? "" : superMessage);
		for (Message message : messages) {
			result.append('\n').append(message.toString());
		}
		
		return result.toString();
	}
{'fraction_non_alphanumeric': 0.1181770005299417, 'fraction_numerical': 0.020137784843667197, 'mean_word_length': 4.4409221902017295, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5454032', 'n_tokens_mistral': 589, 'n_tokens_neox': 511, 'n_words': 130}