You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/06/03 21:52:00 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources DirContextURLConnection.java

remm        01/06/03 12:52:00

  Modified:    catalina/src/share/org/apache/naming/resources
                        DirContextURLConnection.java
  Log:
  - Possible workaround for the perf problem reported by Jon : don't create
    a FilePermission is there is no security manager defined.
  
  Revision  Changes    Path
  1.11      +6 -5      jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java
  
  Index: DirContextURLConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DirContextURLConnection.java	2001/05/11 18:24:33	1.10
  +++ DirContextURLConnection.java	2001/06/03 19:52:00	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v 1.10 2001/05/11 18:24:33 remm Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/05/11 18:24:33 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v 1.11 2001/06/03 19:52:00 remm Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/06/03 19:52:00 $
    *
    * ====================================================================
    *
  @@ -91,7 +91,7 @@
    * content is directly returned.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class DirContextURLConnection 
       extends URLConnection {
  @@ -105,7 +105,8 @@
           if (context == null)
               throw new IllegalArgumentException
                   ("Directory context can't be null");
  -        this.permission = new FilePermission(url.toString(), "read");
  +        if (System.getSecurityManager() != null)
  +            this.permission = new FilePermission(url.toString(), "read");
           this.context = context;
       }
       
  
  
  

Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources DirContextURLConnection.java

Posted by Jason van Zyl <jv...@apache.org>.
remm@apache.org wrote:
> 
> remm        01/06/03 12:52:00
> 
>   Modified:    catalina/src/share/org/apache/naming/resources
>                         DirContextURLConnection.java
>   Log:
>   - Possible workaround for the perf problem reported by Jon : don't create
>     a FilePermission is there is no security manager defined.

That definitely fixed the speed problem! The TDK is humming along like
it
used to. Thanks for fixing that, much appreciated!

> 
>   Revision  Changes    Path
>   1.11      +6 -5      jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java
> 
>   Index: DirContextURLConnection.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v
>   retrieving revision 1.10
>   retrieving revision 1.11
>   diff -u -r1.10 -r1.11
>   --- DirContextURLConnection.java      2001/05/11 18:24:33     1.10
>   +++ DirContextURLConnection.java      2001/06/03 19:52:00     1.11
>   @@ -1,7 +1,7 @@
>    /*
>   - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v 1.10 2001/05/11 18:24:33 remm Exp $
>   - * $Revision: 1.10 $
>   - * $Date: 2001/05/11 18:24:33 $
>   + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v 1.11 2001/06/03 19:52:00 remm Exp $
>   + * $Revision: 1.11 $
>   + * $Date: 2001/06/03 19:52:00 $
>     *
>     * ====================================================================
>     *
>   @@ -91,7 +91,7 @@
>     * content is directly returned.
>     *
>     * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
>   - * @version $Revision: 1.10 $
>   + * @version $Revision: 1.11 $
>     */
>    public class DirContextURLConnection
>        extends URLConnection {
>   @@ -105,7 +105,8 @@
>            if (context == null)
>                throw new IllegalArgumentException
>                    ("Directory context can't be null");
>   -        this.permission = new FilePermission(url.toString(), "read");
>   +        if (System.getSecurityManager() != null)
>   +            this.permission = new FilePermission(url.toString(), "read");
>            this.context = context;
>        }
> 
> 
> 
> 

-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org