kinman      2004/01/22 11:35:07

  Modified:    jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Fix 26276: Generated TLD inconsistent after tagfile changes.  Need to
    remove compilation wrapper for tag files if its clients has been changed.
  
  Revision  Changes    Path
  1.76      +19 -16    
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- Compiler.java     6 Jan 2004 19:42:39 -0000       1.75
  +++ Compiler.java     22 Jan 2004 19:35:07 -0000      1.76
  @@ -498,6 +498,7 @@
        */
       public boolean isOutDated(boolean checkClass) {
   
  +        boolean outDated = false;
           String jsp = ctxt.getJspFile();
   
           long jspRealLastModified = 0;
  @@ -513,7 +514,7 @@
               return true;
           }
   
  -        long targetLastModified;
  +        long targetLastModified = 0;
           File targetFile;
           
           if( checkClass ) {
  @@ -523,29 +524,30 @@
           }
           
           if (!targetFile.exists()) {
  -            return true;
  -        }
  -
  -        targetLastModified = targetFile.lastModified();
  -        if (targetLastModified < jspRealLastModified) {
  -            if( log.isDebugEnabled() )
  -                log.debug("Compiler: outdated: " + targetFile + " " + 
targetLastModified );
  -            return true;
  +            outDated = true;
  +        } else {
  +            targetLastModified = targetFile.lastModified();
  +            if (targetLastModified < jspRealLastModified) {
  +                if( log.isDebugEnabled() ) {
  +                    log.debug("Compiler: outdated: " + targetFile + " " +
  +                        targetLastModified );
  +                }
  +                outDated = true;
  +            }
           }
   
           // determine if source dependent files (e.g. includes using include
  -     // directives) have been changed.
  +        // directives) have been changed.
           if( jsw==null ) {
  -            return false;
  +            return outDated;
           }
   
           List depends = jsw.getDependants();
           if (depends == null) {
  -            return false;
  +            return outDated;
           }
   
           Iterator it = depends.iterator();
  -        boolean outDated = false;
           while (it.hasNext()) {
               String include = (String)it.next();
               try {
  @@ -554,18 +556,19 @@
                       //System.out.println("Compiler: outdated, no includeUri " + 
include );
                       outDated = true;
                   }
  -                if (includeUrl.openConnection().getLastModified() >
  +                if (!outDated && includeUrl.openConnection().getLastModified() >
                       targetLastModified) {
                       //System.out.println("Compiler: outdated, include old " + 
include );
                       outDated = true;
  -                    // Remove any potential Wrappers for tag files
  -                    ctxt.getRuntimeContext().removeWrapper(include);
                   }
  +                // Remove any potential Wrappers for tag files
  +                ctxt.getRuntimeContext().removeWrapper(include);
               } catch (Exception e) {
                   e.printStackTrace();
                   outDated = true;
               }
           }
  +
           return outDated;
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to