MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / deleteOverflow

Method deleteOverflow

src/main/java/org/htmlunit/Cache.java:211–221  ·  view source on GitHub ↗

Truncates the cache to the maximal number of entries.

()

Source from the content-addressed store, hash-verified

209 * Truncates the cache to the maximal number of entries.
210 */
211 protected void deleteOverflow() {
212 synchronized (entries_) {
213 while (entries_.size() > maxSize_) {
214 final Entry oldestEntry = Collections.min(entries_.values());
215 entries_.remove(oldestEntry.key_);
216 if (oldestEntry.response_ != null) {
217 oldestEntry.response_.cleanUp();
218 }
219 }
220 }
221 }
222
223 /**
224 * Determines if the specified response can be cached.

Callers 3

cacheIfPossibleMethod · 0.95
cacheMethod · 0.95
setMaxSizeMethod · 0.95

Calls 5

cleanUpMethod · 0.65
sizeMethod · 0.45
minMethod · 0.45
valuesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected