Bug: dangerous use of non-short-circuit logic

Potentially dangerous use of non-short-circuit logic in
org.eclipse.help.internal.webapp.data.UrlUtil.isRTL(HttpServletRequest,
HttpServletResponse)

This code seems to be using non-short-circuit logic (e.g., & or |)
rather than short-circuit logic (&& or ||). In addition, it seem
possible that, depending on the value of the left hand side, you might
not want to evaluate the right hand side (because it would have side
effects, could cause an exception or could be expensive.

Non-short-circuit logic causes both sides of the expression to be
evaluated even when the result can be inferred from knowing the
left-hand side. This can be less efficient and can result in errors if
the left-hand side guards cases when evaluating the right-hand side can
generate an error.

See the Java Language Specification for details.

Rank: Of Concern (15), confidence: High
Pattern: NS_DANGEROUS_NON_SHORT_CIRCUIT
Type: NS, Category: STYLE (Dodgy code)

Change-Id: I000cdd88fcf7284149bfa1c4857968cdda951dd5
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ua/+/173452
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
1 file changed