@@ -1402,7 +1402,6 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14021402 int start = 0 ;
14031403 int pos = 0 ;
14041404 final int len = value .length ();
1405- final int end = len ;
14061405
14071406 final char delimChar = getDelimiter ();
14081407 final char quoteChar = getQuoteCharacter ().charValue ();
@@ -1445,7 +1444,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14451444 // by including the default comment char too.
14461445 quote = true ;
14471446 } else {
1448- while (pos < end ) {
1447+ while (pos < len ) {
14491448 c = value .charAt (pos );
14501449 if (c == LF || c == CR || c == quoteChar || c == delimChar || c == escapeChar ) {
14511450 quote = true ;
@@ -1455,7 +1454,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14551454 }
14561455
14571456 if (!quote ) {
1458- pos = end - 1 ;
1457+ pos = len - 1 ;
14591458 c = value .charAt (pos );
14601459 // Some other chars at the end caused the parser to fail, so for now
14611460 // encapsulate if we end in anything less than ' '
@@ -1468,7 +1467,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14681467
14691468 if (!quote ) {
14701469 // no encapsulation needed - write out the original value
1471- out .append (value , start , end );
1470+ out .append (value , start , len );
14721471 return ;
14731472 }
14741473 break ;
@@ -1478,7 +1477,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14781477
14791478 if (!quote ) {
14801479 // no encapsulation needed - write out the original value
1481- out .append (value , start , end );
1480+ out .append (value , start , len );
14821481 return ;
14831482 }
14841483
@@ -1487,7 +1486,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
14871486
14881487 // Pick up where we left off: pos should be positioned on the first character that caused
14891488 // the need for encapsulation.
1490- while (pos < end ) {
1489+ while (pos < len ) {
14911490 final char c = value .charAt (pos );
14921491 if (c == quoteChar || c == escapeChar ) {
14931492 // write out the chunk up until this point
@@ -1507,6 +1506,7 @@ private void printWithQuotes(final Object object, final CharSequence value, fina
15071506 * Always use quotes unless QuoteMode is NONE, so we not have to look ahead.
15081507 *
15091508 * @throws IOException
1509+ * If an I/O error occurs
15101510 */
15111511 private void printWithQuotes (final Reader reader , final Appendable out ) throws IOException {
15121512
0 commit comments