Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonObjectDecoder throws ArrayIndexOutOfBoundsException: -1 with valid input [SPR-15013] #19580

Closed
spring-issuemaster opened this issue Dec 14, 2016 · 0 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Dec 14, 2016

Sébastien Deleuze opened SPR-15013 and commented

JsonObjectDecoder fails with ArrayIndexOutOfBoundsException: -1 error with this test case:

JsonObjectDecoder decoder = new JsonObjectDecoder();

		Flux<DataBuffer> source =
				Flux.just(stringBuffer("["), stringBuffer("{\"id\":1,\"name\":\"Robert\"}"), stringBuffer(","), stringBuffer("{\"id\":2,\"name\":\"Raide\"}"), stringBuffer(","), stringBuffer("{\"id\":3,\"name\":\"Ford\"}"), stringBuffer("]"));
		Flux<String> output =
				decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
		StepVerifier.create(output)
				.expectNext("{\"id\":1,\"name\":\"Robert\"}")
				.expectNext("{\"id\":2,\"name\":\"Raide\"}")
				.expectNext("{\"id\":3,\"name\":\"Ford\"}")
				.expectComplete()
				.verify();

Affects: 5.0 M3

Issue Links:

  • #19460 WebClient ArrayIndexOutOfBoundsException ("is duplicated by")
  • #19425 JsonObjectDecoder fails to decode some splitted source

Referenced from: commits 4021d23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.