Skip to content

Commit cacb79d

Browse files
committed
Changed the visibility of the Token types and the protected methods to package private
git-svn-id: https://svn.apache.org/repos/asf/commons/sandbox/csv/trunk@1199769 13f79535-47bb-0310-9956-ffa450edef68
1 parent 43b777b commit cacb79d

1 file changed

Lines changed: 20 additions & 28 deletions

File tree

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

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.InputStreamReader;
2222
import java.io.Reader;
2323
import java.util.ArrayList;
24+
import java.util.List;
2425

2526

2627
/**
@@ -51,32 +52,23 @@
5152
*/
5253
public class CSVParser {
5354

54-
/**
55-
* length of the initial token (content-)buffer
56-
*/
55+
/** length of the initial token (content-)buffer */
5756
private static final int INITIAL_TOKEN_LENGTH = 50;
5857

5958
// the token types
60-
/**
61-
* Token has no valid content, i.e. is in its initialized state.
62-
*/
63-
protected static final int TT_INVALID = -1;
64-
/**
65-
* Token with content, at beginning or in the middle of a line.
66-
*/
67-
protected static final int TT_TOKEN = 0;
68-
/**
69-
* Token (which can have content) when end of file is reached.
70-
*/
71-
protected static final int TT_EOF = 1;
72-
/**
73-
* Token with content when end of a line is reached.
74-
*/
75-
protected static final int TT_EORECORD = 2;
76-
77-
/**
78-
* Immutable empty String array.
79-
*/
59+
/** Token has no valid content, i.e. is in its initialized state. */
60+
static final int TT_INVALID = -1;
61+
62+
/** Token with content, at beginning or in the middle of a line. */
63+
static final int TT_TOKEN = 0;
64+
65+
/** Token (which can have content) when end of file is reached. */
66+
static final int TT_EOF = 1;
67+
68+
/** Token with content when end of a line is reached. */
69+
static final int TT_EORECORD = 2;
70+
71+
/** Immutable empty String array. */
8072
private static final String[] EMPTY_STRING_ARRAY = new String[0];
8173

8274
// the input stream
@@ -88,7 +80,7 @@ public class CSVParser {
8880
/**
8981
* A record buffer for getLine(). Grows as necessary and is reused.
9082
*/
91-
private final ArrayList record = new ArrayList();
83+
private final List record = new ArrayList();
9284
private final Token reusableToken = new Token();
9385
private final CharBuffer wsBuf = new CharBuffer();
9486
private final CharBuffer code = new CharBuffer(4);
@@ -202,7 +194,7 @@ public CSVParser(Reader input, CSVStrategy strategy) {
202194
* @throws IOException on parse error or input read-failure
203195
*/
204196
public String[][] getAllValues() throws IOException {
205-
ArrayList records = new ArrayList();
197+
List records = new ArrayList();
206198
String[] values;
207199
String[][] ret = null;
208200
while ((values = getLine()) != null) {
@@ -307,7 +299,7 @@ public int getLineNumber() {
307299
/**
308300
* Convenience method for <code>nextToken(null)</code>.
309301
*/
310-
protected Token nextToken() throws IOException {
302+
Token nextToken() throws IOException {
311303
return nextToken(new Token());
312304
}
313305

@@ -322,7 +314,7 @@ protected Token nextToken() throws IOException {
322314
* @return the next token found
323315
* @throws IOException on stream access error
324316
*/
325-
protected Token nextToken(Token tkn) throws IOException {
317+
Token nextToken(Token tkn) throws IOException {
326318
wsBuf.clear(); // reuse
327319

328320
// get the last read char (required for empty line detection)
@@ -538,7 +530,7 @@ private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException {
538530
* @return the decoded character
539531
* @throws IOException on wrong unicode escape sequence or read error
540532
*/
541-
protected int unicodeEscapeLexer(int c) throws IOException {
533+
private int unicodeEscapeLexer(int c) throws IOException {
542534
int ret = 0;
543535
// ignore 'u' (assume c==\ now) and read 4 hex digits
544536
c = in.read();

0 commit comments

Comments
 (0)