Program: 70676
Project: 70676
Buggy source:
/** 
 * Test the write for user-defined properties.
 * @throws Exception
 */
public void testWrite() throws Exception {
  openDesign("String_Node_Str");
  SlotHandle params=designHandle.getParameters();
  ScalarParameterHandle handle1=(ScalarParameterHandle)params.get(0);
  assertTrue(handle1.isHidden());
  handle1.setHidden(true);
  assertTrue(handle1.isHidden());
  handle1.setValidate("String_Node_Str");
  handle1.setDataType(DesignChoiceConstants.PARAM_TYPE_DATETIME);
  assertEquals(DesignChoiceConstants.PARAM_TYPE_DATETIME,handle1.getDataType());
  handle1.setParamType(DesignChoiceConstants.SCALAR_PARAM_TYPE_AD_HOC);
  assertEquals(DesignChoiceConstants.SCALAR_PARAM_TYPE_AD_HOC,handle1.getParamType());
  handle1.setConcealValue(true);
  assertTrue(handle1.isConcealValue());
  handle1.setDefaultValue("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getDefaultValue());
  handle1.setIsRequired(false);
  assertFalse(handle1.isRequired());
  handle1.setDistinct(false);
  assertFalse(handle1.distinct());
  handle1.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_ASC);
  assertEquals(DesignChoiceConstants.SORT_DIRECTION_ASC,handle1.getSortDirection());
  handle1.setSortBy(DesignChoiceConstants.PARAM_SORT_VALUES_LABEL);
  assertEquals(DesignChoiceConstants.PARAM_SORT_VALUES_LABEL,handle1.getSortBy());
  handle1.setSortByColumn("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getSortByColumn());
  handle1.setCategory("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getCategory());
  handle1.setPattern("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getPattern());
  handle1.setPattern("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getPattern());
  PropertyHandle propHandle=handle1.getPropertyHandle(IScalarParameterModel.FORMAT_PROP);
  FormatValue formatValueToSet=(FormatValue)handle1.getProperty(IScalarParameterModel.FORMAT_PROP);
  FormatValueHandle formatHandle=(FormatValueHandle)formatValueToSet.getHandle(propHandle);
  formatHandle.setLocale(ULocale.CANADA);
  handle1.setControlType(DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON);
  assertEquals(DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON,handle1.getControlType());
  handle1.setAlignment(DesignChoiceConstants.SCALAR_PARAM_ALIGN_RIGHT);
  assertEquals(DesignChoiceConstants.SCALAR_PARAM_ALIGN_RIGHT,handle1.getAlignment());
  handle1.setDataSetName("String_Node_Str");
  handle1.setValueExpr("String_Node_Str");
  handle1.setLabelExpr("String_Node_Str");
  handle1.setMustMatch(false);
  assertFalse(handle1.isMustMatch());
  handle1.setFixedOrder(false);
  handle1.setHelpText("String_Node_Str");
  handle1.setHelpTextKey("String_Node_Str");
  handle1.setAutoSuggestThreshold(600);
  handle1.setDefaultValueListMethod("String_Node_Str");
  handle1.setSelectionValueListMethod("String_Node_Str");
  ScalarParameterHandle handle2=(ScalarParameterHandle)params.get(1);
  assertEquals("String_Node_Str",handle2.getValueType());
  assertEquals("String_Node_Str",handle2.getDataSetName());
  assertEquals("String_Node_Str",handle2.getValueExpr());
  handle2.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);
  handle2.setDataSetName(null);
  handle2.setValueExpr(null);
  handle2.setPromptText("String_Node_Str");
  handle2.setListlimit(300);
  ScalarParameterHandle handle3=(ScalarParameterHandle)params.get(2);
  List<String> valueList=new ArrayList<String>();
  valueList.add("String_Node_Str");
  valueList.add(null);
  valueList.add("String_Node_Str");
  valueList.add("String_Node_Str");
  handle3.setDefaultValueList(valueList);
  save();
  assertTrue(compareFile("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test the write for user-defined properties.
 * @throws Exception
 */
public void testWrite() throws Exception {
  openDesign("String_Node_Str");
  SlotHandle params=designHandle.getParameters();
  ScalarParameterHandle handle1=(ScalarParameterHandle)params.get(0);
  assertTrue(handle1.isHidden());
  handle1.setHidden(true);
  assertTrue(handle1.isHidden());
  handle1.setValidate("String_Node_Str");
  handle1.setDataType(DesignChoiceConstants.PARAM_TYPE_DATETIME);
  assertEquals(DesignChoiceConstants.PARAM_TYPE_DATETIME,handle1.getDataType());
  handle1.setParamType(DesignChoiceConstants.SCALAR_PARAM_TYPE_AD_HOC);
  assertEquals(DesignChoiceConstants.SCALAR_PARAM_TYPE_AD_HOC,handle1.getParamType());
  handle1.setConcealValue(true);
  assertTrue(handle1.isConcealValue());
  handle1.setDefaultValue("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getDefaultValue());
  handle1.setIsRequired(false);
  assertFalse(handle1.isRequired());
  handle1.setDistinct(false);
  assertFalse(handle1.distinct());
  handle1.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_ASC);
  assertEquals(DesignChoiceConstants.SORT_DIRECTION_ASC,handle1.getSortDirection());
  handle1.setSortBy(DesignChoiceConstants.PARAM_SORT_VALUES_LABEL);
  assertEquals(DesignChoiceConstants.PARAM_SORT_VALUES_LABEL,handle1.getSortBy());
  handle1.setSortByColumn("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getSortByColumn());
  handle1.setCategory("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getCategory());
  handle1.setPattern("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getPattern());
  handle1.setPattern("String_Node_Str");
  assertEquals("String_Node_Str",handle1.getPattern());
  PropertyHandle propHandle=handle1.getPropertyHandle(IScalarParameterModel.FORMAT_PROP);
  FormatValue formatValueToSet=(FormatValue)handle1.getProperty(IScalarParameterModel.FORMAT_PROP);
  FormatValueHandle formatHandle=(FormatValueHandle)formatValueToSet.getHandle(propHandle);
  formatHandle.setLocale(ULocale.CANADA);
  handle1.setControlType(DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON);
  assertEquals(DesignChoiceConstants.PARAM_CONTROL_RADIO_BUTTON,handle1.getControlType());
  handle1.setAlignment(DesignChoiceConstants.SCALAR_PARAM_ALIGN_RIGHT);
  assertEquals(DesignChoiceConstants.SCALAR_PARAM_ALIGN_RIGHT,handle1.getAlignment());
  handle1.setDataSetName("String_Node_Str");
  handle1.setValueExpr("String_Node_Str");
  handle1.setLabelExpr("String_Node_Str");
  handle1.setMustMatch(false);
  assertFalse(handle1.isMustMatch());
  handle1.setFixedOrder(false);
  handle1.setHelpText("String_Node_Str");
  handle1.setHelpTextKey("String_Node_Str");
  handle1.setAutoSuggestThreshold(600);
  handle1.setDefaultValueListMethod("String_Node_Str");
  handle1.setSelectionValueListMethod("String_Node_Str");
  ScalarParameterHandle handle2=(ScalarParameterHandle)params.get(1);
  assertEquals("String_Node_Str",handle2.getValueType());
  assertEquals("String_Node_Str",handle2.getDataSetName());
  assertEquals("String_Node_Str",handle2.getValueExpr());
  handle2.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);
  handle2.setDataSetName(null);
  handle2.setValueExpr(null);
  handle2.setPromptText("String_Node_Str");
  handle2.setListlimit(300);
  ScalarParameterHandle handle3=(ScalarParameterHandle)params.get(2);
  List<Expression> valueList=new ArrayList<Expression>();
  valueList.add(new Expression("String_Node_Str",ExpressionType.CONSTANT));
  valueList.add(null);
  valueList.add(new Expression("String_Node_Str",ExpressionType.CONSTANT));
  valueList.add(new Expression("String_Node_Str",ExpressionType.CONSTANT));
  handle3.setDefaultValueList(valueList);
  save();
  assertTrue(compareFile("String_Node_Str"));
}