accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Medinets <david.medin...@gmail.com>
Subject Non Short Circuit Logic
Date Wed, 12 Sep 2012 16:29:08 GMT
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
View raw message