Remove system-dependent line separator logic in BitMatrix

This commit is contained in:
Sean Owen 2015-02-23 16:08:36 +00:00
parent 68755c5250
commit 8475bf6fd2
2 changed files with 7 additions and 3 deletions

View file

@ -414,9 +414,13 @@ public final class BitMatrix implements Cloneable {
}
public String toString(String setString, String unsetString) {
return toString(setString, unsetString, System.lineSeparator());
return toString(setString, unsetString, "\n");
}
/**
* @deprecated call {@link #toString(String,String)} only, which uses \n line separator always
*/
@Deprecated
public String toString(String setString, String unsetString, String lineSeparator) {
StringBuilder result = new StringBuilder(height * (width + 1));
for (int y = 0; y < height; y++) {

View file

@ -179,7 +179,7 @@ public final class BitMatrixTestCase extends Assert {
assertEquals(emptyMatrix24, BitMatrix.parse(" \n \n \n \n", "x", " "));
assertEquals(centerMatrix, BitMatrix.parse(centerMatrix.toString("x", ".", "\n"), "x", "."));
assertEquals(centerMatrix, BitMatrix.parse(centerMatrix.toString("x", "."), "x", "."));
}
@Test