Program: 59403
Project: 59403
Buggy source:
/** 
 * Return an instance of the Metadata offered by this add-on
 */
protected ItdTypeDetailsProvidingMetadataItem getMetadata(String metadataIdentificationString,JavaType aspectName,PhysicalTypeMetadata governorPhysicalTypeMetadata,String itdFilename){
  JavaType javaType=DatatablesMetadata.getJavaType(metadataIdentificationString);
  LogicalPath path=DatatablesMetadata.getPath(metadataIdentificationString);
  final DatatablesAnnotationValues annotationValues=new DatatablesAnnotationValues(governorPhysicalTypeMetadata);
  String webScaffoldMetadataId=WebScaffoldMetadata.createIdentifier(javaType,path);
  WebScaffoldMetadata webScaffoldMetadata=(WebScaffoldMetadata)metadataService.get(webScaffoldMetadataId);
  metadataDependencyRegistry.registerDependency(webScaffoldMetadataId,metadataIdentificationString);
  JavaType webScaffoldAspectName=webScaffoldMetadata.getAspectName();
  WebScaffoldAnnotationValues webScaffoldAnnotationValues=webScaffoldMetadata.getAnnotationValues();
  JavaType entity=webScaffoldAnnotationValues.getFormBackingObject();
  String webJpaBatchMetadataId=WebJpaBatchMetadata.createIdentifier(javaType,path);
  WebJpaBatchMetadata webJpaBatchMetadata=(WebJpaBatchMetadata)metadataService.get(webJpaBatchMetadataId);
  String jpaMetadataId=JpaActiveRecordMetadata.createIdentifier(entity,path);
  JpaActiveRecordMetadata jpaMetadata=(JpaActiveRecordMetadata)metadataService.get(jpaMetadataId);
  if (jpaMetadata == null) {
    return null;
  }
  metadataDependencyRegistry.registerDependency(jpaMetadataId,metadataIdentificationString);
  String jpaQueryMetadataId=JpaQueryMetadata.createIdentifier(entity,path);
  JpaQueryMetadata jpaQueryMetadata=(JpaQueryMetadata)metadataService.get(jpaQueryMetadataId);
  metadataDependencyRegistry.registerDependency(jpaQueryMetadataId,metadataIdentificationString);
  List<FieldMetadata> identifiers=persistenceMemberLocator.getIdentifierFields(entity);
  String plural=jpaMetadata.getPlural();
  JavaSymbolName entityManagerMethodName=jpaMetadata.getEntityManagerMethod().getMethodName();
  final MemberDetails entityMemberDetails=getMemberDetails(entity);
  final Map<JavaSymbolName,DateTimeFormatDetails> datePatterns=webMetadataService.getDatePatterns(entity,entityMemberDetails,metadataIdentificationString);
  Map<FinderMetadataDetails,QueryHolderTokens> findersRegistered=null;
  String webFinderMetadataId=WebFinderMetadata.createIdentifier(javaType,path);
  WebFinderMetadata webFinderMetadata=(WebFinderMetadata)metadataService.get(webFinderMetadataId);
  metadataDependencyRegistry.registerDependency(webFinderMetadataId,metadataIdentificationString);
  if (webFinderMetadata != null) {
    findersRegistered=getFindersRegisterd(entity,path,entityMemberDetails,plural,jpaMetadata.getEntityName());
  }
  return new DatatablesMetadata(metadataIdentificationString,aspectName,governorPhysicalTypeMetadata,annotationValues,entity,identifiers,plural,entityManagerMethodName,datePatterns,webScaffoldAspectName,webJpaBatchMetadata,jpaQueryMetadata,webScaffoldAnnotationValues,findersRegistered);
}

Fixed version (ground truth):
/** 
 * Return an instance of the Metadata offered by this add-on
 */
protected ItdTypeDetailsProvidingMetadataItem getMetadata(String metadataIdentificationString,JavaType aspectName,PhysicalTypeMetadata governorPhysicalTypeMetadata,String itdFilename){
  JavaType javaType=DatatablesMetadata.getJavaType(metadataIdentificationString);
  LogicalPath path=DatatablesMetadata.getPath(metadataIdentificationString);
  final DatatablesAnnotationValues annotationValues=new DatatablesAnnotationValues(governorPhysicalTypeMetadata);
  String webScaffoldMetadataId=WebScaffoldMetadata.createIdentifier(javaType,path);
  WebScaffoldMetadata webScaffoldMetadata=(WebScaffoldMetadata)metadataService.get(webScaffoldMetadataId);
  metadataDependencyRegistry.registerDependency(webScaffoldMetadataId,metadataIdentificationString);
  JavaType webScaffoldAspectName=webScaffoldMetadata.getAspectName();
  WebScaffoldAnnotationValues webScaffoldAnnotationValues=webScaffoldMetadata.getAnnotationValues();
  JavaType entity=webScaffoldAnnotationValues.getFormBackingObject();
  LogicalPath entityPath=PhysicalTypeUtils.getPath(entity,typeLocationService);
  String webJpaBatchMetadataId=WebJpaBatchMetadata.createIdentifier(javaType,path);
  WebJpaBatchMetadata webJpaBatchMetadata=(WebJpaBatchMetadata)metadataService.get(webJpaBatchMetadataId);
  String jpaMetadataId=JpaActiveRecordMetadata.createIdentifier(entity,entityPath);
  JpaActiveRecordMetadata jpaMetadata=(JpaActiveRecordMetadata)metadataService.get(jpaMetadataId);
  if (jpaMetadata == null) {
    return null;
  }
  metadataDependencyRegistry.registerDependency(jpaMetadataId,metadataIdentificationString);
  String jpaQueryMetadataId=JpaQueryMetadata.createIdentifier(entity,path);
  JpaQueryMetadata jpaQueryMetadata=(JpaQueryMetadata)metadataService.get(jpaQueryMetadataId);
  metadataDependencyRegistry.registerDependency(jpaQueryMetadataId,metadataIdentificationString);
  List<FieldMetadata> identifiers=persistenceMemberLocator.getIdentifierFields(entity);
  String plural=jpaMetadata.getPlural();
  JavaSymbolName entityManagerMethodName=jpaMetadata.getEntityManagerMethod().getMethodName();
  final MemberDetails entityMemberDetails=getMemberDetails(entity);
  final Map<JavaSymbolName,DateTimeFormatDetails> datePatterns=webMetadataService.getDatePatterns(entity,entityMemberDetails,metadataIdentificationString);
  Map<FinderMetadataDetails,QueryHolderTokens> findersRegistered=null;
  String webFinderMetadataId=WebFinderMetadata.createIdentifier(javaType,path);
  WebFinderMetadata webFinderMetadata=(WebFinderMetadata)metadataService.get(webFinderMetadataId);
  metadataDependencyRegistry.registerDependency(webFinderMetadataId,metadataIdentificationString);
  if (webFinderMetadata != null) {
    findersRegistered=getFindersRegisterd(entity,path,entityMemberDetails,plural,jpaMetadata.getEntityName());
  }
  return new DatatablesMetadata(metadataIdentificationString,aspectName,governorPhysicalTypeMetadata,annotationValues,entity,identifiers,plural,entityManagerMethodName,datePatterns,webScaffoldAspectName,webJpaBatchMetadata,jpaQueryMetadata,webScaffoldAnnotationValues,findersRegistered);
}