Program: 59389
Project: 59389
Buggy source:
/** 
 * Replace some vars with values in all AspectJ template portions and concat results in order into one string. <p> Vars has next format: ${entity_package}. Template portions will be placed at same package in src/main/resources. If some method placed in a portion already defined (push-in), don't add it to result string. </p>
 * @param checksumField Checksum field to get field name (one var value).
 * @param persistenceMemberLocator To get identifier field (one var value).
 * @return All template portions replacing vars with values and concatenatedin order.
 */
private String generateITDContents(FieldMetadata checksumField,PersistenceMemberLocator persistenceMemberLocator){
  StringBuilder contents=new StringBuilder();
  contents.append(generateITDContent(ITD_TEMPLATE_CLASS_START,checksumField,persistenceMemberLocator));
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_GET_MESSAGE_DIGEST,checksumField,persistenceMemberLocator));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(ITD_TEMPLATE_METHOD_REMOVE,checksumField,persistenceMemberLocator));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(ITD_TEMPLATE_METHOD_MERGE,checksumField,persistenceMemberLocator));
  }
  List<JavaType> parameters=new ArrayList<JavaType>();
  parameters.add(new JavaType(governorTypeDetails.getName().getSimpleTypeName()));
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str")) == null) {
    contents.append(generateITDContent(METHOD_CHECK_CONCURRENCY,checksumField,persistenceMemberLocator));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_LOAD_CHECKSUM,checksumField,persistenceMemberLocator));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_CHECKSUM_DIGEST,checksumField,persistenceMemberLocator));
  }
  contents.append(generateITDContent(ITD_TEMPLATE_CLASS_END,checksumField,persistenceMemberLocator));
  return contents.toString();
}

Fixed version (ground truth):
/** 
 * Replace some vars with values in all AspectJ template portions and concat results in order into one string. <p> Vars has next format: ${entity_package}. Template portions will be placed at same package in src/main/resources. If some method placed in a portion already defined (push-in), don't add it to result string. </p>
 * @param checksumField Checksum field to get field name (one var value).
 * @param persistenceMemberLocator To get identifier field (one var value).
 * @return All template portions replacing vars with values and concatenatedin order.
 */
private String generateITDContents(FieldMetadata checksumField,PersistenceMemberLocator persistenceMemberLocator){
  StringBuilder contents=new StringBuilder();
  Map<String,String> params=prepareParamsMap(checksumField);
  contents.append(generateITDContent(ITD_TEMPLATE_CLASS_START,checksumField,persistenceMemberLocator,params));
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_GET_MESSAGE_DIGEST,checksumField,persistenceMemberLocator,params));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(ITD_TEMPLATE_METHOD_REMOVE,checksumField,persistenceMemberLocator,params));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(ITD_TEMPLATE_METHOD_MERGE,checksumField,persistenceMemberLocator,params));
  }
  List<JavaType> parameters=new ArrayList<JavaType>();
  parameters.add(new JavaType(governorTypeDetails.getName().getSimpleTypeName()));
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str")) == null) {
    contents.append(generateITDContent(METHOD_CHECK_CONCURRENCY,checksumField,persistenceMemberLocator,params));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_LOAD_CHECKSUM,checksumField,persistenceMemberLocator,params));
  }
  if (MemberFindingUtils.getDeclaredMethod(governorTypeDetails,new JavaSymbolName("String_Node_Str"),null) == null) {
    contents.append(generateITDContent(METHOD_CHECKSUM_DIGEST,checksumField,persistenceMemberLocator,params));
  }
  contents.append(generateITDContent(ITD_TEMPLATE_CLASS_END,checksumField,persistenceMemberLocator,params));
  return contents.toString();
}