Skip to content

Commit

Permalink
Merge pull request apache#3862, bugfix/remove-parse-error-log, revert a…
Browse files Browse the repository at this point in the history
  • Loading branch information
lexburner authored and vio-lin committed Apr 29, 2019
1 parent f862e47 commit a49f26b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ private static BeanDefinition parse(Element element, ParserContext parserContext
String beanProperty = name.substring(3, 4).toLowerCase() + name.substring(4);
String property = StringUtils.camelToSplitName(beanProperty, "-");
props.add(property);
// check the setter/getter whether match
Method getter = null;
try {
getter = beanClass.getMethod("get" + name.substring(3), new Class<?>[0]);
} catch (NoSuchMethodException e) {
try {
getter = beanClass.getMethod("is" + name.substring(3), new Class<?>[0]);
} catch (NoSuchMethodException e2) {
logger.error("Method " + name + " parse error, cause: " + e2.getMessage(), e2);
// ignore, there is no need any log here since some class implement the interface: EnvironmentAware,
// ApplicationAware, etc. They only have setter method, otherwise will cause the error log during application start up.
}
}
if (getter == null
Expand Down

0 comments on commit a49f26b

Please sign in to comment.