You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by vi...@apache.org on 2018/11/20 04:29:58 UTC

[incubator-dubbo] branch master updated: [Dubbo-2798]fix apporiate NotWritablePropertyException (#2800)

This is an automated email from the ASF dual-hosted git repository.

victory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ea6b33  [Dubbo-2798]fix apporiate NotWritablePropertyException (#2800)
5ea6b33 is described below

commit 5ea6b33f2b270d83c37726750e1395f0972636c0
Author: kexianjun <ke...@hotmail.com>
AuthorDate: Tue Nov 20 12:29:51 2018 +0800

    [Dubbo-2798]fix apporiate NotWritablePropertyException (#2800)
    
    fix #2798 .
    'propertyname in java donot contain '-' but camel format'.
---
 .../apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
index e38d1af..73c1819 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
@@ -135,7 +135,8 @@ public class DubboBeanDefinitionParser implements BeanDefinitionParser {
                     && 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 {
@@ -223,7 +224,7 @@ public class DubboBeanDefinitionParser implements BeanDefinitionParser {
                                     }
                                     reference = new RuntimeBeanReference(value);
                                 }
-                                beanDefinition.getPropertyValues().addPropertyValue(property, reference);
+                                beanDefinition.getPropertyValues().addPropertyValue(propertyName, reference);
                             }
                         }
                     }