cpoerschke commented on a change in pull request #207:
URL: https://github.com/apache/solr/pull/207#discussion_r667118063
##########
File path: solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java
##########
@@ -552,15 +553,14 @@ private void markAndSweepByCacheSize() {
// this loop so far.
queue.myMaxSize = sz - lowerWaterMark - numRemoved;
while (queue.size() > queue.myMaxSize && queue.size() > 0) {
- @SuppressWarnings({"rawtypes"})
- CacheEntry otherEntry = queue.pop();
+ CacheEntry<K,V> otherEntry = queue.pop();
newOldestEntry = Math.min(otherEntry.lastAccessedCopy,
newOldestEntry);
}
if (queue.myMaxSize <= 0) break;
Object o = queue.myInsertWithOverflow(ce);
if (o != null) {
- newOldestEntry = Math.min(((CacheEntry)o).lastAccessedCopy,
newOldestEntry);
+ newOldestEntry = Math.min(((CacheEntry<?,?>)o).lastAccessedCopy,
newOldestEntry);
Review comment:
... would allow
```suggestion
newOldestEntry = Math.min(o.lastAccessedCopy, newOldestEntry);
```
cast removal here I think (but the UI won't allow that to be suggested in
one comment)
##########
File path: solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java
##########
@@ -552,15 +553,14 @@ private void markAndSweepByCacheSize() {
// this loop so far.
queue.myMaxSize = sz - lowerWaterMark - numRemoved;
while (queue.size() > queue.myMaxSize && queue.size() > 0) {
- @SuppressWarnings({"rawtypes"})
- CacheEntry otherEntry = queue.pop();
+ CacheEntry<K,V> otherEntry = queue.pop();
newOldestEntry = Math.min(otherEntry.lastAccessedCopy,
newOldestEntry);
}
if (queue.myMaxSize <= 0) break;
Object o = queue.myInsertWithOverflow(ce);
Review comment:
```suggestion
CacheEntry<K,V> o = queue.myInsertWithOverflow(ce);
```
here ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]