nus-yam/ex-repair huggingface dataset:
Program: 35515
Project: 35515
Buggy source:
@TransactionalEventListener(phase=TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event){
  if (addComment) {
    final RequestDto request=event.getRequestDto();
    final IssueInformationDto issueInformation=request.getIssueInformation();
    if (issueInformation.getPlatform() == Platform.GITHUB) {
      final String solver=githubSolverResolver.solveResolver(request).orElseThrow(() -> new RuntimeException("String_Node_Str" + request.getId()));
      final CreateGithubComment comment=new CreateGithubComment();
      comment.setBody(gitHubCommentFactory.createClosedComment(request.getId(),solver));
      final List<GithubIssueCommentsResult> ourComments=getOurComments(issueInformation);
      if (ourComments.size() < 2) {
        githubGateway.createCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),issueInformation.getNumber(),comment);
      }
 else {
        final GithubIssueCommentsResult lastComment=ourComments.stream().max(Comparator.comparing(GithubIssueCommentsResult::getCreatedAt)).get();
        githubGateway.editCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),lastComment.getId(),comment);
      }
    }
  }
}

Fixed version (ground truth):
@TransactionalEventListener(phase=TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event){
  if (addComment) {
    final RequestDto request=event.getRequestDto();
    final IssueInformationDto issueInformation=request.getIssueInformation();
    if (issueInformation.getPlatform() == Platform.GITHUB) {
      final CreateGithubComment comment=createComment(request);
      final List<GithubIssueCommentsResult> ourComments=getOurComments(issueInformation);
      if (ourComments.size() < 2) {
        placeNewComment(issueInformation,comment);
      }
 else {
        editLastComment(issueInformation,comment,ourComments);
      }
    }
  }
}
Program: 35516
Project: 35516
Buggy source:
public UserClaimableDto userClaimableResult(Principal user,RequestDto request){
  Optional<String> solver=githubSolverResolver.solveResolver(request);
  if (solver.isPresent() && request.getStatus() == RequestStatus.FUNDED || request.getStatus() == RequestStatus.CLAIMABLE) {
    return UserClaimableDto.builder().claimable(true).claimableByUser(isClaimalbeByUser(user,request,solver.get())).build();
  }
  return UserClaimableDto.builder().claimable(false).claimableByUser(false).build();
}

Fixed version (ground truth):
public UserClaimableDto userClaimableResult(Principal user,RequestDto request){
  Optional<String> solver=githubSolverResolver.solveResolver(request);
  if (solver.isPresent() && (request.getStatus() == RequestStatus.FUNDED || request.getStatus() == RequestStatus.CLAIMABLE)) {
    return UserClaimableDto.builder().claimable(true).claimableByUser(isClaimalbeByUser(user,request,solver.get())).build();
  }
  return UserClaimableDto.builder().claimable(false).claimableByUser(false).build();
}
Program: 35517
Project: 35517
Buggy source:
public RedirectBuilder redirectView(RedirectAttributes redirectAttributes){
  return new RedirectBuilder(messageSource,redirectAttributes);
}

Fixed version (ground truth):
public RedirectBuilder redirectView(RedirectAttributes redirectAttributes){
  return new RedirectBuilder(redirectAttributes);
}
Program: 35518
Project: 35518
Buggy source:
public RedirectBuilder(MessageSource messageSource,RedirectAttributes redirectAttributes){
  this.redirectAttributes=redirectAttributes;
}

Fixed version (ground truth):
public RedirectBuilder(RedirectAttributes redirectAttributes){
  this.redirectAttributes=redirectAttributes;
}
Program: 35519
Project: 35519
Buggy source:
private FunderDto mapToFunderDto(Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  return totalFundDto == null ? null : FunderDto.builder().funder(StringUtils.isNotBlank(f.getCreatedBy()) ? profileService.getUserProfile(f.getCreatedBy()).getName() : f.getFunder()).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).build();
}

Fixed version (ground truth):
private FunderDto mapToFunderDto(Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  return totalFundDto == null ? null : FunderDto.builder().funder(StringUtils.isNotBlank(f.getFunderUserId()) ? profileService.getUserProfile(f.getFunderUserId()).getName() : f.getFunder()).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).build();
}
Program: 35520
Project: 35520
Buggy source:
@Transactional @Override public void addFunds(FundsAddedCommand command){
  Request request=requestRepository.findOne(command.getRequestId()).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  Fund fund=Fund.builder().amountInWei(command.getAmountInWei()).requestId(command.getRequestId()).token(command.getToken()).timestamp(command.getTimestamp()).funder(command.getFunderAddress()).build();
  Optional<PendingFund> pendingFund=pendingFundRepository.findByTransactionHash(command.getTransactionId());
  if (pendingFund.isPresent()) {
    fund.setCreatedBy(pendingFund.get().getUserId());
  }
  fund=fundRepository.saveAndFlush(fund);
  cacheManager.getCache("String_Node_Str").evict(fund.getRequestId());
  if (request.getStatus() == RequestStatus.OPEN) {
    request.setStatus(RequestStatus.FUNDED);
    request=requestRepository.saveAndFlush(request);
  }
  eventPublisher.publishEvent(new RequestFundedEvent(command.getTransactionId(),mappers.map(Fund.class,FundDto.class,fund),mappers.map(Request.class,RequestDto.class,request),command.getTimestamp()));
}

Fixed version (ground truth):
@Transactional @Override public void addFunds(FundsAddedCommand command){
  Request request=requestRepository.findOne(command.getRequestId()).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  Fund fund=Fund.builder().amountInWei(command.getAmountInWei()).requestId(command.getRequestId()).token(command.getToken()).timestamp(command.getTimestamp()).funder(command.getFunderAddress()).build();
  Optional<PendingFund> pendingFund=pendingFundRepository.findByTransactionHash(command.getTransactionId());
  if (pendingFund.isPresent()) {
    fund.setFunderUserId(pendingFund.get().getUserId());
  }
  fund=fundRepository.saveAndFlush(fund);
  cacheManager.getCache("String_Node_Str").evict(fund.getRequestId());
  if (request.getStatus() == RequestStatus.OPEN) {
    request.setStatus(RequestStatus.FUNDED);
    request=requestRepository.saveAndFlush(request);
  }
  eventPublisher.publishEvent(new RequestFundedEvent(command.getTransactionId(),mappers.map(Fund.class,FundDto.class,fund),mappers.map(Request.class,RequestDto.class,request),command.getTimestamp()));
}
Program: 35521
Project: 35521
Buggy source:
@Builder Fund(String createdBy,String funder,BigDecimal amountInWei,String token,Long requestId,LocalDateTime timestamp){
  super.setCreatedBy(createdBy);
  this.funder=funder == null ? null : funder.toLowerCase();
  this.amountInWei=amountInWei;
  this.token=token;
  this.requestId=requestId;
  this.timestamp=timestamp;
}

Fixed version (ground truth):
@Builder Fund(String funderUserId,String funder,BigDecimal amountInWei,String token,Long requestId,LocalDateTime timestamp){
  this.funderUserId=funderUserId;
  this.funder=funder == null ? null : funder.toLowerCase();
  this.amountInWei=amountInWei;
  this.token=token;
  this.requestId=requestId;
  this.timestamp=timestamp;
}
Program: 35522
Project: 35522
Buggy source:
public static Fund.FundBuilder zrxFundFunderKnown(){
  return Fund.builder().amountInWei(new BigDecimal("String_Node_Str")).createdBy("String_Node_Str").funder("String_Node_Str").requestId(1L).token(TokenInfoDtoMother.zrx().getAddress());
}

Fixed version (ground truth):
public static Fund.FundBuilder zrxFundFunderKnown(){
  return Fund.builder().amountInWei(new BigDecimal("String_Node_Str")).funderUserId("String_Node_Str").funder("String_Node_Str").requestId(1L).token(TokenInfoDtoMother.zrx().getAddress());
}
Program: 35523
Project: 35523
Buggy source:
public static Fund.FundBuilder fndFundFunderKnown(){
  return Fund.builder().amountInWei(new BigDecimal("String_Node_Str")).createdBy("String_Node_Str").funder("String_Node_Str").requestId(1L).token(TokenInfoDtoMother.fnd().getAddress());
}

Fixed version (ground truth):
public static Fund.FundBuilder fndFundFunderKnown(){
  return Fund.builder().amountInWei(new BigDecimal("String_Node_Str")).funderUserId("String_Node_Str").funder("String_Node_Str").requestId(1L).token(TokenInfoDtoMother.fnd().getAddress());
}
Program: 35524
Project: 35524
Buggy source:
@Transactional @Override public void addFunds(FundsAddedCommand command){
  Request request=requestRepository.findOne(command.getRequestId()).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  Fund fund=Fund.builder().amountInWei(command.getAmountInWei()).requestId(command.getRequestId()).token(command.getToken()).timestamp(command.getTimestamp()).build();
  fund=fundRepository.saveAndFlush(fund);
  cacheManager.getCache("String_Node_Str").evict(fund.getId());
  if (request.getStatus() == RequestStatus.OPEN) {
    request.setStatus(RequestStatus.FUNDED);
    request=requestRepository.saveAndFlush(request);
  }
  eventPublisher.publishEvent(new RequestFundedEvent(command.getTransactionId(),mappers.map(Fund.class,FundDto.class,fund),mappers.map(Request.class,RequestDto.class,request),command.getTimestamp()));
}

Fixed version (ground truth):
@Transactional @Override public void addFunds(FundsAddedCommand command){
  Request request=requestRepository.findOne(command.getRequestId()).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  Fund fund=Fund.builder().amountInWei(command.getAmountInWei()).requestId(command.getRequestId()).token(command.getToken()).timestamp(command.getTimestamp()).build();
  fund=fundRepository.saveAndFlush(fund);
  cacheManager.getCache("String_Node_Str").evict(fund.getRequestId());
  if (request.getStatus() == RequestStatus.OPEN) {
    request.setStatus(RequestStatus.FUNDED);
    request=requestRepository.saveAndFlush(request);
  }
  eventPublisher.publishEvent(new RequestFundedEvent(command.getTransactionId(),mappers.map(Fund.class,FundDto.class,fund),mappers.map(Request.class,RequestDto.class,request),command.getTimestamp()));
}
Program: 35525
Project: 35525
Buggy source:
@Override public Object getPrincipal(){
  return userId;
}

Fixed version (ground truth):
@Override public Object getPrincipal(){
  return email;
}
Program: 35526
Project: 35526
Buggy source:
@Override public String getName(){
  return userId;
}

Fixed version (ground truth):
@Override public String getName(){
  return email;
}
Program: 35527
Project: 35527
Buggy source:
public UserAuthentication(String userId){
  this.userId=userId;
}

Fixed version (ground truth):
public UserAuthentication(String email){
  this.email=email;
}
Program: 35528
Project: 35528
Buggy source:
@Override @Transactional(readOnly=true) public UserDto getUser(String userId){
  return userDtoMapper.map(userRepository.findOne(userId).orElse(null));
}

Fixed version (ground truth):
@Override @Transactional(readOnly=true) public UserDto getUser(String email){
  return userDtoMapper.map(userRepository.findOne(email).orElse(null));
}
Program: 35529
Project: 35529
Buggy source:
public static UserDto davy(){
  UserDto userDto=new UserDto();
  userDto.setEmail("String_Node_Str");
  userDto.setPhoneNumber("String_Node_Str");
  userDto.setUserId("String_Node_Str");
  return userDto;
}

Fixed version (ground truth):
public static UserDto davy(){
  UserDto userDto=new UserDto();
  userDto.setEmail("String_Node_Str");
  return userDto;
}
Program: 35530
Project: 35530
Buggy source:
@Before public void setUp() throws Exception {
  userService=Mockito.mock(UserService.class);
  MappingJackson2HttpMessageConverter converter=new MappingJackson2HttpMessageConverter();
  objectMapper=new ObjectMapper();
  objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
  converter.setObjectMapper(objectMapper);
  principal=new UserAuthentication(UserDtoMother.davy().getUserId());
  mockMvc=MockMvcBuilders.standaloneSetup(new UserInfoController(userService)).setMessageConverters(converter).apply(MockMvcRestDocumentation.documentationConfiguration(this.restDocumentation)).build();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  userService=Mockito.mock(UserService.class);
  MappingJackson2HttpMessageConverter converter=new MappingJackson2HttpMessageConverter();
  objectMapper=new ObjectMapper();
  objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
  converter.setObjectMapper(objectMapper);
  principal=new UserAuthentication(UserDtoMother.davy().getEmail());
  mockMvc=MockMvcBuilders.standaloneSetup(new UserInfoController(userService)).setMessageConverters(converter).apply(MockMvcRestDocumentation.documentationConfiguration(this.restDocumentation)).build();
}
Program: 35531
Project: 35531
Buggy source:
@Test public void findAll() throws Exception {
  UserDto user=UserDtoMother.davy();
  Mockito.when(userService.getUser(user.getUserId())).thenReturn(user);
  this.mockMvc.perform(RestDocumentationRequestBuilders.get("String_Node_Str").accept(MediaType.APPLICATION_JSON).principal(principal)).andExpect(MockMvcResultMatchers.status().isOk()).andDo(MockMvcRestDocumentation.document("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void findAll() throws Exception {
  UserDto user=UserDtoMother.davy();
  Mockito.when(userService.getUser(user.getEmail())).thenReturn(user);
  this.mockMvc.perform(RestDocumentationRequestBuilders.get("String_Node_Str").accept(MediaType.APPLICATION_JSON).principal(principal)).andExpect(MockMvcResultMatchers.status().isOk()).andDo(MockMvcRestDocumentation.document("String_Node_Str"));
}
Program: 35532
Project: 35532
Buggy source:
@Bean public CorsFilter corsFilter(){
  UrlBasedCorsConfigurationSource source=new UrlBasedCorsConfigurationSource();
  CorsConfiguration config=new CorsConfiguration();
  config.setAllowCredentials(true);
  config.addAllowedOrigin("String_Node_Str");
  config.addAllowedHeader("String_Node_Str");
  config.addExposedHeader(HttpHeaders.AUTHORIZATION);
  config.addAllowedMethod("String_Node_Str");
  source.registerCorsConfiguration("String_Node_Str",config);
  return new CorsFilter(source);
}

Fixed version (ground truth):
@Bean public CorsFilter corsFilter(){
  UrlBasedCorsConfigurationSource source=new UrlBasedCorsConfigurationSource();
  CorsConfiguration config=new CorsConfiguration();
  config.setAllowCredentials(true);
  config.addAllowedOrigin("String_Node_Str");
  config.addAllowedHeader("String_Node_Str");
  config.addExposedHeader(HttpHeaders.AUTHORIZATION);
  config.addExposedHeader(HttpHeaders.LOCATION);
  config.addAllowedMethod("String_Node_Str");
  source.registerCorsConfiguration("String_Node_Str",config);
  return new CorsFilter(source);
}
Program: 35533
Project: 35533
Buggy source:
public RequestDto map(Request request){
  RequestDto result=delegate.map(request);
  Authentication currentAuth=securityContextService.getLoggedInUser();
  if (result != null && currentAuth != null) {
    result.setLoggedInUserIsWatcher(request.getWatchers().contains(currentAuth.getName()));
  }
  return result;
}

Fixed version (ground truth):
public RequestDto map(Request request){
  RequestDto result=delegate.map(request);
  Authentication currentAuth=securityContextService.getLoggedInUser();
  if (result != null && currentAuth != null) {
    result.setLoggedInUserIsWatcher(request.getWatchers().contains(currentAuth.getName()));
  }
  result.setUserService(userService);
  return result;
}
Program: 35534
Project: 35534
Buggy source:
@Override @Cacheable("String_Node_Str") public UserDto getUser(String username){
  return map(adminRealmResource.users().get(username).toRepresentation());
}

Fixed version (ground truth):
@Override @Cacheable("String_Node_Str") public UserDto getUser(String username){
  UserResource userResource=adminRealmResource.users().get(username);
  try {
    return map(userResource.toRepresentation());
  }
 catch (  javax.ws.rs.NotFoundException e) {
    return null;
  }
}
Program: 35535
Project: 35535
Buggy source:
private UserDto map(UserRepresentation userRepresentation){
  UserDto u=new UserDto();
  u.setEmail(userRepresentation.getEmail());
  u.setName(userRepresentation.getFirstName() + "String_Node_Str" + userRepresentation.getLastName());
  if (userRepresentation.getAccess().containsKey("String_Node_Str") && userRepresentation.getAttributes().get("String_Node_Str").size() > 0 && StringUtils.isNotBlank(userRepresentation.getAttributes().get("String_Node_Str").get(0))) {
    u.setPicture(userRepresentation.getAttributes().get("String_Node_Str").get(0));
  }
 else   if (userRepresentation.getAttributes().containsKey("String_Node_Str")) {
    String mId=userRepresentation.getAttributes().get("String_Node_Str").get(0);
    u.setPicture("String_Node_Str" + mId + "String_Node_Str");
  }
  return u;
}

Fixed version (ground truth):
private UserDto map(UserRepresentation userRepresentation){
  if (userRepresentation != null) {
    UserDto u=new UserDto();
    u.setEmail(userRepresentation.getEmail());
    u.setName(userRepresentation.getFirstName() + "String_Node_Str" + userRepresentation.getLastName());
    if (userRepresentation.getAccess().containsKey("String_Node_Str") && userRepresentation.getAttributes().get("String_Node_Str").size() > 0 && StringUtils.isNotBlank(userRepresentation.getAttributes().get("String_Node_Str").get(0))) {
      u.setPicture(userRepresentation.getAttributes().get("String_Node_Str").get(0));
    }
 else     if (userRepresentation.getAttributes().containsKey("String_Node_Str")) {
      String mId=userRepresentation.getAttributes().get("String_Node_Str").get(0);
      u.setPicture("String_Node_Str" + mId + "String_Node_Str");
    }
    return u;
  }
 else {
    return null;
  }
}
Program: 35537
Project: 35537
Buggy source:
public void checkCollaboratorChanges(){
  if (isCollaboratorChanged()) {
    String oldCollaboratorType=currentCollaboratorType;
    initializeCurrentCollaboratorVariables();
    if (!(currentCollaboratorType.equals("String_Node_Str"))) {
      stdout.println("String_Node_Str");
      collaboratorContext=callbacks.createBurpCollaboratorClientContext();
      interactionServer.addNewCollaboratorContext(collaboratorContext);
      if (interactionServerNeverStarted) {
        interactionServer.resumeThread();
        interactionServerNeverStarted=false;
      }
    }
 else {
      collaboratorContext=null;
      stdout.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void checkCollaboratorChanges(){
  if (isCollaboratorChanged()) {
    initializeCurrentCollaboratorVariables();
    if (!(currentCollaboratorType.equals("String_Node_Str"))) {
      stdout.println("String_Node_Str");
      collaboratorContext=callbacks.createBurpCollaboratorClientContext();
      interactionServer.addNewCollaboratorContext(collaboratorContext);
    }
 else {
      collaboratorContext=null;
      stdout.println("String_Node_Str");
    }
  }
}
Program: 35539
Project: 35539
Buggy source:
public void run(){
  stdout.println("String_Node_Str");
  while (goOn) {
synchronized (pauseLock) {
      if (!goOn) {
        break;
      }
      if (paused) {
        try {
          pauseLock.wait();
        }
 catch (        InterruptedException e) {
          stderr.println("String_Node_Str");
          stderr.println(e.toString());
        }
        if (!goOn) {
          break;
        }
      }
    }
    for (int i=0; i < collaboratorContextList.size(); i++) {
      try {
        stdout.println("String_Node_Str" + collaboratorContextList.get(i).getCollaboratorServerLocation());
        List<IBurpCollaboratorInteraction> allCollaboratorInteractions=collaboratorContextList.get(i).fetchAllCollaboratorInteractions();
        for (int j=0; j < allCollaboratorInteractions.size(); j++) {
          addIssue(allCollaboratorInteractions.get(j),collaboratorContextList.get(i));
        }
      }
 catch (      IllegalStateException e) {
        stdout.println("String_Node_Str");
      }
    }
    try {
      Thread.sleep(pollingMilliseconds);
    }
 catch (    InterruptedException e) {
      stderr.println(e.toString());
    }
  }
}

Fixed version (ground truth):
public void run(){
  stdout.println("String_Node_Str");
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  long INTERVAL=MILLISECONDS.convert(3,MINUTES);
  Date lastPollingDate=null;
  while (goOn) {
synchronized (pauseLock) {
      if (!goOn) {
        break;
      }
      if (paused) {
        try {
          pauseLock.wait();
        }
 catch (        InterruptedException e) {
          stderr.println("String_Node_Str");
          stderr.println(e.toString());
        }
        if (!goOn) {
          break;
        }
      }
    }
    Date date=new Date();
    if (lastPollingDate == null || (date.getTime() - lastPollingDate.getTime()) > INTERVAL) {
      stdout.println("String_Node_Str" + dateFormat.format(date) + "String_Node_Str");
      for (int i=0; i < collaboratorContextList.size(); i++) {
        try {
          stdout.println("String_Node_Str" + collaboratorContextList.get(i).getCollaboratorServerLocation());
        }
 catch (        IllegalStateException e) {
          stdout.println("String_Node_Str");
        }
catch (        Exception f) {
          stdout.println("String_Node_Str");
          stdout.println(f.toString());
        }
      }
      stdout.println();
      lastPollingDate=date;
    }
    for (int i=0; i < collaboratorContextList.size(); i++) {
      try {
        List<IBurpCollaboratorInteraction> allCollaboratorInteractions=collaboratorContextList.get(i).fetchAllCollaboratorInteractions();
        for (int j=0; j < allCollaboratorInteractions.size(); j++) {
          addIssue(allCollaboratorInteractions.get(j),collaboratorContextList.get(i));
        }
      }
 catch (      IllegalStateException e) {
      }
catch (      Exception f) {
        stdout.println("String_Node_Str");
        stdout.println(f.toString());
      }
    }
    try {
      Thread.sleep(pollingMilliseconds);
    }
 catch (    InterruptedException e) {
      stderr.println(e.toString());
    }
  }
}
Program: 35543
Project: 35543
Buggy source:
private void setupAvatarForSession(String session){
  RelativeLayout relativeLayout=remoteRenderersLayout.findViewWithTag(session);
  if (relativeLayout != null) {
    ImageView avatarImageView=relativeLayout.findViewById(R.id.avatarImageView);
    if (participantMap.containsKey(session) && avatarImageView.getDrawable() == null) {
      int size=Math.round(getResources().getDimension(R.dimen.avatar_size_big));
      if (getActivity() != null) {
        GlideApp.with(getActivity()).asBitmap().diskCacheStrategy(DiskCacheStrategy.NONE).load(ApiUtils.getUrlForAvatarWithName(baseUrl,participantMap.get(session).getUserId(),R.dimen.avatar_size_big)).centerInside().override(size,size).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(avatarImageView);
      }
    }
  }
}

Fixed version (ground truth):
private void setupAvatarForSession(String session){
  if (remoteRenderersLayout != null) {
    RelativeLayout relativeLayout=remoteRenderersLayout.findViewWithTag(session);
    if (relativeLayout != null) {
      ImageView avatarImageView=relativeLayout.findViewById(R.id.avatarImageView);
      if (participantMap.containsKey(session) && avatarImageView.getDrawable() == null) {
        int size=Math.round(getResources().getDimension(R.dimen.avatar_size_big));
        if (getActivity() != null) {
          GlideApp.with(getActivity()).asBitmap().diskCacheStrategy(DiskCacheStrategy.NONE).load(ApiUtils.getUrlForAvatarWithName(baseUrl,participantMap.get(session).getUserId(),R.dimen.avatar_size_big)).centerInside().override(size,size).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(avatarImageView);
        }
      }
    }
  }
}
Program: 35544
Project: 35544
Buggy source:
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  eventBus.register(this);
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    remoteRenderersLayout.setOrientation(LinearLayout.HORIZONTAL);
  }
 else   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
    remoteRenderersLayout.setOrientation(LinearLayout.VERTICAL);
  }
}

Fixed version (ground truth):
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  eventBus.register(this);
}
Program: 35545
Project: 35545
Buggy source:
public static ImportAccount getInformationFromAccount(Account account){
  int lastAtPos=account.name.lastIndexOf("String_Node_Str");
  String urlString=account.name.substring(lastAtPos + 1);
  String username=account.name.substring(0,lastAtPos);
  Context context=NextcloudTalkApplication.getSharedApplication().getApplicationContext();
  final AccountManager accMgr=AccountManager.get(context);
  String password=accMgr.getPassword(account);
  if (urlString.endsWith("String_Node_Str")) {
    urlString=urlString.substring(0,urlString.length() - 1);
  }
  return new ImportAccount(username,password,urlString);
}

Fixed version (ground truth):
public static ImportAccount getInformationFromAccount(Account account){
  int lastAtPos=account.name.lastIndexOf("String_Node_Str");
  String urlString=account.name.substring(lastAtPos + 1);
  String username=account.name.substring(0,lastAtPos);
  Context context=NextcloudTalkApplication.getSharedApplication().getApplicationContext();
  final AccountManager accMgr=AccountManager.get(context);
  String password=null;
  try {
    password=accMgr.getPassword(account);
  }
 catch (  Exception exception) {
    Log.e(TAG,"String_Node_Str");
  }
  if (urlString.endsWith("String_Node_Str")) {
    urlString=urlString.substring(0,urlString.length() - 1);
  }
  return new ImportAccount(username,password,urlString);
}
Program: 35546
Project: 35546
Buggy source:
public static List<Account> findAccounts(List<UserEntity> userEntitiesList){
  Context context=NextcloudTalkApplication.getSharedApplication().getApplicationContext();
  final AccountManager accMgr=AccountManager.get(context);
  final Account[] accounts=accMgr.getAccountsByType(context.getString(R.string.nc_import_account_type));
  List<Account> accountsAvailable=new ArrayList<>();
  ImportAccount importAccount;
  UserEntity internalUserEntity;
  boolean accountFound;
  for (  Account account : accounts) {
    accountFound=false;
    for (int i=0; i < userEntitiesList.size(); i++) {
      internalUserEntity=userEntitiesList.get(i);
      importAccount=getInformationFromAccount(account);
      if (importAccount.getBaseUrl().startsWith("String_Node_Str") || importAccount.getBaseUrl().startsWith("String_Node_Str")) {
        if (internalUserEntity.getUsername().equals(importAccount.getUsername()) && internalUserEntity.getBaseUrl().equals(importAccount.getBaseUrl())) {
          accountFound=true;
          break;
        }
      }
 else {
        if (internalUserEntity.getUsername().equals(importAccount.getUsername()) && (internalUserEntity.getBaseUrl().equals("String_Node_Str" + importAccount.getBaseUrl()) || internalUserEntity.getBaseUrl().equals("String_Node_Str" + importAccount.getBaseUrl()))) {
          accountFound=true;
          break;
        }
      }
    }
    if (!accountFound) {
      accountsAvailable.add(account);
    }
  }
  return accountsAvailable;
}

Fixed version (ground truth):
public static List<Account> findAccounts(List<UserEntity> userEntitiesList){
  Context context=NextcloudTalkApplication.getSharedApplication().getApplicationContext();
  final AccountManager accMgr=AccountManager.get(context);
  final Account[] accounts=accMgr.getAccountsByType(context.getString(R.string.nc_import_account_type));
  List<Account> accountsAvailable=new ArrayList<>();
  ImportAccount importAccount;
  UserEntity internalUserEntity;
  boolean accountFound;
  for (  Account account : accounts) {
    accountFound=false;
    for (int i=0; i < userEntitiesList.size(); i++) {
      internalUserEntity=userEntitiesList.get(i);
      importAccount=getInformationFromAccount(account);
      if (importAccount.getToken() != null) {
        if (importAccount.getBaseUrl().startsWith("String_Node_Str") || importAccount.getBaseUrl().startsWith("String_Node_Str")) {
          if (internalUserEntity.getUsername().equals(importAccount.getUsername()) && internalUserEntity.getBaseUrl().equals(importAccount.getBaseUrl())) {
            accountFound=true;
            break;
          }
        }
 else {
          if (internalUserEntity.getUsername().equals(importAccount.getUsername()) && (internalUserEntity.getBaseUrl().equals("String_Node_Str" + importAccount.getBaseUrl()) || internalUserEntity.getBaseUrl().equals("String_Node_Str" + importAccount.getBaseUrl()))) {
            accountFound=true;
            break;
          }
        }
      }
 else {
        accountFound=true;
        break;
      }
    }
    if (!accountFound) {
      accountsAvailable.add(account);
    }
  }
  return accountsAvailable;
}
Program: 35547
Project: 35547
Buggy source:
@Override public void onNext(RoomsOverall roomsOverall){
  for (  Room room : roomsOverall.getOcs().getData()) {
    if (roomId.equals(room.getRoomId())) {
      currentRoom=room;
      conversationNameTextView.setText(currentRoom.getDisplayName());
      loadAvatar();
      checkIfAnyParticipantsRemainInRoom();
      showAnswerControls();
      break;
    }
  }
}

Fixed version (ground truth):
@Override public void onNext(RoomsOverall roomsOverall){
  for (  Room room : roomsOverall.getOcs().getData()) {
    if (roomId.equals(room.getRoomId())) {
      currentRoom=room;
      if (conversationNameTextView != null) {
        conversationNameTextView.setText(currentRoom.getDisplayName());
        loadAvatar();
        checkIfAnyParticipantsRemainInRoom();
        showAnswerControls();
      }
      break;
    }
  }
}
Program: 35548
Project: 35548
Buggy source:
private void handleFromNotification(){
  ncApi.getRooms(credentials,ApiUtils.getUrlForGetRooms(userBeingCalled.getBaseUrl())).subscribeOn(Schedulers.newThread()).retry(3).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<RoomsOverall>(){
    @Override public void onSubscribe(    Disposable d){
      disposablesList.add(d);
    }
    @Override public void onNext(    RoomsOverall roomsOverall){
      for (      Room room : roomsOverall.getOcs().getData()) {
        if (roomId.equals(room.getRoomId())) {
          currentRoom=room;
          conversationNameTextView.setText(currentRoom.getDisplayName());
          loadAvatar();
          checkIfAnyParticipantsRemainInRoom();
          showAnswerControls();
          break;
        }
      }
    }
    @Override public void onError(    Throwable e){
    }
    @Override public void onComplete(){
    }
  }
);
}

Fixed version (ground truth):
private void handleFromNotification(){
  ncApi.getRooms(credentials,ApiUtils.getUrlForGetRooms(userBeingCalled.getBaseUrl())).subscribeOn(Schedulers.newThread()).retry(3).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<RoomsOverall>(){
    @Override public void onSubscribe(    Disposable d){
      disposablesList.add(d);
    }
    @Override public void onNext(    RoomsOverall roomsOverall){
      for (      Room room : roomsOverall.getOcs().getData()) {
        if (roomId.equals(room.getRoomId())) {
          currentRoom=room;
          if (conversationNameTextView != null) {
            conversationNameTextView.setText(currentRoom.getDisplayName());
            loadAvatar();
            checkIfAnyParticipantsRemainInRoom();
            showAnswerControls();
          }
          break;
        }
      }
    }
    @Override public void onError(    Throwable e){
    }
    @Override public void onComplete(){
    }
  }
);
}
Program: 35549
Project: 35549
Buggy source:
@Override public boolean isGooglePlayServicesAvailable(){
  GoogleApiAvailability googleApiAvailability=GoogleApiAvailability.getInstance();
  int resultCode=googleApiAvailability.isGooglePlayServicesAvailable(context);
  return resultCode == ConnectionResult.SUCCESS;
}

Fixed version (ground truth):
@Override public boolean isGooglePlayServicesAvailable(){
  GoogleApiAvailability api=GoogleApiAvailability.getInstance();
  int code=api.isGooglePlayServicesAvailable(NextcloudTalkApplication.getSharedApplication().getApplicationContext());
  return code == ConnectionResult.SUCCESS;
}
Program: 35552
Project: 35552
Buggy source:
public static boolean isMessageWithSingleEmoticonOnly(@NonNull final Context context,@Nullable final CharSequence text){
  final List<EmoticonRange> result=new ArrayList<>();
  if (!TextUtils.isEmpty(text)) {
    final Matcher matcher=getRegex(context).matcher(text);
    while (matcher.find()) {
      String unicode=text.subSequence(matcher.start(),matcher.end()).toString();
      final Emoticon found=new Emoticon(unicode,R.drawable.emoji_food);
      result.add(new EmoticonRange(matcher.start(),matcher.end(),found));
    }
  }
 else {
    return false;
  }
  return result.size() == 1 && result.get(0).mStartPos == 0 && text.length() == result.get(0).mEndPos;
}

Fixed version (ground truth):
public static boolean isMessageWithSingleEmoticonOnly(@NonNull final Context context,@Nullable final CharSequence text){
  final List<EmoticonRange> result=new ArrayList<>();
  if (!TextUtils.isEmpty(text)) {
    String regexString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    final Matcher matcher=Pattern.compile(regexString,Pattern.UNICODE_CASE).matcher(text);
    while (matcher.find()) {
      String unicode=text.subSequence(matcher.start(),matcher.end()).toString();
      final Emoticon found=new Emoticon(unicode,R.drawable.emoji_food);
      result.add(new EmoticonRange(matcher.start(),matcher.end(),found));
    }
  }
 else {
    return false;
  }
  return result.size() == 1 && result.get(0).mStartPos == 0 && text.length() == result.get(0).mEndPos;
}
Program: 35553
Project: 35553
Buggy source:
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  if (getActionBar() != null) {
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
  ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
  ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser);
  if (mentionAutocomplete != null && mentionAutocomplete.isPopupShowing()) {
    mentionAutocomplete.dismissPopup();
  }
  if (getActivity() != null) {
    new KeyboardUtils(getActivity(),getView());
  }
}

Fixed version (ground truth):
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  if (getActionBar() != null) {
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
  ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
  ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser);
  if (mentionAutocomplete != null && mentionAutocomplete.isPopupShowing()) {
    mentionAutocomplete.dismissPopup();
  }
}
Program: 35554
Project: 35554
Buggy source:
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  if (getActionBar() != null) {
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
  ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
  ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser);
  if (mentionAutocomplete != null && mentionAutocomplete.isPopupShowing()) {
    mentionAutocomplete.dismissPopup();
  }
}

Fixed version (ground truth):
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  if (getActionBar() != null) {
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
  ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
  ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser);
  if (mentionAutocomplete != null && mentionAutocomplete.isPopupShowing()) {
    mentionAutocomplete.dismissPopup();
  }
  if (getActivity() != null) {
    new KeyboardUtils(getActivity(),getView());
  }
}
Program: 35555
Project: 35555
Buggy source:
public KeyboardUtils(Activity act,View contentView){
  this.decorView=act.getWindow().getDecorView();
  this.contentView=contentView;
  if (Build.VERSION.SDK_INT >= 19) {
    decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
  }
}

Fixed version (ground truth):
public KeyboardUtils(Activity act,View contentView){
  this.decorView=act.getWindow().getDecorView();
  this.contentView=contentView;
  decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
}
Program: 35556
Project: 35556
Buggy source:
public void enable(){
  if (Build.VERSION.SDK_INT >= 19) {
    decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
  }
}

Fixed version (ground truth):
public void enable(){
  decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
}
Program: 35557
Project: 35557
Buggy source:
public void disable(){
  if (Build.VERSION.SDK_INT >= 19) {
    decorView.getViewTreeObserver().removeOnGlobalLayoutListener(onGlobalLayoutListener);
  }
}

Fixed version (ground truth):
public void disable(){
  decorView.getViewTreeObserver().removeOnGlobalLayoutListener(onGlobalLayoutListener);
}
Program: 35558
Project: 35558
Buggy source:
@Override public void onGlobalLayout(){
  Rect r=new Rect();
  decorView.getWindowVisibleDisplayFrame(r);
  int height=decorView.getContext().getResources().getDisplayMetrics().heightPixels;
  int diff=height - r.bottom;
  if (diff != 0) {
    if (contentView.getPaddingBottom() != diff) {
      contentView.setPadding(0,0,0,diff);
    }
  }
 else {
    if (contentView.getPaddingBottom() != 0) {
      contentView.setPadding(0,0,0,0);
    }
  }
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  Rect r=new Rect();
  decorView.getWindowVisibleDisplayFrame(r);
  int height=decorView.getContext().getResources().getDisplayMetrics().heightPixels;
  int diff=height - r.bottom;
  if (diff > 0) {
    if (contentView.getPaddingBottom() != diff) {
      contentView.setPadding(0,0,0,diff);
    }
  }
 else {
    if (contentView.getPaddingBottom() != 0) {
      contentView.setPadding(0,0,0,0);
    }
  }
}
Program: 35559
Project: 35559
Buggy source:
private void checkPermissions(){
  if (isVoiceOnlyCall) {
    onMicrophoneClick();
  }
 else   if (getActivity() != null) {
    requestPermissions(PERMISSIONS_CALL,100);
  }
}

Fixed version (ground truth):
private void checkPermissions(){
  if (isVoiceOnlyCall) {
    onMicrophoneClick();
  }
 else   if (getActivity() != null) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
      requestPermissions(PERMISSIONS_CALL,100);
    }
 else {
      onRequestPermissionsResult(100,PERMISSIONS_CALL,new int[]{1});
    }
  }
}
Program: 35560
Project: 35560
Buggy source:
@OnClick(R.id.call_control_camera) public void onCameraClick(){
  if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
    videoOn=!videoOn;
    if (videoOn) {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_white_24px);
      if (cameraEnumerator.getDeviceNames().length > 1) {
        cameraSwitchButton.setVisibility(View.VISIBLE);
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraSwitchButton.setVisibility(View.GONE);
    }
    toggleMedia(videoOn,true);
  }
 else   if (getActivity() != null && EffortlessPermissions.somePermissionPermanentlyDenied(getActivity(),PERMISSIONS_CAMERA)) {
    OpenAppDetailsDialogFragment.show(R.string.nc_camera_permission_permanently_denied,R.string.nc_permissions_settings,(AppCompatActivity)getActivity());
  }
 else {
    requestPermissions(PERMISSIONS_CAMERA,100);
  }
}

Fixed version (ground truth):
@OnClick(R.id.call_control_camera) public void onCameraClick(){
  if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
    videoOn=!videoOn;
    if (videoOn) {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_white_24px);
      if (cameraEnumerator.getDeviceNames().length > 1) {
        cameraSwitchButton.setVisibility(View.VISIBLE);
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraSwitchButton.setVisibility(View.GONE);
    }
    toggleMedia(videoOn,true);
  }
 else   if (getActivity() != null && EffortlessPermissions.somePermissionPermanentlyDenied(getActivity(),PERMISSIONS_CAMERA)) {
    OpenAppDetailsDialogFragment.show(R.string.nc_camera_permission_permanently_denied,R.string.nc_permissions_settings,(AppCompatActivity)getActivity());
  }
 else {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
      requestPermissions(PERMISSIONS_CAMERA,100);
    }
 else {
      onRequestPermissionsResult(100,PERMISSIONS_CAMERA,new int[]{1});
    }
  }
}
Program: 35562
Project: 35562
Buggy source:
@Override public void onBackPressed(){
  if (!router.handleBack()) {
    super.onBackPressed();
  }
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  finish();
}
Program: 35564
Project: 35564
Buggy source:
private void checkIfSomeAreApproved(){
  if (!isVoiceOnlyCall) {
    if (cameraEnumerator.getDeviceNames().length == 0) {
      cameraControlButton.setVisibility(View.GONE);
    }
    if (cameraEnumerator.getDeviceNames().length > 1) {
      cameraSwitchButton.setVisibility(View.VISIBLE);
    }
    if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
      if (!videoOn) {
        onCameraClick();
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraControlButton.setAlpha(0.7f);
      cameraSwitchButton.setVisibility(View.GONE);
    }
  }
  if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_MICROPHONE)) {
    if (!audioOn) {
      onMicrophoneClick();
    }
  }
 else {
    microphoneControlButton.getFrontImageView().setImageResource(R.drawable.ic_mic_off_white_24px);
  }
  if (!inCall) {
    startCall();
  }
}

Fixed version (ground truth):
private void checkIfSomeAreApproved(){
  if (!isVoiceOnlyCall) {
    if (cameraEnumerator.getDeviceNames().length == 0) {
      cameraControlButton.setVisibility(View.GONE);
    }
    if (cameraEnumerator.getDeviceNames().length > 1) {
      cameraSwitchButton.setVisibility(View.VISIBLE);
    }
    if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
      if (!videoOn) {
        onCameraClick();
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraControlButton.setAlpha(0.7f);
      cameraSwitchButton.setVisibility(View.GONE);
    }
  }
  if (EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_MICROPHONE)) {
    if (!audioOn) {
      onMicrophoneClick();
    }
  }
 else {
    microphoneControlButton.getFrontImageView().setImageResource(R.drawable.ic_mic_off_white_24px);
  }
  if (!inCall) {
    startCall();
  }
}
Program: 35565
Project: 35565
Buggy source:
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  eventBus.register(this);
}

Fixed version (ground truth):
@Override protected void onAttach(@NonNull View view){
  super.onAttach(view);
  eventBus.register(this);
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    remoteRenderersLayout.setOrientation(LinearLayout.HORIZONTAL);
  }
 else   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
    remoteRenderersLayout.setOrientation(LinearLayout.VERTICAL);
  }
}
Program: 35566
Project: 35566
Buggy source:
private void checkPermissions(){
  if (isVoiceOnlyCall) {
    onMicrophoneClick();
  }
 else   if (getActivity() != null) {
    EffortlessPermissions.requestPermissions(getActivity(),R.string.nc_permissions,R.string.nc_proceed,R.string.nc_empty,100,PERMISSIONS_CALL);
  }
}

Fixed version (ground truth):
private void checkPermissions(){
  if (isVoiceOnlyCall) {
    onMicrophoneClick();
  }
 else   if (getActivity() != null) {
    requestPermissions(PERMISSIONS_CALL,100);
  }
}
Program: 35567
Project: 35567
Buggy source:
@OnClick(R.id.call_control_camera) public void onCameraClick(){
  if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
    videoOn=!videoOn;
    if (videoOn) {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_white_24px);
      if (cameraEnumerator.getDeviceNames().length > 1) {
        cameraSwitchButton.setVisibility(View.VISIBLE);
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraSwitchButton.setVisibility(View.GONE);
    }
    toggleMedia(videoOn,true);
  }
 else   if (getActivity() != null && EffortlessPermissions.somePermissionPermanentlyDenied(getActivity(),PERMISSIONS_CAMERA)) {
    OpenAppDetailsDialogFragment.show(R.string.nc_camera_permission_permanently_denied,R.string.nc_permissions_settings,(AppCompatActivity)getActivity());
  }
 else {
    if (getActivity() != null) {
      EffortlessPermissions.requestPermissions(getActivity(),R.string.nc_permissions_video,R.string.nc_proceed,R.string.nc_empty,100,PERMISSIONS_CAMERA);
    }
  }
}

Fixed version (ground truth):
@OnClick(R.id.call_control_camera) public void onCameraClick(){
  if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(),PERMISSIONS_CAMERA)) {
    videoOn=!videoOn;
    if (videoOn) {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_white_24px);
      if (cameraEnumerator.getDeviceNames().length > 1) {
        cameraSwitchButton.setVisibility(View.VISIBLE);
      }
    }
 else {
      cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
      cameraSwitchButton.setVisibility(View.GONE);
    }
    toggleMedia(videoOn,true);
  }
 else   if (getActivity() != null && EffortlessPermissions.somePermissionPermanentlyDenied(getActivity(),PERMISSIONS_CAMERA)) {
    OpenAppDetailsDialogFragment.show(R.string.nc_camera_permission_permanently_denied,R.string.nc_permissions_settings,(AppCompatActivity)getActivity());
  }
 else {
    requestPermissions(PERMISSIONS_CAMERA,100);
  }
}
Program: 35569
Project: 35569
Buggy source:
private void removeMediaStream(String sessionId){
  if (remoteRenderersLayout != null && remoteRenderersLayout.getChildCount() > 0) {
    RelativeLayout relativeLayout=remoteRenderersLayout.findViewWithTag(sessionId);
    if (relativeLayout != null) {
      SurfaceViewRenderer surfaceViewRenderer=relativeLayout.findViewById(R.id.surface_view);
      surfaceViewRenderer.release();
      remoteRenderersLayout.removeView(relativeLayout);
      remoteRenderersLayout.invalidate();
    }
  }
  callControls.setZ(100.0f);
}

Fixed version (ground truth):
private void removeMediaStream(String sessionId){
  if (remoteRenderersLayout != null && remoteRenderersLayout.getChildCount() > 0) {
    RelativeLayout relativeLayout=remoteRenderersLayout.findViewWithTag(sessionId);
    if (relativeLayout != null) {
      SurfaceViewRenderer surfaceViewRenderer=relativeLayout.findViewById(R.id.surface_view);
      surfaceViewRenderer.release();
      remoteRenderersLayout.removeView(relativeLayout);
      remoteRenderersLayout.invalidate();
    }
  }
  if (callControls != null) {
    callControls.setZ(100.0f);
  }
}