Program: 143785
Project: 143785
Buggy source:
public Object setValue(IRowChangeListener src,String dataProviderID,Object value){
  Object o=getRawValue(dataProviderID);
  if (o instanceof DbIdentValue)   return o;
  Object convertedValue=value;
  int columnIndex=parent.getSQLSheet().getColumnIndex(dataProviderID);
  SQLSheet sheet=getRowManager().getSQLSheet();
  VariableInfo variableInfo=sheet.getCalculationOrColumnVariableInfo(dataProviderID,columnIndex);
  if (convertedValue != null && !("String_Node_Str".equals(convertedValue) && Column.mapToDefaultType(variableInfo.type) == IColumnTypes.TEXT)) {
    if (columnIndex >= 0) {
      Pair<String,String> converterInfo=sheet.getColumnConverterInfo(columnIndex);
      if (converterInfo != null) {
        IColumnConverter conv=parent.getFoundsetManager().getColumnConverterManager().getConverter(converterInfo.getLeft());
        if (conv != null) {
          try {
            OpenProperties props=new OpenProperties();
            if (converterInfo.getRight() != null)             props.load(new StringReader(converterInfo.getRight()));
            convertedValue=conv.convertFromObject(props,variableInfo.type,convertedValue);
          }
 catch (          Exception e) {
            throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}),e);
          }
        }
 else {
          throw new IllegalStateException(Messages.getString("String_Node_Str",new Object[]{converterInfo.getLeft()}));
        }
        int valueLen=Column.getObjectSize(convertedValue,variableInfo.type);
        if (valueLen > 0 && variableInfo.length > 0 && valueLen > variableInfo.length) {
          throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}));
        }
      }
      Pair<String,String> validatorInfo=sheet.getColumnValidatorInfo(columnIndex);
      if (validatorInfo != null) {
        IColumnValidator validator=parent.getFoundsetManager().getColumnValidatorManager().getValidator(validatorInfo.getLeft());
        if (validator != null) {
          OpenProperties props=new OpenProperties();
          try {
            if (validatorInfo.getRight() != null)             props.load(new StringReader(validatorInfo.getRight()));
          }
 catch (          IOException e) {
            Debug.error(e);
          }
          try {
            validator.validate(props,convertedValue);
          }
 catch (          IllegalArgumentException e) {
            String msg=Messages.getString("String_Node_Str",new Object[]{dataProviderID,convertedValue});
            if (e.getMessage() != null && e.getMessage().length() != 0)             msg+=' ' + e.getMessage();
            throw new IllegalArgumentException(msg);
          }
        }
 else {
          throw new IllegalStateException(Messages.getString("String_Node_Str",new Object[]{validatorInfo.getLeft()}));
        }
      }
      if ((variableInfo.flags & Column.UUID_COLUMN) != 0) {
        UUID uuid=Utils.getAsUUID(convertedValue,false);
        if (uuid != null) {
switch (Column.mapToDefaultType(variableInfo.type)) {
case IColumnTypes.TEXT:
            convertedValue=uuid.toString();
          break;
case IColumnTypes.MEDIA:
        convertedValue=uuid.toBytes();
      break;
  }
}
}
}
if (variableInfo.type != IColumnTypes.MEDIA || (variableInfo.flags & Column.UUID_COLUMN) != 0) {
try {
convertedValue=Column.getAsRightType(variableInfo.type,variableInfo.flags,convertedValue,null,variableInfo.length,null,true);
}
 catch (Exception e) {
Debug.error(e);
throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}));
}
}
}
 else if (parent.getFoundsetManager().getNullColumnValidatorEnabled()) {
Column c=null;
try {
c=sheet.getTable().getColumn(dataProviderID);
}
 catch (Exception e) {
Debug.error(e);
}
if (c != null && !c.getAllowNull()) {
throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,convertedValue}));
}
}
boolean wasUNINITIALIZED=false;
if (o == UNINITIALIZED) {
o=null;
wasUNINITIALIZED=true;
}
if (o == null && "String_Node_Str".equals(convertedValue) && containsCalculation(dataProviderID)) return convertedValue;
if (!Utils.equalObjects(o,convertedValue)) {
boolean mustStop=!parent.getFoundsetManager().getEditRecordList().isEditing();
if (src != null && existInDB && !wasUNINITIALIZED) {
src.startEditing(false);
}
if (columnIndex != -1 && columnIndex < columndata.length) {
createOldValuesIfNeeded();
columndata[columnIndex]=convertedValue;
}
 else if (containsCalculation(dataProviderID)) {
unstoredCalcCache.put(dataProviderID,convertedValue);
}
lastException=null;
Column column=sheet.getTable().getColumn(dataProviderID);
if (column != null && (column.getFlags() & Column.IDENT_COLUMNS) != 0) {
List<Runnable> runnables=new ArrayList<Runnable>(1);
getRowManager().pkUpdated(this,getPKHashKey(),runnables);
for (Runnable runnable : runnables) {
runnable.run();
}
}
 else {
getRowManager().fireDependingCalcs(getPKHashKey(),dataProviderID,null);
}
FireCollector collector=new FireCollector();
fireNotifyChange(dataProviderID,convertedValue,collector);
collector.done();
if (src != null && mustStop && existInDB && !wasUNINITIALIZED) {
try {
src.stopEditing();
}
 catch (Exception e) {
Debug.error(e);
}
}
return o;
}
return convertedValue;
}

Fixed version (ground truth):
public Object setValue(IRowChangeListener src,String dataProviderID,Object value){
  Object o=getRawValue(dataProviderID);
  if (o instanceof DbIdentValue)   return o;
  Object convertedValue=value;
  SQLSheet sheet=parent.getSQLSheet();
  int columnIndex=sheet.getColumnIndex(dataProviderID);
  VariableInfo variableInfo=sheet.getCalculationOrColumnVariableInfo(dataProviderID,columnIndex);
  if (convertedValue != null && !("String_Node_Str".equals(convertedValue) && Column.mapToDefaultType(variableInfo.type) == IColumnTypes.TEXT)) {
    if (columnIndex >= 0) {
      Pair<String,String> converterInfo=sheet.getColumnConverterInfo(columnIndex);
      if (converterInfo != null) {
        IColumnConverter conv=parent.getFoundsetManager().getColumnConverterManager().getConverter(converterInfo.getLeft());
        if (conv != null) {
          try {
            OpenProperties props=new OpenProperties();
            if (converterInfo.getRight() != null)             props.load(new StringReader(converterInfo.getRight()));
            convertedValue=conv.convertFromObject(props,variableInfo.type,convertedValue);
          }
 catch (          Exception e) {
            throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}),e);
          }
        }
 else {
          throw new IllegalStateException(Messages.getString("String_Node_Str",new Object[]{converterInfo.getLeft()}));
        }
        int valueLen=Column.getObjectSize(convertedValue,variableInfo.type);
        if (valueLen > 0 && variableInfo.length > 0 && valueLen > variableInfo.length) {
          throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}));
        }
      }
      Pair<String,String> validatorInfo=sheet.getColumnValidatorInfo(columnIndex);
      if (validatorInfo != null) {
        IColumnValidator validator=parent.getFoundsetManager().getColumnValidatorManager().getValidator(validatorInfo.getLeft());
        if (validator != null) {
          OpenProperties props=new OpenProperties();
          try {
            if (validatorInfo.getRight() != null)             props.load(new StringReader(validatorInfo.getRight()));
          }
 catch (          IOException e) {
            Debug.error(e);
          }
          try {
            validator.validate(props,convertedValue);
          }
 catch (          IllegalArgumentException e) {
            String msg=Messages.getString("String_Node_Str",new Object[]{dataProviderID,convertedValue});
            if (e.getMessage() != null && e.getMessage().length() != 0)             msg+=' ' + e.getMessage();
            throw new IllegalArgumentException(msg);
          }
        }
 else {
          throw new IllegalStateException(Messages.getString("String_Node_Str",new Object[]{validatorInfo.getLeft()}));
        }
      }
      if ((variableInfo.flags & Column.UUID_COLUMN) != 0) {
        UUID uuid=Utils.getAsUUID(convertedValue,false);
        if (uuid != null) {
switch (Column.mapToDefaultType(variableInfo.type)) {
case IColumnTypes.TEXT:
            convertedValue=uuid.toString();
          break;
case IColumnTypes.MEDIA:
        convertedValue=uuid.toBytes();
      break;
  }
}
}
}
if (variableInfo.type != IColumnTypes.MEDIA || (variableInfo.flags & Column.UUID_COLUMN) != 0) {
try {
convertedValue=Column.getAsRightType(variableInfo.type,variableInfo.flags,convertedValue,null,variableInfo.length,null,true);
}
 catch (Exception e) {
Debug.error(e);
throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,Column.getDisplayTypeString(variableInfo.type),convertedValue}));
}
}
}
 else if (parent.getFoundsetManager().getNullColumnValidatorEnabled()) {
Column c=null;
try {
c=sheet.getTable().getColumn(dataProviderID);
}
 catch (Exception e) {
Debug.error(e);
}
if (c != null && !c.getAllowNull()) {
throw new IllegalArgumentException(Messages.getString("String_Node_Str",new Object[]{dataProviderID,convertedValue}));
}
}
boolean wasUNINITIALIZED=false;
if (o == UNINITIALIZED) {
o=null;
wasUNINITIALIZED=true;
}
if (o == null && "String_Node_Str".equals(convertedValue) && containsCalculation(dataProviderID)) return convertedValue;
if (!Utils.equalObjects(o,convertedValue)) {
boolean mustStop=!parent.getFoundsetManager().getEditRecordList().isEditing();
if (src != null && existInDB && !wasUNINITIALIZED) {
src.startEditing(false);
}
if (columnIndex != -1 && columnIndex < columndata.length) {
createOldValuesIfNeeded();
columndata[columnIndex]=convertedValue;
}
 else if (containsCalculation(dataProviderID)) {
unstoredCalcCache.put(dataProviderID,convertedValue);
}
lastException=null;
handleCalculationDependencies(sheet.getTable().getColumn(dataProviderID),dataProviderID);
FireCollector collector=new FireCollector();
fireNotifyChange(dataProviderID,convertedValue,collector);
collector.done();
if (src != null && mustStop && existInDB && !wasUNINITIALIZED) {
try {
src.stopEditing();
}
 catch (Exception e) {
Debug.error(e);
}
}
return o;
}
return convertedValue;
}