You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2002/10/11 04:33:08 UTC

cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteConnector.java

billbarker    2002/10/10 19:33:08

  Modified:    coyote/src/java/org/apache/coyote/tomcat4
                        CoyoteConnector.java
  Log:
  Add at least minimal sanity checking on the 'proxyName' value.
  
  Now proxyName="" is the same as omitting it all together.
  
  Reported by: Jon Scott Stevens jon@latchkey.com
  
  Revision  Changes    Path
  1.16      +9 -5      jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CoyoteConnector.java	28 May 2002 14:24:31 -0000	1.15
  +++ CoyoteConnector.java	11 Oct 2002 02:33:07 -0000	1.16
  @@ -667,7 +667,11 @@
        */
       public void setProxyName(String proxyName) {
   
  -        this.proxyName = proxyName;
  +        if(! "".equals(proxyName) {
  +            this.proxyName = proxyName;
  +        } else {
  +            this.proxyName = null;
  +        }
   
       }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteConnector.java

Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 2002/10/10 7:33 PM, "billbarker@apache.org" <bi...@apache.org>
wrote:

> +        if(! "".equals(proxyName)) {

I usually do:

if (proxyName != null && proxyName.length() > 0)

Looking at the source code to String.java, that is a far more efficient way
to do things (would be nice if that code was at the top of String.equals(),
but it isn't). You can probably take out the null check, if you know the
string won't be null, but that is only a minor optimization.

-jon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>