Program: 17835
Project: 17835
Buggy source:
@SuppressWarnings("String_Node_Str") public final Object parse2JPAEntityValueMap(final Object jpaEntity,final EdmStructuralType edmEntityType,final Map<String,Object> propertyValueMap) throws ODataJPARuntimeException {
  if (jpaEntity == null || edmEntityType == null || propertyValueMap == null) {
    return null;
  }
  String jpaEntityAccessKey=jpaEntity.getClass().getName();
  if (!jpaEntityAccessMap.containsKey(jpaEntityAccessKey)) {
    jpaEntityAccessMap.put(jpaEntityAccessKey,getSetters(jpaEntity,edmEntityType,false));
  }
  HashMap<String,Method> setters=jpaEntityAccessMap.get(jpaEntityAccessKey);
  List<EdmProperty> keyProperties=null;
  if (edmEntityType instanceof EdmEntityType) {
    try {
      keyProperties=((EdmEntityType)edmEntityType).getKeyProperties();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
  }
  boolean isKeyProperty=false;
  String propertyName=null;
  try {
    for (    String key : setters.keySet()) {
      isKeyProperty=false;
      if (keyProperties != null) {
        for (        EdmProperty keyProperty : keyProperties) {
          if (keyProperty.getName().equalsIgnoreCase(key)) {
            isKeyProperty=true;
            break;
          }
        }
        if (isKeyProperty) {
          continue;
        }
      }
      EdmProperty property=(EdmProperty)edmEntityType.getProperty(key);
      if (property.getMapping() != null && property.getMapping().getInternalName() != null) {
        propertyName=property.getMapping().getInternalName();
      }
 else {
        propertyName=property.getName();
      }
      Method method=setters.get(key);
      Object propertyValue=propertyValueMap.get(key);
      if (propertyValue == null) {
        continue;
      }
      if (propertyValue != null) {
        if (propertyValue instanceof java.util.GregorianCalendar) {
          propertyValue=((java.util.GregorianCalendar)propertyValue).getTime();
        }
        if (method != null) {
          if (property.getType().getKind().equals(EdmTypeKind.COMPLEX)) {
            Object complexObject=jpaComplexObjectMap.get(propertyName);
            parse2JPAEntityValueMap(complexObject,((EdmComplexType)property.getType()),(Map<String,Object>)propertyValue);
            setters.get(key).invoke(jpaEntity,complexObject);
          }
 else {
            setters.get(key).invoke(jpaEntity,propertyValue);
          }
        }
      }
    }
  }
 catch (  SecurityException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  EdmException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  IllegalAccessException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  IllegalArgumentException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ERROR_JPQL_PARAM_VALUE.addContent(propertyName),e);
  }
catch (  InvocationTargetException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
  return jpaEntity;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public final Object parse2JPAEntityValueMap(final Object jpaEntity,final EdmStructuralType edmEntityType,final Map<String,Object> propertyValueMap) throws ODataJPARuntimeException {
  if (jpaEntity == null || edmEntityType == null || propertyValueMap == null) {
    return null;
  }
  String jpaEntityAccessKey=jpaEntity.getClass().getName();
  if (!jpaEntityAccessMap.containsKey(jpaEntityAccessKey)) {
    jpaEntityAccessMap.put(jpaEntityAccessKey,getSetters(jpaEntity,edmEntityType,false));
  }
  HashMap<String,Method> setters=jpaEntityAccessMap.get(jpaEntityAccessKey);
  List<EdmProperty> keyProperties=null;
  if (edmEntityType instanceof EdmEntityType) {
    try {
      keyProperties=((EdmEntityType)edmEntityType).getKeyProperties();
    }
 catch (    EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
  }
  boolean isKeyProperty=false;
  String propertyName=null;
  try {
    for (    String key : setters.keySet()) {
      isKeyProperty=false;
      if (keyProperties != null) {
        for (        EdmProperty keyProperty : keyProperties) {
          if (keyProperty.getName().equalsIgnoreCase(key)) {
            isKeyProperty=true;
            break;
          }
        }
        if (isKeyProperty) {
          continue;
        }
      }
      EdmProperty property=(EdmProperty)edmEntityType.getProperty(key);
      if (property.getMapping() != null && property.getMapping().getInternalName() != null) {
        propertyName=property.getMapping().getInternalName();
      }
 else {
        propertyName=property.getName();
      }
      Method method=setters.get(key);
      Object propertyValue=propertyValueMap.get(key);
      if (propertyValue == null) {
        continue;
      }
      if (propertyValue != null) {
        if (method != null) {
          if (property.getType().getKind().equals(EdmTypeKind.COMPLEX)) {
            Object complexObject=jpaComplexObjectMap.get(propertyName);
            parse2JPAEntityValueMap(complexObject,((EdmComplexType)property.getType()),(Map<String,Object>)propertyValue);
            setters.get(key).invoke(jpaEntity,complexObject);
          }
 else {
            setters.get(key).invoke(jpaEntity,propertyValue);
          }
        }
      }
    }
  }
 catch (  SecurityException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  EdmException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  IllegalAccessException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
catch (  IllegalArgumentException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ERROR_JPQL_PARAM_VALUE.addContent(propertyName),e);
  }
catch (  InvocationTargetException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
  }
  return jpaEntity;
}