Skip to content

Commit 9d41a09

Browse files
committed
fix codegen
1 parent 0a9036c commit 9d41a09

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.jsoniter</groupId>
5-
<version>0.9.1-SNAPSHOT</version>
5+
<version>0.9.1</version>
66
<artifactId>jsoniter</artifactId>
77
<name>json iterator</name>
88
<description>jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go</description>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,9 @@ private static void genField(StringBuilder lines, Field field, String cacheKey)
328328
append(lines, String.format("obj.%s = iter.readDouble(\"%s\");", field.getName(), fieldCacheKey));
329329
return;
330330
}
331-
append(lines, String.format("obj.%s = (%s)iter.read(\"%s\", %s.class);",
332-
field.getName(), fieldTypeName, fieldCacheKey, fieldTypeName));
331+
getDecoder(fieldCacheKey, fieldType); // put decoder into cache
332+
append(lines, String.format("obj.%s = (%s)iter.read(\"%s\");",
333+
field.getName(), fieldTypeName, fieldCacheKey));
333334
return;
334335
}
335336
append(lines, String.format("obj.%s = %s;", field.getName(), genReadOp(field.getGenericType())));

0 commit comments

Comments
 (0)