package de.codecentric.jbehave.junit.monitoring;

/**
 * @author Valery_Yatsynovich
 */
public final class JUnitStringDecorator
{
	private JUnitStringDecorator()
	{
		// Utility class
	}

	public static String getJunitSafeString(String string) {
		return replaceLinebreaks(string).replaceAll("[\\(\\)]", "|");
	}

	private static String replaceLinebreaks(String string) {
		return string.replaceAll("\r", "\n").replaceAll("\n+", ", ");
	}
}

@@ -154,18 +154,17 @@
 orator()
-%0A%09
+ 
 %7B%0A%09%09// U
@@ -251,33 +251,14 @@
 urn 
-replaceLinebreaks(
 string
-)
 .rep
@@ -272,121 +272,19 @@
 (%22%5B%5C
-%5C(%5C%5C)%5D%22, %22%7C%22);%0A%09%7D%0A%0A%09private static String replaceLinebreaks(String string) %7B%0A%09%09return string.replaceAll(%22%5Cr%22, %22%5Cn
+r%5Cn%5D+%22, %22, 
 %22).r
@@ -298,17 +298,17 @@
 ll(%22
-%5Cn+
+%5B()%5D
 %22, %22
-, 
+%7C
 %22);%0A

Optimize JUnitStringDecorator