package org.wallride.support;

import org.springframework.format.Formatter;
import org.springframework.util.StringUtils;

import java.text.Normalizer;
import java.text.ParseException;
import java.util.Locale;

public class CodeFormatter implements Formatter<String> {

	@Override
	public String print(String object, Locale locale) {
		return (!object.equals("") ? object : null);
	}

	@Override
	public String parse(String text, Locale locale) throws ParseException {
		String value = StringUtils.trimWhitespace(text);
		value = Normalizer.normalize(value, Normalizer.Form.NFKC);
		value = StringUtils.replace(value, " ", "-");
		return value;
	}
}

@@ -461,16 +461,58 @@
 ption %7B%0A
+%09%09if (text == null) %7B%0A%09%09%09return null;%0A%09%09%7D%0A
 %09%09String

Fix CodeFormatter