-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YamlUtils工具类 ymlToObj函数 Properties baseProperties参数问题 #4355
Milestone
Comments
#4560 修改后的代码参考这里 # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
environment
Issue Description
com.alibaba.otter.canal.client.adapter.support 包下YamlUtils工具类ymlToObj
java 基本数据类型作为参数传递时,传递的是值的拷贝,无论怎么改变这个拷贝,原值是不会改变的,
引用对象参数传递时,传递的是指向真实对象的地址,而函数中的形参 baseProperties 拿到同样的地址时,通过 baseProperties.putAll(properties);,会通过地址找到真实的对象进行操作,会改变属性数据,进而导致获取的配置对象错乱
Steps to reproduce
Expected behaviour
Actual behaviour
If there is an exception, please attach the exception trace:
The text was updated successfully, but these errors were encountered: