-
Notifications
You must be signed in to change notification settings - Fork 143
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
When using foreach, the keyset method loops infinitely #70
Labels
Comments
|
Happy to take a PR for this. |
There is something wrong when ExpirationPolicy is ACCESSED. For ex: This works.
But this doesn't.
|
This is a bug. |
The bug is that get > resetEntry (if policy is accessed) > reorder (removes and add) This looks like a bug, that it adds again, so when I removed the reorder line, it worked fine but then I am not sure if that is correct fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
code
public static void main(String[] args) { ExpiringMap<String, String> map = ExpiringMap.builder() .maxSize(100) .expiration(20L, TimeUnit.MINUTES) .expirationPolicy(ExpirationPolicy.ACCESSED) .variableExpiration() .build(); map.put("1", "1"); map.put("2", "2"); map.keySet().forEach((key) -> { System.out.println(map.get(key)); }); }
and result
1 2 1 2 1 2 1 2 .....
The text was updated successfully, but these errors were encountered: