Type safety: The expression of type HashMap needs unchecked conversion to
conform to HashMap<String,BigDecimal>
Sorry about the topic but thats all the characters I could fit.
So I'm trying to make sure all the new code I'm producing these days uses generics, because they're cool and casting all the time is lame.
I've got a HashMap<String, HashMap> that is storing HashMap<String, BigDecimal>
In the context where I'm taking the second HashMap out of the first I've got a line like this:
HashMap<String, BigDecimal> fiscalPeriods = object.get(objectNumber);
And the second half of that expression Eclipse doesn't care for and gives me the aformentioned warning.
Object is declared as such:
private LinkedHashMap<String, HashMap> object = new LinkedHashMap<String, HashMap>();
What could/should I be doing better/different here?