Program: 34339
Project: 34339
Buggy source:
static void enforceConsistency(Name<?> resourceName,String managerId,DataSet newState,DataSet currentState) throws InvalidContentException {
  ManagedIndividualId id=ManagedIndividualId.createId(resourceName,managerId);
  LOGGER.debug("String_Node_Str",format(id));
  LOGGER.trace("String_Node_Str",currentState);
  LOGGER.trace("String_Node_Str",newState);
  ManagedIndividual stateIndividual=currentState.individual(id,ManagedIndividual.class);
  Property stateProperty=stateIndividual.property(READ_ONLY_PROPERTY);
  ManagedIndividual inIndividual=newState.individual(id,ManagedIndividual.class);
  Property inProperty=inIndividual.property(READ_ONLY_PROPERTY);
  if (stateProperty == null && inProperty == null) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY);
    return;
  }
  if (stateProperty == null && inProperty != null) {
    LOGGER.error("String_Node_Str",READ_ONLY_PROPERTY);
    throw new InvalidContentException("String_Node_Str" + READ_ONLY_PROPERTY + "String_Node_Str");
  }
  if (stateProperty != null && inProperty == null) {
    LOGGER.error("String_Node_Str",READ_ONLY_PROPERTY);
    throw new InvalidContentException("String_Node_Str" + READ_ONLY_PROPERTY + "String_Node_Str");
  }
  for (  Value value : inProperty) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY,format(value));
    if (DataSetUtils.hasValue(value,stateProperty)) {
      LOGGER.error("String_Node_Str",format(value),READ_ONLY_PROPERTY);
      throw new InvalidContentException("String_Node_Str" + format(value) + "String_Node_Str"+ READ_ONLY_PROPERTY+ "String_Node_Str");
    }
  }
  for (  Value value : stateProperty) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY,format(value));
    if (!DataSetUtils.hasValue(value,inProperty)) {
      LOGGER.error("String_Node_Str",format(value),READ_ONLY_PROPERTY);
      throw new InvalidContentException("String_Node_Str" + value + "String_Node_Str"+ READ_ONLY_PROPERTY+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
static void enforceConsistency(Name<?> resourceName,String managerId,DataSet newState,DataSet currentState) throws InvalidContentException {
  ManagedIndividualId id=ManagedIndividualId.createId(resourceName,managerId);
  LOGGER.debug("String_Node_Str",format(id));
  LOGGER.trace("String_Node_Str",currentState);
  LOGGER.trace("String_Node_Str",newState);
  ManagedIndividual stateIndividual=currentState.individual(id,ManagedIndividual.class);
  Property stateProperty=stateIndividual.property(READ_ONLY_PROPERTY);
  ManagedIndividual inIndividual=newState.individual(id,ManagedIndividual.class);
  Property inProperty=inIndividual.property(READ_ONLY_PROPERTY);
  if (stateProperty == null && inProperty == null) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY);
    return;
  }
  if (stateProperty == null && inProperty != null) {
    LOGGER.error("String_Node_Str",READ_ONLY_PROPERTY);
    throw new InvalidContentException("String_Node_Str" + READ_ONLY_PROPERTY + "String_Node_Str");
  }
  if (stateProperty != null && inProperty == null) {
    LOGGER.error("String_Node_Str",READ_ONLY_PROPERTY);
    throw new InvalidContentException("String_Node_Str" + READ_ONLY_PROPERTY + "String_Node_Str");
  }
  for (  Value value : inProperty) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY,format(value));
    if (!DataSetUtils.hasValue(value,stateProperty)) {
      LOGGER.error("String_Node_Str",format(value),READ_ONLY_PROPERTY);
      throw new InvalidContentException("String_Node_Str" + format(value) + "String_Node_Str"+ READ_ONLY_PROPERTY+ "String_Node_Str");
    }
  }
  for (  Value value : stateProperty) {
    LOGGER.debug("String_Node_Str",READ_ONLY_PROPERTY,format(value));
    if (!DataSetUtils.hasValue(value,inProperty)) {
      LOGGER.error("String_Node_Str",format(value),READ_ONLY_PROPERTY);
      throw new InvalidContentException("String_Node_Str" + value + "String_Node_Str"+ READ_ONLY_PROPERTY+ "String_Node_Str");
    }
  }
}