From ea29e58e9c088401dcd3e6ee98cbc3f94e25e16f Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Wed, 22 Aug 2018 19:47:27 +0000 Subject: [PATCH] Simplified Java code to use StringBuilder method chaining. --- java/io/nayuki/qrcodegen/QrCode.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/java/io/nayuki/qrcodegen/QrCode.java b/java/io/nayuki/qrcodegen/QrCode.java index 2096137..7d62e0a 100644 --- a/java/io/nayuki/qrcodegen/QrCode.java +++ b/java/io/nayuki/qrcodegen/QrCode.java @@ -283,14 +283,13 @@ public final class QrCode { if (size + border * 2L > Integer.MAX_VALUE) throw new IllegalArgumentException("Border too large"); - StringBuilder sb = new StringBuilder(); - sb.append("\n"); - sb.append("\n"); - sb.append(String.format( - "\n", - size + border * 2)); - sb.append("\t\n"); - sb.append("\t\n") + .append("\n") + .append(String.format("\n", + size + border * 2)) + .append("\t\n") + .append("\t\n"); - sb.append("\n"); - return sb.toString(); + return sb + .append("\" fill=\"#000000\"/>\n") + .append("\n") + .toString(); }