From 8475bf6fd24f021d596a1a134df34a0b7c0b6c55 Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Mon, 23 Feb 2015 16:08:36 +0000 Subject: [PATCH] Remove system-dependent line separator logic in BitMatrix --- core/src/main/java/com/google/zxing/common/BitMatrix.java | 8 ++++++-- .../java/com/google/zxing/common/BitMatrixTestCase.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/zxing/common/BitMatrix.java b/core/src/main/java/com/google/zxing/common/BitMatrix.java index 1a3bba8f4..0816e4587 100755 --- a/core/src/main/java/com/google/zxing/common/BitMatrix.java +++ b/core/src/main/java/com/google/zxing/common/BitMatrix.java @@ -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++) { diff --git a/core/src/test/java/com/google/zxing/common/BitMatrixTestCase.java b/core/src/test/java/com/google/zxing/common/BitMatrixTestCase.java index 0b43278b2..0e6e9ce12 100644 --- a/core/src/test/java/com/google/zxing/common/BitMatrixTestCase.java +++ b/core/src/test/java/com/google/zxing/common/BitMatrixTestCase.java @@ -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