From 25e3359a082be3adec6e1f59a9b99a32e9790371 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Thu, 31 Oct 2024 09:08:54 +0000 Subject: [PATCH] PDFBOX-5660: use StringJoiner git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1921714 13f79535-47bb-0310-9956-ffa450edef68 --- .../logicalstructure/Revisions.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/Revisions.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/Revisions.java index dff74db7e3e..87c4e248519 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/Revisions.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/Revisions.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; /** * @@ -122,17 +123,12 @@ public int size() @Override public String toString() { - StringBuilder sb = new StringBuilder(); + StringJoiner sj = new StringJoiner("; ", "{", "}"); for (int i = 0; i < this.getObjects().size(); i++) { - if (i > 0) - { - sb.append("; "); - } - sb.append("object=").append(this.getObjects().get(i)) - .append(", revisionNumber=").append(this.getRevisionNumber(i)); + sj.add("object=" + this.getObjects().get(i) + ", revisionNumber=" + this.getRevisionNumber(i)); } - return sb.toString(); + return sj.toString(); } }