costin      01/06/16 13:39:47

  Modified:    jasper34/generator/org/apache/jasper34/core Options.java
  Log:
  Eliminate some duplicated code ( all implementations were checking for null
  and default to java.io.tmpdir )
  
  Revision  Changes    Path
  1.5       +7 -3      
jakarta-tomcat-jasper/jasper34/generator/org/apache/jasper34/core/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper34/generator/org/apache/jasper34/core/Options.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Options.java      2001/06/12 15:06:06     1.4
  +++ Options.java      2001/06/16 20:39:46     1.5
  @@ -167,12 +167,16 @@
        * in?
        */
       public File getScratchDir() {
  -     return new File( args.getProperty( SCRATCH_DIR, null ));
  +     // Special case: args should try to get it from context
  +     String sdProp=args.getProperty( SCRATCH_DIR, null );
  +     if( sdProp==null ) {
  +         sdProp=System.getProperty("java.io.tmpdir");
  +     }
  +     if( sdProp==null ) return null;
  +     return new File(sdProp);
   
        /* XXX integrate ( from Embeded )
        scratchDir = (File) context.getAttribute(Constants.TMP_DIR);
  -     if (scratchDir == null) {
  -     dir = System.getProperty("java.io.tmpdir");
        if (dir != null)
        scratchDir = new File(dir);
        */
  
  
  

Reply via email to