@@ -0,0 +1,3266 @@
+package sfBugs;%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport java.util.Locale;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.ServletOutputStream;%0Aimport javax.servlet.ServletRequest;%0Aimport javax.servlet.ServletResponse;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport edu.umd.cs.findbugs.annotations.Confidence;%0Aimport edu.umd.cs.findbugs.annotations.ExpectWarning;%0Aimport edu.umd.cs.findbugs.annotations.NoWarning;%0A%0Apublic class Bug3598793 implements ServletResponse %7B%0A%0A    @NoWarning(%22BC_UNCONFIRMED_CAST%22)%0A    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException %7B%0A        HttpServletResponse response;%0A%0A        try %7B%0A            response = (HttpServletResponse) res;%0A        %7D catch (ClassCastException e) %7B%0A            throw new ServletException(%22non-HTTP request or response%22, e);%0A        %7D%0A        response.sendError(404);%0A    %7D%0A%0A    @ExpectWarning(value=%22BC_UNCONFIRMED_CAST%22, confidence=Confidence.LOW)%0A    public void service2(ServletRequest req, ServletResponse res) throws ServletException, IOException %7B%0A        HttpServletResponse response;%0A%0A        response = (HttpServletResponse) res;%0A%0A        response.sendError(404);%0A    %7D%0A%0A  @ExpectWarning(%22BC_UNCONFIRMED_CAST%22)%0A  public  Integer foo(Number x) %7B%0A      return (Integer) x;%0A  %7D%0A%0A  @NoWarning(%22BC_UNCONFIRMED_CAST%22)%0A  public  Integer foo(Object x) %7B%0A      return (Integer) x;%0A  %7D%0A    %0A    @Override%0A    public void flushBuffer() throws IOException %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public int getBufferSize() %7B%0A        // TODO Auto-generated method stub%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public String getCharacterEncoding() %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public String getContentType() %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Locale getLocale() %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public ServletOutputStream getOutputStream() throws IOException %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public PrintWriter getWriter() throws IOException %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public boolean isCommitted() %7B%0A        // TODO Auto-generated method stub%0A        return false;%0A    %7D%0A%0A    @Override%0A    public void reset() %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void resetBuffer() %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void setBufferSize(int arg0) %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void setCharacterEncoding(String arg0) %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void setContentLength(int arg0) %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void setContentType(String arg0) %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A%0A    @Override%0A    public void setLocale(Locale arg0) %7B%0A        // TODO Auto-generated method stub%0A        %0A    %7D%0A    %0A%0A%0A%7D%0A

add test case for bug 3598793