I have this method:
public <T extends CacheResult> T get(Object key, CacheDefinition cacheDefinition) {
return load(key, cacheDefinition.name(), cacheDefinition.getTypeReference());
}
Now my IDE complains (as expected, and which is correct) about this line, because the return type is supposed to be CacheResult
User user = spxCacheManager.get(username, CacheDefinition.USERS_BY_USERNAME);
What I currently dont understand, is that the IDE (IntelliJ) is not complaining about this:
List<User> usersFromCache = spxCacheManager.get(username, CacheDefinition.USERS_BY_USERNAME);
Which is actually wrong. What am I missing here?