code: public static int setSynchronized(int modifier, boolean b) {
          if (b) {
              return (modifier | SYNCHRONIZED) &
                  (~VOLATILE & ~TRANSIENT & ~INTERFACE);
          }
          else {
              return modifier & ~SYNCHRONIZED;
          }
      }
docs: When set synchronized, non-method settings are cleared.