Program: 65452
Project: 65452
Buggy source:
private void updateFormatField(){
  ULocale locale=formatLocale;
  if (locale == null)   locale=ULocale.getDefault();
  String displayFormat;
  String previewString;
  String type=getSelectedDataType();
  IChoiceSet choiceSet=getFormatChoiceSet(type);
  Expression expression=getFirstDefaultValue();
  String defaultValue=expression == null ? null : expression.getStringExpression();
  String exprType=expression == null ? ExpressionType.CONSTANT : expression.getType();
  if (ExpressionType.JAVASCRIPT.equals(exprType))   defaultValue=null;
  if (choiceSet == null) {
    displayFormat=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
    previewString="String_Node_Str";
  }
 else {
    if (formatCategroy == null) {
      return;
    }
    if (choiceSet.findChoice(formatCategroy) == null) {
      return;
    }
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (ParameterUtil.isCustomCategory(formatCategroy)) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
    if (type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATETIME_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_DATE)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals(DesignChoiceConstants.DATE_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATE_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_TIME)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals("String_Node_Str") ? DateFormatter.TIME_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING)) {
      previewString=new StringFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : formatCategroy,locale).format(defaultValue == null ? Messages.getString("String_Node_Str") : defaultValue);
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_INTEGER)) {
      int intValue=DEFAULT_PREVIEW_INTEGER;
      if (defaultValue != null) {
        try {
          intValue=java.lang.Integer.parseInt(defaultValue);
        }
 catch (        NumberFormatException e) {
        }
      }
      previewString=new NumberFormatter((ParameterUtil.isCustomCategory(formatCategroy) || (isNumberFormat(formatCategroy))) ? formatPattern : formatCategroy,locale).format(intValue);
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT)) {
      double doulbeValue=DEFAULT_PREVIEW_NUMBER;
      if (defaultValue != null) {
        try {
          doulbeValue=Double.parseDouble(defaultValue);
        }
 catch (        NumberFormatException e) {
        }
      }
      String realformatPattern=(ParameterUtil.isCustomCategory(formatCategroy) || (isNumberFormat(formatCategroy))) ? formatPattern : formatCategroy;
      NumberFormatter tempFormater=new NumberFormatter(realformatPattern,locale);
      previewString=tempFormater.format(doulbeValue);
      if (Double.isInfinite(doulbeValue)) {
        BigDecimal tempDecimal=new BigDecimal(defaultValue);
        if (realformatPattern == null) {
          previewString=tempDecimal.toString();
        }
 else {
          previewString=tempFormater.format(tempDecimal);
        }
      }
    }
 else {
      previewString=new NumberFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : formatCategroy,locale).format(DEFAULT_PREVIEW_NUMBER);
    }
  }
  formatField.setText(displayFormat);
  previewLabel.setText(convertNullString(previewString));
  changeFormat.setEnabled(choiceSet != null);
}

Fixed version (ground truth):
private void updateFormatField(){
  ULocale locale=formatLocale;
  if (locale == null)   locale=ULocale.getDefault();
  String displayFormat;
  String previewString;
  String type=getSelectedDataType();
  IChoiceSet choiceSet=getFormatChoiceSet(type);
  Expression expression=getFirstDefaultValue();
  String defaultValue=expression == null ? null : expression.getStringExpression();
  String exprType=expression == null ? ExpressionType.CONSTANT : expression.getType();
  if (ExpressionType.JAVASCRIPT.equals(exprType))   defaultValue=null;
  if (choiceSet == null) {
    displayFormat=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
    previewString="String_Node_Str";
  }
 else {
    if (formatCategroy == null || choiceSet.findChoice(formatCategroy) == null) {
      return;
    }
    if (choiceSet.findChoice(formatCategroy) == null) {
      return;
    }
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (ParameterUtil.isCustomCategory(formatCategroy)) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
    if (type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATETIME_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_DATE)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals(DesignChoiceConstants.DATE_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATE_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_TIME)) {
      previewString=new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : (formatCategroy.equals("String_Node_Str") ? DateFormatter.TIME_UNFORMATTED : formatCategroy),locale).format(new Date());
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING)) {
      previewString=new StringFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : formatCategroy,locale).format(defaultValue == null ? Messages.getString("String_Node_Str") : defaultValue);
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_INTEGER)) {
      int intValue=DEFAULT_PREVIEW_INTEGER;
      if (defaultValue != null) {
        try {
          intValue=java.lang.Integer.parseInt(defaultValue);
        }
 catch (        NumberFormatException e) {
        }
      }
      previewString=new NumberFormatter((ParameterUtil.isCustomCategory(formatCategroy) || (isNumberFormat(formatCategroy))) ? formatPattern : formatCategroy,locale).format(intValue);
    }
 else     if (type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT)) {
      double doulbeValue=DEFAULT_PREVIEW_NUMBER;
      if (defaultValue != null) {
        try {
          doulbeValue=Double.parseDouble(defaultValue);
        }
 catch (        NumberFormatException e) {
        }
      }
      String realformatPattern=(ParameterUtil.isCustomCategory(formatCategroy) || (isNumberFormat(formatCategroy))) ? formatPattern : formatCategroy;
      NumberFormatter tempFormater=new NumberFormatter(realformatPattern,locale);
      previewString=tempFormater.format(doulbeValue);
      if (Double.isInfinite(doulbeValue)) {
        BigDecimal tempDecimal=new BigDecimal(defaultValue);
        if (realformatPattern == null) {
          previewString=tempDecimal.toString();
        }
 else {
          previewString=tempFormater.format(tempDecimal);
        }
      }
    }
 else {
      previewString=new NumberFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern : formatCategroy,locale).format(DEFAULT_PREVIEW_NUMBER);
    }
  }
  formatField.setText(displayFormat);
  previewLabel.setText(convertNullString(previewString));
  changeFormat.setEnabled(choiceSet != null);
}