replaced deprecated IOUtils.LINE_SEPARATOR with System.lineSeparator()

This commit is contained in:
Stefan Spieker committed 2020-12-31 15:40:38 +01:00
1 parent 884e4ddefe
commit e75345a85e
2 files changed
+4 -6

No files matched your search

+2 -3
View File
@@ -43,7 +43,6 @@ import java.util.regex.Pattern;
import hudson.util.VersionNumber;
import jenkins.model.Jenkins;
import org.apache.commons.io.IOUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -555,10 +554,10 @@ public class FunctionsTest {
private static void assertPrintThrowable(Throwable t, String traditional, String custom) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
assertEquals(sw.toString().replace(IOUtils.LINE_SEPARATOR, "\n"), traditional);
assertEquals(sw.toString().replace(System.lineSeparator(), "\n"), traditional);
String actual = Functions.printThrowable(t);
System.out.println(actual);
assertEquals(actual.replace(IOUtils.LINE_SEPARATOR, "\n"), custom);
assertEquals(actual.replace(System.lineSeparator(), "\n"), custom);
}
private static final class Stack extends Throwable {
private static final Pattern LINE = Pattern.compile("(.+)[.](.+)[.](.+):(\\d+)");