Silence meaningless warnings from JarScanner

Don't log warnings when annotationName is null.

Change-Id: Ib7ef7490b1525a0d33ea09de6169ebde7759fb59
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2015-10-21 11:04:35 +02:00
parent 3dcf53f214
commit c3e4e0de0f

View File

@@ -107,14 +107,14 @@ public class JarScanner implements PluginContentScanner {
continue;
}
if (def.isConcrete()) {
if (!Strings.isNullOrEmpty(def.annotationName)) {
rawMap.put(def.annotationName, def);
if (!Strings.isNullOrEmpty(def.annotationName)) {
if (def.isConcrete()) {
rawMap.put(def.annotationName, def);
} else {
PluginLoader.log.warn(String.format(
"Plugin %s tries to @%s(\"%s\") abstract class %s", pluginName,
def.annotationName, def.annotationValue, def.className));
}
} else {
PluginLoader.log.warn(String.format(
"Plugin %s tries to @%s(\"%s\") abstract class %s", pluginName,
def.annotationName, def.annotationValue, def.className));
}
}