You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
998 B
26 lines
998 B
5 years ago
|
// TODO: Checking any one of {InterleavedResponse, ForwardUncommited} is relatively fast. But,
|
||
|
// checking both is very slow.
|
||
|
|
||
|
// According to the Servlet API, one should use
|
||
|
// - a writer for a textual response
|
||
|
// - a stream for a binary response, or for a mixed binary+textual response
|
||
|
// but never both a writer and a stream.
|
||
|
property InterleavedResponse
|
||
|
message "A ServletResponse was asked for both a writer and a stream."
|
||
|
prefix "ServletResponse"
|
||
|
nondet (start)
|
||
|
start -> start: *
|
||
|
start -> gotWriter: getWriter(R)
|
||
|
start -> gotStream: getOutputStream(R)
|
||
|
gotWriter -> error: getOutputStream(r)
|
||
|
gotStream -> error: getWriter(r)
|
||
|
|
||
|
property ForwardUncommitted
|
||
|
message "A ServletResponse was forwarded before being committed."
|
||
|
nondet (start)
|
||
|
start -> start: *
|
||
|
start -> gotChannel: C = "ServletResponse.\\(getWriter\\|getOutputStream\\)"(R)
|
||
|
gotChannel -> ok: "\\(PrintWriter\\|ServletOutputStream\\).flush.*"(c)
|
||
|
gotChannel -> error: "RequestDispatcher.forward"(*, *, r)
|
||
|
|