addMutationsForField
514878
@Override
    public boolean updateValuesForField(String currentValue) {
        boolean bUpdated = false;
        FieldDefinition fieldDef = m_tableDef.getFieldDef(m_fieldName);
        if (fieldDef == null || !fieldDef.isCollection()) {
            bUpdated = updateSVScalar(currentValue);
        } else {
            bUpdated = updateMVScalar(currentValue);
        }
        return bUpdated;
    }
611480
private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
        switch (descriptor.getType()) {
            case BYTE:
            case BINARY:
                writer.formatln(".addByteArrayField(\"%s\")", field.name());
                break;
            case BOOL:
                writer.formatln(".addBooleanArrayField(\"%s\")", field.name());
                break;
            case DOUBLE:
                writer.formatln(".addDoubleArrayField(\"%s\")", field.name());
                break;
            case I16:
                writer.formatln(".addShortArrayField(\"%s\")", field.name());
                break;
            case I32:
            case ENUM:
                writer.formatln(".addIntArrayField(\"%s\")", field.name());
                break;
            case I64:
                writer.formatln(".addLongArrayField(\"%s\")", field.name());
                break;
            case STRING:
                writer.formatln(".addUTFArrayField(\"%s\")", field.name());
                break;
            case MESSAGE:
                writer.formatln(".addPortableArrayField(\"%s\", %s(%s))",
                                field.name(),
                                camelCase("get", descriptor.getName() + "Definition"),
                                PORTABLE_VERSION);
                break;
            default:
                throw new GeneratorException(
                        "Not implemented appendCollectionTypeField for list with type: " + descriptor.getType() + " in " +
                        this.getClass()
                            .getSimpleName());
        }
    }
826765
def iterate_over_fields(cls):
        """"""
        for attr in dir(cls):
            clsattr = getattr(cls, attr)
            if isinstance(clsattr, BaseField):
                yield attr, clsattr
639714
def add_custom_fields(cls, *args, **kw):
        
        for factory in config.custom_field_factories:
            for field in factory():
                setattr(cls, field.name, field)
1355592
def addfield(self, pkt, s, val):
        """"""
        if self.adjust(pkt, self.length_of) == 2:
            return s + struct.pack(self.fmt[0] + "H", val)
        elif self.adjust(pkt, self.length_of) == 8:
            return s + struct.pack(self.fmt[0] + "Q", val)
        else:
            return s
625902
public void addDifference(Field field, Object before, Object after) {
        ModelDiffEntry entry = new ModelDiffEntry();
        entry.setBefore(before);
        entry.setAfter(after);
        entry.setField(field);
        differences.put(field, entry);
    }
1106771
public function addField($field, $after=null) {

        // Detect duplicates first
        if ($this->getField($field->getName())) {
            throw new coding_exception('Duplicate field '.$field->getName().' specified in table '.$this->getName());
        }

        // Calculate the previous and next fields
        $prevfield = null;
        $nextfield = null;

        if (!$after) {
            $allfields = $this->getFields();
            if (!empty($allfields)) {
                end($allfields);
                $prevfield = $allfields[key($allfields)];
            }
        } else {
            $prevfield = $this->getField($after);
        }
        if ($prevfield && $prevfield->getNext()) {
            $nextfield = $this->getField($prevfield->getNext());
        }

        // Set current field previous and next attributes
        if ($prevfield) {
            $field->setPrevious($prevfield->getName());
            $prevfield->setNext($field->getName());
        }
        if ($nextfield) {
            $field->setNext($nextfield->getName());
            $nextfield->setPrevious($field->getName());
        }
        // Some more attributes
        $field->setLoaded(true);
        $field->setChanged(true);
        // Add the new field
        $this->fields[] = $field;
        // Reorder the field
        $this->orderFields($this->fields);
        // Recalculate the hash
        $this->calculateHash(true);
        // We have one new field, so the table has changed
        $this->setChanged(true);

        return $field;
    }
492557
def _AddFieldPaths(node, prefix, field_mask):
  """"""
  if not node:
    field_mask.paths.append(prefix)
    return
  for name in sorted(node):
    if prefix:
      child_path = prefix + '.' + name
    else:
      child_path = name
    _AddFieldPaths(node[name], child_path, field_mask)
234298
function doAppend(uiSchema, params) {
  Object.keys(params).forEach(field => {
    let appendVal = params[field];
    let fieldUiSchema = uiSchema[field];
    if (!fieldUiSchema) {
      uiSchema[field] = appendVal;
    } else if (Array.isArray(fieldUiSchema)) {
      toArray(appendVal)
        .filter(v => !fieldUiSchema.includes(v))
        .forEach(v => fieldUiSchema.push(v));
    } else if (typeof appendVal === "object" && !Array.isArray(appendVal)) {
      doAppend(fieldUiSchema, appendVal);
    } else if (typeof fieldUiSchema === "string") {
      if (!fieldUiSchema.includes(appendVal)) {
        uiSchema[field] = fieldUiSchema + " " + appendVal;
      }
    } else {
      uiSchema[field] = appendVal;
    }
  });
}
1105143
def mutate(self, field):
        
        new_val = self.next_val(field)
        field._pfp__set_value(new_val)
        return field
855378
public void addOptionalField(String optionalField) {
        if (optionalField == null) {
            return;
        } else if (this.optionalFields == null) {
            this.optionalFields = new ArrayList<String >();
        }
        this.optionalFields.add(optionalField);
    }
373342
function generateNamedFieldExtractors(input) {
  var names = input.filter(function(matcher, index, array) {
    // has a name?
    return matcher.name;
  });
  // has duplicates?
  names.forEach(function(matcher, index, array) {
    var isDuplicate = array.slice(0, index).some(function(previousMatcher) {
      return previousMatcher.name == matcher.name;
    });
    if (isDuplicate) {
      throw new Error("duplicate named field '" + matcher.name + "'");
    }
  });
  return names;
}
550266
@Nonnull
    public BugInstance addField(FieldVariable field) {
        return addField(field.getClassName(), field.getFieldName(), field.getFieldSig(), field.isStatic());
    }
182462
public void addValueToField(String fieldName, Object value) {
		add(new SimpleUpdateField(fieldName, value, UpdateAction.ADD));
	}
849172
private Method[] settersMethodForField(Field field) {
    List<Method> methods = new ArrayList<>();
    for (Method method : field.getDeclaringClass().getDeclaredMethods()) {
      if (Ascii.toLowerCase(method.getName()).equals("set" + Ascii.toLowerCase(field.getName()))
          && method.getParameterTypes().length == 1) {
        methods.add(method);
      }
    }
    return methods.toArray(new Method[0]);
  }
392475
def mutapply(self, function, fieldname):
        
        self[fieldname] = self.apply(function, fieldname)
1165899
public boolean addFields(Collection<FormField> fieldsToAdd) {
        boolean fieldOverridden = false;
        synchronized (fields) {
            for (FormField field : fieldsToAdd) {
                FormField previousField = fields.put(field.getVariable(), field);
                if (previousField != null) {
                    fieldOverridden = true;
                }
            }
        }
        return fieldOverridden;
    }