Moved creation of reqeust and response out of the try/finally block. I don't see any way for

them to throw an exception, and it is bad form to reference a variable created in the try in 
the finally block (fortifysoftware issue)

 --This line, and those below, will be ignored--

M    src/webapp/src/org/apache/solr/servlet/SolrServlet.java


git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@488778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mike Klaas 2006-12-19 19:31:26 +00:00
parent 072c3c5922
commit f0edf7f848
1 changed files with 2 additions and 4 deletions

View File

@ -84,11 +84,9 @@ public class SolrServlet extends HttpServlet {
} }
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
SolrServletRequest solrReq =null; SolrServletRequest solrReq = new SolrServletRequest(core, request);;
SolrQueryResponse solrRsp =null; SolrQueryResponse solrRsp = new SolrQueryResponse();
try { try {
solrRsp = new SolrQueryResponse();
solrReq = new SolrServletRequest(core, request);
core.execute(solrReq, solrRsp); core.execute(solrReq, solrRsp);
if (solrRsp.getException() == null) { if (solrRsp.getException() == null) {
QueryResponseWriter responseWriter = core.getQueryResponseWriter(solrReq); QueryResponseWriter responseWriter = core.getQueryResponseWriter(solrReq);