Program: 69972
Project: 69972
Buggy source:
protected void postImportCondition(Condition condition,CourseEnvironmentMapper envMapper){
  if (condition == null)   return;
  boolean easy=StringHelper.containsNonWhitespace(condition.getConditionFromEasyModeConfiguration());
  if (easy) {
    List<Long> groupKeys=condition.getEasyModeGroupAccessIdList();
    if (groupKeys == null) {
      groupKeys=envMapper.toGroupKeyFromOriginalNames(condition.getEasyModeGroupAccess());
    }
 else {
      groupKeys=envMapper.toGroupKeyFromOriginalKeys(groupKeys);
    }
    condition.setEasyModeGroupAccessIdList(groupKeys);
    List<Long> areaKeys=condition.getEasyModeGroupAreaAccessIdList();
    if (areaKeys == null) {
      areaKeys=envMapper.toAreaKeyFromOriginalNames(condition.getEasyModeGroupAreaAccess());
    }
 else {
      areaKeys=envMapper.toAreaKeyFromOriginalKeys(areaKeys);
    }
    condition.setEasyModeGroupAreaAccessIdList(areaKeys);
    String condString=condition.getConditionFromEasyModeConfiguration();
    condition.setConditionExpression(condString);
  }
 else   if (condition.isExpertMode()) {
    String expression=condition.getConditionExpression();
    if (StringHelper.containsNonWhitespace(expression)) {
      String processExpression=convertExpressionNameToKey(expression,envMapper);
      processExpression=convertExpressionKeyToKey(expression,envMapper);
      if (!expression.equals(processExpression)) {
        condition.setConditionUpgraded(processExpression);
      }
    }
  }
}

Fixed version (ground truth):
protected void postImportCondition(Condition condition,CourseEnvironmentMapper envMapper){
  if (condition == null)   return;
  boolean easy=StringHelper.containsNonWhitespace(condition.getConditionFromEasyModeConfiguration());
  if (easy) {
    List<Long> groupKeys=condition.getEasyModeGroupAccessIdList();
    if (groupKeys == null || groupKeys.isEmpty()) {
      groupKeys=envMapper.toGroupKeyFromOriginalNames(condition.getEasyModeGroupAccess());
    }
 else {
      groupKeys=envMapper.toGroupKeyFromOriginalKeys(groupKeys);
    }
    condition.setEasyModeGroupAccessIdList(groupKeys);
    condition.setEasyModeGroupAccess(envMapper.toGroupNames(groupKeys));
    List<Long> areaKeys=condition.getEasyModeGroupAreaAccessIdList();
    if (areaKeys == null || areaKeys.isEmpty()) {
      areaKeys=envMapper.toAreaKeyFromOriginalNames(condition.getEasyModeGroupAreaAccess());
    }
 else {
      areaKeys=envMapper.toAreaKeyFromOriginalKeys(areaKeys);
    }
    condition.setEasyModeGroupAreaAccessIdList(areaKeys);
    condition.setEasyModeGroupAreaAccess(envMapper.toAreaNames(areaKeys));
    String condString=condition.getConditionFromEasyModeConfiguration();
    condition.setConditionExpression(condString);
  }
 else   if (condition.isExpertMode()) {
    String expression=condition.getConditionExpression();
    if (StringHelper.containsNonWhitespace(expression)) {
      String processExpression=convertExpressionNameToKey(expression,envMapper);
      processExpression=convertExpressionKeyToKey(expression,envMapper);
      if (!expression.equals(processExpression)) {
        condition.setConditionUpgraded(processExpression);
      }
    }
  }
}