Program: 172238
Project: 172238
Buggy source:
@SuppressWarnings("String_Node_Str") public void testGetForm() throws Exception {
  Form form=this.formService.getForm(this.document.toString());
  assertNotNull("String_Node_Str",form);
  assertEquals(this.document.toString(),form.getItem());
  assertEquals(ContentModel.TYPE_CONTENT.toPrefixString(this.namespaceService),form.getType());
  assertNull("String_Node_Str",form.getFieldGroups());
  Collection<FieldDefinition> fieldDefs=form.getFieldDefinitions();
  assertNotNull("String_Node_Str",fieldDefs);
  assertEquals("String_Node_Str",22,fieldDefs.size());
  Map<String,FieldDefinition> fieldDefMap=new HashMap<String,FieldDefinition>(fieldDefs.size());
  for (  FieldDefinition fieldDef : fieldDefs) {
    fieldDefMap.put(fieldDef.getName(),fieldDef);
  }
  PropertyFieldDefinition nameField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition titleField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition descField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition mimetypeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition encodingField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition sizeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition originatorField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition addresseeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition addresseesField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition subjectField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition sentDateField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  AssociationFieldDefinition referencesField=(AssociationFieldDefinition)fieldDefMap.get("String_Node_Str");
  assertNotNull("String_Node_Str",nameField);
  assertNotNull("String_Node_Str",titleField);
  assertNotNull("String_Node_Str",descField);
  assertNotNull("String_Node_Str",mimetypeField);
  assertNotNull("String_Node_Str",encodingField);
  assertNotNull("String_Node_Str",sizeField);
  assertNotNull("String_Node_Str",originatorField);
  assertNotNull("String_Node_Str",addresseeField);
  assertNotNull("String_Node_Str",addresseesField);
  assertNotNull("String_Node_Str",subjectField);
  assertNotNull("String_Node_Str",sentDateField);
  assertNotNull("String_Node_Str",referencesField);
  assertEquals("String_Node_Str" + LABEL_NAME,LABEL_NAME,nameField.getLabel());
  assertEquals("String_Node_Str" + LABEL_TITLE,LABEL_TITLE,titleField.getLabel());
  assertEquals("String_Node_Str" + LABEL_DESCRIPTION,LABEL_DESCRIPTION,descField.getLabel());
  assertEquals("String_Node_Str" + LABEL_MIMETYPE,LABEL_MIMETYPE,mimetypeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ENCODING,LABEL_ENCODING,encodingField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SIZE,LABEL_SIZE,sizeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ORIGINATOR,LABEL_ORIGINATOR,originatorField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ADDRESSEE,LABEL_ADDRESSEE,addresseeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ADDRESSEES,LABEL_ADDRESSEES,addresseesField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SUBJECT,LABEL_SUBJECT,subjectField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SENT_DATE,LABEL_SENT_DATE,sentDateField.getLabel());
  assertEquals("String_Node_Str" + LABEL_REFERENCES,LABEL_REFERENCES,referencesField.getLabel());
  assertEquals("String_Node_Str","String_Node_Str",nameField.getDataType());
  assertTrue("String_Node_Str",nameField.isMandatory());
  assertFalse("String_Node_Str",nameField.isRepeating());
  List<FieldConstraint> constraints=nameField.getConstraints();
  assertEquals("String_Node_Str",1,constraints.size());
  FieldConstraint constraint=constraints.get(0);
  assertEquals("String_Node_Str","String_Node_Str",constraint.getType());
  Map<String,String> params=constraint.getParams();
  assertNotNull("String_Node_Str",params);
  assertEquals("String_Node_Str",2,params.size());
  assertNotNull("String_Node_Str",params.get("String_Node_Str"));
  assertNotNull("String_Node_Str",params.get("String_Node_Str"));
  assertEquals("String_Node_Str","String_Node_Str",addresseesField.getDataType());
  assertFalse("String_Node_Str",addresseesField.isMandatory());
  assertTrue("String_Node_Str",addresseesField.isRepeating());
  assertNull("String_Node_Str",addresseesField.getConstraints());
  assertEquals("String_Node_Str","String_Node_Str",referencesField.getEndpointType());
  assertEquals("String_Node_Str",Direction.TARGET.toString(),referencesField.getEndpointDirection().toString());
  assertFalse("String_Node_Str",referencesField.isEndpointMandatory());
  assertTrue("String_Node_Str",referencesField.isEndpointMany());
  FormData data=form.getFormData();
  assertNotNull("String_Node_Str",data);
  Map<String,FormData.FieldData> fieldData=data.getData();
  assertNotNull("String_Node_Str",fieldData);
  assertEquals(VALUE_TITLE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_DESCRIPTION,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_MIMETYPE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ENCODING,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ORIGINATOR,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ADDRESSEE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_SUBJECT,fieldData.get("String_Node_Str").getValue());
  assertTrue("String_Node_Str",((Long)fieldData.get("String_Node_Str").getValue()).longValue() > 0);
  String addressees=(String)fieldData.get("String_Node_Str").getValue();
  assertNotNull(addressees);
  assertTrue("String_Node_Str",addressees.indexOf("String_Node_Str") != -1);
  String[] addresseesArr=StringUtils.delimitedListToStringArray(addressees,"String_Node_Str");
  assertEquals("String_Node_Str",2,addresseesArr.length);
  assertEquals(VALUE_ADDRESSEES1,addresseesArr[0]);
  assertEquals(VALUE_ADDRESSEES2,addresseesArr[1]);
  Calendar calTestValue=Calendar.getInstance();
  calTestValue.setTime(VALUE_SENT_DATE);
  Calendar calServiceValue=Calendar.getInstance();
  calServiceValue.setTime((Date)fieldData.get("String_Node_Str").getValue());
  assertEquals(calTestValue.getTimeInMillis(),calServiceValue.getTimeInMillis());
  List<String> targets=(List<String>)fieldData.get("String_Node_Str").getValue();
  assertEquals("String_Node_Str",1,targets.size());
  assertEquals(this.associatedDoc.toString(),targets.get(0));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testGetForm() throws Exception {
  Form form=this.formService.getForm(this.document.toString());
  assertNotNull("String_Node_Str",form);
  assertEquals(this.document.toString(),form.getItem());
  assertEquals(ContentModel.TYPE_CONTENT.toPrefixString(this.namespaceService),form.getType());
  assertNull("String_Node_Str",form.getFieldGroups());
  Collection<FieldDefinition> fieldDefs=form.getFieldDefinitions();
  assertNotNull("String_Node_Str",fieldDefs);
  assertEquals("String_Node_Str",23,fieldDefs.size());
  Map<String,FieldDefinition> fieldDefMap=new HashMap<String,FieldDefinition>(fieldDefs.size());
  for (  FieldDefinition fieldDef : fieldDefs) {
    fieldDefMap.put(fieldDef.getName(),fieldDef);
  }
  PropertyFieldDefinition nameField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition titleField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition descField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition mimetypeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition encodingField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition sizeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition originatorField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition addresseeField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition addresseesField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition subjectField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  PropertyFieldDefinition sentDateField=(PropertyFieldDefinition)fieldDefMap.get("String_Node_Str");
  AssociationFieldDefinition referencesField=(AssociationFieldDefinition)fieldDefMap.get("String_Node_Str");
  assertNotNull("String_Node_Str",nameField);
  assertNotNull("String_Node_Str",titleField);
  assertNotNull("String_Node_Str",descField);
  assertNotNull("String_Node_Str",mimetypeField);
  assertNotNull("String_Node_Str",encodingField);
  assertNotNull("String_Node_Str",sizeField);
  assertNotNull("String_Node_Str",originatorField);
  assertNotNull("String_Node_Str",addresseeField);
  assertNotNull("String_Node_Str",addresseesField);
  assertNotNull("String_Node_Str",subjectField);
  assertNotNull("String_Node_Str",sentDateField);
  assertNotNull("String_Node_Str",referencesField);
  assertEquals("String_Node_Str" + LABEL_NAME,LABEL_NAME,nameField.getLabel());
  assertEquals("String_Node_Str" + LABEL_TITLE,LABEL_TITLE,titleField.getLabel());
  assertEquals("String_Node_Str" + LABEL_DESCRIPTION,LABEL_DESCRIPTION,descField.getLabel());
  assertEquals("String_Node_Str" + LABEL_MIMETYPE,LABEL_MIMETYPE,mimetypeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ENCODING,LABEL_ENCODING,encodingField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SIZE,LABEL_SIZE,sizeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ORIGINATOR,LABEL_ORIGINATOR,originatorField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ADDRESSEE,LABEL_ADDRESSEE,addresseeField.getLabel());
  assertEquals("String_Node_Str" + LABEL_ADDRESSEES,LABEL_ADDRESSEES,addresseesField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SUBJECT,LABEL_SUBJECT,subjectField.getLabel());
  assertEquals("String_Node_Str" + LABEL_SENT_DATE,LABEL_SENT_DATE,sentDateField.getLabel());
  assertEquals("String_Node_Str" + LABEL_REFERENCES,LABEL_REFERENCES,referencesField.getLabel());
  assertEquals("String_Node_Str","String_Node_Str",nameField.getDataType());
  assertTrue("String_Node_Str",nameField.isMandatory());
  assertFalse("String_Node_Str",nameField.isRepeating());
  List<FieldConstraint> constraints=nameField.getConstraints();
  assertEquals("String_Node_Str",1,constraints.size());
  FieldConstraint constraint=constraints.get(0);
  assertEquals("String_Node_Str","String_Node_Str",constraint.getType());
  Map<String,String> params=constraint.getParams();
  assertNotNull("String_Node_Str",params);
  assertEquals("String_Node_Str",2,params.size());
  assertNotNull("String_Node_Str",params.get("String_Node_Str"));
  assertNotNull("String_Node_Str",params.get("String_Node_Str"));
  assertEquals("String_Node_Str","String_Node_Str",addresseesField.getDataType());
  assertFalse("String_Node_Str",addresseesField.isMandatory());
  assertTrue("String_Node_Str",addresseesField.isRepeating());
  assertNull("String_Node_Str",addresseesField.getConstraints());
  assertEquals("String_Node_Str","String_Node_Str",referencesField.getEndpointType());
  assertEquals("String_Node_Str",Direction.TARGET.toString(),referencesField.getEndpointDirection().toString());
  assertFalse("String_Node_Str",referencesField.isEndpointMandatory());
  assertTrue("String_Node_Str",referencesField.isEndpointMany());
  FormData data=form.getFormData();
  assertNotNull("String_Node_Str",data);
  Map<String,FormData.FieldData> fieldData=data.getData();
  assertNotNull("String_Node_Str",fieldData);
  assertEquals(VALUE_TITLE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_DESCRIPTION,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_MIMETYPE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ENCODING,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ORIGINATOR,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_ADDRESSEE,fieldData.get("String_Node_Str").getValue());
  assertEquals(VALUE_SUBJECT,fieldData.get("String_Node_Str").getValue());
  assertTrue("String_Node_Str",((Long)fieldData.get("String_Node_Str").getValue()).longValue() > 0);
  String addressees=(String)fieldData.get("String_Node_Str").getValue();
  assertNotNull(addressees);
  assertTrue("String_Node_Str",addressees.indexOf("String_Node_Str") != -1);
  String[] addresseesArr=StringUtils.delimitedListToStringArray(addressees,"String_Node_Str");
  assertEquals("String_Node_Str",2,addresseesArr.length);
  assertEquals(VALUE_ADDRESSEES1,addresseesArr[0]);
  assertEquals(VALUE_ADDRESSEES2,addresseesArr[1]);
  Calendar calTestValue=Calendar.getInstance();
  calTestValue.setTime(VALUE_SENT_DATE);
  Calendar calServiceValue=Calendar.getInstance();
  calServiceValue.setTime((Date)fieldData.get("String_Node_Str").getValue());
  assertEquals(calTestValue.getTimeInMillis(),calServiceValue.getTimeInMillis());
  List<String> targets=(List<String>)fieldData.get("String_Node_Str").getValue();
  assertEquals("String_Node_Str",1,targets.size());
  assertEquals(this.associatedDoc.toString(),targets.get(0));
}