Comments (8)
wow, thank you, such a big bug :(
Just fixed
from java.
Thank you. How does affect performance of the stream API? I've tried to run forked java-json-benchmark but it wasn't update for the latest jsoniter and crashing with some exceptions.
from java.
this bug will not affect the performance, as the benchmarking only tested the fast path. java-json-benchmark project is out of date, I will update the code when I have time. If performance is your priority, stick with bind-api, it is faster than iterator api. As the readObject() and readArray() has too many branching in it.
from java.
connot read big string lentgh filed :
03-06 17:51:09.211 30483-30483/com.mahdi.ketabcell E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mahdi.ketabcell, PID: 30483
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mahdi.ketabcell/com.mahdi.ketabcell.activity.piccell.ShowPiccellActivity}: com.jsoniter.spi.JsonException: readString: incomplete string, head: 9, peek: {"body":", buf: {"body":"یب سمینبتشسیمن بشمسنیتب منش ستیمبشسینبتا سشیبسشنتیا بنتسیاب نتسیا بنتسیابنسشتیاب نشستی ابنتشسیابنستیابنشسیانبسشایب نسشای بنشسای نبساینبتش سینباشسنیباسشنیبا شسنیبا سنیتبا سشنیت نسیت بت سیتب اسینتبسی باسیبنسیا بنسیاب سیاب سیناب سینتبا سیتنبا سیتنبا سینت باسیبتنسی نتسی بنت سی بتس بس سنیت سین سیسینباسنیب","commentCount":0,"doILike":false,"doISuggest":false,"likeCount":0,"rowId":"58bcf9ef620b1d05f8533103","specialLabel":0,"submitDate":"2017-03-06T05:55:59.460Z","suggestCount":0,"title":"تس می باشد","type":1,"url":["images/cell/544989037.jpg"],"username":"mahdihp"}
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
from java.
@Mahdihp can you give me a txt file with the json string?
from java.
{"body":"یبل تیبلتیبمسش یبمک سشیمب سشیکمب تشسکمیبنمسیتبمسشتیب منشستمتبیملتیبملتیبمتلیمبلت یبلتیبل ینبنن اسی باسیش نباسشینباشسینبشسنتیب شسنیاب نشسیابنسشتیابنتسشیابنسشیابنسیشابنسشیاب نسشیاب سشیب سشیبن ت سینبسیبنسیشاب نسیاب سیاب نسیتبا سینا سیا بسیاب نستیشاب نستیبسی","commentCount":0,"doILike":false,"doISuggest":false,"likeCount":1,"rowId":"58bf6ed1c8015f0bd4422c70","specialLabel":0,"submitDate":"2017-03-08T02:39:13.568Z","suggestCount":0,"title":"تست می باشد.","type":1,"url":["images/cell/490661220.jpg"],"username":"mahdihp"}
from java.
public static class TestObject {
public String body;
public int commentCount;
}
public void test_utf8() {
String input = "{\"body\":\"یبل تیبلتیبمسش یبمک سشیمب سشیکمب تشسکمیبنمسیتبمسشتیب منشستمتبیملتیبملتیبمتلیمبلت یبلتیبل ینبنن اسی باسیش نباسشینباشسینبشسنتیب شسنیاب نشسیابنسشتیابنتسشیابنسشیابنسیشابنسشیاب نسشیاب سشیب سشیبن ت سینبسیبنسیشاب نسیاب سیاب نسیتبا سینا سیا بسیاب نستیشاب نستیبسی\",\"commentCount\":0,\"doILike\":false,\"doISuggest\":false,\"likeCount\":1,\"rowId\":\"58bf6ed1c8015f0bd4422c70\",\"specialLabel\":0,\"submitDate\":\"2017-03-08T02:39:13.568Z\",\"suggestCount\":0,\"title\":\"تست می باشد.\",\"type\":1,\"url\":[\"images/cell/490661220.jpg\"],\"username\":\"mahdihp\"}";
TestObject obj = JsonIterator.deserialize(input, TestObject.class);
assertEquals(0, obj.commentCount);
}
can not reproduce. please make sure the input is utf8, other encoding is not supported.
from java.
I have been able to reproduce this on latest version. The following test fails:
final String json = "{\"str\":\"{\\\"escapedKey\\\":\\\"escapedValues\\\"}\"}";
final Any any = JsonIterator.deserialize(json);
Assert.assertEquals("{\\\"escapedKey\\\":\\\"escapedValues\\\"}", any.get("str").toString());
from java.
Related Issues (20)
- Bug?: iter.skipNumber will keep illegal character
- hma HOT 1
- Codegen fails to generate Enum decoder if Enum has overriden toString() method
- No constructor for: interface io.netty.Channel
- `indentionStep` has no effect on `com.jsoniter.any.Any`
- In the micro-benchmark test, the jsoniter serialization performance seems to be a bit poor
- java 17 NPE
- duplicate class definition for name: "com/jsoniter/IterImpl" when use treaming processing
- Aplicación del patrón de diseño "Strategy"
- Aplicación del patrón de diseño Decorator
- Aplicacion del patron de diseño Strategy 2
- Reporte Refactoring 1
- Reporte refactoring 2 HOT 1
- Java 17 support & java-json-benchmark HOT 5
- Concerns regarding the way jsoniter is implemented for high performance parsing
- Java HOT 1
- Json java
- helloworld
- 递归循环报错,引发StackOverflowError HOT 1
- JsonStream.serialize error,cause StackOverflowError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java.