From 3b959626f4c1ad31a4f8fbdcba513e12fc6f7f3d Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 11 Jul 2021 13:54:43 -0400 Subject: [PATCH] Better internal names. --- .../org/apache/commons/csv/CSVPrinter.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVPrinter.java b/src/main/java/org/apache/commons/csv/CSVPrinter.java index 6eb71c343..c0529ee97 100644 --- a/src/main/java/org/apache/commons/csv/CSVPrinter.java +++ b/src/main/java/org/apache/commons/csv/CSVPrinter.java @@ -70,7 +70,7 @@ public final class CSVPrinter implements Flushable, Closeable { /** The place that the values get written. */ - private final Appendable out; + private final Appendable appendable; private final CSVFormat format; /** True if we just began a new record. */ @@ -83,7 +83,7 @@ public final class CSVPrinter implements Flushable, Closeable { * and escaping with a different character) are not supported. *

* - * @param out + * @param appendable * stream to which to print. Must not be null. * @param format * the CSV format. Must not be null. @@ -92,11 +92,11 @@ public final class CSVPrinter implements Flushable, Closeable { * @throws IllegalArgumentException * thrown if the parameters of the format are inconsistent or if either out or format are null. */ - public CSVPrinter(final Appendable out, final CSVFormat format) throws IOException { - Objects.requireNonNull(out, "out"); + public CSVPrinter(final Appendable appendable, final CSVFormat format) throws IOException { + Objects.requireNonNull(appendable, "appendable"); Objects.requireNonNull(format, "format"); - this.out = out; + this.appendable = appendable; this.format = format; // TODO: Is it a good idea to do this here instead of on the first call to a print method? // It seems a pain to have to track whether the header has already been printed or not. @@ -127,8 +127,8 @@ public void close(final boolean flush) throws IOException { if (flush || format.getAutoFlush()) { flush(); } - if (out instanceof Closeable) { - ((Closeable) out).close(); + if (appendable instanceof Closeable) { + ((Closeable) appendable).close(); } } @@ -140,8 +140,8 @@ public void close(final boolean flush) throws IOException { */ @Override public void flush() throws IOException { - if (out instanceof Flushable) { - ((Flushable) out).flush(); + if (appendable instanceof Flushable) { + ((Flushable) appendable).flush(); } } @@ -151,7 +151,7 @@ public void flush() throws IOException { * @return the target Appendable. */ public Appendable getOut() { - return this.out; + return this.appendable; } /** @@ -163,7 +163,7 @@ public Appendable getOut() { * If an I/O error occurs */ public void print(final Object value) throws IOException { - format.print(value, out, newRecord); + format.print(value, appendable, newRecord); newRecord = false; } @@ -195,8 +195,8 @@ public void printComment(final String comment) throws IOException { if (!newRecord) { println(); } - out.append(format.getCommentMarker().charValue()); - out.append(SP); + appendable.append(format.getCommentMarker().charValue()); + appendable.append(SP); for (int i = 0; i < comment.length(); i++) { final char c = comment.charAt(i); switch (c) { @@ -207,11 +207,11 @@ public void printComment(final String comment) throws IOException { //$FALL-THROUGH$ break intentionally excluded. case LF: println(); - out.append(format.getCommentMarker().charValue()); - out.append(SP); + appendable.append(format.getCommentMarker().charValue()); + appendable.append(SP); break; default: - out.append(c); + appendable.append(c); break; } } @@ -237,7 +237,7 @@ public void printHeaders(final ResultSet resultSet) throws IOException, SQLExcep * If an I/O error occurs */ public void println() throws IOException { - format.println(out); + format.println(appendable); newRecord = true; }