Bug 33219 - Slight code improvement
Summary: Slight code improvement
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: Nightly Build
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 16:19 UTC by David Biesack
Modified: 2005-03-23 08:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Biesack 2005-01-24 16:19:48 UTC
I found what I would classify as a small "broken window" (really more of a nick
than a break) while debugging another problem. Below is a patch for 
org/apache/jasper/servlet/JspServletWrapper.java to remove unnecessary
conditional statements.  The change will not really have much, if any, affect on
performance, although there will be fewer bytecodes, less (and simpler) source code.

--- JspServletWrapper.java.orig	2005-01-24 09:40:38.000000000 -0500
+++ JspServletWrapper.java	2005-01-24 09:42:19.000000000 -0500
@@ -196,9 +196,7 @@
             }
             if (options.getDevelopment() || firstTime ) {
                 synchronized (this) {
-                    if (firstTime) {
-                        firstTime = false;
-                    }
+                    firstTime = false;
                     ctxt.compile();
                 }
             } else {
@@ -289,9 +287,7 @@
              */
             if (options.getDevelopment() || firstTime ) {
                 synchronized (this) {
-                    if (firstTime) {
-                        firstTime = false;
-                    }
+                    firstTime = false;
                     // The following sets reload to true, if necessary
                     ctxt.compile();
                 }
Comment 1 Yoav Shapira 2005-02-01 21:41:13 UTC
Changing severity.
Comment 2 Yoav Shapira 2005-03-23 17:38:15 UTC
Done.  Thanks for reporting the patch.