Skip to content

Commit

Permalink
ignore synthetic fields when reflection (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
LijunnanLJN authored and wenweihu86 committed Dec 13, 2019
1 parent 5a30b07 commit 7a1d0c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ private RpcProxyFactoryBean createRpcProxyFactoryBean(RpcProxy rpcProxy,
MutablePropertyValues values = new MutablePropertyValues();
BrpcConfig brpcConfig = getServiceConfig(beanFactory, serviceInterface);
for (Field field : RpcClientOptions.class.getDeclaredFields()) {
if (field.isSynthetic()) {
continue;
}
try {
field.setAccessible(true);
values.addPropertyValue(field.getName(), field.get(brpcConfig.getClient()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ protected RpcProxyFactoryBean createRpcProxyFactoryBean(RpcProxy rpcProxy,
beanDef.setBeanClass(RpcProxyFactoryBean.class);
MutablePropertyValues values = new MutablePropertyValues();
for (Field field : rpcClientOptions.getClass().getDeclaredFields()) {
if (field.isSynthetic()) {
continue;
}
try {
field.setAccessible(true);
values.addPropertyValue(field.getName(), field.get(rpcClientOptions));
Expand Down

0 comments on commit 7a1d0c3

Please sign in to comment.