code: public static int setTransient(int modifier, boolean b) {
          if (b) {
              return (modifier | TRANSIENT) &
                  (~SYNCHRONIZED & ~NATIVE & ~INTERFACE & ~ABSTRACT & ~STRICT);
          }
          else {
              return modifier & ~TRANSIENT;
          }
      }
docs: When set transient, non-field settings are cleared.