Skip to content

Commit 5d8d728

Browse files
Immortalis202asturio
authored andcommitted
Build the test update without a format string
1 parent 81e942f commit 5d8d728

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎openpdf-core/src/test/java/org/openpdf/text/pdf/PdfReaderMissingCatalogTest.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ void rootToMissingObjectIsReported() throws Exception {
2424
startxref = reader.getLastXref();
2525
}
2626
// an incremental update whose trailer points /Root at an object that is not in the file
27-
String update = String.format("xref\n0 1\n0000000000 65535 f \ntrailer\n<< /Size %d /Root %d 0 R /Prev %d >>\n"
28-
+ "startxref\n%d\n%%%%EOF\n", size + 1, size, startxref, original.length);
27+
String trailer = String.format("<< /Size %d /Root %d 0 R /Prev %d >>", size + 1, size, startxref);
28+
// lines end with \n, whatever the platform
29+
String update = String.join("\n", "xref", "0 1", "0000000000 65535 f ", "trailer", trailer,
30+
"startxref", String.valueOf(original.length), "%%EOF", "");
2931
ByteArrayOutputStream out = new ByteArrayOutputStream();
3032
out.write(original);
3133
out.write(update.getBytes(ISO_8859_1));

0 commit comments

Comments
 (0)