File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -380,13 +380,24 @@ private void extractExterns() throws IOException {
380380 Path trapCachePath = SEMMLE_DIST .resolve (".cache" ).resolve ("trap-cache" ).resolve ("javascript" );
381381 if (Files .isDirectory (trapCachePath )) {
382382 trapCache = new DefaultTrapCache (trapCachePath .toString (), null , Main .EXTRACTOR_VERSION ) {
383+ boolean warnedAboutCacheMiss = false ;
384+
383385 @ Override
384386 public File lookup (String source , ExtractorConfig config , FileType type ) {
385387 File f = super .lookup (source , config , type );
386388 // only return `f` if it exists; this has the effect of making the cache read-only
387- return f .exists () ? f : null ;
389+ if (f .exists ())
390+ return f ;
391+ // warn on first failed lookup
392+ if (!warnedAboutCacheMiss ) {
393+ warn ("Trap cache lookup for externs failed." );
394+ warnedAboutCacheMiss = true ;
395+ }
396+ return null ;
388397 }
389398 };
399+ } else {
400+ warn ("No externs trap cache found" );
390401 }
391402 }
392403
You can’t perform that action at this time.
0 commit comments