Update docs/language/learn-ql/java/basic-query-java.rst

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
This commit is contained in:
Shati Patel
2020-07-30 11:55:14 +02:00
committed by GitHub
parent a79f09f1de
commit 9aaf20e6f2

View File

@@ -107,11 +107,11 @@ Browsing the results of our basic query shows that it could be improved. Among t
.. code-block:: java
if (...) {
...
...
} else if (!strcmp(option, "-verbose") {
// nothing to do - handled earlier
// nothing to do - handled earlier
} else {
error("unrecognized option");
error("unrecognized option");
}
In this case, identifying the ``if`` statement with the empty ``then`` branch as redundant is a false positive. One solution to this is to modify the query to ignore empty ``then`` branches if the ``if`` statement has an ``else`` branch.