根据类名确定对象类型
Open
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 5.7k
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/alibaba/DataX/blob/05a000db446aa8185191824f6d56fa1c131aeb79/common/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java#L194
根据类名来确定一个类是不好的做法。应该采用以下方式比较确定对象是否存在要求的类型。
if (inputReader.getClass() == Test.class){
...
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Open common/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java and inspect line 194, where the issue identifies class-name-based type detection. Replace that approach with the class-based comparison described in the issue, then verify the affected module still builds and that the object-type check behaves as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100