Program: 95346
Project: 95346
Buggy source:
/** 
 * Creates Controls depending on the given IParamNodePO and the given parameter name in dataset view.<br> E.g. it returns a Text Control which only accepts Integers.
 * @param paramName the current parameter name
 * @param paramObj the current param object
 * @param parent the parent composite
 * @param style the style of the new Control
 * @return the control to edit test data
 */
public static Control createControl(IParameterInterfacePO paramObj,String paramName,Composite parent,int style){
  Map<String,String> map=StringHelper.getInstance().getMap();
  String nameOfParam=paramName;
  IParamDescriptionPO paramDesc=paramObj.getParameterForName(nameOfParam);
  if (paramDesc == null) {
    nameOfParam=map.get(paramName);
    paramDesc=paramObj.getParameterForName(nameOfParam);
  }
  if (paramObj instanceof ICapPO) {
    ICapPO cap=(ICapPO)paramObj;
    Action action=CapBP.getAction(cap);
    List<String> values=new ArrayList<String>();
    Param param=action.findParam(paramDesc.getUniqueId());
    for (Iterator<ValueSetElement> iter=param.valueSetIterator(); iter.hasNext(); ) {
      values.add(map.get((iter.next()).getValue()));
    }
    if (!values.isEmpty()) {
      return new CheckedParamText(parent,style,cap,paramDesc,createParamValueValidator(TestDataConstants.STR,param.getValueSet().isCombinable(),values.toArray(new String[values.size()])));
    }
  }
  if (paramObj instanceof IParamNodePO) {
    IParamNodePO paramNode=(IParamNodePO)paramObj;
    ParamValueSet valueSet=ParamTextPropertyDescriptor.getValuesSet(paramNode,paramDesc.getUniqueId());
    String[] values=ParamTextPropertyDescriptor.getValues(valueSet);
    Map<String,String> valuesWithComment=ParamTextPropertyDescriptor.getValuesWithComment(valueSet);
    if (TestDataConstants.BOOLEAN.equals(paramDesc.getType())) {
      values=BOOLEAN_VALUES;
      valuesWithComment.clear();
      valuesWithComment.put(BOOLEAN_VALUES[0],StringConstants.EMPTY);
      valuesWithComment.put(BOOLEAN_VALUES[1],StringConstants.EMPTY);
    }
    return new CheckedParamTextContentAssisted(parent,style,paramNode,paramDesc,createParamValueValidator(paramDesc.getType(),valueSet != null ? valueSet.isCombinable() : false,values),new ParamProposalProvider(valuesWithComment,paramNode,paramDesc));
  }
  if (paramObj instanceof ITestDataCubePO) {
    ITestDataCubePO tdc=(ITestDataCubePO)paramObj;
    String[] values=getValuesFromValueSet(paramDesc);
    if (TestDataConstants.BOOLEAN.equals(paramDesc.getType())) {
      return new CheckedParamTextContentAssisted(parent,style,tdc,paramDesc,createParamValueValidator(paramDesc.getType(),false,BOOLEAN_VALUES),new ParamProposalProvider(BOOLEAN_VALUES,null,paramDesc));
    }
    return new CheckedParamTextContentAssisted(parent,style,tdc,paramDesc,createParamValueValidator(paramDesc.getType(),false,values),new ParamProposalProvider(values,null,paramDesc));
  }
  Assert.notReached(Messages.ImplementFor + StringConstants.SPACE + paramObj.getClass().getName());
  return null;
}

Fixed version (ground truth):
/** 
 * Creates Controls depending on the given IParamNodePO and the given parameter name in dataset view.<br> E.g. it returns a Text Control which only accepts Integers.
 * @param paramName the current parameter name
 * @param paramObj the current param object
 * @param parent the parent composite
 * @param style the style of the new Control
 * @return the control to edit test data
 */
public static Control createControl(IParameterInterfacePO paramObj,String paramName,Composite parent,int style){
  Map<String,String> map=StringHelper.getInstance().getMap();
  String nameOfParam=paramName;
  IParamDescriptionPO paramDesc=paramObj.getParameterForName(nameOfParam);
  if (paramDesc == null) {
    nameOfParam=map.get(paramName);
    paramDesc=paramObj.getParameterForName(nameOfParam);
  }
  if (paramObj instanceof ICapPO) {
    ICapPO cap=(ICapPO)paramObj;
    Action action=CapBP.getAction(cap);
    List<String> values=new ArrayList<String>();
    Param param=action.findParam(paramDesc.getUniqueId());
    for (Iterator<ValueSetElement> iter=param.valueSetIterator(); iter.hasNext(); ) {
      values.add(map.get((iter.next()).getValue()));
    }
    if (!values.isEmpty()) {
      return new CheckedParamText(parent,style,cap,paramDesc,createParamValueValidator(TestDataConstants.STR,param.getValueSet().isCombinable(),values.toArray(new String[values.size()])));
    }
  }
  if (paramObj instanceof IParamNodePO) {
    IParamNodePO paramNode=(IParamNodePO)paramObj;
    ParamValueSet valueSet=ParamTextPropertyDescriptor.getValuesSet(paramNode,paramDesc.getUniqueId());
    String[] values=ParamTextPropertyDescriptor.getValues(valueSet);
    Map<String,String> valuesWithComment=ParamTextPropertyDescriptor.getValuesWithComment(valueSet);
    if (TestDataConstants.BOOLEAN.equals(paramDesc.getType())) {
      values=BOOLEAN_VALUES;
      valuesWithComment.clear();
      valuesWithComment.put(BOOLEAN_VALUES[0],StringConstants.EMPTY);
      valuesWithComment.put(BOOLEAN_VALUES[1],StringConstants.EMPTY);
    }
    return new CheckedParamTextContentAssisted(parent,style,paramNode,paramDesc,createParamValueValidator(paramDesc.getType(),valueSet != null ? valueSet.isCombinable() : false,values),new ParamProposalProvider(valuesWithComment,paramNode,paramDesc));
  }
  if (paramObj instanceof ITestDataCubePO) {
    ITestDataCubePO tdc=(ITestDataCubePO)paramObj;
    Map<String,String> values=getValuesFromValueSet(paramDesc);
    if (TestDataConstants.BOOLEAN.equals(paramDesc.getType())) {
      return new CheckedParamTextContentAssisted(parent,style,tdc,paramDesc,createParamValueValidator(paramDesc.getType(),false,BOOLEAN_VALUES),new ParamProposalProvider(BOOLEAN_VALUES,null,paramDesc));
    }
    return new CheckedParamTextContentAssisted(parent,style,tdc,paramDesc,createParamValueValidator(paramDesc.getType(),false,values.keySet().toArray(new String[values.size()])),new ParamProposalProvider(values,null,paramDesc));
  }
  Assert.notReached(Messages.ImplementFor + StringConstants.SPACE + paramObj.getClass().getName());
  return null;
}