I am struggling to prevent IDEA from complaining about assignment to variable declared by def
keyword.
The assignment is absolutely safe as far as I can tell (I observe the same for literals of other types assigned to def
ed variables). I do not see why assigning Integer
into Object
would be a problem in the first place.
There does not seem to be any explanation in inspections settings (Groovy > Assignment issues > Incompatible type assignments) nor any fine grained configuration to tune this. When turned off completely, it stops reporting real problems like Integer a = ""
as well.
How do I get it to report real problems without highlighting safe assignments?
IntelliJ IDEA can not relay grok the groovy code unless there are both Groovy and Java SDKs configured. By importing the project Groovy got configured automatically, but Java did not.