Skip to content

Commit bf06bed

Browse files
committed
Remove trailing spaces.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1383577 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0638a37 commit bf06bed

21 files changed

Lines changed: 199 additions & 199 deletions

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CSVFormat implements Serializable {
3333

3434
/** According to RFC 4180, line breaks are delimited by CRLF */
3535
public static final String CRLF = "\r\n";
36-
36+
3737
private final char delimiter;
3838
private final char encapsulator;
3939
private final char commentStart;
@@ -60,14 +60,14 @@ public class CSVFormat implements Serializable {
6060
*/
6161
static final CSVFormat PRISTINE = new CSVFormat(DISABLED, DISABLED, DISABLED, DISABLED, false, false, null, null);
6262

63-
/**
64-
* Standard comma separated format, as for {@link #RFC4180} but allowing blank lines.
63+
/**
64+
* Standard comma separated format, as for {@link #RFC4180} but allowing blank lines.
6565
* <ul>
6666
* <li>withDelimiter(',')</li>
6767
* <li>withEncapsulator('"')</li>
6868
* <li>withEmptyLinesIgnored(true)</li>
6969
* <li>withLineSeparator(CRLF)</li>
70-
* </ul>
70+
* </ul>
7171
*/
7272
public static final CSVFormat DEFAULT =
7373
PRISTINE.
@@ -83,7 +83,7 @@ public class CSVFormat implements Serializable {
8383
* <li>withEncapsulator('"')</li>
8484
* <li>withLineSeparator(CRLF)</li>
8585
* <li></li>
86-
* </ul>
86+
* </ul>
8787
*/
8888
public static final CSVFormat RFC4180 =
8989
PRISTINE.
@@ -99,7 +99,7 @@ public class CSVFormat implements Serializable {
9999
* <p/>
100100
* For example for parsing or generating a CSV file on a French system
101101
* the following format will be used:
102-
*
102+
*
103103
* <pre>CSVFormat fmt = CSVFormat.EXCEL.withDelimiter(';');</pre>
104104
*/
105105
public static final CSVFormat EXCEL =
@@ -122,7 +122,7 @@ public class CSVFormat implements Serializable {
122122
* <tt>LOAD DATA INFILE</tt> operations. This is a tab-delimited
123123
* format with a LF character as the line separator. Values are not quoted
124124
* and special characters are escaped with '\'.
125-
*
125+
*
126126
* @see <a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html">http://dev.mysql.com/doc/refman/5.1/en/load-data.html</a>
127127
*/
128128
public static final CSVFormat MYSQL =
@@ -168,9 +168,9 @@ public class CSVFormat implements Serializable {
168168

169169
/**
170170
* Returns true if the given character is a line break character.
171-
*
171+
*
172172
* @param c the character to check
173-
*
173+
*
174174
* @return true if <code>c</code> is a line break character
175175
*/
176176
private static boolean isLineBreak(char c) {
@@ -184,27 +184,27 @@ void validate() throws IllegalArgumentException {
184184
if (delimiter == encapsulator) {
185185
throw new IllegalArgumentException("The encapsulator character and the delimiter cannot be the same (\"" + encapsulator + "\")");
186186
}
187-
187+
188188
if (delimiter == escape) {
189189
throw new IllegalArgumentException("The escape character and the delimiter cannot be the same (\"" + escape + "\")");
190190
}
191-
191+
192192
if (delimiter == commentStart) {
193193
throw new IllegalArgumentException("The comment start character and the delimiter cannot be the same (\"" + commentStart + "\")");
194194
}
195-
195+
196196
if (encapsulator != DISABLED && encapsulator == commentStart) {
197197
throw new IllegalArgumentException("The comment start character and the encapsulator cannot be the same (\"" + commentStart + "\")");
198198
}
199-
199+
200200
if (escape != DISABLED && escape == commentStart) {
201201
throw new IllegalArgumentException("The comment start and the escape character cannot be the same (\"" + commentStart + "\")");
202202
}
203203
}
204204

205205
/**
206206
* Returns the character delimiting the values (typically ';', ',' or '\t').
207-
*
207+
*
208208
* @return the delimiter character
209209
*/
210210
public char getDelimiter() {
@@ -213,7 +213,7 @@ public char getDelimiter() {
213213

214214
/**
215215
* Returns a copy of this format using the specified delimiter character.
216-
*
216+
*
217217
* @param delimiter the delimiter character
218218
* @return A copy of this format using the specified delimiter character
219219
* @throws IllegalArgumentException thrown if the specified character is a line break
@@ -228,7 +228,7 @@ public CSVFormat withDelimiter(char delimiter) {
228228

229229
/**
230230
* Returns the character used to encapsulate values containing special characters.
231-
*
231+
*
232232
* @return the encapsulator character
233233
*/
234234
public char getEncapsulator() {
@@ -237,7 +237,7 @@ public char getEncapsulator() {
237237

238238
/**
239239
* Returns a copy of this format using the specified encapsulator character.
240-
*
240+
*
241241
* @param encapsulator the encapsulator character
242242
* @return A copy of this format using the specified encapsulator character
243243
* @throws IllegalArgumentException thrown if the specified character is a line break
@@ -246,13 +246,13 @@ public CSVFormat withEncapsulator(char encapsulator) {
246246
if (isLineBreak(encapsulator)) {
247247
throw new IllegalArgumentException("The encapsulator cannot be a line break");
248248
}
249-
249+
250250
return new CSVFormat(delimiter, encapsulator, commentStart, escape, surroundingSpacesIgnored, emptyLinesIgnored, lineSeparator, header);
251251
}
252252

253253
/**
254254
* Returns whether an encapsulator has been defined.
255-
*
255+
*
256256
* @return {@code true} if an encapsulator is defined
257257
*/
258258
public boolean isEncapsulating() {
@@ -261,7 +261,7 @@ public boolean isEncapsulating() {
261261

262262
/**
263263
* Returns the character marking the start of a line comment.
264-
*
264+
*
265265
* @return the comment start marker.
266266
*/
267267
public char getCommentStart() {
@@ -270,10 +270,10 @@ public char getCommentStart() {
270270

271271
/**
272272
* Returns a copy of this format using the specified character as the comment start marker.
273-
*
273+
*
274274
* Note that the comment introducer character is only recognised
275275
* at the start of a line.
276-
*
276+
*
277277
* @param commentStart the comment start marker
278278
* @return A copy of this format using the specified character as the comment start marker
279279
* @throws IllegalArgumentException thrown if the specified character is a line break
@@ -282,16 +282,16 @@ public CSVFormat withCommentStart(char commentStart) {
282282
if (isLineBreak(commentStart)) {
283283
throw new IllegalArgumentException("The comment start character cannot be a line break");
284284
}
285-
285+
286286
return new CSVFormat(delimiter, encapsulator, commentStart, escape, surroundingSpacesIgnored, emptyLinesIgnored, lineSeparator, header);
287287
}
288288

289289
/**
290290
* Specifies whether comments are supported by this format.
291-
*
291+
*
292292
* Note that the comment introducer character is only recognised
293293
* at the start of a line.
294-
*
294+
*
295295
* @return <tt>true</tt> is comments are supported, <tt>false</tt> otherwise
296296
*/
297297
public boolean isCommentingEnabled() {
@@ -300,7 +300,7 @@ public boolean isCommentingEnabled() {
300300

301301
/**
302302
* Returns the escape character.
303-
*
303+
*
304304
* @return the escape character
305305
*/
306306
public char getEscape() {
@@ -309,7 +309,7 @@ public char getEscape() {
309309

310310
/**
311311
* Returns a copy of this format using the specified escape character.
312-
*
312+
*
313313
* @param escape the escape character
314314
* @return A copy of this format using the specified escape character
315315
* @throws IllegalArgumentException thrown if the specified character is a line break
@@ -318,13 +318,13 @@ public CSVFormat withEscape(char escape) {
318318
if (isLineBreak(escape)) {
319319
throw new IllegalArgumentException("The escape character cannot be a line break");
320320
}
321-
321+
322322
return new CSVFormat(delimiter, encapsulator, commentStart, escape, surroundingSpacesIgnored, emptyLinesIgnored, lineSeparator, header);
323323
}
324324

325325
/**
326326
* Returns whether escape are being processed.
327-
*
327+
*
328328
* @return {@code true} if escapes are processed
329329
*/
330330
public boolean isEscaping() {
@@ -333,7 +333,7 @@ public boolean isEscaping() {
333333

334334
/**
335335
* Specifies whether spaces around values are ignored when parsing input.
336-
*
336+
*
337337
* @return <tt>true</tt> if spaces around values are ignored, <tt>false</tt> if they are treated as part of the value.
338338
*/
339339
public boolean isSurroundingSpacesIgnored() {
@@ -353,7 +353,7 @@ public CSVFormat withSurroundingSpacesIgnored(boolean surroundingSpacesIgnored)
353353

354354
/**
355355
* Specifies whether empty lines between records are ignored when parsing input.
356-
*
356+
*
357357
* @return <tt>true</tt> if empty lines between records are ignored, <tt>false</tt> if they are turned into empty records.
358358
*/
359359
public boolean isEmptyLinesIgnored() {
@@ -373,7 +373,7 @@ public CSVFormat withEmptyLinesIgnored(boolean emptyLinesIgnored) {
373373

374374
/**
375375
* Returns the line separator delimiting output records.
376-
*
376+
*
377377
* @return the line separator
378378
*/
379379
public String getLineSeparator() {
@@ -382,9 +382,9 @@ public String getLineSeparator() {
382382

383383
/**
384384
* Returns a copy of this format using the specified output line separator.
385-
*
385+
*
386386
* @param lineSeparator the line separator to be used for output.
387-
*
387+
*
388388
* @return A copy of this format using the specified output line separator
389389
*/
390390
public CSVFormat withLineSeparator(String lineSeparator) {
@@ -415,7 +415,7 @@ public CSVFormat withHeader(String... header) {
415415

416416
/**
417417
* Parses the specified content.
418-
*
418+
*
419419
* @param in the input stream
420420
*/
421421
public Iterable<CSVRecord> parse(Reader in) throws IOException {
@@ -424,7 +424,7 @@ public Iterable<CSVRecord> parse(Reader in) throws IOException {
424424

425425
/**
426426
* Format the specified values.
427-
*
427+
*
428428
* @param values the values to format
429429
*/
430430
public String format(String... values) {
@@ -435,7 +435,7 @@ public String format(String... values) {
435435
} catch (IOException e) {
436436
// should not happen
437437
throw new IllegalStateException(e);
438-
}
438+
}
439439
}
440440

441441
@Override
@@ -448,19 +448,19 @@ public String toString() {
448448
}
449449
if (isEncapsulating()) {
450450
sb.append(' ');
451-
sb.append("Encapsulator=<").append(encapsulator).append('>');
451+
sb.append("Encapsulator=<").append(encapsulator).append('>');
452452
}
453453
if (isCommentingEnabled()) {
454454
sb.append(' ');
455455
sb.append("CommentStart=<").append(commentStart).append('>');
456456
}
457457
if (isEmptyLinesIgnored()) {
458-
sb.append(" EmptyLines:ignored");
458+
sb.append(" EmptyLines:ignored");
459459
}
460460
if (isSurroundingSpacesIgnored()) {
461-
sb.append(" SurroundingSpaces:ignored");
461+
sb.append(" SurroundingSpaces:ignored");
462462
}
463463
return sb.toString();
464464
}
465-
465+
466466
}

src/main/java/org/apache/commons/csv/CSVLexer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CSVLexer extends Lexer {
2727
public CSVLexer(CSVFormat format, ExtendedBufferedReader in) {
2828
super(format, in);
2929
}
30-
30+
3131
/**
3232
* Returns the next token.
3333
* <p/>
@@ -92,7 +92,7 @@ Token nextToken(Token tkn) throws IOException {
9292
eol = isEndOfLine(c);
9393
}
9494
}
95-
95+
9696
// ok, start of token reached: encapsulated, or token
9797
if (isDelimiter(c)) {
9898
// empty token return TOKEN("")
@@ -183,7 +183,7 @@ private Token simpleTokenLexer(Token tkn, int c) throws IOException {
183183
*
184184
* @param tkn the current token
185185
* @return a valid token object
186-
* @throws IOException on invalid state:
186+
* @throws IOException on invalid state:
187187
* EOF before closing encapsulator or invalid character before delimiter or EOL
188188
*/
189189
private Token encapsulatedTokenLexer(Token tkn) throws IOException {
@@ -192,7 +192,7 @@ private Token encapsulatedTokenLexer(Token tkn) throws IOException {
192192
int c;
193193
while (true) {
194194
c = in.read();
195-
195+
196196
if (isEscape(c)) {
197197
tkn.content.append((char) readEscape());
198198
} else if (isEncapsulator(c)) {

0 commit comments

Comments
 (0)