Skip to content

Commit

Permalink
[Dubbo-2798]fix apporiate NotWritablePropertyException (apache#2800)
Browse files Browse the repository at this point in the history
fix apache#2798 .
'propertyname in java donot contain '-' but camel format'.
  • Loading branch information
kexianjun authored and CrazyHZM committed Dec 6, 2018
1 parent 054de5e commit 890e57d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ private static BeanDefinition parse(Element element, ParserContext parserContext
&& Modifier.isPublic(setter.getModifiers())
&& setter.getParameterTypes().length == 1) {
Class<?> type = setter.getParameterTypes()[0];
String property = StringUtils.camelToSplitName(name.substring(3, 4).toLowerCase() + name.substring(4), "-");
String propertyName = name.substring(3, 4).toLowerCase() + name.substring(4);
String property = StringUtils.camelToSplitName(propertyName, "-");
props.add(property);
Method getter = null;
try {
Expand Down Expand Up @@ -223,7 +224,7 @@ private static BeanDefinition parse(Element element, ParserContext parserContext
}
reference = new RuntimeBeanReference(value);
}
beanDefinition.getPropertyValues().addPropertyValue(property, reference);
beanDefinition.getPropertyValues().addPropertyValue(propertyName, reference);
}
}
}
Expand Down

0 comments on commit 890e57d

Please sign in to comment.