18
18
public class FileAnnotationCache {
19
19
20
20
private static final Logger LOGGER = LoggerFactory .getLogger (FileAnnotationCache .class );
21
- // cache size in entries
22
- private final static int CACHE_SIZE = 10 ;
21
+
22
+ private static final int CACHE_SIZE = 1024 ;
23
23
24
24
// the inner list holds the annotations per file, the outer collection maps this to a BibEntry.
25
25
private LoadingCache <BibEntry , Map <Path , List <FileAnnotation >>> annotationCache ;
26
26
27
- /**
28
- * Creates an empty fil annotation cache. Required to allow the annotation cache to be injected into views without
29
- * hitting the bug https://github.com/AdamBien/afterburner.fx/issues/71 .
30
- */
27
+ /// Creates an empty file annotation cache. Required to allow the annotation cache to be injected into views without
28
+ /// hitting the bug <https://github.com/AdamBien/afterburner.fx/issues/71>.
31
29
public FileAnnotationCache () {
32
30
}
33
31
@@ -47,12 +45,12 @@ public Map<Path, List<FileAnnotation>> load(BibEntry entry) {
47
45
* @return Map containing a list of annotations in a list for each file
48
46
*/
49
47
public Map <Path , List <FileAnnotation >> getFromCache (BibEntry entry ) {
50
- LOGGER .debug ("Loading Bibentry '%s' from cache." . formatted ( entry .getCitationKey ().orElse (entry .getId () )));
48
+ LOGGER .debug ("Loading BibEntry {} from cache." , entry .getCitationKey ().orElse (entry .getId ()));
51
49
return annotationCache .getUnchecked (entry );
52
50
}
53
51
54
52
public void remove (BibEntry entry ) {
55
- LOGGER .debug ("Deleted Bibentry '%s' from cache." . formatted ( entry .getCitationKey ().orElse (entry .getId () )));
53
+ LOGGER .debug ("Deleted BibEntry {} from cache." , entry .getCitationKey ().orElse (entry .getId ()));
56
54
annotationCache .invalidate (entry );
57
55
}
58
56
}
0 commit comments