Program: 17496
Project: 17496
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  int type=getItemViewType(position);
  if (view == null) {
    if (type == CUSTOM_TEXT_FIELD) {
      view=inflater.inflate(R.layout.uv_text_field_item,null);
    }
 else     if (type == CUSTOM_PREDEFINED_FIELD) {
      view=inflater.inflate(R.layout.uv_select_field_item,null);
    }
 else {
      return super.getView(position,convertView,parent);
    }
  }
  if (type == CUSTOM_TEXT_FIELD) {
    TextView title=(TextView)view.findViewById(R.id.uv_header_text);
    final EditText field=(EditText)view.findViewById(R.id.uv_text_field);
    final CustomField customField=(CustomField)getItem(position);
    String value=customFieldValues.get(customField.getName());
    title.setText(customField.getName());
    field.setHint(R.string.uv_value);
    field.setInputType(EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
    field.setText(value);
    field.setOnFocusChangeListener(new View.OnFocusChangeListener(){
      @Override public void onFocusChange(      View v,      boolean hasFocus){
        if (!hasFocus) {
          customFieldValues.put(customField.getName(),field.getText().toString());
        }
      }
    }
);
  }
 else   if (type == CUSTOM_PREDEFINED_FIELD) {
    final CustomField customField=(CustomField)getItem(position);
    String value=customFieldValues.get(customField.getName());
    TextView title=(TextView)view.findViewById(R.id.uv_header_text);
    title.setText(customField.getName());
    Spinner field=(Spinner)view.findViewById(R.id.uv_select_field);
    field.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
      @Override public void onItemSelected(      AdapterView<?> parent,      View view,      int position,      long id){
        customFieldValues.put(customField.getName(),position == 0 ? null : customField.getPredefinedValues().get(position - 1));
      }
      @Override public void onNothingSelected(      AdapterView<?> parent){
      }
    }
);
    field.setAdapter(new SpinnerAdapter<String>(context,customField.getPredefinedValues()));
    if (value != null && customField.getPredefinedValues().contains(value))     field.setSelection(customField.getPredefinedValues().indexOf(value));
  }
 else {
    return super.getView(position,view,parent);
  }
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  int type=getItemViewType(position);
  if (view == null) {
    if (type == CUSTOM_TEXT_FIELD) {
      view=inflater.inflate(R.layout.uv_text_field_item,null);
    }
 else     if (type == CUSTOM_PREDEFINED_FIELD) {
      view=inflater.inflate(R.layout.uv_select_field_item,null);
    }
 else {
      return super.getView(position,convertView,parent);
    }
  }
  if (type == CUSTOM_TEXT_FIELD) {
    TextView title=(TextView)view.findViewById(R.id.uv_header_text);
    final EditText field=(EditText)view.findViewById(R.id.uv_text_field);
    final CustomField customField=(CustomField)getItem(position);
    String value=customFieldValues.get(customField.getName());
    title.setText(customField.getName());
    field.setHint(R.string.uv_value);
    field.setInputType(EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
    field.setText(value);
    field.setOnFocusChangeListener(new View.OnFocusChangeListener(){
      @Override public void onFocusChange(      View v,      boolean hasFocus){
        if (!hasFocus) {
          customFieldValues.put(customField.getName(),field.getText().toString());
        }
      }
    }
);
  }
 else   if (type == CUSTOM_PREDEFINED_FIELD) {
    final CustomField customField=(CustomField)getItem(position);
    String value=customFieldValues.get(customField.getName());
    TextView title=(TextView)view.findViewById(R.id.uv_header_text);
    title.setText(customField.getName());
    Spinner field=(Spinner)view.findViewById(R.id.uv_select_field);
    field.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
      @Override public void onItemSelected(      AdapterView<?> parent,      View view,      int position,      long id){
        customFieldValues.put(customField.getName(),position == 0 ? null : customField.getPredefinedValues().get(position - 1));
      }
      @Override public void onNothingSelected(      AdapterView<?> parent){
      }
    }
);
    field.setAdapter(new SpinnerAdapter<String>(context,customField.getPredefinedValues()));
    if (value != null && customField.getPredefinedValues().contains(value)) {
      field.setSelection(customField.getPredefinedValues().indexOf(value) + 1);
    }
  }
 else {
    return super.getView(position,view,parent);
  }
  return view;
}