The PMD type resolution for inferred types using the var keyword is very simple (see Java 10 Support).
As a result it's usually not possible to get the type of such variables during analysis.
So for now it's probably best to make sure not any NPEs occur whenever the type cannot be inferred.
Since var can only be used with local variables, it's not likely loggers will be instantiated often this way.
The PMD type resolution for inferred types using the
var
keyword is very simple (see Java 10 Support). As a result it's usually not possible to get the type of such variables during analysis. So for now it's probably best to make sure not any NPEs occur whenever the type cannot be inferred. Sincevar
can only be used with local variables, it's not likely loggers will be instantiated often this way.Fixes #379
Draft because this builds upon the changes made in
UseSLF4JLoggerRule
part of https://github.com/openhab/static-code-analysis/pull/380