eve-esi icon indicating copy to clipboard operation
eve-esi copied to clipboard

Contradiction: condition never becomes true (dead code)

Open eaglerainbow opened this issue 4 years ago • 0 comments

https://github.com/burberius/eve-esi/blob/f29725bc7ce51cdb80531ee9986a01003bf9c752/src/main/java/net/troja/eve/esi/ApiClient.java#L131

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

https://github.com/burberius/eve-esi/blob/f29725bc7ce51cdb80531ee9986a01003bf9c752/src/main/java/net/troja/eve/esi/ApiClient.java#L132

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).

eaglerainbow avatar Dec 06 '20 09:12 eaglerainbow