nus-yam/ex-repair huggingface dataset:
Program: 37550
Project: 37550
Buggy source:
/** 
 * query domain, without inner objects.
 * @param queryParam query parameter
 * @return autnum
 */
private Domain queryWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String domainName=domainQueryParam.getQ();
  final String punyName=domainQueryParam.getPunyName();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      ps.setString(2,domainName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}

Fixed version (ground truth):
/** 
 * query domain, without inner objects.
 * @param queryParam query parameter
 * @return autnum
 */
private Domain queryWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}
Program: 37551
Project: 37551
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testSearchInvalidDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isBadRequest()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testSearchInvalidDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isUnprocessableEntity()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(422)).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}
Program: 37552
Project: 37552
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryExistEvent(){
  Long autnumId=1L;
  List<Event> events=eventQueryDao.queryAsInnerObjects(autnumId,ModelType.AUTNUM);
  Assert.notNull(events);
  assertEquals(events.size(),1);
  Event event=events.get(0);
  Assert.notNull(event);
  assertEquals(event.getEventAction(),"String_Node_Str");
  assertEquals(event.getEventActor(),"String_Node_Str");
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  assertEquals(dateFormat.format(event.getEventDate()),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryExistEvent(){
  Long autnumId=1L;
  List<Event> events=eventQueryDao.queryAsInnerObjects(autnumId,ModelType.AUTNUM);
  Assert.notNull(events);
  assertEquals(events.size(),1);
  Event event=events.get(0);
  Assert.notNull(event);
  assertEquals(event.getEventAction(),"String_Node_Str");
  assertEquals(event.getEventActor(),"String_Node_Str");
  assertEquals(event.getEventDate(),"String_Node_Str");
}
Program: 37553
Project: 37553
Buggy source:
/** 
 * get maxSigLife.
 * @return maxSigLife.
 */
public int getMaxSigLife(){
  return maxSigLife;
}

Fixed version (ground truth):
/** 
 * get maxSigLife.
 * @return maxSigLife.
 */
public Integer getMaxSigLife(){
  return maxSigLife;
}
Program: 37554
Project: 37554
Buggy source:
/** 
 * set maxSigLife.
 * @param maxSigLife maxSigLife.
 */
public void setMaxSigLife(int maxSigLife){
  this.maxSigLife=maxSigLife;
}

Fixed version (ground truth):
/** 
 * set maxSigLife.
 * @param maxSigLife maxSigLife.
 */
public void setMaxSigLife(Integer maxSigLife){
  this.maxSigLife=maxSigLife;
}
Program: 37555
Project: 37555
Buggy source:
/** 
 * query domain by domain name.
 * @param domainName is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryDomain(@PathVariable String domainName){
  String decodeDomain=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(domainName);
  String punyDomainName=decodeDomain;
  try {
    punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=StringUtils.lowerCase(decodeDomain);
  Domain domain=queryService.queryDomain(queryParser.parseDomainQueryParam(decodeDomain,punyDomainName));
  if (null != domain) {
    responseDecorator.decorateResponse(domain);
    return RestResponseUtil.createResponse200(domain);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * query domain by domain name.
 * @param domainName is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryDomain(@PathVariable String domainName){
  String decodeDomain=domainName;
  String punyDomainName=decodeDomain;
  try {
    decodeDomain=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(domainName);
    punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=StringUtils.lowerCase(decodeDomain);
  Domain domain=queryService.queryDomain(queryParser.parseDomainQueryParam(decodeDomain,punyDomainName));
  if (null != domain) {
    responseDecorator.decorateResponse(domain);
    return RestResponseUtil.createResponse200(domain);
  }
  return RestResponseUtil.createResponse404();
}
Program: 37556
Project: 37556
Buggy source:
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  String punyDomainName=domainName;
  try {
    punyDomainName=geneDomainPunyName(domainName);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
    return false;
  }
  String domainWithoutLastPoint=deleteLastPoint(punyDomainName);
  String[] splits=StringUtils.split(domainWithoutLastPoint,"String_Node_Str");
  if (splits.length > MAX_DOMAIN_LABEL) {
    return false;
  }
  if (domainName.equals(punyDomainName)) {
    if (isLdh(domainName)) {
      return true;
    }
 else {
      return false;
    }
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}

Fixed version (ground truth):
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  String punyDomainName=domainName;
  try {
    punyDomainName=geneDomainPunyName(domainName);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
    return false;
  }
  String punyWithoutLastPoint=deleteLastPoint(punyDomainName);
  if (!validateDomainLength(punyWithoutLastPoint)) {
    return false;
  }
  String domainNameWithoutLastPoint=deleteLastPoint(domainName);
  String[] splits=StringUtils.split(punyWithoutLastPoint,"String_Node_Str");
  if (splits.length > MAX_DOMAIN_LABEL) {
    return false;
  }
  if (domainName.equals(punyDomainName) || domainNameWithoutLastPoint.equals(punyWithoutLastPoint)) {
    if (isLdh(domainName)) {
      return true;
    }
 else {
      return false;
    }
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}
Program: 37557
Project: 37557
Buggy source:
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  decodeServletPathForSpringUrlMapping(request);
  String path=request.getRequestURI();
  if (StringUtils.isBlank(path)) {
    writeError400Response(response);
    return;
  }
  String decodeUri=StringUtils.EMPTY;
  String uri=path.substring(request.getContextPath().length());
  if (StringUtils.isBlank(uri)) {
    writeError400Response(response);
    return;
  }
  try {
    decodeUri=urlDecode(uri);
    if (decodeUri.contains("String_Node_Str")) {
      writeError400Response(response);
      return;
    }
  }
 catch (  Exception e) {
    writeError400Response(response);
    return;
  }
  if (decodeUri.contains("String_Node_Str") || decodeUri.contains("String_Node_Str")) {
    writeError400Response(response);
    return;
  }
  if (!"String_Node_Str".equals(decodeUri)) {
    String uriWithoutPrefixSlash=decodeUri.substring(1,decodeUri.length());
    if (!uriWithoutPrefixSlash.startsWith(RDAP_URL_PREFIX)) {
      writeError400Response(response);
      return;
    }
 else     if (!uriWithoutPrefixSlash.equals(RDAP_URL_PREFIX + "String_Node_Str") && decodeUri.endsWith("String_Node_Str")) {
      writeError400Response(response);
      return;
    }
  }
  chain.doFilter(request,response);
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  decodeServletPathForSpringUrlMapping(request);
  String path=request.getRequestURI();
  if (StringUtils.isBlank(path)) {
    writeError400Response(response);
    return;
  }
  String decodeUri=StringUtils.EMPTY;
  String uri=path.substring(request.getContextPath().length());
  if (StringUtils.isBlank(uri)) {
    writeError400Response(response);
    return;
  }
  try {
    decodeUri=urlDecode(uri);
    if (decodeUri.contains("String_Node_Str")) {
      writeError400Response(response);
      return;
    }
  }
 catch (  Exception e) {
    writeError400Response(response);
    return;
  }
  if (decodeUri.contains("String_Node_Str") || decodeUri.contains("String_Node_Str")) {
    writeError400Response(response);
    return;
  }
  if (!"String_Node_Str".equals(decodeUri)) {
    String uriWithoutPrefixSlash=decodeUri.substring(1,decodeUri.length());
    if (!uriWithoutPrefixSlash.startsWith(RDAP_URL_PREFIX)) {
      writeError400Response(response);
      return;
    }
 else     if (!uriWithoutPrefixSlash.equals(RDAP_URL_PREFIX + "String_Node_Str") && decodeUri.endsWith("String_Node_Str")) {
      writeError400Response(response);
      return;
    }
 else     if (uriWithoutPrefixSlash.endsWith("String_Node_Str")) {
      writeError400Response(response);
      return;
    }
  }
  chain.doFilter(request,response);
}
Program: 37558
Project: 37558
Buggy source:
/** 
 * query domain, without inner objects.
 * @param queryParam query parameter
 * @return autnum
 */
private Domain queryWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String domainName=domainQueryParam.getQ();
  final String punyName=domainQueryParam.getPunyName();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      ps.setString(2,domainName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}

Fixed version (ground truth):
/** 
 * query domain, without inner objects.
 * @param queryParam query parameter
 * @return autnum
 */
private Domain queryWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}
Program: 37559
Project: 37559
Buggy source:
/** 
 * check if domainName is valid ip v4 arpa domain.
 * @param domainName domain name.
 * @return true if is, false if not.
 */
private static boolean isIpV4ArpaTldAndLabelIsValid(String domainName){
  if (StringUtils.isBlank(domainName)) {
    return false;
  }
  if (!domainName.endsWith(IPV4_ARPA_SUFFIX)) {
    return false;
  }
  domainName=StringUtils.removeEndIgnoreCase(domainName,IPV4_ARPA_SUFFIX);
  String ipV4ArpaReg="String_Node_Str";
  if (domainName.matches(ipV4ArpaReg)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check if domainName is valid ip v4 arpa domain.
 * @param domainName domain name.
 * @return true if domain is ipv4 arpa and label is valid; return false ifnot.
 */
private static boolean isIpV4ArpaTldAndLabelIsValid(String domainName){
  if (StringUtils.isBlank(domainName)) {
    return false;
  }
  if (!domainName.endsWith(IPV4_ARPA_SUFFIX)) {
    return false;
  }
  domainName=StringUtils.removeEndIgnoreCase(domainName,IPV4_ARPA_SUFFIX);
  String ipV4ArpaReg="String_Node_Str";
  if (domainName.matches(ipV4ArpaReg)) {
    return true;
  }
  return false;
}
Program: 37560
Project: 37560
Buggy source:
/** 
 * check if domainName is valid ip v6 arpa domain.
 * @param domainName domain name.
 * @return true if is, false if not.
 */
private static boolean isIpV6ArpaTldAndLabelIsValid(String domainName){
  if (StringUtils.isBlank(domainName)) {
    return false;
  }
  if (!domainName.endsWith(IPV6_ARPA_SUFFIX)) {
    return false;
  }
  domainName=StringUtils.removeEndIgnoreCase(domainName,IPV6_ARPA_SUFFIX);
  String ipV6ArpaReg="String_Node_Str";
  if (domainName.matches(ipV6ArpaReg)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check if domainName is valid ip v6 arpa domain.
 * @param domainName domain name.
 * @return true if domain is ipv6 arpa and label is valid; return false ifnot.
 */
private static boolean isIpV6ArpaTldAndLabelIsValid(String domainName){
  if (StringUtils.isBlank(domainName)) {
    return false;
  }
  if (!domainName.endsWith(IPV6_ARPA_SUFFIX)) {
    return false;
  }
  domainName=StringUtils.removeEndIgnoreCase(domainName,IPV6_ARPA_SUFFIX);
  String ipV6ArpaReg="String_Node_Str";
  if (domainName.matches(ipV6ArpaReg)) {
    return true;
  }
  return false;
}
Program: 37561
Project: 37561
Buggy source:
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  if (!domainName.startsWith(ACE_PREFIX) && isLdh(domainName)) {
    return true;
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!validateDomainLength(domainName)) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}

Fixed version (ground truth):
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  if (isLdh(domainName)) {
    return true;
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!validateDomainLength(domainName)) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}
Program: 37562
Project: 37562
Buggy source:
/** 
 * check domain is valid ldh.
 * @param domain domain name.
 * @return true if is,false if not.
 */
private static boolean isLdh(String domain){
  if (StringUtils.isBlank(domain)) {
    return false;
  }
  if (domain.indexOf("String_Node_Str") == XN_PREFIX.length()) {
    return false;
  }
  String domainWithoutLastPoint=deleteLastPoint(domain);
  if (!validateDomainLength(domainWithoutLastPoint)) {
    return false;
  }
  String ldhReg="String_Node_Str" + "String_Node_Str";
  if (domainWithoutLastPoint.matches(ldhReg)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check domain is valid ldh.
 * @param domain domain name.
 * @return true if is,false if not.
 */
private static boolean isLdh(String domain){
  if (StringUtils.isBlank(domain)) {
    return false;
  }
  String domainWithoutLastPoint=deleteLastPoint(domain);
  if (!validateDomainLength(domainWithoutLastPoint)) {
    return false;
  }
  String ldhReg="String_Node_Str" + "String_Node_Str";
  if (domainWithoutLastPoint.matches(ldhReg)) {
    return true;
  }
  return false;
}
Program: 37563
Project: 37563
Buggy source:
/** 
 * query domain by domain name.
 * @param domainName is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryDomain(@PathVariable String domainName){
  String decodeDomain=DomainUtil.decodeAndTrim(domainName);
  String punyDomainName=decodeDomain;
  try {
    punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=DomainUtil.getLowerCaseByLabel(decodeDomain);
  Domain domain=queryService.queryDomain(queryParser.parseDomainQueryParam(decodeDomain,punyDomainName));
  if (null != domain) {
    responseDecorator.decorateResponse(domain);
    return RestResponseUtil.createResponse200(domain);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * query domain by domain name.
 * @param domainName is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryDomain(@PathVariable String domainName){
  String decodeDomain=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(domainName);
  String punyDomainName=decodeDomain;
  try {
    punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=StringUtils.lowerCase(decodeDomain);
  Domain domain=queryService.queryDomain(queryParser.parseDomainQueryParam(decodeDomain,punyDomainName));
  if (null != domain) {
    responseDecorator.decorateResponse(domain);
    return RestResponseUtil.createResponse200(domain);
  }
  return RestResponseUtil.createResponse404();
}
Program: 37565
Project: 37565
Buggy source:
/** 
 * test decodeAndTrim.
 */
@Test public void testDecodeAndTrimDecodedStr(){
  String result=DomainUtil.decodeAndTrim("String_Node_Str");
  assertEquals("String_Node_Str",result);
}

Fixed version (ground truth):
/** 
 * test decodeAndTrim.
 */
@Test public void testDecodeAndTrimDecodedStr(){
  String result=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase("String_Node_Str");
  assertEquals("String_Node_Str",result);
}
Program: 37566
Project: 37566
Buggy source:
/** 
 * test decodeAndTrim.
 */
@Test public void testDecodeAndTrim(){
  String result=DomainUtil.decodeAndTrim("String_Node_Str");
  assertEquals("String_Node_Str",result);
}

Fixed version (ground truth):
/** 
 * test decodeAndTrim.
 */
@Test public void testDecodeAndTrim(){
  assertEquals("String_Node_Str",DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase("String_Node_Str"));
}
Program: 37567
Project: 37567
Buggy source:
/** 
 * init ErrorMessages list
 */
private static void initErrorMessages(){
  errorMessageMap=errorMessageService.getAllErrorMessageMap();
}

Fixed version (ground truth):
/** 
 * init ErrorMessages list
 */
public static void initErrorMessages(){
  errorMessageMap=errorMessageService.getAllErrorMessageMap();
}
Program: 37568
Project: 37568
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test public void testQueryInvalidDomain() throws Exception {
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryInvalidDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
}
Program: 37569
Project: 37569
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test public void testQueryNonExistDomain() throws Exception {
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryNonExistDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
  commonQueryNonExistDomain("String_Node_Str");
}
Program: 37570
Project: 37570
Buggy source:
/** 
 * encoded url with UTF-8 encoding. This will escape protocol(eg:'http://') and '/'.
 * @param str string
 * @return String encoded string
 */
public static String urlEncode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    String decodedURL=URLDecoder.decode(str,CHAR_SET_UTF8);
    URI uri=new URI(decodedURL);
    result=uri.toASCIIString();
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * encoded url with UTF-8 encoding. This will escape protocol(eg:'http://') and '/'.
 * @param str string
 * @return String encoded string
 */
public static String urlEncode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    String decodedURL=URLDecoder.decode(str,CHAR_SET_UTF8);
    decodedURL=decodedURL.replaceAll("String_Node_Str",URLEncoder.encode("String_Node_Str",CHAR_SET_UTF8));
    URI uri=new URI(decodedURL);
    result=uri.toASCIIString();
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
  }
  return result;
}
Program: 37571
Project: 37571
Buggy source:
/** 
 * create response with HTTP status code 405
 * @param response model object
 * @return ResponseEntity
 */
public static ResponseEntity<ErrorMessage> createResponse405(){
  return createCommonErrorResponse(HttpStatus.METHOD_NOT_ALLOWED);
}

Fixed version (ground truth):
/** 
 * create response with HTTP status code 405
 * @param response model object
 * @return ResponseEntity
 */
public static ResponseEntity<ErrorMessage> createResponse405(){
  HttpHeaders headers=new HttpHeaders();
  Set<HttpMethod> allowMethods=new HashSet<HttpMethod>();
  allowMethods.add(HttpMethod.GET);
  headers.setAllow(allowMethods);
  ResponseEntity<ErrorMessage> response=createErrorResponseWithHeaders(HttpStatus.METHOD_NOT_ALLOWED,headers);
  return response;
}
Program: 37572
Project: 37572
Buggy source:
/** 
 * encoded url with UTF-8 encoding. This will escape protocol(eg:'http://') and '/'.
 * @param str string
 * @return String encoded string
 */
public static String urlEncode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    String decodedURL=URLDecoder.decode(str,"String_Node_Str");
    URL url=new URL(decodedURL);
    URI uri=new URI(url.getProtocol(),url.getUserInfo(),url.getHost(),url.getPort(),url.getPath(),url.getQuery(),url.getRef());
    result=uri.toASCIIString();
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * encoded url with UTF-8 encoding. This will escape protocol(eg:'http://') and '/'.
 * @param str string
 * @return String encoded string
 */
public static String urlEncode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    String decodedURL=URLDecoder.decode(str,CHAR_SET_UTF8);
    URI uri=new URI(decodedURL);
    result=uri.toASCIIString();
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
  }
  return result;
}
Program: 37573
Project: 37573
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity queryAs(@PathVariable String autnum,HttpServletRequest request,HttpServletResponse response){
  if (!AutnumValidator.isValidAutnum(autnum)) {
    return RestResponseUtil.createResponse400();
  }
  Autnum result=queryService.queryAutnum(queryParser.parseQueryParam(autnum));
  if (null != result) {
    responseDecorator.decorateResponse(result);
    return RestResponseUtil.createResponse200(result);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity queryAs(@PathVariable String autnum,HttpServletRequest request,HttpServletResponse response){
  logger.info("String_Node_Str" + autnum);
  if (!AutnumValidator.isValidAutnum(autnum)) {
    return RestResponseUtil.createResponse400();
  }
  Autnum result=queryService.queryAutnum(queryParser.parseQueryParam(autnum));
  if (null != result) {
    responseDecorator.decorateResponse(result);
    return RestResponseUtil.createResponse200(result);
  }
  return RestResponseUtil.createResponse404();
}
Program: 37574
Project: 37574
Buggy source:
/** 
 * write response.
 * @param responseEntity
 * @param response
 * @throws IOException
 */
public static void writeResponse(ResponseEntity<ErrorMessage> responseEntity,HttpServletResponse response) throws IOException {
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setCharacterEncoding("String_Node_Str");
  PrintWriter writer=response.getWriter();
  response.setStatus(responseEntity.getStatusCode().value());
  String jsonStr=beanToJSON(responseEntity.getBody());
  writer.print(jsonStr);
}

Fixed version (ground truth):
/** 
 * write response.
 * @param responseEntity
 * @param response
 * @throws IOException
 */
public static void writeResponse(ResponseEntity<ErrorMessage> responseEntity,HttpServletResponse response) throws IOException {
  response.setHeader("String_Node_Str","String_Node_Str");
  HttpHeaders headers=responseEntity.getHeaders();
  Set<String> headerKeys=headers.keySet();
  for (  String headerKey : headerKeys) {
    List<String> headerValues=headers.get(headerKey);
    for (    String headerValue : headerValues) {
      response.setHeader(headerKey,headerValue);
    }
  }
  response.setCharacterEncoding("String_Node_Str");
  PrintWriter writer=response.getWriter();
  response.setStatus(responseEntity.getStatusCode().value());
  String jsonStr=beanToJSON(responseEntity.getBody());
  writer.print(jsonStr);
}
Program: 37575
Project: 37575
Buggy source:
/** 
 * test create ResponseEntity with HTTP code 405
 */
@Test public void testCreateResponse405(){
  ResponseEntity result=RestResponseUtil.createResponse405();
  Assert.notNull(result);
  assertEquals(result.getStatusCode(),HttpStatus.METHOD_NOT_ALLOWED);
}

Fixed version (ground truth):
/** 
 * test create ResponseEntity with HTTP code 405
 */
@Test public void testCreateResponse405(){
  ResponseEntity result=RestResponseUtil.createResponse405();
  Assert.notNull(result);
  assertEquals(result.getStatusCode(),HttpStatus.METHOD_NOT_ALLOWED);
  assertTrue(result.getHeaders().containsKey("String_Node_Str"));
  assertThat(result.getHeaders().get("String_Node_Str"),CoreMatchers.hasItems(HttpMethod.GET.toString()));
}
Program: 37576
Project: 37576
Buggy source:
/** 
 * create error response
 * @param errorStatus HttpStatus of error message
 * @return ResponseEntity
 */
private static ResponseEntity<ErrorMessage> createCommonErrorResponse(HttpStatus errorStatus){
  ErrorMessage errorMessage=getErrorMessageByErrorCode(errorStatus.toString());
  return new ResponseEntity<ErrorMessage>(errorMessage,errorStatus);
}

Fixed version (ground truth):
/** 
 * create error response
 * @param errorStatus HttpStatus of error message
 * @return ResponseEntity
 */
private static ResponseEntity<ErrorMessage> createCommonErrorResponse(HttpStatus errorStatus){
  ErrorMessage errorMessage=getErrorMessageByErrorCode(errorStatus.toString());
  RestResponseUtil.rdapConformanceService.setRdapConformance(errorMessage);
  return new ResponseEntity<ErrorMessage>(errorMessage,errorStatus);
}
Program: 37577
Project: 37577
Buggy source:
public ErrorMessage mapRow(ResultSet rs,int rowNum) throws SQLException {
  ErrorMessage errorMessage=new ErrorMessage();
  errorMessage.setErrorCode(rs.getLong("String_Node_Str"));
  errorMessage.setTitle(rs.getString("String_Node_Str"));
  errorMessage.addDescription(rs.getString("String_Node_Str"));
  return errorMessage;
}

Fixed version (ground truth):
public ErrorMessage mapRow(ResultSet rs,int rowNum) throws SQLException {
  ErrorMessage errorMessage=new ErrorMessage();
  errorMessage.setErrorCode(rs.getLong("String_Node_Str"));
  errorMessage.setTitle(rs.getString("String_Node_Str"));
  errorMessage.addDescription(rs.getString("String_Node_Str"));
  errorMessage.setLang(rs.getString("String_Node_Str"));
  return errorMessage;
}
Program: 37578
Project: 37578
Buggy source:
/** 
 * get all erroMessage
 */
@Override public List<ErrorMessage> getAllErrorMessages(){
  final String sql="String_Node_Str";
  List<ErrorMessage> result=jdbcTemplate.query(sql,new RowMapper<ErrorMessage>(){
    public ErrorMessage mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      ErrorMessage errorMessage=new ErrorMessage();
      errorMessage.setErrorCode(rs.getLong("String_Node_Str"));
      errorMessage.setTitle(rs.getString("String_Node_Str"));
      errorMessage.addDescription(rs.getString("String_Node_Str"));
      return errorMessage;
    }
  }
);
  return result;
}

Fixed version (ground truth):
/** 
 * get all erroMessage
 */
@Override public List<ErrorMessage> getAllErrorMessages(){
  final String sql="String_Node_Str";
  List<ErrorMessage> result=jdbcTemplate.query(sql,new RowMapper<ErrorMessage>(){
    public ErrorMessage mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      ErrorMessage errorMessage=new ErrorMessage();
      errorMessage.setErrorCode(rs.getLong("String_Node_Str"));
      errorMessage.setTitle(rs.getString("String_Node_Str"));
      errorMessage.addDescription(rs.getString("String_Node_Str"));
      errorMessage.setLang(rs.getString("String_Node_Str"));
      return errorMessage;
    }
  }
);
  return result;
}
Program: 37579
Project: 37579
Buggy source:
public Drawable getIcon(Context context){
  if (mIcon == null) {
    if (mApkFile.exists()) {
      mIcon=mInfo.loadIcon(context.getPackageManager());
      return mIcon;
    }
 else {
      mMounted=false;
    }
  }
 else   if (!mMounted) {
    if (mApkFile.exists()) {
      mMounted=true;
      mIcon=mInfo.loadIcon(context.getPackageManager());
      return mIcon;
    }
  }
 else {
    return mIcon;
  }
  Drawable drawable;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    drawable=context.getDrawable(android.R.drawable.sym_def_app_icon);
  }
 else {
    drawable=context.getResources().getDrawable(android.R.drawable.sym_def_app_icon);
  }
  return drawable;
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public Drawable getIcon(Context context){
  if (mIcon == null) {
    if (mApkFile.exists()) {
      mIcon=mInfo.loadIcon(context.getPackageManager());
      return mIcon;
    }
 else {
      mMounted=false;
    }
  }
 else   if (!mMounted) {
    if (mApkFile.exists()) {
      mMounted=true;
      mIcon=mInfo.loadIcon(context.getPackageManager());
      return mIcon;
    }
  }
 else {
    return mIcon;
  }
  Drawable drawable;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    drawable=context.getDrawable(android.R.drawable.sym_def_app_icon);
  }
 else {
    drawable=context.getResources().getDrawable(android.R.drawable.sym_def_app_icon);
  }
  return drawable;
}
Program: 37580
Project: 37580
Buggy source:
public void onTalkUpdated(final Talk talk){
  final int index=mFilteredData.indexOf(talk);
  if (index > 0) {
    notifyItemChanged(index);
  }
}

Fixed version (ground truth):
public void onTalkUpdated(@NonNull final Talk talk){
  for (int i=0; i < mFilteredData.size(); i++) {
    if (mFilteredData.get(i).getObjectId().equals(talk.getObjectId())) {
      notifyItemChanged(i);
      break;
    }
  }
}
Program: 37581
Project: 37581
Buggy source:
/** 
 * Populates the set of favorites from its JSON representation, as returned from toJSON.
 */
private void setJSON(JSONObject json){
  JSONArray favorites=json.optJSONArray("String_Node_Str");
  if (favorites == null) {
    favorites=new JSONArray();
  }
  ArrayList<Talk> toRemove=new ArrayList<Talk>();
  for (  String objectId : talkIds) {
    Talk pointer=Talk.createWithoutData(Talk.class,objectId);
    toRemove.add(pointer);
  }
  for (  Talk talk : toRemove) {
    remove(talk);
  }
  for (int i=0; i < favorites.length(); ++i) {
    String objectId=favorites.optString(i);
    Talk pointer=Talk.createWithoutData(Talk.class,objectId);
    add(pointer);
  }
}

Fixed version (ground truth):
/** 
 * Populates the set of favorites from its JSON representation, as returned from toJSON.
 */
private void setJSON(JSONObject json){
  JSONArray favorites=json.optJSONArray("String_Node_Str");
  if (favorites == null) {
    favorites=new JSONArray();
  }
  ArrayList<Talk> toRemove=new ArrayList<>();
  for (  String objectId : talkIds) {
    Talk pointer=Talk.createWithoutData(Talk.class,objectId);
    toRemove.add(pointer);
  }
  for (  Talk talk : toRemove) {
    remove(talk);
  }
  for (int i=0; i < favorites.length(); ++i) {
    String objectId=favorites.optString(i);
    Talk pointer=Talk.createWithoutData(Talk.class,objectId);
    add(pointer);
  }
}
Program: 37582
Project: 37582
Buggy source:
/** 
 * Saves the current set of favorites to Parse, so that we can push to people based on what talks they have favorited, and also to measure which talks were the most favorited.
 */
private void saveToParse(){
  ArrayList<String> ids=new ArrayList<String>(talkIds);
  ParseInstallation.getCurrentInstallation().put("String_Node_Str",ids);
  ParseInstallation.getCurrentInstallation().saveEventually();
}

Fixed version (ground truth):
/** 
 * Saves the current set of favorites to Parse, so that we can push to people based on what talks they have favorited, and also to measure which talks were the most favorited.
 */
private void saveToParse(){
  ArrayList<String> ids=new ArrayList<>(talkIds);
  ParseInstallation.getCurrentInstallation().put("String_Node_Str",ids);
  ParseInstallation.getCurrentInstallation().saveEventually();
}
Program: 37583
Project: 37583
Buggy source:
/** 
 * Saves the current set of favorites to a SharedPreferences file. This method returns quickly, while the saving runs asynchronously.
 */
private void saveLocally(final Context context){
  final JSONObject json=toJSON();
  new AsyncTask<Void,Void,Exception>(){
    @Override protected Exception doInBackground(    Void... unused){
      try {
        String jsonString=json.toString();
        SharedPreferences prefs=context.getSharedPreferences("String_Node_Str",Context.MODE_PRIVATE);
        prefs.edit().putString("String_Node_Str",jsonString).commit();
      }
 catch (      Exception e) {
        return e;
      }
      return null;
    }
    @Override protected void onPostExecute(    Exception error){
      if (error != null) {
        Toast toast=Toast.makeText(context,error.getMessage(),Toast.LENGTH_LONG);
        toast.show();
      }
    }
  }
.execute();
}

Fixed version (ground truth):
/** 
 * Saves the current set of favorites to a SharedPreferences file. This method returns quickly, while the saving runs asynchronously.
 */
private void saveLocally(final Context context){
  final JSONObject json=toJSON();
  new AsyncTask<Void,Void,Exception>(){
    @Override protected Exception doInBackground(    Void... unused){
      try {
        String jsonString=json.toString();
        SharedPreferences prefs=context.getSharedPreferences("String_Node_Str",Context.MODE_PRIVATE);
        prefs.edit().putString("String_Node_Str",jsonString).apply();
      }
 catch (      Exception e) {
        return e;
      }
      return null;
    }
    @Override protected void onPostExecute(    Exception error){
      if (error != null) {
        Toast toast=Toast.makeText(context,error.getMessage(),Toast.LENGTH_LONG);
        toast.show();
      }
    }
  }
.execute();
}
Program: 37584
Project: 37584
Buggy source:
public static Favorites get(){
  return instance;
}

Fixed version (ground truth):
public static Favorites get(){
  return INSTANCE;
}
Program: 37585
Project: 37585
Buggy source:
private void initParse(){
  ParseObject.registerSubclass(Room.class);
  ParseObject.registerSubclass(Slot.class);
  ParseObject.registerSubclass(Speaker.class);
  ParseObject.registerSubclass(Talk.class);
  ParseObject.registerSubclass(Event.class);
  ParseObject.registerSubclass(Location.class);
  ParseCrashReporting.enable(this);
  Parse.initialize(this,getParseApplicationId(),getParseClientKey());
  PushService.setDefaultPushCallback(this,MainActivity.class);
  Favorites.get().addListener(new FavoritesNotificationScheduler(this));
  Favorites.get().findLocally(this);
}

Fixed version (ground truth):
private void initParse(){
  ParseObject.registerSubclass(Room.class);
  ParseObject.registerSubclass(Slot.class);
  ParseObject.registerSubclass(Speaker.class);
  ParseObject.registerSubclass(Talk.class);
  ParseObject.registerSubclass(Event.class);
  ParseObject.registerSubclass(Location.class);
  ParseCrashReporting.enable(this);
  Parse.initialize(this,getParseApplicationId(),getParseClientKey());
  Favorites.get().addListener(new FavoritesNotificationScheduler(this));
  Favorites.get().findLocally(this);
}
Program: 37586
Project: 37586
Buggy source:
private void navigate(final int position){
switch (position) {
case NAV_ITEM_SCHEDULE:
    Fragment sched=TalkListFragment.newInstance(((BaseEventScheduleApp)getApplicationContext()).getParseEventId(),false);
  getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,sched,"String_Node_Str").commit();
break;
case NAV_ITEM_FAVORITES:
Fragment favs=TalkListFragment.newInstance(((BaseEventScheduleApp)getApplicationContext()).getParseEventId(),true);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,favs,"String_Node_Str").commit();
break;
case NAV_ITEM_EVENT_DETAILS:
startActivity(new Intent(this,EventDetailsActivity.class));
break;
case NAV_ITEM_LEGAL:
startActivity(new Intent(this,LegalActivity.class));
break;
default :
}
mNavPosition=position;
}

Fixed version (ground truth):
private void navigate(final int position){
switch (position) {
case NAV_ITEM_SCHEDULE:
    Fragment sched=TalkListFragment.newInstance(((BaseEventScheduleApp)getApplicationContext()).getParseEventId(),false);
  getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,sched,"String_Node_Str").commit();
mNavPosition=position;
break;
case NAV_ITEM_FAVORITES:
Fragment favs=TalkListFragment.newInstance(((BaseEventScheduleApp)getApplicationContext()).getParseEventId(),true);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,favs,"String_Node_Str").commit();
mNavPosition=position;
break;
case NAV_ITEM_EVENT_DETAILS:
startActivity(new Intent(this,EventDetailsActivity.class));
break;
case NAV_ITEM_LEGAL:
startActivity(new Intent(this,LegalActivity.class));
break;
default :
}
}
Program: 37587
Project: 37587
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_talk);
  final TalkDetailsFragment detailsFragment=TalkDetailsFragment.newInstance();
  getSupportFragmentManager().beginTransaction().add(R.id.container,detailsFragment).commit();
  String talkId=Talk.getTalkId(getIntent().getData());
  Talk.getInBackground(talkId,new GetCallback<Talk>(){
    @Override public void done(    final Talk talk,    ParseException e){
      if (e != null) {
        Toast.makeText(TalkActivity.this,e.getMessage(),Toast.LENGTH_LONG).show();
        return;
      }
      if (talk == null) {
        throw new RuntimeException("String_Node_Str");
      }
      detailsFragment.setTalk(talk);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_talk);
  String talkId=Talk.getTalkId(getIntent().getData());
  Talk.getInBackground(talkId,new GetCallback<Talk>(){
    @Override public void done(    final Talk talk,    ParseException e){
      if (e != null) {
        Toast.makeText(TalkActivity.this,e.getMessage(),Toast.LENGTH_LONG).show();
        return;
      }
      if (talk == null) {
        throw new RuntimeException("String_Node_Str");
      }
      TalkDetailsFragment fragment=(TalkDetailsFragment)getSupportFragmentManager().findFragmentById(R.id.talk_details);
      fragment.setTalk(talk);
    }
  }
);
}
Program: 37588
Project: 37588
Buggy source:
@Override public void done(final Talk talk,ParseException e){
  if (e != null) {
    Toast.makeText(TalkActivity.this,e.getMessage(),Toast.LENGTH_LONG).show();
    return;
  }
  if (talk == null) {
    throw new RuntimeException("String_Node_Str");
  }
  detailsFragment.setTalk(talk);
}

Fixed version (ground truth):
@Override public void done(final Talk talk,ParseException e){
  if (e != null) {
    Toast.makeText(TalkActivity.this,e.getMessage(),Toast.LENGTH_LONG).show();
    return;
  }
  if (talk == null) {
    throw new RuntimeException("String_Node_Str");
  }
  TalkDetailsFragment fragment=(TalkDetailsFragment)getSupportFragmentManager().findFragmentById(R.id.talk_details);
  fragment.setTalk(talk);
}