Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 422837

Summary: Shutdown request should return valid JSON
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mpost, rsternberg
Version: 2.2   
Target Milestone: 2.2 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Updated patch with suggestion from comment #2 ivan: review?, rsternberg: review+

Description Ivan Furnadjiev CLA 2013-11-29 07:23:51 EST
Currently, the last shutdown request ( with { "head" : { "shutdown":true } ... } ) returns empty page even the content type is set to "application/json". We should return empty JSON object.
Comment 1 Ivan Furnadjiev CLA 2013-11-29 07:54:24 EST
Created attachment 237847 [details]
Proposed patch

With this patch the "shutdown" request returns empty JSON message (with empty head and operations).
Comment 2 Ralf Sternberg CLA 2013-11-29 08:04:54 EST
Comment on attachment 237847 [details]
Proposed patch

I'm fine with the change. But shouldn't we use

    new ProtocolMessageWriter().createMessage().writeTo( response.getWriter() );

instead of assembling the message manually?
Comment 3 Ivan Furnadjiev CLA 2013-11-29 08:26:41 EST
(In reply to comment #2)
> new ProtocolMessageWriter().createMessage().writeTo( response.getWriter() );
I thought about it too, but ProtocolMessageWriter is doing some internal checks which I decided to skip. I will update the patch with your proposal.
Comment 4 Ivan Furnadjiev CLA 2013-11-29 08:29:27 EST
Created attachment 237848 [details]
Updated patch with suggestion from comment #2
Comment 5 Ralf Sternberg CLA 2013-12-03 05:43:11 EST
Comment on attachment 237848 [details]
Updated patch with suggestion from comment #2

Although it's not a critical bug, I'm in favor of including this fix in 2.2, because it removes an exceptional case that third-party clients need to handle.
Comment 6 Ivan Furnadjiev CLA 2013-12-03 06:06:13 EST
Applied patch to master with commit 3cc3cfb85d07868980a2019e496234f43e71148a.