Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23612] YSQL: Fix java unit test misuse of == for string comparison
Summary: The buggy code is ``` boolean is_wait_on_conflict_concurrency_control = (enable_wait_queues == "true"); ``` One answer from stackoverflow: In java, "==" compares Object references with each other and not their literal values. If both the variables point to same object, it will return true. So, String s1 = new String("hello"); String s2 = new String("hello"); Here s1==s2, will return false as both are different objects. When you use equals(), it will compare the literal values of the content and give its results. So the test is not doing what it intended to do because is_wait_on_conflict_concurrency_control is false. Also fixed another place where we can see misleading WARNING log for a valid gflag. Jira: DB-12524 Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgTransparentRestarts Reviewers: kfranz Reviewed By: kfranz Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D37516
- Loading branch information