code: public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass) {
          checkInitalised();
  
          boolean isStatic = theClass != Class.class && object instanceof Class;
          if (isStatic && object != theClass) {
              MetaClass mc = registry.getMetaClass((Class) object);
              mc.setAttribute(sender, object, attribute, newValue, useSuper, fromInsideClass);
              return;
          }
  
          MetaProperty mp = getMetaProperty(sender, attribute, useSuper, isStatic);
  
          if (mp != null) {
              if (mp instanceof MetaBeanProperty) {
                  MetaBeanProperty mbp = (MetaBeanProperty) mp;
                  mp = mbp.getField();
              }
              if (mp != null) {
                  mp.setProperty(object, newValue);
                  return;
              }
          }
  
          throw new MissingFieldException(attribute, theClass);
      }
docs: <p>Sets an attribute on the given receiver for the specified arguments. The sender is the class that is setting the attribute from the object.
  The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
  
  <p>The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly
  to the super class if necessary
  
  @param sender The java.lang.Class instance that is mutating the property
  @param object The Object which the property is being set on
  @param attribute The name of the attribute,
  @param newValue The new value of the attribute to set
  @param useSuper Whether the call is to a super class property
  @param fromInsideClass Whether the call was invoked from the inside or the outside of the class