doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] The Pair.java in fe-common module exist hidden danger of NullPointException

Open ZhongJinHacker opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

in master branch

What's Wrong?

In the fe project, many place use the Pair.java in fe-common module. And I found this case in the code project. image

Developers usually input a null value into Pair object, but the Pair.java not support null value with its first and second member correctly.

When a Pair object with null value, i would cause the NullPointException by calling its toString method or equals method. (I repeated this case by my unit test)

It is very dangerous. And I have fixed it in my forked project. Please assign this issue to me , and then I will pr my commit soon.

Thank you very much

What You Expected?

Please assign this issue to me , and then I will pr my commit soon.

How to Reproduce?

Pair<String, Object> firstPair = Pair.of(null, "world"); firstPair.toString();

it will cause NullPointException

Anything Else?

No response

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

ZhongJinHacker avatar Feb 24 '24 08:02 ZhongJinHacker