/*
(non-Javadoc)
@see org.fcrepo.server.management.FedoraAPIMMTOM#modifyObject(String pid
,)String state ,)String label ,)String ownerId ,)String logMessage )*
555612
@Override
    public String modifyObject(String pid,
                               String state,
                               String label,
                               String ownerId,
                               String logMessage) {
        LOG.debug("start: modifyObject, {}", pid);
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            return DateUtility.convertDateToString(m_management
                    .modifyObject(ReadOnlyContext.getSoapContext(ctx),
                                  pid,
                                  state,
                                  label,
                                  ownerId,
                                  logMessage,
                                  null));
        } catch (Throwable th) {
            LOG.error("Error modifying object", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: modifyObject, {}", pid);
        }
    }
890331
public FessMessages addSuccessCrudUpdateCrudTable(String property) {
        assertPropertyNotNull(property);
        add(property, new UserMessage(SUCCESS_crud_update_crud_table));
        return this;
    }
800975
public boolean addLockedObjectOwner( String owner ) {

        if (this.owner == null) {
            this.owner = new String[1];
        } else {

            int size = this.owner.length;
            String[] newLockObjectOwner = new String[size + 1];

            // check if the owner is already here (that should actually not
            // happen)
            for (int i = 0; i < size; i++) {
                if (this.owner[i].equals(owner)) {
                    return false;
                }
            }

            System.arraycopy(this.owner, 0, newLockObjectOwner, 0, size);
            this.owner = newLockObjectOwner;
        }

        this.owner[this.owner.length - 1] = owner;
        return true;
    }
481072
@SuppressWarnings("unchecked")
  public void setModifiedWith(PROCESS modifyingProcess) {
    processChange("modifiedWith", this.modifiedWith, modifyingProcess);
    this.lastModifiedWith = ObjectUtils.defaultIfNull(this.lastModifiedWith, this.modifiedWith);
  }
1275083
public <T extends Identifiable> void updateObject(T obj,
			NameValuePair... params) throws RedmineException {
		final EntityConfig<T> config = getConfig(obj.getClass());
		final Integer id = obj.getId();
		if (id == null) {
			throw new RuntimeException("'id' field cannot be NULL in the given object:" +
					" it is required to identify the object in the target system");
		}
		final URI uri = getURIConfigurator().getObjectURI(obj.getClass(),
				Integer.toString(id));
		final HttpPut http = new HttpPut(uri);
		final String body = RedmineJSONBuilder.toSimpleJSON(
				config.singleObjectName, obj, config.writer);
		setEntity(http, body);
		send(http);
	}
1151186
public final void setObject(String key, Object value, boolean modified) {
		if(!isModifiable()) throw new AssertionError("ResourceBundle is not modifiable: "+this);
		handleSetObject(key, value, modified);
	}
1222887
public Date modifyDatastreamByValue(Context context,
                                        String pid,
                                        String datastreamID,
                                        String[] altIDs,
                                        String dsLabel,
                                        String mimeType,
                                        String formatURI,
                                        InputStream dsContent,
                                        String checksumType,
                                        String checksum,
                                        String logMessage,
                                        Date lastModifiedDate
    ) throws ServerException {
        return worker.modifyDatastreamByValue(context,
                                              pid,
                                              datastreamID,
                                              altIDs,
                                              dsLabel,
                                              mimeType,
                                              formatURI,
                                              dsContent,
                                              checksumType,
                                              checksum,
                                              logMessage,
                                              null
        );
    }
1302977
@Override
    public String purgeObject(String pid, String logMessage, boolean force) {
        LOG.debug("start: purgeObject, {}", pid);
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            return DateUtility.convertDateToString(m_management
                    .purgeObject(ReadOnlyContext.getSoapContext(ctx),
                                 pid,
                                 logMessage));
        } catch (Throwable th) {
            LOG.error("Error purging object", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: purgeObject, {}", pid);
        }
    }
874169
def _AddPrivateHelperMethods(message_descriptor, cls):
  """"""

  def Modified(self):
    """Sets the _cached_byte_size_dirty bit to true,
    and propagates this to our listener iff this was a state change.
    """

    # Note:  Some callers check _cached_byte_size_dirty before calling
    #   _Modified() as an extra optimization.  So, if this method is ever
    #   changed such that it does stuff even when _cached_byte_size_dirty is
    #   already true, the callers need to be updated.
    if not self._cached_byte_size_dirty:
      self._cached_byte_size_dirty = True
      self._listener_for_children.dirty = True
      self._is_present_in_parent = True
      self._listener.Modified()

  def _UpdateOneofState(self, field):
    """Sets field as the active field in its containing oneof.

    Will also delete currently active field in the oneof, if it is different
    from the argument. Does not mark the message as modified.
    """
    other_field = self._oneofs.setdefault(field.containing_oneof, field)
    if other_field is not field:
      del self._fields[other_field]
      self._oneofs[field.containing_oneof] = field

  cls._Modified = Modified
  cls.SetInParent = Modified
  cls._UpdateOneofState = _UpdateOneofState
765918
private void updatePermissions(
            IPortletDefinition def,
            Set<IGroupMember> newPrincipals,
            String owner,
            String activity) {
        final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def);

        final IUpdatingPermissionManager pm =
                authorizationService.newUpdatingPermissionManager(owner);

        /* Create the new permissions array */
        final List<IPermission> newPermissions = new ArrayList<>();
        for (final IGroupMember newPrincipal : newPrincipals) {
            final IAuthorizationPrincipal authorizationPrincipal =
                    authorizationService.newPrincipal(newPrincipal);
            final IPermission permission = pm.newPermission(authorizationPrincipal);
            permission.setType(IPermission.PERMISSION_TYPE_GRANT);
            permission.setActivity(activity);
            permission.setTarget(portletTargetId);
            newPermissions.add(permission);
            logger.trace("In updatePermissions() - adding a new permission of: {}", permission);
        }

        /* Remove former permissions for this portlet / activity */
        final IPermission[] oldPermissions = pm.getPermissions(activity, portletTargetId);
        pm.removePermissions(oldPermissions);

        /* Add the new permissions */
        pm.addPermissions(newPermissions.toArray(new IPermission[newPermissions.size()]));
    }
