private static String humanHelper(int flags, int mask, int what) {
    StringBuilder sb = new StringBuilder(80);
    int extra = flags & ~mask;

    flags &= mask;

    if ((flags & ACC_PUBLIC) != 0) {
      sb.append("|public");
    }
    if ((flags & ACC_PRIVATE) != 0) {
      sb.append("|private");
    }
    if ((flags & ACC_PROTECTED) != 0) {
      sb.append("|protected");
    }
    if ((flags & ACC_STATIC) != 0) {
      sb.append("|static");
    }
    if ((flags & ACC_FINAL) != 0) {
      sb.append("|final");
    }
    if ((flags & ACC_SYNCHRONIZED) != 0) {
      if (what == CONV_CLASS) {
        sb.append("|super");
      } else {
        sb.append("|synchronized");
      }
    }
    if ((flags & ACC_VOLATILE) != 0) {
      if (what == CONV_METHOD) {
        sb.append("|bridge");
      } else {
        sb.append("|volatile");
      }
    }
    if ((flags & ACC_TRANSIENT) != 0) {
      if (what == CONV_METHOD) {
        sb.append("|varargs");
      } else {
        sb.append("|transient");
      }
    }
    if ((flags & ACC_NATIVE) != 0) {
      sb.append("|native");
    }
    if ((flags & ACC_INTERFACE) != 0) {
      sb.append("|interface");
    }
    if ((flags & ACC_ABSTRACT) != 0) {
      sb.append("|abstract");
    }
    if ((flags & ACC_STRICT) != 0) {
      sb.append("|strictfp");
    }
    if ((flags & ACC_SYNTHETIC) != 0) {
      sb.append("|synthetic");
    }
    if ((flags & ACC_ANNOTATION) != 0) {
      sb.append("|annotation");
    }
    if ((flags & ACC_ENUM) != 0) {
      sb.append("|enum");
    }
    if ((flags & ACC_CONSTRUCTOR) != 0) {
      sb.append("|constructor");
    }
    if ((flags & ACC_DECLARED_SYNCHRONIZED) != 0) {
      sb.append("|declared_synchronized");
    }

    if ((extra != 0) || (sb.length() == 0)) {
      sb.append('|');
      sb.append(Hex.u2(extra));
    }

    return sb.substring(1);
  }
Helper to return a human-oriented string representing the given access flags.

@param flags the defined flags
@param mask mask for the "defined" bits
@param what what the flags represent (one of {@code CONV_*})
@return {@code non-null;} human-oriented string
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/AccessFlags.java