Skip to content

Commit

Permalink
Such logic already exists in findAnnotationName (#1750)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCaptain1015 authored and ralf0131 committed May 12, 2018
1 parent b8a7a39 commit 616f629
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,7 @@ private void loadClass(Map<String, Class<?>> extensionClasses, java.net.URL reso
if (name == null || name.length() == 0) {
name = findAnnotationName(clazz);
if (name == null || name.length() == 0) {
if (clazz.getSimpleName().length() > type.getSimpleName().length()
&& clazz.getSimpleName().endsWith(type.getSimpleName())) {
name = clazz.getSimpleName().substring(0, clazz.getSimpleName().length() - type.getSimpleName().length()).toLowerCase();
} else {
throw new IllegalStateException("No such extension name for the class " + clazz.getName() + " in the config " + resourceURL);
}
throw new IllegalStateException("No such extension name for the class " + clazz.getName() + " in the config " + resourceURL);
}
}
String[] names = NAME_SEPARATOR.split(name);
Expand Down

0 comments on commit 616f629

Please sign in to comment.