Skip to content

Commit db2afe2

Browse files
committed
rename to readAny
1 parent d2d7255 commit db2afe2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/java/com/github/jsoniter/Codegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Codegen {
2727
put(Integer.class.getName(), "Integer.valueOf(iter.readInt())");
2828
put(Long.class.getName(), "Long.valueOf(iter.readLong())");
2929
put(String.class.getName(), "iter.readString()");
30-
put(Object.class.getName(), "iter.read()");
30+
put(Object.class.getName(), "iter.readAny()");
3131
}};
3232
final static Set<Class> WITH_CAPACITY_COLLECTION_CLASSES = new HashSet<Class>() {{
3333
add(ArrayList.class);

src/main/java/com/github/jsoniter/Jsoniter.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.io.InputStream;
88
import java.lang.reflect.Type;
99
import java.util.ArrayList;
10-
import java.util.Date;
1110
import java.util.HashMap;
1211
import java.util.Map;
1312

@@ -119,7 +118,7 @@ final boolean loadMore() throws IOException {
119118
eof = true;
120119
return false;
121120
} else {
122-
throw new IOException("read returned " + n);
121+
throw new IOException("readAny returned " + n);
123122
}
124123
} else {
125124
head = 0;
@@ -666,7 +665,7 @@ public final double readDouble() throws IOException {
666665
return Double.valueOf(readNumber());
667666
}
668667

669-
public final Object read() throws IOException {
668+
public final Object readAny() throws IOException {
670669
ValueType valueType = whatIsNext();
671670
switch (valueType) {
672671
case STRING:
@@ -680,7 +679,7 @@ public final Object read() throws IOException {
680679
case ARRAY:
681680
ArrayList list = new ArrayList();
682681
while (readArray()) {
683-
list.add(read());
682+
list.add(readAny());
684683
}
685684
return list;
686685
case OBJECT:
@@ -690,7 +689,7 @@ public final Object read() throws IOException {
690689
}
691690
return map;
692691
default:
693-
throw reportError("read", "unexpected value type: " + valueType);
692+
throw reportError("readAny", "unexpected value type: " + valueType);
694693
}
695694
}
696695

@@ -857,7 +856,7 @@ final void skipString() throws IOException {
857856
return;
858857
}
859858
if (escaped) {
860-
head = 1; // skip the first char as last char read is \
859+
head = 1; // skip the first char as last char readAny is \
861860
}
862861
} else {
863862
head = end;

0 commit comments

Comments
 (0)