95239
void setAnnotation(String key, Object object) {
    checkArgument(object != null, "The stored annotation value cannot be null.");
    Preconditions.checkArgument(
        !annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key);
    annotationMap.put(key, object);
  }
1313903
private void addObjectProperties(Feed feed, DigitalObject obj)
            throws ObjectIntegrityException {
        PID pid;
        try {
            pid = new PID(feed.getId().toString());
        } catch (MalformedPIDException e) {
            throw new ObjectIntegrityException(e.getMessage(), e);
        }

        String label = feed.getTitle();
        String state =
                m_xpath.valueOf("/a:feed/a:category[@scheme='"
                        + MODEL.STATE.uri + "']/@term", feed);
        String createDate =
                m_xpath.valueOf("/a:feed/a:category[@scheme='"
                        + MODEL.CREATED_DATE.uri + "']/@term", feed);

        obj.setPid(pid.toString());

        try {
            obj.setState(DOTranslationUtility.readStateAttribute(state));
        } catch (ParseException e) {
            throw new ObjectIntegrityException("Could not read object state", e);
        }

        obj.setLabel(label);
        obj.setOwnerId(getOwnerId(feed));
        obj.setCreateDate(DateUtility.convertStringToDate(createDate));
        obj.setLastModDate(feed.getUpdated());

        setExtProps(obj, feed);
    }
479367
@SuppressWarnings("unchecked")
  public void setModifiedBy(USER modifiedBy) {
    processChange("modifiedBy", this.modifiedBy, modifiedBy);
    this.lastModifiedBy = ObjectUtils.defaultIfNull(this.lastModifiedBy, this.modifiedBy);
  }
446063
public Date modifyDatastreamByValue(Context context,
                                        String pid,
                                        String datastreamID,
                                        String[] altIDs,
                                        String dsLabel,
                                        String mimeType,
                                        String formatURI,
                                        InputStream dsContent,
                                        String checksumType,
                                        String checksum,
                                        String logMessage,
                                        Date lastModifiedDate) throws ServerException {
        throw rejectCallsFromOutsideWhileInRecoveryMode();
    }
1349766
@MainThread
    public void change(T obj) {
        if (!isLockEnabled) {
            throw new RuntimeException("changing of values only cen be performed in locked state");
        }

        modifiedValue = obj;
        notifyInMainThread(modifiedValue);
    }
1306677
private void addObjectIdentity(final Object object) {

        if (object == null) {
            _buffer.append("null");
        } else {
            _buffer.append(object.getClass().getName());
            _buffer.append("@");
            _buffer
                    .append(Integer
                            .toHexString(System.identityHashCode(object)));
        }

    }
1227906
public static void addDeepConsoleLogger(Object object)
    {
        addDeepLogger(object, m -> System.out.println(m));
    }