Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Accumulo, mail # dev - Non Short Circuit Logic


Copy link to this message
-
Non Short Circuit Logic
David Medinets 2012-09-12, 16:29
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();
+
John Vines 2012-09-12, 17:22
+
Jim Klucar 2012-09-12, 18:04
+
David Medinets 2012-09-12, 20:54
+
John Vines 2012-09-12, 21:00