In my IntelliJ (a recent version), if I write a small Java function like this:
private static void blah()
{
final int abc = 3;
for (int def = 7; def < 20; ++def)
{
System.out.print(def);
}
}
The variable 'def' is underlined. Mouse-over hint shows: 'Reassigned local variable'. To be clear, 'abc' is not underlined. When I write Java, I try to use the smallest variable scopes possible with as much final (keyword) as possible. It helps me to write more maintainable code, that is easier to read.
As an aside, you might also enjoy the inline inferred annotations.
https://www.jetbrains.com/help/idea/annotating-source-code.h...
Seeing @NotNull in there even if the author hasn't specifically written that can help in understanding (and not needing to consider) various branches.
1st) you use ++def in a loop, don't be weird; 2nd) if 'abc' is to be used in the loop body, define in the loop, e.g. for (int def = 7, abc =3; ...); 3rd) this is an IntelliJ bug - both 'def' and 'abc' in the sample are always defined.
3) looks like you read 'underlined' as 'undefined'
true that, thanks!
the only thing that is weird is your lack of understanding temporary variables
perhaps... yet, Java doesn't have a definition for temporary variables
This works in RustRover as well! Super useful.
Rust's type system specifically facilitates more powerful tools: https://github.com/willcrichton/flowistry