This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b95962  Better internal names.
3b95962 is described below

commit 3b959626f4c1ad31a4f8fbdcba513e12fc6f7f3d
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Jul 11 13:54:43 2021 -0400

    Better internal names.
---
 .../java/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 6eb71c3..c0529ee 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 @@ import java.util.Objects;
 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.
      * </p>
      *
-     * @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 final class CSVPrinter implements Flushable, 
Closeable {
         if (flush || format.getAutoFlush()) {
             flush();
         }
-        if (out instanceof Closeable) {
-            ((Closeable) out).close();
+        if (appendable instanceof Closeable) {
+            ((Closeable) appendable).close();
         }
     }
 
@@ -140,8 +140,8 @@ public final class CSVPrinter implements Flushable, 
Closeable {
      */
     @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 final class CSVPrinter implements Flushable, 
Closeable {
      * @return the target Appendable.
      */
     public Appendable getOut() {
-        return this.out;
+        return this.appendable;
     }
 
     /**
@@ -163,7 +163,7 @@ public final class CSVPrinter implements Flushable, 
Closeable {
      *             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 final class CSVPrinter implements Flushable, 
Closeable {
         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 final class CSVPrinter implements Flushable, 
Closeable {
                 //$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 final class CSVPrinter implements Flushable, 
Closeable {
      *             If an I/O error occurs
      */
     public void println() throws IOException {
-        format.println(out);
+        format.println(appendable);
         newRecord = true;
     }
 

Reply via email to