Skip to content
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

ReflectUtils.invokeMethodByName 方法添加一处判断,防止参数的子类进入到类型转换的流程 #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morningf
Copy link

@morningf morningf commented Aug 1, 2023

这个地方原本的判断是类型完全相等,其实如果实际传入的类型是参数类型的子类,是可以直接赋值的,不需要再做转换。

这个问题是在我们公司的项目改造Excel导入数据时发现的,excel中有一列是特殊的时间字符串,之后我们使用了Hutool的DateTime类型做了导入的变量解析和保存,之后调用到这个方法时,由于DateTime为Date的子类,进入到转换流程,造成转换异常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant