nus-yam/ex-repair huggingface dataset:
Program: 160184
Project: 160184
Buggy source:
public PostBuilder(){
  this.title="String_Node_Str";
  this.author=new MemberProfile();
  this.author.setUsername("String_Node_Str");
  this.category=PostCategory.ENGINEERING;
  this.rawContent="String_Node_Str";
  this.renderedContent="String_Node_Str";
  this.renderedSummary="String_Node_Str";
  this.broadcast=false;
  this.publishAt=new Date(System.currentTimeMillis() - 24 * 60 * 60* 1000);
  this.draft=false;
}

Fixed version (ground truth):
public PostBuilder(){
  this.title="String_Node_Str";
  this.author=new MemberProfile();
  this.author.setUsername("String_Node_Str");
  this.category=PostCategory.ENGINEERING;
  this.rawContent="String_Node_Str";
  this.renderedContent="String_Node_Str";
  this.renderedSummary="String_Node_Str";
  this.broadcast=false;
  this.publishAt=new Date(System.currentTimeMillis());
  this.draft=false;
}
Program: 160185
Project: 160185
Buggy source:
@Test public void containsBlogPostFields() throws Exception {
  Post post=PostBuilder.post().category(PostCategory.ENGINEERING).isBroadcast().build();
  postRepository.save(post);
  ResultActions resultActions=mockMvc.perform(get("String_Node_Str"));
  MvcResult mvcResult=resultActions.andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith("String_Node_Str")).andReturn();
  assertThat(mvcResult.getResponse().getCharacterEncoding(),equalTo("String_Node_Str"));
  String atomFeed=mvcResult.getResponse().getContentAsString();
  assertThat(atomFeed,containsString(post.getTitle()));
  assertThat(atomFeed,containsString(post.getRenderedContent()));
  String postDate=new SimpleDateFormat("String_Node_Str").format(post.getCreatedAt());
  assertThat(atomFeed,containsString(postDate));
  assertThat(atomFeed,containsString("String_Node_Str" + post.getPublicSlug()));
  assertThat(atomFeed,containsString(PostCategory.ENGINEERING.getDisplayName()));
  assertThat(atomFeed,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void containsBlogPostFields() throws Exception {
  Post post=PostBuilder.post().category(PostCategory.ENGINEERING).isBroadcast().build();
  postRepository.save(post);
  ResultActions resultActions=mockMvc.perform(get("String_Node_Str"));
  MvcResult mvcResult=resultActions.andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith("String_Node_Str")).andReturn();
  assertThat(mvcResult.getResponse().getCharacterEncoding(),equalTo("String_Node_Str"));
  String atomFeed=mvcResult.getResponse().getContentAsString();
  assertThat(atomFeed,containsString(post.getTitle()));
  assertThat(atomFeed,containsString(post.getRenderedContent()));
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeUtil.UTC);
  String postDate=dateFormat.format(post.getCreatedAt());
  assertThat(atomFeed,containsString(postDate));
  assertThat(atomFeed,containsString("String_Node_Str" + post.getPublicSlug()));
  assertThat(atomFeed,containsString(PostCategory.ENGINEERING.getDisplayName()));
  assertThat(atomFeed,containsString("String_Node_Str"));
}
Program: 160186
Project: 160186
Buggy source:
private void setId(Post post,Entry entry,HttpServletRequest request){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(UTC);
  String dateString=dateFormat.format(post.getCreatedAt());
  String host=request.getServerName();
  String id=String.format("String_Node_Str",host,dateString,post.getId());
  entry.setId(id);
}

Fixed version (ground truth):
private void setId(Post post,Entry entry,HttpServletRequest request){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(TimeUtil.UTC);
  String dateString=dateFormat.format(post.getCreatedAt());
  String host=request.getServerName();
  String id=String.format("String_Node_Str",host,dateString,post.getId());
  entry.setId(id);
}
Program: 160187
Project: 160187
Buggy source:
@Override public int compare(JsonElement o1,JsonElement o2){
  String term1=o1.getAsJsonObject().get("String_Node_Str").getAsString();
  String term2=o2.getAsJsonObject().get("String_Node_Str").getAsString();
  return term1.compareTo(term2);
}

Fixed version (ground truth):
@Override public int compare(JsonElement o1,JsonElement o2){
  String term1=o1.getAsJsonObject().get("String_Node_Str").getAsString().replace("String_Node_Str","String_Node_Str");
  String term2=o2.getAsJsonObject().get("String_Node_Str").getAsString().replace("String_Node_Str","String_Node_Str");
  return term1.compareTo(term2);
}
Program: 160188
Project: 160188
Buggy source:
private List<JsonElement> sortedTermElements(JsonArray termArray){
  ArrayList<JsonElement> list=Lists.newArrayList(termArray);
  Collections.sort(list,new Comparator<JsonElement>(){
    @Override public int compare(    JsonElement o1,    JsonElement o2){
      String term1=o1.getAsJsonObject().get("String_Node_Str").getAsString();
      String term2=o2.getAsJsonObject().get("String_Node_Str").getAsString();
      return term1.compareTo(term2);
    }
  }
);
  return list;
}

Fixed version (ground truth):
private List<JsonElement> sortedTermElements(JsonArray termArray){
  ArrayList<JsonElement> list=Lists.newArrayList(termArray);
  Collections.sort(list,new Comparator<JsonElement>(){
    @Override public int compare(    JsonElement o1,    JsonElement o2){
      String term1=o1.getAsJsonObject().get("String_Node_Str").getAsString().replace("String_Node_Str","String_Node_Str");
      String term2=o2.getAsJsonObject().get("String_Node_Str").getAsString().replace("String_Node_Str","String_Node_Str");
      return term1.compareTo(term2);
    }
  }
);
  return list;
}
Program: 160189
Project: 160189
Buggy source:
@Test public void returnNestedFacets(){
  SearchFacet guidesFacet=searchResults.getFacets().get(0);
  assertThat(guidesFacet.getFacets().size(),equalTo(3));
}

Fixed version (ground truth):
@Test public void returnNestedFacets(){
  SearchFacet guidesFacet=searchResults.getFacets().get(0);
  assertThat(guidesFacet.getFacets().size(),equalTo(3));
  SearchFacet projectsFacet=searchResults.getFacets().get(1);
  List<SearchFacet> projectsFacetFacets=projectsFacet.getFacets();
  assertThat(projectsFacetFacets.size(),equalTo(4));
  assertThat(projectsFacetFacets.get(0).getName(),equalTo("String_Node_Str"));
  assertThat(projectsFacetFacets.get(1).getName(),equalTo("String_Node_Str"));
  assertThat(projectsFacetFacets.get(2).getName(),equalTo("String_Node_Str"));
  assertThat(projectsFacetFacets.get(3).getName(),equalTo("String_Node_Str"));
}
Program: 160190
Project: 160190
Buggy source:
public void updateMemberProfile(String memberId,MemberProfile profile){
  MemberProfile existingProfile=fetchMemberProfile(memberId);
  existingProfile.setSpeakerdeckUsername(profile.getSpeakerdeckUsername());
  existingProfile.setTwitterUsername(profile.getTwitterUsername());
  existingProfile.setBio(profile.getBio());
  existingProfile.setName(profile.getName());
  existingProfile.setGithubUsername(profile.getGithubUsername());
  existingProfile.setTwitterUsername(profile.getTwitterUsername());
  existingProfile.setSpeakerdeckUsername(profile.getSpeakerdeckUsername());
  existingProfile.setLanyrdUsername(profile.getLanyrdUsername());
  existingProfile.setLocation(profile.getLocation());
  existingProfile.setGeoLocation(profile.getGeoLocation());
  existingProfile.setVideoEmbeds(profile.getVideoEmbeds());
  existingProfile.setGravatarEmail(profile.getGravatarEmail());
  if (!StringUtils.isEmpty(profile.getGravatarEmail())) {
    PasswordEncoder encoder=new Md5PasswordEncoder();
    String hashedEmail=encoder.encodePassword(profile.getGravatarEmail(),null);
    existingProfile.setAvatarUrl(String.format("String_Node_Str",hashedEmail));
  }
  teamRepository.save(existingProfile);
  try {
    searchService.saveToIndex(mapper.map(existingProfile));
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + existingProfile.getMemberId(),e);
  }
}

Fixed version (ground truth):
public void updateMemberProfile(String memberId,MemberProfile profile){
  MemberProfile existingProfile=fetchMemberProfile(memberId);
  existingProfile.setSpeakerdeckUsername(profile.getSpeakerdeckUsername());
  existingProfile.setTwitterUsername(profile.getTwitterUsername());
  existingProfile.setBio(profile.getBio());
  existingProfile.setName(profile.getName());
  existingProfile.setTwitterUsername(profile.getTwitterUsername());
  existingProfile.setSpeakerdeckUsername(profile.getSpeakerdeckUsername());
  existingProfile.setLanyrdUsername(profile.getLanyrdUsername());
  existingProfile.setLocation(profile.getLocation());
  existingProfile.setGeoLocation(profile.getGeoLocation());
  existingProfile.setVideoEmbeds(profile.getVideoEmbeds());
  existingProfile.setGravatarEmail(profile.getGravatarEmail());
  if (!StringUtils.isEmpty(profile.getGravatarEmail())) {
    PasswordEncoder encoder=new Md5PasswordEncoder();
    String hashedEmail=encoder.encodePassword(profile.getGravatarEmail(),null);
    existingProfile.setAvatarUrl(String.format("String_Node_Str",hashedEmail));
  }
  teamRepository.save(existingProfile);
  try {
    searchService.saveToIndex(mapper.map(existingProfile));
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + existingProfile.getMemberId(),e);
  }
}
Program: 160192
Project: 160192
Buggy source:
@Autowired public StaticPageIndexer(CrawlerService crawlerService,SearchService searchService,StaticPageMapper staticPageMapper){
  this.crawlerService=crawlerService;
  this.staticPageMapper=staticPageMapper;
  this.documentProcessor=new CrawledWebDocumentProcessor(searchService,new WebDocumentSearchEntryMapper());
}

Fixed version (ground truth):
@Autowired public StaticPageIndexer(CrawlerService crawlerService,SearchService searchService,StaticPageMapper staticPageMapper){
  this.crawlerService=crawlerService;
  this.staticPageMapper=staticPageMapper;
  this.documentProcessor=new CrawledWebDocumentProcessor(searchService,new LocalStaticPagesSearchEntryMapper());
}
Program: 160193
Project: 160193
Buggy source:
@Autowired public ToolsIndexer(CrawlerService crawlerService,SearchService searchService){
  this.crawlerService=crawlerService;
  this.documentProcessor=new CrawledWebDocumentProcessor(searchService,new WebDocumentSearchEntryMapper());
}

Fixed version (ground truth):
@Autowired public ToolsIndexer(CrawlerService crawlerService,SearchService searchService){
  this.crawlerService=crawlerService;
  this.documentProcessor=new CrawledWebDocumentProcessor(searchService,new LocalStaticPagesSearchEntryMapper());
}
Program: 160194
Project: 160194
Buggy source:
@Override public void addViewControllers(ViewControllerRegistry registry){
  try {
    for (    StaticPageMapper.StaticPageMapping mapping : this.staticPageMapper.staticPagePaths()) {
      registry.addViewController(mapping.getUrlPath()).setViewName("String_Node_Str" + mapping.getFilePath());
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void addViewControllers(ViewControllerRegistry registry){
  try {
    for (    StaticPageMapper.StaticPageMapping mapping : this.staticPageMapper.staticPagePaths()) {
      String urlPath=mapping.getUrlPath();
      registry.addViewController(urlPath).setViewName("String_Node_Str" + mapping.getFilePath());
      if (!urlPath.isEmpty()) {
        registry.addViewController(urlPath + "String_Node_Str").setViewName("String_Node_Str" + mapping.getFilePath());
      }
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 160195
Project: 160195
Buggy source:
private QueryBuilder addFiltersByFacets(List<String> filters,QueryBuilder query){
  if (!filters.isEmpty()) {
    TermsFilterBuilder termsFilterBuilder=new TermsFilterBuilder("String_Node_Str",filters).execution("String_Node_Str");
    query=QueryBuilders.filteredQuery(query,termsFilterBuilder);
  }
  return query;
}

Fixed version (ground truth):
private QueryBuilder addFiltersByFacets(List<String> filters,QueryBuilder query){
  if (filters != null && !filters.isEmpty()) {
    TermsFilterBuilder termsFilterBuilder=new TermsFilterBuilder("String_Node_Str",filters).execution("String_Node_Str");
    query=QueryBuilders.filteredQuery(query,termsFilterBuilder);
  }
  return query;
}
Program: 160196
Project: 160196
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void search_providesAllResultsForBlankQuery(){
  SearchForm searchForm=new SearchForm();
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((List<SearchResult>)this.model.get("String_Node_Str"),equalTo(this.entries));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void search_providesAllResultsForBlankQuery(){
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((List<SearchResult>)this.model.get("String_Node_Str"),equalTo(this.entries));
}
Program: 160197
Project: 160197
Buggy source:
@Test public void search_providesQueryInModel(){
  SearchForm searchForm=new SearchForm();
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((SearchForm)this.model.get("String_Node_Str"),equalTo(searchForm));
}

Fixed version (ground truth):
@Test public void search_providesQueryInModel(){
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((SearchForm)this.model.get("String_Node_Str"),equalTo(searchForm));
}
Program: 160198
Project: 160198
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void search_providesResultsInModel(){
  SearchForm searchForm=new SearchForm();
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((List<SearchResult>)this.model.get("String_Node_Str"),equalTo(this.entries));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void search_providesResultsInModel(){
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat((List<SearchResult>)this.model.get("String_Node_Str"),equalTo(this.entries));
}
Program: 160199
Project: 160199
Buggy source:
@Test public void search_providesPaginationInfoInModel(){
  SearchForm searchForm=new SearchForm();
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat(this.model.get("String_Node_Str"),is(notNullValue()));
}

Fixed version (ground truth):
@Test public void search_providesPaginationInfoInModel(){
  searchForm.setQ("String_Node_Str");
  this.controller.search(searchForm,1,this.model);
  assertThat(this.model.get("String_Node_Str"),is(notNullValue()));
}
Program: 160200
Project: 160200
Buggy source:
@RequestMapping(value="String_Node_Str",method={GET,HEAD}) public String showPost(@PathVariable Long postId,@PathVariable String slug,Model model){
  model.addAttribute("String_Node_Str",service.getPost(postId));
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method={GET,HEAD}) public String showPost(@PathVariable Long postId,@PathVariable String slug,Model model){
  model.addAttribute("String_Node_Str",postViewFactory.createPostView(service.getPost(postId)));
  return "String_Node_Str";
}
Program: 160201
Project: 160201
Buggy source:
@PostConstruct public void deleteSearchIndex() throws Exception {
  ElasticsearchTemplate elasticsearchTemplate=new ElasticsearchTemplate(elasticSearchClient());
  elasticsearchTemplate.deleteIndex(Post.class);
  elasticsearchTemplate.createIndex(Post.class);
}

Fixed version (ground truth):
@PostConstruct public void deleteSearchIndex() throws Exception {
  ElasticsearchTemplate elasticsearchTemplate=new ElasticsearchTemplate(elasticSearchClient());
  elasticsearchTemplate.deleteIndex(Post.class);
  elasticsearchTemplate.createIndex(Post.class);
  elasticsearchTemplate.putMapping(Post.class);
  elasticsearchTemplate.refresh(Post.class,false);
}
Program: 160202
Project: 160202
Buggy source:
@Test public void showPostModel(){
  Post post=PostBuilder.post().build();
  when(blogService.getPost(post.getId())).thenReturn(post);
  controller.showPost(post.getId(),"String_Node_Str",model);
  assertThat((Post)model.get("String_Node_Str"),is(post));
}

Fixed version (ground truth):
@Test public void showPostModel(){
  Post post=PostBuilder.post().build();
  when(blogService.getPost(post.getId())).thenReturn(post);
  controller.showPost(post.getId(),"String_Node_Str",model);
  PostView view=(PostView)model.get("String_Node_Str");
  assertThat(view,is(notNullValue()));
}
Program: 160203
Project: 160203
Buggy source:
@Override public List<Guide> listGuides(){
  ObjectMapper mapper=new ObjectMapper();
  try {
    InputStream json=new ClassPathResource("String_Node_Str",getClass()).getInputStream();
    return mapper.readValue(json,new TypeReference<List<Guide>>(){
    }
);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public List<Guide> listGuides(){
  ObjectMapper mapper=new ObjectMapper();
  try {
    String reposJson="String_Node_Str";
    InputStream json=new ClassPathResource(reposJson,getClass()).getInputStream();
    return mapper.readValue(json,new TypeReference<List<Guide>>(){
    }
);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 160205
Project: 160205
Buggy source:
public CustomColourDialog(final Context context){
  super(context);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  this.setContentView(R.layout.customcolourdialog);
  this.setCancelable(false);
  Button closeButton=(Button)this.findViewById(R.id.returnColourDialog);
  closeButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      dismiss();
    }
  }
);
  saveButton=(Button)this.findViewById(R.id.shareColourDialog);
  rSeekBar=(SeekBar)findViewById(R.id.rSeekBar);
  rSeekBar.setMax(255);
  rSeekBar.setProgress(111);
  rSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
  gSeekBar=(SeekBar)findViewById(R.id.gSeekBar);
  gSeekBar.setMax(255);
  gSeekBar.setProgress(111);
  gSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
  bSeekBar=(SeekBar)findViewById(R.id.bSeekBar);
  bSeekBar.setMax(255);
  bSeekBar.setProgress(111);
  bSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
}

Fixed version (ground truth):
public CustomColourDialog(final Context context){
  super(context);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  this.setContentView(R.layout.customcolourdialog);
  this.setCancelable(false);
  Button closeButton=(Button)this.findViewById(R.id.returnColourDialog);
  closeButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      dismiss();
    }
  }
);
  saveButton=(Button)this.findViewById(R.id.shareColourDialog);
  rSeekBar=(SeekBar)findViewById(R.id.rSeekBar);
  rSeekBar.setMax(255);
  rSeekBar.setProgress(111);
  rSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
  gSeekBar=(SeekBar)findViewById(R.id.gSeekBar);
  gSeekBar.setMax(255);
  gSeekBar.setProgress(111);
  gSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
  bSeekBar=(SeekBar)findViewById(R.id.bSeekBar);
  bSeekBar.setMax(255);
  bSeekBar.setProgress(111);
  bSeekBar.setOnSeekBarChangeListener(rgbOnSeekBarListener());
  calculateRGB();
}
Program: 160207
Project: 160207
Buggy source:
@Override public void onClick(View arg0){
  squareFragment.squareProgressBar.setHoloColor(integer);
  selectItem(position);
}

Fixed version (ground truth):
@Override public void onClick(View arg0){
  squareFragment.squareProgressBar.setHoloColor(integer);
  selectItem(position);
  lastPosition=position;
}
Program: 160208
Project: 160208
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if ((position != 0) && (position != 11) && (position != 13)&& (position != 17)) {
    selectItem(position);
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if ((position != 0) && (position != 11) && (position != 13)&& (position != 17)) {
    selectItem(position);
  }
 else {
    selectItem(lastPosition);
  }
}
Program: 160210
Project: 160210
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final SquareProgressBar squareProgressBar=(SquareProgressBar)findViewById(R.id.subi2);
  squareProgressBar.setImage(R.drawable.house);
  squareProgressBar.setColor(getApplicationContext().getResources().getColor(android.R.color.holo_blue_dark));
  Button change=(Button)findViewById(R.id.button2);
  change.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (darth) {
        squareProgressBar.setImage(R.drawable.house);
        darth=false;
      }
 else {
        squareProgressBar.setImage(R.drawable.darth);
        darth=true;
      }
    }
  }
);
  SeekBar seekBar=(SeekBar)findViewById(R.id.seekBar1);
  seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      squareProgressBar.setProgress(progress);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final SquareProgressBar squareProgressBar=(SquareProgressBar)findViewById(R.id.subi2);
  squareProgressBar.setImage(R.drawable.house);
  squareProgressBar.setColor(getApplicationContext().getResources().getColor(android.R.color.holo_blue_dark));
  squareProgressBar.setProgress(90);
  Button change=(Button)findViewById(R.id.button2);
  change.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (darth) {
        squareProgressBar.setImage(R.drawable.house);
        darth=false;
      }
 else {
        squareProgressBar.setImage(R.drawable.darth);
        darth=true;
      }
    }
  }
);
  SeekBar seekBar=(SeekBar)findViewById(R.id.seekBar1);
  seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      squareProgressBar.setProgress(progress);
    }
  }
);
}
Program: 160211
Project: 160211
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final SquareProgressBar squareProgressBar=(SquareProgressBar)findViewById(R.id.subi2);
  squareProgressBar.setImage(R.drawable.house);
  squareProgressBar.setColor(getApplicationContext().getResources().getColor(android.R.color.holo_blue_dark));
  squareProgressBar.setProgress(90);
  Button change=(Button)findViewById(R.id.button2);
  change.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (darth) {
        squareProgressBar.setImage(R.drawable.house);
        darth=false;
      }
 else {
        squareProgressBar.setImage(R.drawable.darth);
        darth=true;
      }
    }
  }
);
  SeekBar seekBar=(SeekBar)findViewById(R.id.seekBar1);
  seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      squareProgressBar.setProgress(progress);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final SquareProgressBar squareProgressBar=(SquareProgressBar)findViewById(R.id.subi2);
  squareProgressBar.setImage(R.drawable.house);
  squareProgressBar.setColor(getApplicationContext().getResources().getColor(android.R.color.holo_blue_dark));
  squareProgressBar.setProgress(25);
  Button change=(Button)findViewById(R.id.button2);
  change.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (darth) {
        squareProgressBar.setImage(R.drawable.house);
        darth=false;
      }
 else {
        squareProgressBar.setImage(R.drawable.darth);
        darth=true;
      }
    }
  }
);
  SeekBar seekBar=(SeekBar)findViewById(R.id.seekBar1);
  seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      squareProgressBar.setProgress(progress);
    }
  }
);
}
Program: 160212
Project: 160212
Buggy source:
private CustomViewGroup(Context context){
  super(context);
  this.setOrientation(VERTICAL);
  this.setGravity(Gravity.CENTER);
  this.setWeightSum(3);
  this.textView=new TextView(context);
  this.imageView=new ImageView(context);
  this.button=new Button(context);
  LinearLayout.LayoutParams layoutParams=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,0,1);
  this.textView.setLayoutParams(layoutParams);
  this.imageView.setLayoutParams(layoutParams);
  this.button.setLayoutParams(layoutParams);
  this.textView.setGravity(Gravity.CENTER);
  this.imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
  this.button.setText("String_Node_Str");
  this.button.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
      view.getContext().startActivity(i);
    }
  }
);
  this.addView(this.textView);
  this.addView(this.imageView);
  this.addView(this.button);
}

Fixed version (ground truth):
private CustomViewGroup(Context context){
  super(context);
  this.setOrientation(VERTICAL);
  this.textView=new TextView(context);
  this.imageView=new ImageView(context);
  this.button=new Button(context);
  LinearLayout.LayoutParams layoutParams=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  this.textView.setLayoutParams(layoutParams);
  this.imageView.setLayoutParams(layoutParams);
  this.button.setLayoutParams(layoutParams);
  this.textView.setGravity(Gravity.CENTER);
  this.imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
  this.imageView.setAdjustViewBounds(true);
  this.button.setText("String_Node_Str");
  this.button.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
      view.getContext().startActivity(i);
    }
  }
);
  this.addView(this.textView);
  this.addView(this.imageView);
  this.addView(this.button);
}
Program: 160213
Project: 160213
Buggy source:
@Override protected boolean getChildStaticTransformation(View child,Transformation t){
  FancyCoverFlowItemWrapper item=(FancyCoverFlowItemWrapper)child;
  if (android.os.Build.VERSION.SDK_INT >= 16) {
    item.invalidate();
  }
  final int coverFlowCenter=this.getWidth() / 2;
  final int childCenter=item.getLeft() + item.getWidth() / 2;
  final int childWidth=item.getWidth();
  final int childHeight=item.getWidth();
  final float effectsAmount=Math.min(1.0f,Math.max(-1.0f,(1.0f / this.actionDistance) * (childCenter - coverFlowCenter)));
  final int rotationAngle=(int)(-effectsAmount * this.maxRotation);
  final float zoomAmount=1 - this.maxScaleDown * Math.abs(effectsAmount);
  final float alphaAmount=(this.unselectedAlpha - 1) * Math.abs(effectsAmount) + 1;
  final float saturationAmount=(this.unselectedSaturation - 1) * Math.abs(effectsAmount) + 1;
  t.clear();
  t.setTransformationType(Transformation.TYPE_BOTH);
  t.setAlpha(alphaAmount);
  item.setSaturation(saturationAmount);
  final Matrix imageMatrix=t.getMatrix();
  this.transformationCamera.save();
  this.transformationCamera.rotateY(rotationAngle);
  this.transformationCamera.getMatrix(imageMatrix);
  this.transformationCamera.restore();
  imageMatrix.preTranslate(-childWidth / 2.0f,-childHeight / 2.0f);
  imageMatrix.postScale(zoomAmount,zoomAmount);
  imageMatrix.postTranslate(childWidth / 2.0f,childHeight / 2.0f);
  return true;
}

Fixed version (ground truth):
@Override protected boolean getChildStaticTransformation(View child,Transformation t){
  FancyCoverFlowItemWrapper item=(FancyCoverFlowItemWrapper)child;
  if (android.os.Build.VERSION.SDK_INT >= 16) {
    item.invalidate();
  }
  final int coverFlowCenter=this.getWidth() / 2;
  final int childWidth=item.getWidth();
  final int childHeight=item.getHeight();
  final int childCenter=item.getLeft() + childWidth / 2;
  final float effectsAmount=Math.min(1.0f,Math.max(-1.0f,(1.0f / this.actionDistance) * (childCenter - coverFlowCenter)));
  final int rotationAngle=(int)(-effectsAmount * this.maxRotation);
  final float zoomAmount=1 - this.maxScaleDown * Math.abs(effectsAmount);
  final float alphaAmount=(this.unselectedAlpha - 1) * Math.abs(effectsAmount) + 1;
  final float saturationAmount=(this.unselectedSaturation - 1) * Math.abs(effectsAmount) + 1;
  t.clear();
  t.setTransformationType(Transformation.TYPE_BOTH);
  t.setAlpha(alphaAmount);
  item.setSaturation(saturationAmount);
  final Matrix imageMatrix=t.getMatrix();
  this.transformationCamera.save();
  this.transformationCamera.rotateY(rotationAngle);
  this.transformationCamera.getMatrix(imageMatrix);
  this.transformationCamera.restore();
  imageMatrix.preTranslate(-childWidth / 2.0f,-childHeight / 2.0f);
  imageMatrix.postScale(zoomAmount,zoomAmount);
  imageMatrix.postTranslate(childWidth / 2.0f,childHeight / 2.0f);
  return true;
}
Program: 160215
Project: 160215
Buggy source:
protected ReplicatorConfiguration.Builder makeConfig(boolean push,boolean pull,boolean continuous,Database db,URI targetURI) throws URISyntaxException {
  URLEndpoint endpoint=new URLEndpoint(targetURI.getHost(),targetURI.getPort(),targetURI.getPath(),false);
  ReplicatorConfiguration.Builder builder=new ReplicatorConfiguration.Builder(this.db,endpoint);
  builder.setReplicatorType(push && pull ? PUSH_AND_PULL : (push ? PUSH : PULL));
  builder.setContinuous(continuous);
  return builder;
}

Fixed version (ground truth):
protected ReplicatorConfiguration.Builder makeConfig(boolean push,boolean pull,boolean continuous,Database db,URI targetURI) throws URISyntaxException {
  URLEndpoint endpoint=new URLEndpoint(targetURI.getHost(),targetURI.getPort(),targetURI.getPath(),false);
  ReplicatorConfiguration.Builder builder=new ReplicatorConfiguration.Builder(db,endpoint);
  builder.setReplicatorType(push && pull ? PUSH_AND_PULL : (push ? PUSH : PULL));
  builder.setContinuous(continuous);
  return builder;
}
Program: 160218
Project: 160218
Buggy source:
@Test public void testEnumeratingArray(){
  Array array=new Array();
  for (int i=0; i < 20; i++) {
    array.add(i);
  }
  List<Object> content=array.toList();
  List<Object> result=new ArrayList<>();
  int counter=0;
  for (  Object item : array) {
    assertNotNull(item);
    result.add(item);
    counter++;
  }
  assertEquals(content,result);
  assertEquals(array.count(),counter);
  array.remove(1);
  array.add(20);
  array.add(21);
  content=array.toList();
  result=new ArrayList<>();
  for (  Object item : array) {
    assertNotNull(item);
    result.add(item);
  }
  assertEquals(content,result);
  Document doc=createDocument("String_Node_Str");
  doc.set("String_Node_Str",array);
  final List<Object> c=content;
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array array){
      List<Object> r=new ArrayList<Object>();
      for (      Object item : array) {
        assertNotNull(item);
        r.add(item);
      }
      assertEquals(c,r);
    }
  }
);
}

Fixed version (ground truth):
@Test public void testEnumeratingArray(){
  Array array=new Array();
  for (int i=0; i < 20; i++) {
    array.add(i);
  }
  List<Object> content=array.toList();
  List<Object> result=new ArrayList<>();
  int counter=0;
  for (  Object item : array) {
    assertNotNull(item);
    result.add(item);
    counter++;
  }
  assertEquals(content,result);
  assertEquals(array.count(),counter);
  array.remove(1);
  array.add(20);
  array.add(21);
  content=array.toList();
  result=new ArrayList<>();
  for (  Object item : array) {
    assertNotNull(item);
    result.add(item);
  }
  assertEquals(content,result);
  Document doc=createDocument("String_Node_Str");
  doc.set("String_Node_Str",array);
  final List<Object> c=content;
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array array){
      List<Object> r=new ArrayList<Object>();
      for (      Object item : array) {
        assertNotNull(item);
        r.add(item);
      }
      assertEquals(c.toString(),r.toString());
    }
  }
);
}
Program: 160219
Project: 160219
Buggy source:
@Test public void testGetNumber(){
  Array array=new Array();
  populateData(array);
  assertEquals(12,array.count());
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertNull(a.getNumber(0));
      assertNull(a.getNumber(1));
      assertNull(a.getNumber(2));
      assertEquals(0,a.getNumber(3));
      assertEquals(1,a.getNumber(4));
      assertEquals(-1,a.getNumber(5));
      assertEquals(1.1,a.getNumber(6));
      assertNull(a.getNumber(7));
      assertNull(a.getNumber(8));
      assertNull(a.getNumber(9));
      assertNull(a.getNumber(10));
      assertNull(a.getNumber(11));
    }
  }
);
}

Fixed version (ground truth):
@Test public void testGetNumber(){
  Array array=new Array();
  populateData(array);
  assertEquals(12,array.count());
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertNull(a.getNumber(0));
      assertNull(a.getNumber(1));
      assertNull(a.getNumber(2));
      assertEquals(0,((Number)a.getNumber(3)).intValue());
      assertEquals(1,((Number)a.getNumber(4)).intValue());
      assertEquals(-1,((Number)a.getNumber(5)).intValue());
      assertEquals(1.1,a.getNumber(6));
      assertNull(a.getNumber(7));
      assertNull(a.getNumber(8));
      assertNull(a.getNumber(9));
      assertNull(a.getNumber(10));
      assertNull(a.getNumber(11));
    }
  }
);
}
Program: 160220
Project: 160220
Buggy source:
@Override public void validate(Array array){
  List<Object> r=new ArrayList<Object>();
  for (  Object item : array) {
    assertNotNull(item);
    r.add(item);
  }
  assertEquals(c,r);
}

Fixed version (ground truth):
@Override public void validate(Array array){
  List<Object> r=new ArrayList<Object>();
  for (  Object item : array) {
    assertNotNull(item);
    r.add(item);
  }
  assertEquals(c.toString(),r.toString());
}
Program: 160221
Project: 160221
Buggy source:
@Test public void testSetGetFloatNumbers(){
  Array array=new Array();
  array.add(1.00);
  array.add(1.49);
  array.add(1.50);
  array.add(1.51);
  array.add(1.99);
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(1,a.getInt(0));
      assertEquals(1L,a.getLong(0));
      assertEquals(1.00F,a.getFloat(0),0.0F);
      assertEquals(1.00,a.getDouble(0),0.0);
      assertEquals(1.49,a.getObject(1));
      assertEquals(1.49,a.getNumber(1));
      assertEquals(1,a.getInt(1));
      assertEquals(1L,a.getLong(1));
      assertEquals(1.49F,a.getFloat(1),0.0F);
      assertEquals(1.49,a.getDouble(1),0.0);
      assertEquals(1,a.getInt(2));
      assertEquals(1L,a.getLong(2));
      assertEquals(1.50F,a.getFloat(2),0.0F);
      assertEquals(1.50,a.getDouble(2),0.0);
      assertEquals(1.51,a.getObject(3));
      assertEquals(1.51,a.getNumber(3));
      assertEquals(1,a.getInt(3));
      assertEquals(1L,a.getLong(3));
      assertEquals(1.51F,a.getFloat(3),0.0F);
      assertEquals(1.51,a.getDouble(3),0.0);
      assertEquals(1.99,a.getObject(4));
      assertEquals(1.99,a.getNumber(4));
      assertEquals(1,a.getInt(4));
      assertEquals(1L,a.getLong(4));
      assertEquals(1.99F,a.getFloat(4),0.0F);
      assertEquals(1.99,a.getDouble(4),0.0);
    }
  }
);
}

Fixed version (ground truth):
@Test public void testSetGetFloatNumbers(){
  Array array=new Array();
  array.add(1.00);
  array.add(1.49);
  array.add(1.50);
  array.add(1.51);
  array.add(1.99);
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(1.00,((Number)a.getObject(0)).doubleValue(),0.0);
      assertEquals(1.00,a.getNumber(0).doubleValue(),0.0);
      assertEquals(1,a.getInt(0));
      assertEquals(1L,a.getLong(0));
      assertEquals(1.00F,a.getFloat(0),0.0F);
      assertEquals(1.00,a.getDouble(0),0.0);
      assertEquals(1.49,a.getObject(1));
      assertEquals(1.49,a.getNumber(1));
      assertEquals(1,a.getInt(1));
      assertEquals(1L,a.getLong(1));
      assertEquals(1.49F,a.getFloat(1),0.0F);
      assertEquals(1.49,a.getDouble(1),0.0);
      assertEquals(1.50,((Number)a.getObject(2)).doubleValue(),0.0);
      assertEquals(1.50,a.getNumber(2).doubleValue(),0.0);
      assertEquals(1,a.getInt(2));
      assertEquals(1L,a.getLong(2));
      assertEquals(1.50F,a.getFloat(2),0.0F);
      assertEquals(1.50,a.getDouble(2),0.0);
      assertEquals(1.51,a.getObject(3));
      assertEquals(1.51,a.getNumber(3));
      assertEquals(1,a.getInt(3));
      assertEquals(1L,a.getLong(3));
      assertEquals(1.51F,a.getFloat(3),0.0F);
      assertEquals(1.51,a.getDouble(3),0.0);
      assertEquals(1.99,a.getObject(4));
      assertEquals(1.99,a.getNumber(4));
      assertEquals(1,a.getInt(4));
      assertEquals(1L,a.getLong(4));
      assertEquals(1.99F,a.getFloat(4),0.0F);
      assertEquals(1.99,a.getDouble(4),0.0);
    }
  }
);
}
Program: 160222
Project: 160222
Buggy source:
@Test public void testAddObjects(){
  Array array=new Array();
  populateData(array);
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(12,a.count());
      assertEquals(true,a.getObject(0));
      assertEquals(false,a.getObject(1));
      assertEquals("String_Node_Str",a.getObject(2));
      assertEquals(0,a.getObject(3));
      assertEquals(1,a.getObject(4));
      assertEquals(-1,a.getObject(5));
      assertEquals(1.1,a.getObject(6));
      assertEquals(kArrayTestDate,a.getObject(7));
      assertEquals(null,a.getObject(8));
      Dictionary subdict=(Dictionary)a.getObject(9);
      Map<String,Object> expectedMap=new HashMap<>();
      expectedMap.put("String_Node_Str","String_Node_Str");
      assertEquals(expectedMap,subdict.toMap());
      Array subarray=(Array)a.getObject(10);
      List<Object> expected=new ArrayList<>();
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      assertEquals(expected,subarray.toList());
      Blob blob=(Blob)a.getObject(11);
      assertTrue(Arrays.equals(kArrayTestBlob.getBytes(),blob.getContent()));
      assertEquals(kArrayTestBlob,new String(blob.getContent()));
    }
  }
);
}

Fixed version (ground truth):
@Test public void testAddObjects(){
  Array array=new Array();
  populateData(array);
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(12,a.count());
      assertEquals(true,a.getObject(0));
      assertEquals(false,a.getObject(1));
      assertEquals("String_Node_Str",a.getObject(2));
      assertEquals(0,((Number)a.getObject(3)).intValue());
      assertEquals(1,((Number)a.getObject(4)).intValue());
      assertEquals(-1,((Number)a.getObject(5)).intValue());
      assertEquals(1.1,a.getObject(6));
      assertEquals(kArrayTestDate,a.getObject(7));
      assertEquals(null,a.getObject(8));
      Dictionary subdict=(Dictionary)a.getObject(9);
      Map<String,Object> expectedMap=new HashMap<>();
      expectedMap.put("String_Node_Str","String_Node_Str");
      assertEquals(expectedMap,subdict.toMap());
      Array subarray=(Array)a.getObject(10);
      List<Object> expected=new ArrayList<>();
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      assertEquals(expected,subarray.toList());
      Blob blob=(Blob)a.getObject(11);
      assertTrue(Arrays.equals(kArrayTestBlob.getBytes(),blob.getContent()));
      assertEquals(kArrayTestBlob,new String(blob.getContent()));
    }
  }
);
}
Program: 160223
Project: 160223
Buggy source:
@Test public void testSetObject(){
  List<Object> data=arrayOfAllTypes();
  Array array=new Array();
  for (int i=0; i < data.size(); i++)   array.add(null);
  for (int i=0; i < data.size(); i++)   array.set(i,data.get(i));
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(12,a.count());
      assertEquals(true,a.getObject(0));
      assertEquals(false,a.getObject(1));
      assertEquals("String_Node_Str",a.getObject(2));
      assertEquals(0,a.getObject(3));
      assertEquals(1,a.getObject(4));
      assertEquals(-1,a.getObject(5));
      assertEquals(1.1,a.getObject(6));
      assertEquals(kArrayTestDate,a.getObject(7));
      assertEquals(null,a.getObject(8));
      Dictionary subdict=(Dictionary)a.getObject(9);
      Map<String,Object> expectedMap=new HashMap<>();
      expectedMap.put("String_Node_Str","String_Node_Str");
      assertEquals(expectedMap,subdict.toMap());
      Array subarray=(Array)a.getObject(10);
      List<Object> expected=new ArrayList<>();
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      assertEquals(expected,subarray.toList());
      Blob blob=(Blob)a.getObject(11);
      assertTrue(Arrays.equals(kArrayTestBlob.getBytes(),blob.getContent()));
      assertEquals(kArrayTestBlob,new String(blob.getContent()));
    }
  }
);
}

