We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#225 This solution will lead to thread safety problem.
@Override protected void doBind(Object bean, String beanName, String dataId, String groupId, String configType, NacosConfigurationProperties properties, String content, ConfigService configService) { synchronized (this) { String name = "nacos-bootstrap-" + beanName; NacosPropertySource propertySource = new NacosPropertySource(dataId, groupId, name, content, configType); environment.getPropertySources().addLast(propertySource); ObjectUtils.cleanMapOrCollectionField(bean); Binder binder = Binder.get(environment); ResolvableType type = getBeanType(bean, beanName); Bindable<?> target = Bindable.of(type).withExistingValue(bean); binder.bind(properties.prefix(), target); publishBoundEvent(bean, beanName, dataId, groupId, properties, content, configService); publishMetadataEvent(bean, beanName, dataId, groupId, properties); environment.getPropertySources().remove(name); } }
ObjectUtils.cleanMapOrCollectionField(bean);will make the type of Map or Collectiion field null,when bean uses the field will throw NPE
ObjectUtils.cleanMapOrCollectionField(bean);
Map
Collectiion
The text was updated successfully, but these errors were encountered:
#225 This solution will lead to thread safety problem. @Override protected void doBind(Object bean, String beanName, String dataId, String groupId, String configType, NacosConfigurationProperties properties, String content, ConfigService configService) { synchronized (this) { String name = "nacos-bootstrap-" + beanName; NacosPropertySource propertySource = new NacosPropertySource(dataId, groupId, name, content, configType); environment.getPropertySources().addLast(propertySource); ObjectUtils.cleanMapOrCollectionField(bean); Binder binder = Binder.get(environment); ResolvableType type = getBeanType(bean, beanName); Bindable<?> target = Bindable.of(type).withExistingValue(bean); binder.bind(properties.prefix(), target); publishBoundEvent(bean, beanName, dataId, groupId, properties, content, configService); publishMetadataEvent(bean, beanName, dataId, groupId, properties); environment.getPropertySources().remove(name); } } ObjectUtils.cleanMapOrCollectionField(bean);will make the type of Map or Collectiion field null,when bean uses the field will throw NPE
@ i will solved it@
Sorry, something went wrong.
chenhao26-nineteen
No branches or pull requests
#225 This solution will lead to thread safety problem.
ObjectUtils.cleanMapOrCollectionField(bean);
will make the type ofMap
orCollectiion
field null,when bean uses the field will throw NPEThe text was updated successfully, but these errors were encountered: