Program: 35368
Project: 35368
Buggy source:
/** 
 * Builds a new contact list panel with default values.
 */
@Inject public ContactsListWidget(final View view,final Injector injector){
  super(view,injector);
  createContactHandler=new CreateContactHandler(){
    @Override public void handleContactCreation(    final ContactModelDTO contactModelDTO,    final String email,    final String firstName,    final String familyName,    final String organizationName,    final OrgUnitDTO mainOrgUnit,    final List<OrgUnitDTO> secondaryOrgUnits){
      CheckContactDuplication checkContactDuplication;
      if (contactModelDTO.getType() == ContactModelType.INDIVIDUAL) {
        checkContactDuplication=new CheckContactDuplication(null,email,familyName,firstName);
      }
 else {
        checkContactDuplication=new CheckContactDuplication(null,email,familyName,null);
      }
      dispatch.execute(checkContactDuplication,new AsyncCallback<ListResult<ContactDTO>>(){
        @Override public void onFailure(        Throwable caught){
          Log.error("String_Node_Str");
        }
        @Override public void onSuccess(        ListResult<ContactDTO> result){
          final HashMap<String,Object> properties=buildPropertyMap(contactModelDTO,email,firstName,familyName,organizationName,mainOrgUnit,secondaryOrgUnits);
          if (result == null || result.getSize() == 0) {
            createEntity(properties);
            return;
          }
          final DedupeContactDialog dedupeContactDialog=new DedupeContactDialog(true);
          dedupeContactDialog.getPossibleDuplicatesGrid().getStore().add(result.getList());
          dedupeContactDialog.getFirstStepMainButton().addSelectionListener(new SelectionListener<ButtonEvent>(){
            @Override public void componentSelected(            ButtonEvent ce){
              createEntity(properties);
              dedupeContactDialog.hide();
            }
          }
);
          dedupeContactDialog.setSecondStepHandler(new DedupeContactDialog.SecondStepHandler(){
            @Override public void initialize(            final Integer contactId,            final ListStore<ContactDuplicatedProperty> propertiesStore){
              dispatch.execute(new GetContactDuplicatedProperties(contactId,null,properties),new CommandResultHandler<ListResult<ContactDuplicatedProperty>>(){
                @Override protected void onCommandSuccess(                ListResult<ContactDuplicatedProperty> result){
                  propertiesStore.add(result.getList());
                }
              }
,new LoadingMask(dedupeContactDialog));
            }
            @Override public void downloadImage(            String id,            final Image image){
              imageProvider.provideDataUrl(id,new SuccessCallback<String>(){
                @Override public void onSuccess(                String dataUrl){
                  image.setUrl(dataUrl);
                }
              }
);
            }
            @Override public void handleDedupeContact(            final Integer targetedContactId,            List<ContactDuplicatedProperty> selectedProperties){
              dispatch.execute(new DedupeContact(selectedProperties,targetedContactId),new CommandResultHandler<ContactDTO>(){
                @Override protected void onCommandSuccess(                ContactDTO targetedContactDTO){
                  dedupeContactDialog.hide();
                  eventBus.navigateRequest(Page.CONTACT_DASHBOARD.requestWith(RequestParameter.ID,targetedContactId));
                }
              }
);
            }
            @Override public void handleCancel(){
              dedupeContactDialog.hide();
            }
          }
);
          dedupeContactDialog.show();
        }
      }
);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Builds a new contact list panel with default values.
 */
@Inject public ContactsListWidget(final View view,final Injector injector){
  super(view,injector);
  createContactHandler=new CreateContactHandler(){
    @Override public void handleContactCreation(    final ContactModelDTO contactModelDTO,    final String email,    final String firstName,    final String familyName,    final String organizationName,    final OrgUnitDTO mainOrgUnit,    final List<OrgUnitDTO> secondaryOrgUnits){
      CheckContactDuplication checkContactDuplication;
      if (contactModelDTO.getType() == ContactModelType.INDIVIDUAL) {
        checkContactDuplication=new CheckContactDuplication(null,email,familyName,firstName,contactModelDTO);
      }
 else {
        checkContactDuplication=new CheckContactDuplication(null,email,familyName,null,contactModelDTO);
      }
      dispatch.execute(checkContactDuplication,new AsyncCallback<ListResult<ContactDTO>>(){
        @Override public void onFailure(        Throwable caught){
          Log.error("String_Node_Str");
        }
        @Override public void onSuccess(        ListResult<ContactDTO> result){
          final HashMap<String,Object> properties=buildPropertyMap(contactModelDTO,email,firstName,familyName,organizationName,mainOrgUnit,secondaryOrgUnits);
          if (result == null || result.getSize() == 0) {
            createEntity(properties);
            return;
          }
          final DedupeContactDialog dedupeContactDialog=new DedupeContactDialog(true);
          dedupeContactDialog.getPossibleDuplicatesGrid().getStore().add(result.getList());
          dedupeContactDialog.getFirstStepMainButton().addSelectionListener(new SelectionListener<ButtonEvent>(){
            @Override public void componentSelected(            ButtonEvent ce){
              createEntity(properties);
              dedupeContactDialog.hide();
            }
          }
);
          dedupeContactDialog.setSecondStepHandler(new DedupeContactDialog.SecondStepHandler(){
            @Override public void initialize(            final Integer contactId,            final ListStore<ContactDuplicatedProperty> propertiesStore){
              dispatch.execute(new GetContactDuplicatedProperties(contactId,null,properties),new CommandResultHandler<ListResult<ContactDuplicatedProperty>>(){
                @Override protected void onCommandSuccess(                ListResult<ContactDuplicatedProperty> result){
                  propertiesStore.add(result.getList());
                }
              }
,new LoadingMask(dedupeContactDialog));
            }
            @Override public void downloadImage(            String id,            final Image image){
              imageProvider.provideDataUrl(id,new SuccessCallback<String>(){
                @Override public void onSuccess(                String dataUrl){
                  image.setUrl(dataUrl);
                }
              }
);
            }
            @Override public void handleDedupeContact(            final Integer targetedContactId,            List<ContactDuplicatedProperty> selectedProperties){
              dispatch.execute(new DedupeContact(selectedProperties,targetedContactId),new CommandResultHandler<ContactDTO>(){
                @Override protected void onCommandSuccess(                final ContactDTO targetedContactDTO){
                  dedupeContactDialog.hide();
                  GetContactHistory historyCmd=new GetContactHistory(targetedContactDTO.getId(),true);
                  dispatch.execute(historyCmd,new CommandResultHandler<ListResult<ContactHistory>>(){
                    @Override protected void onCommandSuccess(                    ListResult<ContactHistory> result){
                      ContactHistory lastChange=result.isEmpty() ? null : result.getList().get(0);
                      view.addContact(new DashboardContact(targetedContactDTO,lastChange));
                    }
                  }
);
                }
              }
);
            }
            @Override public void handleCancel(){
              dedupeContactDialog.hide();
            }
          }
);
          dedupeContactDialog.show();
        }
      }
);
    }
  }
;
}