Fixed version (ground truth):
@Test public void testSetObject(){
  List<Object> data=arrayOfAllTypes();
  Array array=new Array();
  for (int i=0; i < data.size(); i++)   array.add(null);
  for (int i=0; i < data.size(); i++)   array.set(i,data.get(i));
  Document doc=createDocument("String_Node_Str");
  save(doc,"String_Node_Str",array,new Validator<Array>(){
    @Override public void validate(    Array a){
      assertEquals(12,a.count());
      assertEquals(true,a.getObject(0));
      assertEquals(false,a.getObject(1));
      assertEquals("String_Node_Str",a.getObject(2));
      assertEquals(0,((Number)a.getObject(3)).intValue());
      assertEquals(1,((Number)a.getObject(4)).intValue());
      assertEquals(-1,((Number)a.getObject(5)).intValue());
      assertEquals(1.1,a.getObject(6));
      assertEquals(kArrayTestDate,a.getObject(7));
      assertEquals(null,a.getObject(8));
      Dictionary subdict=(Dictionary)a.getObject(9);
      Map<String,Object> expectedMap=new HashMap<>();
      expectedMap.put("String_Node_Str","String_Node_Str");
      assertEquals(expectedMap,subdict.toMap());
      Array subarray=(Array)a.getObject(10);
      List<Object> expected=new ArrayList<>();
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      expected.add("String_Node_Str");
      assertEquals(expected,subarray.toList());
      Blob blob=(Blob)a.getObject(11);
      assertTrue(Arrays.equals(kArrayTestBlob.getBytes(),blob.getContent()));
      assertEquals(kArrayTestBlob,new String(blob.getContent()));
    }
  }
);
}
Program: 160225
Project: 160225
Buggy source:
protected void openDB(){
  assertNull(db);
  DatabaseConfiguration options=new DatabaseConfiguration();
  options.setDirectory(dir);
  db=new Database(kDatabaseName,options);
  assertNotNull(db);
}

Fixed version (ground truth):
protected void openDB(){
  assertNull(db);
  DatabaseConfiguration options=new DatabaseConfiguration(this.context);
  options.setDirectory(dir);
  db=new Database(kDatabaseName,options);
  assertNotNull(db);
}
Program: 160226
Project: 160226
Buggy source:
protected void openDB(ConflictResolver resolver){
  assertNull(db);
  DatabaseConfiguration options=new DatabaseConfiguration();
  options.setDirectory(dir);
  options.setConflictResolver(resolver);
  db=new Database(kDatabaseName,options);
  assertNotNull(db);
}

Fixed version (ground truth):
protected void openDB(ConflictResolver resolver){
  assertNull(db);
  DatabaseConfiguration options=new DatabaseConfiguration(this.context);
  options.setDirectory(dir);
  options.setConflictResolver(resolver);
  db=new Database(kDatabaseName,options);
  assertNotNull(db);
}
Program: 160227
Project: 160227
Buggy source:
/** 
 * Implementing for Iterable. Currently iterator() returns keys. Not Key,Value pair.
 * @return Iterator<String>
 */
public Iterator<String> iterator(){
  if (properties != null) {
    return properties.keySet().iterator();
  }
 else {
    return root == null ? null : root.iterator();
  }
}

Fixed version (ground truth):
/** 
 * Implementing for Iterable. Currently iterator() returns keys. Not Key,Value pair.
 * @return the iterator of type {@code String}.
 */
public Iterator<String> iterator(){
  if (properties != null) {
    return properties.keySet().iterator();
  }
 else {
    return root == null ? null : root.iterator();
  }
}
Program: 160228
Project: 160228
Buggy source:
/** 
 * Runs the query. The returning a result set that enumerates result rows one at a time. You can run the query any number of times, and you can even have multiple ResultSet active at once. <br/> The results come from a snapshot of the database taken at the moment the run() method is called, so they will not reflect any changes made to the database afterwards.
 * @return the ResultSet for the query result.
 * @throws CouchbaseLiteException if there is an error when running the query.
 */
public ResultSet run() throws CouchbaseLiteException {
  if (c4query == null)   check();
  try {
    C4QueryOptions options=new C4QueryOptions();
    C4QueryEnumerator c4enum=c4query.run(options,null);
    return new ResultSet(this,c4enum);
  }
 catch (  LiteCoreException e) {
    throw LiteCoreBridge.convertException(e);
  }
}

Fixed version (ground truth):
/** 
 * Runs the query. The returning a result set that enumerates result rows one at a time. You can run the query any number of times, and you can even have multiple ResultSet active at once. <p> The results come from a snapshot of the database taken at the moment the run() method is called, so they will not reflect any changes made to the database afterwards. </p>
 * @return the ResultSet for the query result.
 * @throws CouchbaseLiteException if there is an error when running the query.
 */
public ResultSet run() throws CouchbaseLiteException {
  if (c4query == null)   check();
  try {
    C4QueryOptions options=new C4QueryOptions();
    C4QueryEnumerator c4enum=c4query.run(options,null);
    return new ResultSet(this,c4enum);
  }
 catch (  LiteCoreException e) {
    throw LiteCoreBridge.convertException(e);
  }
}