Skip to content

Commit

Permalink
jsonRender 适配 Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
shevawen committed Mar 6, 2016
1 parent cd1537a commit f1fee93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/nutz/json/impl/JsonRenderImpl.java
Expand Up @@ -112,8 +112,8 @@ else if (mr.isDateTimeLike()) {
map2Json((Map) obj);
}
// 集合
else if (obj instanceof Collection) {
coll2Json((Collection) obj);
else if (obj instanceof Iterable) {
coll2Json((Iterable) obj);
}
// 数组
else if (obj.getClass().isArray()) {
Expand Down Expand Up @@ -396,7 +396,7 @@ private void array2Json(Object obj) throws IOException {
writer.append(']');
}

private void coll2Json(Collection iterable) throws IOException {
private void coll2Json(Iterable iterable) throws IOException {
writer.append('[');
for (Iterator<?> it = iterable.iterator(); it.hasNext();) {
render(it.next());
Expand Down

0 comments on commit f1fee93

Please sign in to comment.