Won't work unless LevelO is an interface, yes? In any case, the point of an inspection is to act as a sensor for the issue, not just a fix if you happen to run across it.
I had pegged the issue as simpler, namely that you shouldn't rely on Java's half-assed semantics for "inheritance" of static fields or methods. If you want to access a static, use .]]>. There are already inspections for avoiding accessing a static via an instance and accessing a static implicitly (name only if you're in the same class). This is just a stylistic tightening up of the access pattern (although like many stylistic inspections it can find real bugs hiding in bad style as well).
No, but there will be in within the next couple of EAP releases. Good one. Someone assign this to me, please.
--Dave Griffith
Refactor|Use Interface where possible.
--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Alain Ravet" < alainravet-jetbrains@yahoo.com> wrote in message
news:22306215.1100359806388.JavaMail.itn@is.intellij.net...
>
>
>
>
>
Alexey
>Refactor|Use Interface where possible.
>
First you inspect, then you refactor;
We need a real inspection, to find the interfaces to use where possible.
Alain
Won't work unless LevelO is an interface, yes? In any case, the point of an inspection is to act as a sensor for the issue, not just a fix if you happen to run across it.
--Dave Griffith
The issue being not relying on the class referenced always inheriting from the parent class? Thus a tightening of the reference?
I had pegged the issue as simpler, namely that you shouldn't rely on Java's half-assed semantics for "inheritance" of static fields or methods. If you want to access a static, use .]]>. There are already inspections for avoiding accessing a static via an instance and accessing a static implicitly (name only if you're in the same class). This is just a stylistic tightening up of the access pattern (although like many stylistic inspections it can find real bugs hiding in bad style as well).
--Dave Griffith