BUG-4109: Correct checkstyle dependency and avoid a couple of NPEs
We need to ensure that the version of checkstyle used to build the
plugin extension is the same as that used when running the
maven-checkstyle-plugin. (Otherwise, ABI changes break the checks,
notably changes in type values.) To do this, depend on the
maven-checkstyle-plugin; it's not particularly elegant but it gets the
job done.
Also fix a couple of places where a type or variable name is retrieved
before further checks which could be done beforehand. By doing the
risk-free checks before calculating the type or variable name, we
avoid NPEs.
Clean up an "if () { return true; } else { return false; }".
Change-Id: Iec696a7486e43f52db69befe12c6a053903c879d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>