Skip to content

Commit 1b0ccbe

Browse files
committed
Applying checkstyle changes
git-svn-id: https://svn.apache.org/repos/asf/commons/sandbox/csv/trunk@631133 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9acb622 commit 1b0ccbe

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

src/java/org/apache/commons/csv/CSVParser.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
*/
1717
package org.apache.commons.csv;
1818

19-
import java.io.*;
19+
import java.io.IOException;
20+
import java.io.Reader;
21+
import java.io.InputStreamReader;
22+
import java.io.InputStream;
2023
import java.util.ArrayList;
2124

2225

@@ -257,7 +260,9 @@ public String[] getLine() throws IOException {
257260
throw new IOException("(line " + getLineNumber() + ") invalid parse sequence");
258261
// unreachable: break;
259262
}
260-
if (reusableToken.type != TT_TOKEN) break;
263+
if (reusableToken.type != TT_TOKEN) {
264+
break;
265+
}
261266
}
262267
if (!record.isEmpty()) {
263268
ret = (String[]) record.toArray(new String[record.size()]);

src/java/org/apache/commons/csv/CSVStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class CSVStrategy implements Cloneable, Serializable {
4545
true, false, true);
4646
public static CSVStrategy EXCEL_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
4747
false, false, false);
48-
public static CSVStrategy TDF_STRATEGY = new CSVStrategy(' ', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
48+
public static CSVStrategy TDF_STRATEGY = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
4949
true, false, true);
5050

5151

src/java/org/apache/commons/csv/CharBuffer.java

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
* @author Ortwin Gl�ck
2828
*/
2929
public class CharBuffer {
30+
3031
private char[] c;
32+
3133
/**
3234
* Actually used number of characters in the array.
3335
* It is also the index at which
@@ -47,7 +49,9 @@ public CharBuffer() {
4749
* of <code>length</code> characters.
4850
*/
4951
public CharBuffer(final int length) {
50-
if (length == 0) throw new IllegalArgumentException("Can't create an empty CharBuffer");
52+
if (length == 0) {
53+
throw new IllegalArgumentException("Can't create an empty CharBuffer");
54+
}
5155
this.c = new char[length];
5256
}
5357

@@ -81,7 +85,9 @@ public int capacity() {
8185
* @param cb the CharBuffer to append or null
8286
*/
8387
public void append(final CharBuffer cb) {
84-
if (cb == null) return;
88+
if (cb == null) {
89+
return;
90+
}
8591
provideCapacity(length + cb.length);
8692
System.arraycopy(cb.c, 0, c, length, cb.length);
8793
length += cb.length;
@@ -93,7 +99,9 @@ public void append(final CharBuffer cb) {
9399
* @param s the String to append or null
94100
*/
95101
public void append(final String s) {
96-
if (s == null) return;
102+
if (s == null) {
103+
return;
104+
}
97105
append(s.toCharArray());
98106
}
99107

@@ -103,7 +111,9 @@ public void append(final String s) {
103111
* @param sb the StringBuffer to append or null
104112
*/
105113
public void append(final StringBuffer sb) {
106-
if (sb == null) return;
114+
if (sb == null) {
115+
return;
116+
}
107117
provideCapacity(length + sb.length());
108118
sb.getChars(0, sb.length(), c, length);
109119
length += sb.length();
@@ -115,7 +125,9 @@ public void append(final StringBuffer sb) {
115125
* @param data the char[] to append or null
116126
*/
117127
public void append(final char[] data) {
118-
if (data == null) return;
128+
if (data == null) {
129+
return;
130+
}
119131
provideCapacity(length + data.length);
120132
System.arraycopy(data, 0, c, length, data.length);
121133
length += data.length;
@@ -137,7 +149,9 @@ public void append(final char data) {
137149
* This method involves copying the data once!
138150
*/
139151
public void shrink() {
140-
if (c.length == length) return;
152+
if (c.length == length) {
153+
return;
154+
}
141155
char[] newc = new char[length];
142156
System.arraycopy(c, 0, newc, 0, length);
143157
c = newc;
@@ -161,7 +175,9 @@ public void trimTrailingWhitespace() {
161175
* @return
162176
*/
163177
public char[] getCharacters() {
164-
if (c.length == length) return c;
178+
if (c.length == length) {
179+
return c;
180+
}
165181
char[] chars = new char[length];
166182
System.arraycopy(c, 0, chars, 0, length);
167183
return chars;
@@ -199,7 +215,9 @@ public String toString() {
199215
* @param capacity
200216
*/
201217
public void provideCapacity(final int capacity) {
202-
if (c.length >= capacity) return;
218+
if (c.length >= capacity) {
219+
return;
220+
}
203221
int newcapacity = ((capacity*3)>>1) + 1;
204222
char[] newc = new char[newcapacity];
205223
System.arraycopy(c, 0, newc, 0, length);

0 commit comments

Comments
 (0)