Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/json-iterator/java
Browse files Browse the repository at this point in the history
  • Loading branch information
taowen committed Mar 5, 2018
2 parents 68c985b + ce5e516 commit 7ef9cbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.17.3</version>
<version>1.20</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.17.3</version>
<version>1.20</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jsoniter/IterImplString.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static final String readString(JsonIterator iter) throws IOException {
IterImpl.skipFixedBytes(iter, 3);
return null;
}
iter.reportError("readString", "expect string or null, but " + (char) c);
throw iter.reportError("readString", "expect string or null, but " + (char) c);
}
int j = parse(iter);
return new String(iter.reusableChars, 0, j);
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/com/jsoniter/BenchGson.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.jsoniter.extra.GsonCompatibilityMode;
import com.jsoniter.spi.DecodingMode;
import com.jsoniter.spi.JsoniterSpi;
import org.junit.Test;
import org.openjdk.jmh.Main;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.BenchmarkParams;
Expand Down Expand Up @@ -42,7 +41,7 @@ public void benchSetup(BenchmarkParams params) {

@Benchmark
public void gsonDecoder(Blackhole bh) throws IOException {
FileInputStream stream = new FileInputStream("/tmp/tweets.json");
FileInputStream stream = new FileInputStream("./src/test/tweets.json");
InputStreamReader reader = new InputStreamReader(stream);
try {
bh.consume(gson.fromJson(reader, new TypeReference<List<Tweet>>() {
Expand All @@ -55,7 +54,7 @@ public void gsonDecoder(Blackhole bh) throws IOException {

@Benchmark
public void jsoniterReflectionDecoder(Blackhole bh) throws IOException {
FileInputStream stream = new FileInputStream("/tmp/tweets.json");
FileInputStream stream = new FileInputStream("./src/test/tweets.json");
JsonIterator iter = JsonIteratorPool.borrowJsonIterator();
try {
iter.reset(stream);
Expand Down

0 comments on commit 7ef9cbd

Please sign in to comment.