Program: 172082
Project: 172082
Buggy source:
/** 
 * Sets a property value.
 */
@SuppressWarnings("String_Node_Str") public void setProperty(NodeRef nodeRef,TypeDefinitionWrapper type,PropertyData<?> property){
  if (property == null) {
    throw new CmisInvalidArgumentException("String_Node_Str");
  }
  PropertyDefinitionWrapper propDef=type.getPropertyById(property.getId());
  if (propDef == null) {
    throw new CmisInvalidArgumentException("String_Node_Str" + property.getId() + "String_Node_Str");
  }
  Updatability updatability=propDef.getPropertyDefinition().getUpdatability();
  if ((updatability == Updatability.READONLY) || (updatability == Updatability.WHENCHECKEDOUT && !checkOutCheckInService.isWorkingCopy(nodeRef))) {
    throw new CmisInvalidArgumentException("String_Node_Str" + property.getId() + "String_Node_Str");
  }
  Serializable value=getValue(property,propDef.getPropertyDefinition().getCardinality() == Cardinality.MULTI);
  if (propDef.getPropertyId().equals(PropertyIds.SECONDARY_OBJECT_TYPE_IDS)) {
    if (!(value instanceof List)) {
      throw new CmisInvalidArgumentException("String_Node_Str");
    }
    List secondaryTypes=(List)value;
    for (    Object o : secondaryTypes) {
      String secondaryType=(String)o;
      TypeDefinitionWrapper wrapper=cmisDictionaryService.findType(secondaryType);
      if (wrapper != null) {
        nodeService.addAspect(nodeRef,wrapper.getAlfrescoName(),null);
      }
 else {
        throw new CmisInvalidArgumentException("String_Node_Str" + secondaryType);
      }
    }
  }
 else {
    QName propertyQName=propDef.getPropertyAccessor().getMappedProperty();
    if (propertyQName == null) {
      throw new CmisConstraintException("String_Node_Str" + property.getId() + "String_Node_Str");
    }
    if (property.getId().equals(PropertyIds.NAME)) {
      if (!(value instanceof String)) {
        throw new CmisInvalidArgumentException("String_Node_Str");
      }
      try {
        fileFolderService.rename(nodeRef,value.toString());
      }
 catch (      FileExistsException e) {
        throw new CmisContentAlreadyExistsException("String_Node_Str",e);
      }
catch (      FileNotFoundException e) {
        throw new CmisInvalidArgumentException("String_Node_Str" + nodeRef.getId() + "String_Node_Str");
      }
    }
 else {
      if (value == null) {
        nodeService.removeProperty(nodeRef,propertyQName);
      }
 else {
        nodeService.setProperty(nodeRef,propertyQName,value);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets a property value.
 */
@SuppressWarnings("String_Node_Str") public void setProperty(NodeRef nodeRef,TypeDefinitionWrapper type,PropertyData<?> property){
  if (property == null) {
    throw new CmisInvalidArgumentException("String_Node_Str");
  }
  PropertyDefinitionWrapper propDef=type.getPropertyById(property.getId());
  if (propDef == null) {
    throw new CmisInvalidArgumentException("String_Node_Str" + property.getId() + "String_Node_Str");
  }
  Updatability updatability=propDef.getPropertyDefinition().getUpdatability();
  if ((updatability == Updatability.READONLY) || (updatability == Updatability.WHENCHECKEDOUT && !checkOutCheckInService.isWorkingCopy(nodeRef))) {
    throw new CmisInvalidArgumentException("String_Node_Str" + property.getId() + "String_Node_Str");
  }
  Serializable value=getValue(property,propDef.getPropertyDefinition().getCardinality() == Cardinality.MULTI);
  if (propDef.getPropertyId().equals(PropertyIds.SECONDARY_OBJECT_TYPE_IDS)) {
    if (!(value instanceof List)) {
      throw new CmisInvalidArgumentException("String_Node_Str");
    }
    List secondaryTypes=(List)value;
    for (    Object o : secondaryTypes) {
      String secondaryType=(String)o;
      TypeDefinitionWrapper wrapper=cmisDictionaryService.findType(secondaryType);
      if (wrapper != null) {
        nodeService.addAspect(nodeRef,wrapper.getAlfrescoName(),null);
      }
 else {
        throw new CmisInvalidArgumentException("String_Node_Str" + secondaryType);
      }
    }
  }
 else {
    QName propertyQName=propDef.getPropertyAccessor().getMappedProperty();
    if (propertyQName == null) {
      throw new CmisConstraintException("String_Node_Str" + property.getId() + "String_Node_Str");
    }
    if (property.getId().equals(PropertyIds.NAME)) {
      if (!(value instanceof String)) {
        throw new CmisInvalidArgumentException("String_Node_Str");
      }
      try {
        fileFolderService.rename(nodeRef,value.toString());
      }
 catch (      FileExistsException e) {
        throw new CmisContentAlreadyExistsException("String_Node_Str",e);
      }
catch (      FileNotFoundException e) {
        throw new CmisInvalidArgumentException("String_Node_Str" + nodeRef.getId() + "String_Node_Str");
      }
    }
 else {
      if (value == null) {
        nodeService.removeProperty(nodeRef,propertyQName);
      }
 else {
        if (propDef.getPropertyDefinition().getPropertyType() == PropertyType.INTEGER && value instanceof BigInteger) {
          org.alfresco.service.cmr.dictionary.PropertyDefinition def=dictionaryService.getProperty(propertyQName);
          QName dataDef=def.getDataType().getName();
          BigInteger bigValue=(BigInteger)value;
          if ((bigValue.compareTo(maxInt) > 0 || bigValue.compareTo(minInt) < 0) && dataDef.equals(DataTypeDefinition.INT)) {
            throw new CmisConstraintException("String_Node_Str" + propertyQName.getLocalName());
          }
          if ((bigValue.compareTo(maxLong) > 0 || bigValue.compareTo(minLong) < 0) && dataDef.equals(DataTypeDefinition.LONG)) {
            throw new CmisConstraintException("String_Node_Str" + propertyQName.getLocalName());
          }
        }
        nodeService.setProperty(nodeRef,propertyQName,value);
      }
    }
  }
}