jsr107 / jsr107spec

JSR107 Cache Specification
Apache License 2.0
413 stars 164 forks source link

iterator() return type in Cache #420

Open dhruvv90 opened 11 months ago

dhruvv90 commented 11 months ago

Proposal : to change return type of iterator() method in class Cache from Iterator<Cache.Entry<K, V>> to Iterator<? extends Cache.Entry<K, V>>

This will help JSR implementations to create Iterables of custom types, since Generics are not covariant. There might be reasons this wasn't done this way, but sorry i'm not aware of that if that's the case