accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Vines <jvi...@gmail.com>
Subject Re: Non Short Circuit Logic
Date Wed, 12 Sep 2012 17:22:27 GMT
Judging from that code, p is never null so that second case is unnecessary.

Sent from my phone, so pardon the typos and brevity.
On Sep 12, 2012 12:29 PM, "David Medinets" <david.medinets@gmail.com> wrote:

> The if statement belows uses a single & instead of &&. Therefore it is
> not using short-circut logic. This seems like a typo. Does anyone
> object if I change the '&' to '&&'?
>
>     String delim = "";
>     shellState.getReader().printString("System permissions: ");
>     for (SystemPermission p : SystemPermission.values()) {
>       if
> (shellState.getConnector().securityOperations().hasSystemPermission(user,
> p) & p != null) {
>         shellState.getReader().printString(delim + "System." + p.name());
>         delim = ", ";
>       }
>     }
>     shellState.getReader().printNewline();
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message