Skip to content

Commit 8033a71

Browse files
committed
Rename local variables to make them easier to read
l (ell) looks rather like 1 (one) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1300540 13f79535-47bb-0310-9956-ffa450edef68
1 parent 18d7060 commit 8033a71

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,27 @@ int readAgain() {
7777
}
7878

7979
@Override
80-
public int read(char[] buf, int off, int len) throws IOException {
81-
if (len == 0) {
80+
public int read(char[] buf, int offset, int length) throws IOException {
81+
if (length == 0) {
8282
return 0;
8383
}
8484

85-
int l = super.read(buf, off, len);
85+
int len = super.read(buf, offset, length);
8686

87-
if (l > 0) {
88-
lastChar = buf[off + l - 1];
87+
if (len > 0) {
88+
lastChar = buf[offset + len - 1];
8989

90-
for (int i = off; i < off + l; i++) {
90+
for (int i = offset; i < offset + len; i++) {
9191
if (buf[i] == '\n') {
9292
lineCounter++;
9393
}
9494
}
9595

96-
} else if (l == -1) {
96+
} else if (len == -1) {
9797
lastChar = END_OF_STREAM;
9898
}
9999

100-
return l;
100+
return len;
101101
}
102102

103103
@Override

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,28 @@ class UnicodeUnescapeReader extends Reader {
3939
}
4040

4141
@Override
42-
public int read(char[] cbuf, int off, int len) throws IOException {
42+
public int read(char[] cbuf, int offset, int length) throws IOException {
4343
int count = 0;
44-
for (int i = 0; i < len; i++) {
44+
for (int i = 0; i < length; i++) {
4545
int c = reader.read();
4646

4747
if (c == -1) {
4848
return count == 0 ? -1 : count;
4949
}
5050

5151
if (c == '\\') {
52-
int l = reader.read(sequence);
53-
if (l == sequence.length && isUnicodeSequence(sequence)) {
52+
int len = reader.read(sequence);
53+
if (len == sequence.length && isUnicodeSequence(sequence)) {
5454
// unicode escape found
5555
c = Integer.parseInt(new String(sequence, 1, 4), 16);
5656

57-
} else if (l > 0) {
57+
} else if (len > 0) {
5858
// put the characters back in the stream
59-
reader.unread(sequence, 0, l);
59+
reader.unread(sequence, 0, len);
6060
}
6161
}
6262

63-
cbuf[off + i] = (char) c;
63+
cbuf[offset + i] = (char) c;
6464
count++;
6565
}
6666

0 commit comments

Comments
 (0)