Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Apr 13, 2020

I don't why, but I found that sometimes when I use "==" to judge the equality of type,
it return false, even if the types are exactly same.

ISSUE: #3309

This CL only changes == to equals() to solve the problem, but the reason is still unknown.

I don't why, but I found that sometimes when I use "==" to judge the equality of type,
it return false, even if the types are exactly same.
@imay
Copy link
Contributor

imay commented Apr 13, 2020

@morningman
I think we should replace all == compare with equals. == returns true only when the two sides refer the same object. I think all the type compare means to test if they are the same type, not the same object.

@morningman
Copy link
Contributor Author

@morningman
I think we should replace all == compare with equals. == returns true only when the two sides refer the same object. I think all the type compare means to test if they are the same type, not the same object.

I agree. I am just puzzled why they are not the same object. I think they should be....

@imay
Copy link
Contributor

imay commented Apr 13, 2020

I agree. I am just puzzled why they are not the same object. I think they should be....

Without knowing why, we can still make Doris work in the right way.
So we can move it to another issue to investigate later on.

@morningman
Copy link
Contributor Author

I agree. I am just puzzled why they are not the same object. I think they should be....

Without knowing why, we can still make Doris work in the right way.
So we can move it to another issue to investigate later on.

OK, I will try to find out all == and change them to equals()

@kangpinghuang
Copy link
Contributor

I think we should add some unit tests.

@morningman
Copy link
Contributor Author

I think we should add some unit tests.

OK, I added a case described in #3309

Copy link
Contributor

@kangkaisen kangkaisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. LGTM

Copy link
Contributor

@kangpinghuang kangpinghuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1,LGTM

@morningman morningman merged commit e617937 into apache:master Apr 15, 2020
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Jan 20, 2021
)

I don't why, but I found that sometimes when I use "==" to judge the equality of type,
it return false, even if the types are exactly same.

ISSUE: apache#3309

This CL only changes == to equals() to solve the problem, but the reason is still unknown.
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.

[Bug] errCode = 2, detailMessage = errCode = 2, detailMessage = date literal [2020-03-06] is invalid

4 participants