-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: SlidingExpirationCache and SlidingExpirationCacheWithCleanupThread #1142
Conversation
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: true Contact Qodana teamContact us at [email protected]
|
// A list is used to store the cached item for later disposal since lambdas require references to outer variables | ||
// to be final. This allows us to dispose of the item after it has been removed and the cache has been unlocked, | ||
// which is important because the disposal function may be long-running. | ||
final List<V> itemList = new ArrayList<>(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use List<> instead of a simple variable of type V?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I try to do that I get "Variable used in lambda expression should be final or effectively final". It seems you cannot assign a value to a variable declared outside of the lambda unless that variable is final. The solutions my IDE proposes are other making it an atomic reference or making it a list. This relates to this discussion on the custom endpoint PR.
Summary
fix: SlidingExpirationCache and SlidingExpirationCacheWithCleanupThread
Description
Contains fixes for SlidingExpirationCache and SlidingExpirationCacheWithCleanupThread:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.