<commit_before>package org.fedorahosted.flies.rest.dto;

import java.io.StringWriter;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;

class Utility {

	public static String toXML(Object obj) {
		try {
			Marshaller m = null;
			JAXBContext jc = JAXBContext.newInstance(obj.getClass());
			m = jc.createMarshaller();
			m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			StringWriter writer = new StringWriter();
			m.marshal(obj, writer);
			return writer.toString();
		} catch (Exception e) {
			return String.valueOf(obj);<commit_msg>Fixed exception handling in toString<commit_after>package org.fedorahosted.flies.rest.dto;

import java.io.StringWriter;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class Utility {
	
	final static Logger logger = LoggerFactory.getLogger(Utility.class);
	
	public static String toXML(Object obj) {
		try {
			Marshaller m = null;
			JAXBContext jc = JAXBContext.newInstance(obj.getClass());
			m = jc.createMarshaller();
			m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			StringWriter writer = new StringWriter();
			m.marshal(obj, writer);
			return writer.toString();
		} catch (Exception e) {
			logger.error("toXML failed", e);
			return obj.getClass().getName() + "@" + Integer.toHexString(obj.hashCode());
{'fraction_non_alphanumeric': 0.12035010940919037, 'fraction_numerical': 0.0014587892049598833, 'mean_word_length': 4.716666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '535170', 'n_tokens_mistral': 496, 'n_tokens_neox': 459, 'n_words': 94}