2013/1/10  <ma...@apache.org>:
> Author: markt
> Date: Thu Jan 10 11:45:12 2013
> New Revision: 1431298
>
> URL: http://svn.apache.org/viewvc?rev=1431298&view=rev
> Log:
> Remove unnecessary warnings
>

What settings do you have in
Java -> Compiler -> Errors/Warnings
section "Potential programming problems",
items
* "Resource leak",
* "Potential resource leak"

Mine are both set on "Warning".

>From this fix I guess you have "Ignore" for "potential resource leak" setting.
I'd agree that there are too many "non-closed" writers in web applications.
I am going to update my configuration and docs.


> Modified:
>     tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
>     tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
>
> Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=1431298&r1=1431297&r2=1431298&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java 
> (original)
> +++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java Thu 
> Jan 10 11:45:12 2013
> @@ -161,7 +161,6 @@ public class TestStandardContext extends
>          @Override
>          public void doFilter(ServletRequest request, ServletResponse 
> response,
>                  FilterChain chain) throws IOException, ServletException {
> -            @SuppressWarnings("resource") // No need to close this writer
>              PrintWriter out = response.getWriter();
>              out.print(getClass().getName());
>              chain.doFilter(request, response);
> @@ -648,7 +647,6 @@ public class TestStandardContext extends
>              resp.setContentType("text/plain");
>              resp.setCharacterEncoding("UTF-8");
>
> -            @SuppressWarnings("resource") // No need to close this writer
>              PrintWriter out = resp.getWriter();
>
>              out.println("parts=" + (null == req.getParts()
>
> Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1431298&r1=1431297&r2=1431298&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java 
> (original)
> +++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Thu Jan 
> 10 11:45:12 2013
> @@ -182,7 +182,6 @@ public abstract class TomcatBaseTest ext
>          @Override
>          protected void doGet(HttpServletRequest req, HttpServletResponse 
> resp)
>                  throws ServletException, IOException {
> -            @SuppressWarnings("resource") // No need to close this writer
>              PrintWriter out = resp.getWriter();
>              out.print(RESPONSE_TEXT);
>          }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to