fixed NPE reported by Paul King, getPackage() might return null...
I can't believe it's so difficult to extract the package name of a class...
This commit is contained in:
parent
d963b8bfc2
commit
635444ddb2
|
|
@ -56,8 +56,10 @@ public class PackageHtmlCheck extends AbstractFileSetCheck
|
|||
dispatcher.fireFileStarted(path);
|
||||
if (!packageHtml.exists()) {
|
||||
LocalizedMessage[] errors = new LocalizedMessage[1];
|
||||
final String bundle =
|
||||
this.getClass().getPackage().getName() + ".messages";
|
||||
final String className = getClass().getName();
|
||||
final int pkgEndIndex = className.lastIndexOf('.');
|
||||
final String pkgName = className.substring(0, pkgEndIndex);
|
||||
final String bundle = pkgName + ".messages";
|
||||
errors[0] = new LocalizedMessage(
|
||||
0, bundle, "javadoc.packageHtml", null);
|
||||
getMessageDispatcher().fireErrors(path, errors);
|
||||
|
|
|
|||
Loading…
Reference in New Issue