File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -380,8 +380,16 @@ private void extractExterns() throws IOException {
380380 ITrapCache trapCache = this .trapCache ;
381381 if (trapCache instanceof DummyTrapCache ) {
382382 Path trapCachePath = SEMMLE_DIST .resolve (".cache" ).resolve ("trap-cache" ).resolve ("javascript" );
383- if (Files .isDirectory (trapCachePath ))
384- trapCache = new DefaultTrapCache (trapCachePath .toString (), null , Main .EXTRACTOR_VERSION );
383+ if (Files .isDirectory (trapCachePath )) {
384+ trapCache = new DefaultTrapCache (trapCachePath .toString (), null , Main .EXTRACTOR_VERSION ) {
385+ @ Override
386+ public File lookup (String source , ExtractorConfig config , FileType type ) {
387+ File f = super .lookup (source , config , type );
388+ // only return `f` if it exists; this has the effect of making the cache read-only
389+ return f .exists () ? f : null ;
390+ }
391+ };
392+ }
385393 }
386394
387395 FileExtractor extractor = new FileExtractor (config , outputConfig , trapCache , extractorState );
You can’t perform that action at this time.
0 commit comments