java – Eclipse showing ‘Object’ instead of correct type for var
I am new to the var
keyword, and I am trying to understand something in Eclipse.
The code I have is:
Map<Integer, Set<Integer>> savedConfirmations = USERS.fetchStaffAccessConfirmed(managerId, dates)
.entrySet()
.stream()
.collect(Collectors.toMap(Entry::getKey, (o) -> o.getValue().keySet()));
When I change the type from Map<Integer, Set<Integer>>
to var
Eclipse tells me it is an Object
when I hover over it.
However I am able to use the variable as if it is a Map<Integer, Set<Integer>>
in both ways without error.
Eg:
savedConfirmations.get(1);
It appears to only effect Collectors.toMap
, as if I collect to a List the hover shows its correct type.
Is there something I am misunderstanding about var
?
Read more here: Source link