You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/06/23 17:19:59 UTC

[tomcat] branch 9.0.x updated: Simplify - identified by SpotBugs

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new d52d085  Simplify - identified by SpotBugs
d52d085 is described below

commit d52d08507fa6568bfbf3b3e67b94892929dfe8dd
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 23 18:18:37 2021 +0100

    Simplify - identified by SpotBugs
---
 java/org/apache/jasper/runtime/PageContextImpl.java | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/java/org/apache/jasper/runtime/PageContextImpl.java b/java/org/apache/jasper/runtime/PageContextImpl.java
index be5eebe..5393140 100644
--- a/java/org/apache/jasper/runtime/PageContextImpl.java
+++ b/java/org/apache/jasper/runtime/PageContextImpl.java
@@ -93,8 +93,6 @@ public class PageContextImpl extends PageContext {
 
     private transient ELContextImpl elContext;
 
-    private boolean isIncluded;
-
 
     // initial output stream
     private transient JspWriter out;
@@ -160,26 +158,13 @@ public class PageContextImpl extends PageContext {
         setAttribute(CONFIG, config);
         setAttribute(PAGECONTEXT, this);
         setAttribute(APPLICATION, context);
-
-        isIncluded = request.getAttribute(
-                RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
     }
 
     @Override
     public void release() {
         out = baseOut;
         try {
-            if (isIncluded) {
-                ((JspWriterImpl) out).flushBuffer();
-                // push it into the including jspWriter
-            } else {
-                // Old code:
-                // out.flush();
-                // Do not flush the buffer even if we're not included (i.e.
-                // we are the main page. The servlet will flush it and close
-                // the stream.
-                ((JspWriterImpl) out).flushBuffer();
-            }
+            ((JspWriterImpl) out).flushBuffer();
         } catch (IOException ex) {
             IllegalStateException ise = new IllegalStateException(Localizer.getMessage("jsp.error.flush"), ex);
             throw ise;

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