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

Contradiction: condition never becomes true (dead code) #117

Open
eaglerainbow opened this issue Dec 6, 2020 · 0 comments
Open

Contradiction: condition never becomes true (dead code) #117

eaglerainbow opened this issue Dec 6, 2020 · 0 comments

Comments

@eaglerainbow
Copy link

declares a variable called tokenUrl and initializes it with the empty string.
The next if condition uses this variable by

if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) {

Here "".equals(tokenUrl) evaluates to true.
Then, !"".equals(tokenUrl) is always false.

An ever-false value which is ANDed with anything else will always result in false.
Hence, the code in the if block is dead code (and can never be reached).

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

No branches or pull requests

1 participant