View | Details | Raw Unified | Return to bug 33453
Collapse All | Expand All

(-)Compiler.java.original (-13 / +19 lines)
Lines 26-31 Link Here
26
import java.net.URLConnection;
26
import java.net.URLConnection;
27
import java.util.Iterator;
27
import java.util.Iterator;
28
import java.util.List;
28
import java.util.List;
29
import java.util.Map;
29
30
30
import org.apache.jasper.JasperException;
31
import org.apache.jasper.JasperException;
31
import org.apache.jasper.JspCompilationContext;
32
import org.apache.jasper.JspCompilationContext;
Lines 368-378 Link Here
368
            return true;
369
            return true;
369
        }
370
        }
370
371
371
        targetLastModified = targetFile.lastModified();
372
        if (jsw != null) {
372
        if (checkClass && jsw != null) {
373
           targetLastModified = jsw.getLastModified();   
373
            jsw.setServletClassLastModifiedTime(targetLastModified);
374
        }
374
        }   
375
        else {
375
        if (targetLastModified < jspRealLastModified) {
376
           return false;
377
        }
378
                
379
        if (targetLastModified != jspRealLastModified) {
376
            if( log.isDebugEnabled() ) {
380
            if( log.isDebugEnabled() ) {
377
                log.debug("Compiler: outdated: " + targetFile + " " +
381
                log.debug("Compiler: outdated: " + targetFile + " " +
378
                    targetLastModified );
382
                    targetLastModified );
Lines 381-396 Link Here
381
        }
385
        }
382
386
383
        // determine if source dependent files (e.g. includes using include
387
        // determine if source dependent files (e.g. includes using include
384
        // directives) have been changed.
388
        // directives) have been changed.                
385
        if( jsw==null ) {
386
            return false;
387
        }
388
        
389
        List depends = jsw.getDependants();
389
        List depends = jsw.getDependants();
390
        Map dependToLastModified = jsw.getDependantToLastModified();
390
        if (depends == null) {
391
        if (depends == null) {
391
            return false;
392
            return false;
392
        }
393
        }
393
394
        
395
        if (dependToLastModified == null) {
396
           return true;   
397
        }
398
        
394
        Iterator it = depends.iterator();
399
        Iterator it = depends.iterator();
395
        while (it.hasNext()) {
400
        while (it.hasNext()) {
396
            String include = (String)it.next();
401
            String include = (String)it.next();
Lines 403-410 Link Here
403
                URLConnection includeUconn = includeUrl.openConnection();
408
                URLConnection includeUconn = includeUrl.openConnection();
404
                long includeLastModified = includeUconn.getLastModified();
409
                long includeLastModified = includeUconn.getLastModified();
405
                includeUconn.getInputStream().close();
410
                includeUconn.getInputStream().close();
406
411
                
407
                if (includeLastModified > targetLastModified) {
412
                Long previousLastModified = (Long)dependToLastModified.get(include);                     
413
                if ((previousLastModified == null) || (includeLastModified != previousLastModified.longValue())) {
408
                    return true;
414
                    return true;
409
                }
415
                }
410
            } catch (Exception e) {
416
            } catch (Exception e) {

Return to bug 33453