nus-yam/ex-repair huggingface dataset:
Program: 33319
Project: 33319
Buggy source:
public UriInfoImpl setSystemQueryOption(final SystemQueryOptionImpl systemOption){
  if (systemOption.getKind() == SystemQueryOptionKind.EXPAND) {
    systemQueryOptions.put(SystemQueryOptionKind.EXPAND,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.FILTER) {
    systemQueryOptions.put(SystemQueryOptionKind.FILTER,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.FORMAT) {
    systemQueryOptions.put(SystemQueryOptionKind.FORMAT,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.ID) {
    systemQueryOptions.put(SystemQueryOptionKind.ID,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.COUNT) {
    systemQueryOptions.put(SystemQueryOptionKind.COUNT,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.ORDERBY) {
    systemQueryOptions.put(SystemQueryOptionKind.ORDERBY,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.SEARCH) {
    systemQueryOptions.put(SystemQueryOptionKind.SEARCH,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.SELECT) {
    systemQueryOptions.put(SystemQueryOptionKind.SELECT,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.SKIP) {
    systemQueryOptions.put(SystemQueryOptionKind.SKIP,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.SKIPTOKEN) {
    systemQueryOptions.put(SystemQueryOptionKind.SKIPTOKEN,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.TOP) {
    systemQueryOptions.put(SystemQueryOptionKind.TOP,systemOption);
  }
 else   if (systemOption.getKind() == SystemQueryOptionKind.LEVELS) {
    systemQueryOptions.put(SystemQueryOptionKind.LEVELS,systemOption);
  }
 else {
    throw new ODataRuntimeException("String_Node_Str" + systemOption.getName());
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Adds system query option.
 * @param systemOption the option to be added
 * @return this object for method chaining
 * @throws ODataRuntimeException if an unsupported option is providedor an option of this kind has been added before
 */
public UriInfoImpl setSystemQueryOption(final SystemQueryOption systemOption){
  final SystemQueryOptionKind kind=systemOption.getKind();
switch (kind) {
case EXPAND:
case FILTER:
case FORMAT:
case ID:
case COUNT:
case ORDERBY:
case SEARCH:
case SELECT:
case SKIP:
case SKIPTOKEN:
case TOP:
case LEVELS:
    if (systemQueryOptions.containsKey(kind)) {
      throw new ODataRuntimeException("String_Node_Str" + systemOption.getName());
    }
 else {
      systemQueryOptions.put(kind,systemOption);
    }
  break;
default :
throw new ODataRuntimeException("String_Node_Str" + systemOption.getName());
}
return this;
}
Program: 33321
Project: 33321
Buggy source:
public static RawUri decodeUri(final String uri,final int scipSegments){
  RawUri rawUri=new RawUri();
  Matcher m=uriPattern.matcher(uri);
  if (m.matches()) {
    rawUri.scheme=m.group(2);
    rawUri.authority=m.group(4);
    rawUri.path=m.group(5);
    rawUri.queryOptionString=m.group(7);
    rawUri.fragment=m.group(9);
  }
  splittPath(rawUri,scipSegments);
  splittOptions(rawUri);
  decode(rawUri);
  return rawUri;
}

Fixed version (ground truth):
public static RawUri decodeUri(final String uri,final int skipSegments) throws UriParserSyntaxException {
  RawUri rawUri=new RawUri();
  Matcher m=uriPattern.matcher(uri);
  if (m.matches()) {
    rawUri.scheme=m.group(2);
    rawUri.authority=m.group(4);
    rawUri.path=m.group(5);
    rawUri.queryOptionString=m.group(7);
    rawUri.fragment=m.group(9);
  }
  splitPath(rawUri,skipSegments);
  splitOptions(rawUri);
  decode(rawUri);
  return rawUri;
}
Program: 33322
Project: 33322
Buggy source:
public static String decode(final String encoded){
  return Decoder.decode(encoded);
}

Fixed version (ground truth):
public static String decode(final String encoded) throws UriParserSyntaxException {
  try {
    return Decoder.decode(encoded);
  }
 catch (  final IllegalArgumentException e) {
    throw new UriParserSyntaxException("String_Node_Str",e,UriParserSyntaxException.MessageKeys.SYNTAX);
  }
}
Program: 33323
Project: 33323
Buggy source:
private RawUri runRawParser(final String uri,final int scipSegments) throws UriParserSyntaxException {
  return UriDecoder.decodeUri(uri,scipSegments);
}

Fixed version (ground truth):
private RawUri runRawParser(final String uri,final int skipSegments) throws UriParserSyntaxException {
  return UriDecoder.decodeUri(uri,skipSegments);
}
Program: 33324
Project: 33324
Buggy source:
public TestServerBuilder addWebApp() throws IOException {
  if (server != null) {
    return this;
  }
  File webAppProjectDir=getFileForDirProperty(PROJECT_WEB_APP_DIR);
  File webAppDir=new File(baseDir,webAppProjectDir.getName());
  FileUtils.deleteDirectory(webAppDir);
  if (!webAppDir.mkdirs()) {
    throw new RuntimeException("String_Node_Str" + webAppDir.getAbsolutePath() + "String_Node_Str");
  }
  FileUtils.copyDirectory(webAppProjectDir,webAppDir);
  File libDir=new File(webAppDir,"String_Node_Str");
  File classesDir=new File(webAppDir,"String_Node_Str");
  String[] libsToExtract=libDir.list(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.toLowerCase(Locale.ENGLISH).contains("String_Node_Str") && name.toLowerCase(Locale.ENGLISH).endsWith("String_Node_Str");
    }
  }
);
  for (  String lib : libsToExtract) {
    File libFile=new File(libDir,lib);
    extract(libFile,classesDir);
    FileUtils.forceDelete(libFile);
  }
  String contextPath="String_Node_Str";
  Context context=tomcat.addWebapp(tomcat.getHost(),contextPath,webAppDir.getAbsolutePath());
  LOG.info("String_Node_Str",webAppDir.getName(),contextPath);
  WebappLoader solrLoader=new WebappLoader(Thread.currentThread().getContextClassLoader());
  context.setLoader(solrLoader);
  return this;
}

Fixed version (ground truth):
public TestServerBuilder addWebApp() throws IOException {
  if (server != null) {
    return this;
  }
  File webAppProjectDir=getFileForDirProperty(PROJECT_WEB_APP_DIR);
  File webAppDir=new File(baseDir,webAppProjectDir.getName());
  FileUtils.deleteDirectory(webAppDir);
  if (!webAppDir.mkdirs()) {
    throw new RuntimeException("String_Node_Str" + webAppDir.getAbsolutePath() + "String_Node_Str");
  }
  FileUtils.copyDirectory(webAppProjectDir,webAppDir);
  String contextPath="String_Node_Str";
  Context context=tomcat.addWebapp(tomcat.getHost(),contextPath,webAppDir.getAbsolutePath());
  context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader()));
  LOG.info("String_Node_Str",webAppDir.getName(),contextPath);
  return this;
}
Program: 33326
Project: 33326
Buggy source:
@Test public void delta(){
  ContextURL contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDelta());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaDeletedLink());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaLink());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaDeletedEntity());
}

Fixed version (ground truth):
@Test public void delta(){
  ContextURL contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDelta());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertFalse(contextURL.isEntity());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaDeletedLink());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertFalse(contextURL.isEntity());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaLink());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertFalse(contextURL.isEntity());
  contextURL=ContextURL.getInstance(URI.create("String_Node_Str"));
  assertTrue(contextURL.isDeltaDeletedEntity());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertFalse(contextURL.isEntity());
}
Program: 33327
Project: 33327
Buggy source:
@Test public void testServiceDocumentDefault() throws Exception {
  ODataRequest request=new ODataRequest();
  request.setMethod(HttpMethod.GET);
  request.setRawBaseUri("String_Node_Str");
  request.setRawODataPath("String_Node_Str");
  ODataResponse response=handler.process(request);
  assertNotNull(response);
  assertEquals(200,response.getStatusCode());
  assertEquals(HttpContentType.APPLICATION_JSON,response.getHeaders().get(HttpHeader.CONTENT_TYPE));
  assertNotNull(response.getContent());
  String doc=IOUtils.toString(response.getContent());
  assertTrue(doc.contains("String_Node_Str"));
  assertTrue(doc.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testServiceDocumentDefault() throws Exception {
  ODataRequest request=new ODataRequest();
  request.setMethod(HttpMethod.GET);
  request.setRawBaseUri("String_Node_Str");
  request.setRawODataPath("String_Node_Str");
  ODataResponse response=handler.process(request);
  assertNotNull(response);
  assertEquals(200,response.getStatusCode());
  String ct=response.getHeaders().get(HttpHeader.CONTENT_TYPE);
  assertTrue(ct.contains("String_Node_Str"));
  assertTrue(ct.contains("String_Node_Str"));
  assertNotNull(response.getContent());
  String doc=IOUtils.toString(response.getContent());
  assertTrue(doc.contains("String_Node_Str"));
  assertTrue(doc.contains("String_Node_Str"));
}
Program: 33329
Project: 33329
Buggy source:
private Calendar createCalendarInstance(){
  return Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"),Locale.ENGLISH);
}

Fixed version (ground truth):
private Calendar createCalendarInstance(){
  Calendar cal=Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"),Locale.ENGLISH);
  cal.set(Calendar.ZONE_OFFSET,0);
  return cal;
}
Program: 33333
Project: 33333
Buggy source:
@Override public String toString(){
  StringBuilder result=new StringBuilder();
  result.append(type).append('/').append(subtype);
  for (  final String key : parameters.keySet()) {
    result.append(';').append(key).append('=').append(parameters.get(key));
  }
  if (quality < 1F) {
    result.append(';').append(TypeUtil.PARAMETER_Q).append('=').append(quality);
  }
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder result=new StringBuilder();
  result.append(type).append('/').append(subtype);
  for (  final String key : parameters.keySet()) {
    result.append(';').append(key).append('=').append(parameters.get(key));
  }
  return result.toString();
}
Program: 33334
Project: 33334
Buggy source:
private TreeMap<String,String> createParameterMap(){
  return new TreeMap<String,String>(new Comparator<String>(){
    @Override public int compare(    final String o1,    final String o2){
      return o1.compareToIgnoreCase(o2);
    }
  }
);
}

Fixed version (ground truth):
private static TreeMap<String,String> createParameterMap(){
  return new TreeMap<String,String>(new Comparator<String>(){
    @Override public int compare(    final String o1,    final String o2){
      return o1.compareToIgnoreCase(o2);
    }
  }
);
}
Program: 33335
Project: 33335
Buggy source:
@Override protected <T>String internalValueToString(final T value,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode) throws EdmPrimitiveTypeException {
  Date date=null;
  Integer fractionalSecs=null;
  if (value instanceof Calendar) {
    final Calendar calendar=(Calendar)value;
    date=calendar.getTime();
    fractionalSecs=calendar.get(Calendar.MILLISECOND);
  }
  if (value instanceof Timestamp) {
    final Timestamp timestamp=(Timestamp)value;
    date=new Date(timestamp.getTime());
    fractionalSecs=timestamp.getNanos();
  }
  final StringBuilder result=new StringBuilder().append(DATE_FORMAT.get().format(date));
  try {
    if (value instanceof Timestamp) {
      EdmDateTimeOffset.appendFractionalSeconds(result,fractionalSecs,precision);
    }
 else {
      EdmDateTimeOffset.appendMilliseconds(result,fractionalSecs,precision);
    }
  }
 catch (  final IllegalArgumentException e) {
    throw new EdmPrimitiveTypeException("String_Node_Str",e);
  }
  return result.toString();
}

Fixed version (ground truth):
@Override protected <T>String internalValueToString(final T value,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode) throws EdmPrimitiveTypeException {
  if (value instanceof Calendar) {
    final Calendar calendar=(Calendar)value;
    Date date=calendar.getTime();
    Integer fractionalSecs=calendar.get(Calendar.MILLISECOND);
    final StringBuilder result=new StringBuilder().append(DATE_FORMAT.get().format(date));
    EdmDateTimeOffset.appendMilliseconds(result,fractionalSecs,precision);
    return result.toString();
  }
 else   if (value instanceof Timestamp) {
    final Timestamp timestamp=(Timestamp)value;
    Date date=new Date(timestamp.getTime());
    Integer fractionalSecs=timestamp.getNanos();
    final StringBuilder result=new StringBuilder().append(DATE_FORMAT.get().format(date));
    EdmDateTimeOffset.appendFractionalSeconds(result,fractionalSecs,precision);
    return result.toString();
  }
 else {
    throw new EdmPrimitiveTypeException("String_Node_Str");
  }
}
Program: 33336
Project: 33336
Buggy source:
public static Object getKey(final Edm metadata,final Class<?> entityTypeRef,final CommonODataEntity entity){
  final Object res;
  if (entity.getProperties().isEmpty()) {
    res=null;
  }
 else {
    final Class<?> keyRef=ClassUtils.getCompoundKeyRef(entityTypeRef);
    if (keyRef == null) {
      final CommonODataProperty property=entity.getProperty(firstValidEntityKey(entityTypeRef));
      res=property == null || !property.hasPrimitiveValue() ? null : property.getPrimitiveValue().toValue();
    }
 else {
      try {
        res=keyRef.newInstance();
        populate(metadata,res,CompoundKeyElement.class,entity.getProperties().iterator());
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",keyRef.getSimpleName(),e);
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  return res;
}

Fixed version (ground truth):
public static Object getKey(final Edm metadata,final Class<?> entityTypeRef,final CommonODataEntity entity){
  Object res=null;
  if (!entity.getProperties().isEmpty()) {
    final Class<?> keyRef=ClassUtils.getCompoundKeyRef(entityTypeRef);
    if (keyRef == null) {
      final CommonODataProperty property=entity.getProperty(firstValidEntityKey(entityTypeRef));
      if (property != null && property.hasPrimitiveValue()) {
        res=primitiveValueToObject(property.getPrimitiveValue());
      }
    }
 else {
      try {
        res=keyRef.newInstance();
        populate(metadata,res,CompoundKeyElement.class,entity.getProperties().iterator());
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",keyRef.getSimpleName(),e);
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  return res;
}
Program: 33337
Project: 33337
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static Object getValueFromProperty(final Edm metadata,final CommonODataProperty property,final Type type) throws InstantiationException, IllegalAccessException {
  final Object value;
  if (property == null || property.hasNullValue()) {
    value=null;
  }
 else   if (property.hasCollectionValue()) {
    value=new ArrayList();
    final ParameterizedType collType=(ParameterizedType)type;
    final Class<?> collItemClass=(Class<?>)collType.getActualTypeArguments()[0];
    final Iterator<ODataValue> collPropItor=property.getValue().asCollection().iterator();
    while (collPropItor.hasNext()) {
      final ODataValue odataValue=collPropItor.next();
      if (odataValue.isPrimitive()) {
        ((Collection)value).add(odataValue.asPrimitive().toValue());
      }
      if (odataValue.isComplex()) {
        final Object collItem=collItemClass.newInstance();
        populate(metadata,collItem,Property.class,odataValue.asComplex().iterator());
        ((Collection)value).add(collItem);
      }
    }
  }
 else   if (property.hasPrimitiveValue()) {
    value=property.getPrimitiveValue().toValue();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + property);
  }
  return value;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static Object getValueFromProperty(final Edm metadata,final CommonODataProperty property,final Type type) throws InstantiationException, IllegalAccessException {
  final Object value;
  if (property == null || property.hasNullValue()) {
    value=null;
  }
 else   if (property.hasCollectionValue()) {
    value=new ArrayList();
    final ParameterizedType collType=(ParameterizedType)type;
    final Class<?> collItemClass=(Class<?>)collType.getActualTypeArguments()[0];
    final Iterator<ODataValue> collPropItor=property.getValue().asCollection().iterator();
    while (collPropItor.hasNext()) {
      final ODataValue odataValue=collPropItor.next();
      if (odataValue.isPrimitive()) {
        ((Collection)value).add(primitiveValueToObject(odataValue.asPrimitive()));
      }
      if (odataValue.isComplex()) {
        final Object collItem=collItemClass.newInstance();
        populate(metadata,collItem,Property.class,odataValue.asComplex().iterator());
        ((Collection)value).add(collItem);
      }
    }
  }
 else   if (property.hasPrimitiveValue()) {
    value=primitiveValueToObject(property.getPrimitiveValue());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + property);
  }
  return value;
}
Program: 33341
Project: 33341
Buggy source:
@Test public void runBfuncBnEsRtEs(){
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isParameter(0,"String_Node_Str","String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isParameter(0,"String_Node_Str","String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav).n().isCount();
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isKeyPredicate(0,"String_Node_Str","String_Node_Str").isKeyPredicate(1,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void runBfuncBnEsRtEs(){
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isParameter(0,"String_Node_Str","String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav);
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isType(EdmTechProvider.nameETTwoKeyNav).n().isCount();
  testUri.run("String_Node_Str").isKind(UriInfoKind.resource).goPath().first().isEntitySet("String_Node_Str").n().isFunction("String_Node_Str").isKeyPredicate(0,"String_Node_Str","String_Node_Str").isKeyPredicate(1,"String_Node_Str","String_Node_Str");
}
Program: 33342
Project: 33342
Buggy source:
@Test public void testBoundFunction_Overloading(){
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETTwoKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
}

Fixed version (ground truth):
@Test public void testBoundFunction_Overloading(){
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETTwoKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETTwoKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
  testPath.run("String_Node_Str").at(0).isUriPathInfoKind(UriResourceKind.entitySet).isType(EdmTechProvider.nameETTwoKeyNav).isCollection(true).at(1).isUriPathInfoKind(UriResourceKind.function).isType(EdmTechProvider.nameETTwoKeyNav);
}
Program: 33343
Project: 33343
Buggy source:
public FunctionMapKey(final FullQualifiedName functionName,final FullQualifiedName bindingParameterTypeName,final Boolean isBindingParameterCollection,final List<String> bindingParameterNames){
  this.functionName=functionName;
  this.bindingParameterTypeName=bindingParameterTypeName;
  this.isBindingParameterCollection=isBindingParameterCollection;
  parameterNames=bindingParameterNames;
}

Fixed version (ground truth):
public FunctionMapKey(final FullQualifiedName functionName,final FullQualifiedName bindingParameterTypeName,final Boolean isBindingParameterCollection,final List<String> bindingParameterNames){
  this.functionName=functionName;
  this.bindingParameterTypeName=bindingParameterTypeName;
  this.isBindingParameterCollection=isBindingParameterCollection;
  parameterNames=bindingParameterNames;
  if (parameterNames != null) {
    Collections.sort(parameterNames);
  }
}
Program: 33345
Project: 33345
Buggy source:
@Override public String getRequestUrl(String baseUri,boolean includeServletPath){
  return baseUri == null ? delegate.getRequestURL().toString() : (baseUri + delegate.getPathInfo());
}

Fixed version (ground truth):
@Override public String getRequestUrl(String baseUri,boolean includeServletPath){
  final String servletPath=includeServletPath ? delegate.getServletPath() : "String_Node_Str";
  final String pathInfo=delegate.getPathInfo() == null ? "String_Node_Str" : delegate.getPathInfo();
  return baseUri == null ? delegate.getRequestURL().toString() : (baseUri + servletPath + pathInfo);
}
Program: 33346
Project: 33346
Buggy source:
@Override public String getRequestUrl(String baseUri,boolean includeServletPath){
  return filterContext.getCompleteRequestPath().replace(requestSpec.getBaseUri(),baseUri);
}

Fixed version (ground truth):
@Override public String getRequestUrl(String baseUri,boolean includeServletPath){
  if (StringUtils.isBlank(baseUri)) {
    return filterContext.getCompleteRequestPath();
  }
  return filterContext.getCompleteRequestPath().replace(requestSpec.getBaseUri(),baseUri);
}
Program: 33347
Project: 33347
Buggy source:
@Override public byte[] getContent(){
  return requestSpec.getBody();
}

Fixed version (ground truth):
@Override public byte[] getContent(){
  String body=requestSpec.getBody();
  return body == null ? null : body.getBytes();
}
Program: 33348
Project: 33348
Buggy source:
@Before public void before(){
  RestAssured.baseURI=baseUrl();
  api=RamlLoaders.fromClasspath(RestAssuredTest.class).load("String_Node_Str").assumingBaseUri("String_Node_Str");
  restAssured=api.createRestAssured();
}

Fixed version (ground truth):
@Before public void before(){
  RestAssured.baseURI=baseUrlWithPort();
  api=RamlLoaders.fromClasspath(RestAssuredTest.class).load("String_Node_Str").assumingBaseUri("String_Node_Str");
  restAssured=api.createRestAssured();
}
Program: 33349
Project: 33349
Buggy source:
@Test public void testServletOk() throws IOException {
  restAssured.given().get("String_Node_Str").andReturn();
  assertTrue(restAssured.getLastReport().isEmpty());
}

Fixed version (ground truth):
@Test public void testServletOk() throws IOException {
  restAssured.given().get("String_Node_Str").andReturn();
  assertTrue(restAssured.getLastReport().toString(),restAssured.getLastReport().isEmpty());
}
Program: 33350
Project: 33350
Buggy source:
@Test public void includeServletPathNoPathInfo() throws Exception {
  final HttpPost post=new HttpPost(url("String_Node_Str"));
  execute(post,new MessageTester(){
    @Override public void test(    HttpServletRequest servletRequest,    HttpServletResponse servletResponse,    RamlRequest ramlRequest,    RamlResponse ramlResponse) throws IOException {
      assertEquals(baseUrl() + "String_Node_Str",ramlRequest.getRequestUrl(null,true));
      assertEquals("String_Node_Str",ramlRequest.getRequestUrl("String_Node_Str",true));
    }
  }
);
}

Fixed version (ground truth):
@Test public void includeServletPathNoPathInfo() throws Exception {
  final HttpPost post=new HttpPost(url("String_Node_Str"));
  execute(post,new MessageTester(){
    @Override public void test(    HttpServletRequest servletRequest,    HttpServletResponse servletResponse,    RamlRequest ramlRequest,    RamlResponse ramlResponse) throws IOException {
      assertEquals(baseUrlWithPort() + "String_Node_Str",ramlRequest.getRequestUrl(null,true));
      assertEquals("String_Node_Str",ramlRequest.getRequestUrl("String_Node_Str",true));
    }
  }
);
}
Program: 33351
Project: 33351
Buggy source:
@Test public void includeServletPathWithPathInfo() throws Exception {
  final HttpPost post=new HttpPost(url("String_Node_Str"));
  execute(post,new MessageTester(){
    @Override public void test(    HttpServletRequest servletRequest,    HttpServletResponse servletResponse,    RamlRequest ramlRequest,    RamlResponse ramlResponse) throws IOException {
      assertEquals(baseUrl() + "String_Node_Str",ramlRequest.getRequestUrl(null,true));
      assertEquals("String_Node_Str",ramlRequest.getRequestUrl("String_Node_Str",true));
    }
  }
);
}

Fixed version (ground truth):
@Test public void includeServletPathWithPathInfo() throws Exception {
  final HttpPost post=new HttpPost(url("String_Node_Str"));
  execute(post,new MessageTester(){
    @Override public void test(    HttpServletRequest servletRequest,    HttpServletResponse servletResponse,    RamlRequest ramlRequest,    RamlResponse ramlResponse) throws IOException {
      assertEquals(baseUrlWithPort() + "String_Node_Str",ramlRequest.getRequestUrl(null,true));
      assertEquals("String_Node_Str",ramlRequest.getRequestUrl("String_Node_Str",true));
    }
  }
);
}
Program: 33352
Project: 33352
Buggy source:
protected String baseUrl(){
  return "String_Node_Str" + port();
}

Fixed version (ground truth):
protected String baseUrl(){
  return "String_Node_Str";
}
Program: 33353
Project: 33353
Buggy source:
protected String url(String path){
  return baseUrl() + "String_Node_Str" + path;
}

Fixed version (ground truth):
protected String url(String path){
  return baseUrlWithPort() + "String_Node_Str" + path;
}
Program: 33354
Project: 33354
Buggy source:
/** 
 * 替换XML文件中attribute的value值
 * @param tarDoc		目标document
 * @param targetList		目标替换文字,模糊替换,即只要匹配list集合里中其中一个就会被抽取替换
 * @param replacement	替换成的内容
 * @return 是否有替换操作
 */
@SuppressWarnings("String_Node_Str") public static boolean replaceAttrValue(Document tarDoc,List<String> targetList,String replacement){
  boolean hasReplace=false;
  List<Element> tarElements=tarDoc.getRootElement().elements();
  for (  Element element : tarElements) {
    List<Attribute> attrs=element.attributes();
    for (    Attribute attr : attrs) {
      String attrValue=attr.getValue();
      int index=targetList.indexOf(attrValue);
      if (index != -1) {
        attr.setValue(replacement);
        hasReplace=true;
      }
    }
  }
  return hasReplace;
}

Fixed version (ground truth):
/** 
 * 替换XML文件中attribute的value值
 * @param tarDoc		目标document
 * @param targetList		目标替换文字,模糊替换,即只要匹配list集合里中其中一个就会被抽取替换
 * @param replacement	替换成的内容
 * @return 是否有替换操作
 */
@SuppressWarnings("String_Node_Str") public static boolean replaceAttrValue(Document tarDoc,List<String> targetList,String replacement){
  boolean hasReplace=false;
  List<Element> tarElements=XmlUtil.getAllElements(tarDoc);
  for (  Element element : tarElements) {
    List<Attribute> attrs=element.attributes();
    for (    Attribute attr : attrs) {
      String attrValue=attr.getValue();
      int index=targetList.indexOf(attrValue);
      if (index != -1) {
        attr.setValue(replacement);
        hasReplace=true;
      }
    }
  }
  return hasReplace;
}
Program: 33355
Project: 33355
Buggy source:
private void launchTv(){
  finish();
}

Fixed version (ground truth):
private void launchTv(){
  if (!CheckTV.isATV(this) && Preferences.getFirstRun(this)) {
    Preferences.setFirstRun(this);
    launchNavigation();
  }
  finish();
}
Program: 33356
Project: 33356
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  startActivity(new Intent(this,NavigationActivity.class));
  finish();
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setUpActivity();
  finish();
}
Program: 33357
Project: 33357
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  launchIntro();
  setUpInjections();
  setUpSettingsMenu();
  setUpAuthenticationListener();
  setUpContentRefreshing();
  setUpServers(savedInstanceState);
  setServerTitleClicked(false);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setUpInjections();
  setUpSettingsMenu();
  setUpAuthenticationListener();
  setUpContentRefreshing();
  setUpServers(savedInstanceState);
  setServerTitleClicked(false);
}
Program: 33358
Project: 33358
Buggy source:
private void finishDownloading(){
  DownloadManager.Query downloadQuery=new DownloadManager.Query().setFilterById(downloadId);
  Cursor downloadInformation=getDownloadManager(context).query(downloadQuery);
  downloadInformation.moveToFirst();
  int downloadStatus=downloadInformation.getInt(downloadInformation.getColumnIndex(DownloadManager.COLUMN_STATUS));
  if (downloadStatus == DownloadManager.STATUS_SUCCESSFUL) {
    String downloadUri=downloadInformation.getString(downloadInformation.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
    if (downloadUri.substring(0,7).matches("String_Node_Str")) {
      downloadUri=downloadUri.substring(7);
    }
    File file=new File(downloadUri);
    Uri contentUri=FileProvider.getUriForFile(context,"String_Node_Str",file);
    BusProvider.getBus().post(new FileDownloadedEvent(contentUri));
  }
 else {
    BusProvider.getBus().post(new FileDownloadFailedEvent());
  }
  downloadInformation.close();
}

Fixed version (ground truth):
private void finishDownloading(){
  DownloadManager.Query downloadQuery=new DownloadManager.Query().setFilterById(downloadId);
  Cursor downloadInformation=getDownloadManager(context).query(downloadQuery);
  downloadInformation.moveToFirst();
  int downloadStatus=downloadInformation.getInt(downloadInformation.getColumnIndex(DownloadManager.COLUMN_STATUS));
  if (downloadStatus == DownloadManager.STATUS_SUCCESSFUL) {
    String downloadUri=downloadInformation.getString(downloadInformation.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
    if (downloadUri.substring(0,7).matches("String_Node_Str")) {
      downloadUri=downloadUri.substring(7);
    }
    try {
      URI uri=new URI(downloadUri);
      downloadUri=uri.getPath();
    }
 catch (    URISyntaxException e) {
      Log.e("String_Node_Str","String_Node_Str" + downloadUri);
    }
    File file=new File(downloadUri);
    Uri contentUri=FileProvider.getUriForFile(context,"String_Node_Str",file);
    BusProvider.getBus().post(new FileDownloadedEvent(contentUri));
  }
 else {
    BusProvider.getBus().post(new FileDownloadFailedEvent());
  }
  downloadInformation.close();
}
Program: 33359
Project: 33359
Buggy source:
public boolean isConnected(Server server){
  return (this.server != null) && (this.server.getSession().equals(server.getSession()));
}

Fixed version (ground truth):
public boolean isConnected(Server server){
  return (this.server != null) && (this.serverRoute != null) && (this.server.getSession().equals(server.getSession()));
}
Program: 33360
Project: 33360
Buggy source:
@Override public void onFailure(Call<ServerRoute> call,Throwable t){
  BusProvider.getBus().post(new ServerConnectionFailedEvent());
}

Fixed version (ground truth):
@Override public void onFailure(Call<ServerRoute> call,Throwable t){
  BusProvider.getBus().post(new ServerRouteLoadFailedEvent(t.getMessage()));
}
Program: 33361
Project: 33361
Buggy source:
@Override public void onGuidedActionClicked(GuidedAction action){
  if (getSelectedActionPosition() <= 3) {
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_auto))) {
      Preferences.setPrefAuto(preference,mContext);
    }
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_remote))) {
      Preferences.setPrefRemote(preference,mContext);
    }
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_local))) {
      Preferences.setPrefLocal(preference,mContext);
    }
  }
 else {
    if (initialSelected.matches(Preferences.getServerConnection(preference,mContext)))     getActivity().finish();
 else     startActivity(new Intent(getActivity(),NavigationActivity.class));
  }
}

Fixed version (ground truth):
@Override public void onGuidedActionClicked(GuidedAction action){
  if (getSelectedActionPosition() <= 3) {
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_auto))) {
      Preferences.setPrefAuto(preference,mContext);
    }
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_remote))) {
      Preferences.setPrefRemote(preference,mContext);
    }
    if (OPTION_NAMES.get(getSelectedActionPosition() - 1).matches(getString(R.string.preference_entry_server_connection_local))) {
      Preferences.setPrefLocal(preference,mContext);
    }
    keepCheck();
  }
}
Program: 33362
Project: 33362
Buggy source:
@Override public void onCreateActions(@NonNull List<GuidedAction> actions,Bundle savedInstanceState){
  setTitle(actions);
  populateNames();
  populateDesc();
  String selected=getServerConnectionStatus();
  initialSelected=selected;
  markSelected(selected);
  setCheckedActionButtons(actions);
  setBackButton(actions);
}

Fixed version (ground truth):
@Override public void onCreateActions(@NonNull List<GuidedAction> actions,Bundle savedInstanceState){
  setTitle(actions);
  populateNames();
  populateDesc();
  String selected=getServerConnectionStatus();
  initialSelected=selected;
  markSelected(selected);
  setCheckedActionButtons(actions);
}
Program: 33363
Project: 33363
Buggy source:
@Subscribe public void onFilesLoaded(ServerFilesLoadedEvent event){
  List<ServerFile> serverFiles=sortFiles(event.getServerFiles());
  ListRow listRow=null;
  ArrayObjectAdapter gridRowAdapter=new ArrayObjectAdapter(new MainTVPresenter(getActivity(),serverClient,serverFiles));
  if (serverFiles.size() != 0) {
    String shareName=serverFiles.get(0).getParentShare().getName();
    for (int i=0; i < serverFiles.size(); i++) {
      gridRowAdapter.add(serverFiles.get(i));
    }
    for (int i=0; i < serverShareList.size(); i++) {
      if (shareName.matches(serverShareList.get(i).getName())) {
        HeaderItem headerItem=new HeaderItem(shareName);
        listRow=new ListRow(headerItem,gridRowAdapter);
        mRowsAdapter.add(listRow);
        serverShareList.remove(i);
        break;
      }
    }
  }
  if (listRow != null) {
    int index1=mRowsAdapter.indexOf(listRow);
    int index2=mRowsAdapter.indexOf(settingsRow);
    mRowsAdapter.replace(index1,settingsRow);
    mRowsAdapter.replace(index2,listRow);
  }
  setAdapter(mRowsAdapter);
}

Fixed version (ground truth):
@Subscribe public void onFilesLoaded(ServerFilesLoadedEvent event){
  List<ServerFile> serverFiles=sortFiles(event.getServerFiles());
  ListRow listRow=null;
  ArrayObjectAdapter gridRowAdapter=new ArrayObjectAdapter(new MainTVPresenter(getActivity(),serverClient,serverFiles));
  if (serverFiles.size() != 0) {
    String shareName=serverFiles.get(0).getParentShare().getName();
    for (int i=0; i < serverFiles.size(); i++) {
      gridRowAdapter.add(serverFiles.get(i));
    }
    for (int i=0; i < serverShareList.size(); i++) {
      if (shareName.matches(serverShareList.get(i).getName())) {
        HeaderItem headerItem=new HeaderItem(shareName);
        listRow=new ListRow(headerItem,gridRowAdapter);
        mRowsAdapter.add(listRow);
        serverShareList.remove(i);
        break;
      }
    }
  }
  if (listRow != null) {
    int index1=mRowsAdapter.indexOf(listRow);
    int index2=mRowsAdapter.indexOf(settingsRow);
    mRowsAdapter.replace(index1,settingsRow);
    mRowsAdapter.replace(index2,listRow);
  }
  sortHeaders();
  setAdapter(mRowsAdapter);
}
Program: 33364
Project: 33364
Buggy source:
@Override public void onGuidedActionClicked(GuidedAction action){
  if (getSelectedActionPosition() <= mServerArrayList.size()) {
    String server=mServerArrayList.get(getSelectedActionPosition() - 1).getName();
    Preferences.setServertoPref(server,mContext,mSharedPref);
  }
 else {
    startActivity(new Intent(mContext,NavigationActivity.class));
  }
}

Fixed version (ground truth):
@Override public void onGuidedActionClicked(GuidedAction action){
  if (getSelectedActionPosition() <= mServerArrayList.size()) {
    String server=mServerArrayList.get(getSelectedActionPosition() - 1).getName();
    if (indexSelected == (getSelectedActionPosition() - 1))     getActivity().finish();
 else {
      Preferences.setServertoPref(server,mContext,mSharedPref);
      startActivity(new Intent(mContext,NavigationActivity.class));
    }
  }
}
Program: 33365
Project: 33365
Buggy source:
@Override public void onCreateActions(@NonNull List<GuidedAction> actions,Bundle savedInstanceState){
  super.onCreateActions(actions,savedInstanceState);
  mSharedPref=Preferences.getPreference(mContext);
  mServerArrayList=getActivity().getIntent().getParcelableArrayListExtra(getString(R.string.intent_servers));
  setTitle(actions);
  populateData();
  String serverName=Preferences.getServerFromPref(mContext,mSharedPref);
  if (serverName == null) {
    setDefaultChecked();
  }
 else {
    int indexSelected=0;
    for (int i=0; i < mServerArrayList.size(); i++) {
      if (serverName.matches(mServerArrayList.get(i).getName())) {
        indexSelected=i;
        break;
      }
    }
    setFalseChecked();
    OPTION_CHECKED.set(indexSelected,true);
  }
  setCheckedActionButtons(actions);
  setBackButton(actions);
}

Fixed version (ground truth):
@Override public void onCreateActions(@NonNull List<GuidedAction> actions,Bundle savedInstanceState){
  super.onCreateActions(actions,savedInstanceState);
  mSharedPref=Preferences.getPreference(mContext);
  mServerArrayList=getActivity().getIntent().getParcelableArrayListExtra(getString(R.string.intent_servers));
  setTitle(actions);
  populateData();
  String serverName=Preferences.getServerFromPref(mContext,mSharedPref);
  if (serverName == null) {
    setDefaultChecked();
  }
 else {
    for (int i=0; i < mServerArrayList.size(); i++) {
      if (serverName.matches(mServerArrayList.get(i).getName())) {
        indexSelected=i;
        break;
      }
    }
    setFalseChecked();
    OPTION_CHECKED.set(indexSelected,true);
  }
  setCheckedActionButtons(actions);
}
Program: 33366
Project: 33366
Buggy source:
private void tearDownAudioPlayback(){
  audioPlayer.reset();
}

Fixed version (ground truth):
private void tearDownAudioPlayback(){
  if (isAudioPlaying())   pauseAudio();
  audioPlayer.reset();
}
Program: 33367
Project: 33367
Buggy source:
public void pauseAudio(){
  audioPlayer.pause();
  setMediaPlaybackState(PlaybackStateCompat.STATE_PAUSED);
  setUpAudioPlayerNotification(audioMetadataFormatter,audioAlbumArt);
}

Fixed version (ground truth):
public void pauseAudio(){
  mediaSession.setActive(false);
  audioPlayer.pause();
  setMediaPlaybackState(PlaybackStateCompat.STATE_PAUSED);
}
Program: 33368
Project: 33368
Buggy source:
@Subscribe public void onAudioMetadataRetrieved(AudioMetadataRetrievedEvent event){
  this.audioMetadataFormatter=new AudioMetadataFormatter(event.getAudioTitle(),event.getAudioArtist(),event.getAudioAlbum());
  this.audioAlbumArt=event.getAudioAlbumArt();
  setUpAudioPlayerRemote(audioMetadataFormatter,audioAlbumArt);
  setUpAudioPlayerNotification(audioMetadataFormatter,audioAlbumArt);
}

Fixed version (ground truth):
@Subscribe public void onAudioMetadataRetrieved(AudioMetadataRetrievedEvent event){
  this.audioMetadataFormatter=new AudioMetadataFormatter(event.getAudioTitle(),event.getAudioArtist(),event.getAudioAlbum());
  this.audioAlbumArt=event.getAudioAlbumArt();
  setUpAudioPlayerRemote(audioMetadataFormatter,audioAlbumArt);
  mMediaNotificationManager.startNotification();
}
Program: 33369
Project: 33369
Buggy source:
private void setUpAudioPlayerRemote(AudioMetadataFormatter audioMetadataFormatter,Bitmap audioAlbumArt){
  mediaSession.setMetadata(new MediaMetadataCompat.Builder().putString(MediaMetadataCompat.METADATA_KEY_TITLE,audioMetadataFormatter.getAudioTitle(audioFile)).putString(MediaMetadataCompat.METADATA_KEY_ALBUM,audioMetadataFormatter.getAudioSubtitle(audioShare)).putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART,getAudioPlayerRemoteArtwork(audioAlbumArt)).build());
}

Fixed version (ground truth):
private void setUpAudioPlayerRemote(AudioMetadataFormatter audioMetadataFormatter,Bitmap audioAlbumArt){
  mediaSession.setMetadata(new MediaMetadataCompat.Builder().putString(MediaMetadataCompat.METADATA_KEY_TITLE,audioMetadataFormatter.getAudioTitle(audioFile)).putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE,audioMetadataFormatter.getAudioSubtitle(audioShare)).putString(MediaMetadataCompat.METADATA_KEY_ALBUM,audioMetadataFormatter.getAudioSubtitle(audioShare)).putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART,getAudioPlayerRemoteArtwork(audioAlbumArt)).build());
}
Program: 33370
Project: 33370
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  MediaButtonReceiver.handleIntent(mediaSession,intent);
  handleIntent(intent);
  return super.onStartCommand(intent,flags,startId);
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  MediaButtonReceiver.handleIntent(mediaSession,intent);
  return super.onStartCommand(intent,flags,startId);
}
Program: 33371
Project: 33371
Buggy source:
private void setMediaPlaybackState(int state){
  PlaybackStateCompat.Builder playbackStateBuilder=new PlaybackStateCompat.Builder();
  if (state == PlaybackStateCompat.STATE_PLAYING) {
    playbackStateBuilder.setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PAUSE);
  }
 else {
    playbackStateBuilder.setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PLAY);
  }
  playbackStateBuilder.setState(state,PlaybackStateCompat.PLAYBACK_POSITION_UNKNOWN,0);
  mediaSession.setPlaybackState(playbackStateBuilder.build());
}

Fixed version (ground truth):
private void setMediaPlaybackState(int state){
  PlaybackStateCompat.Builder playbackStateBuilder=new PlaybackStateCompat.Builder();
  playbackStateBuilder.setActions(getAvailableActions());
  playbackStateBuilder.setState(state,audioPlayer.getCurrentPosition(),1.0f,SystemClock.elapsedRealtime());
  mediaSession.setPlaybackState(playbackStateBuilder.build());
}
Program: 33372
Project: 33372
Buggy source:
public void playAudio(){
  audioPlayer.start();
  setMediaPlaybackState(PlaybackStateCompat.STATE_PLAYING);
  setUpAudioPlayerNotification(audioMetadataFormatter,audioAlbumArt);
}

Fixed version (ground truth):
public void playAudio(){
  mediaSession.setActive(true);
  audioPlayer.start();
  setMediaPlaybackState(PlaybackStateCompat.STATE_PLAYING);
}
Program: 33373
Project: 33373
Buggy source:
private void tearDownAudioPlayerNotification(){
  stopForeground(true);
}

Fixed version (ground truth):
private void tearDownAudioPlayerNotification(){
  mMediaNotificationManager.stopNotification();
}
Program: 33374
Project: 33374
Buggy source:
private void setUpWebResourceContent(Bundle state){
  if (!isWebResourceStateValid(state)) {
    getWebView().loadUrl(getWebResourceUri().toString());
  }
}

Fixed version (ground truth):
private void setUpWebResourceContent(Bundle state){
  if (!isWebResourceStateValid(state)) {
    getWebView().getSettings().setLoadWithOverviewMode(true);
    getWebView().getSettings().setUseWideViewPort(true);
    getWebView().getSettings().setBuiltInZoomControls(true);
    getWebView().loadUrl(getWebResourceUri().toString());
  }
}
Program: 33375
Project: 33375
Buggy source:
private void tearDownActivity(){
  getActivity().finish();
  Intent myIntent=new Intent(getActivity().getApplicationContext(),AuthenticationActivity.class);
  myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  startActivity(myIntent);
}

Fixed version (ground truth):
private void tearDownActivity(){
  Toast.makeText(getActivity(),R.string.message_logout,Toast.LENGTH_SHORT).show();
  Intent myIntent=new Intent(getActivity().getApplicationContext(),NavigationActivity.class);
  myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  startActivity(myIntent);
  getActivity().finish();
}
Program: 33376
Project: 33376
Buggy source:
private void setUpImageListener(){
  getImagePager().setOnPageChangeListener(this);
}

Fixed version (ground truth):
private void setUpImageListener(){
  getImagePager().addOnPageChangeListener(this);
}
Program: 33377
Project: 33377
Buggy source:
private ImageView getImageView(){
  return (ImageView)getView().findViewById(R.id.image);
}

Fixed version (ground truth):
private TouchImageView getImageView(){
  return (TouchImageView)getView().findViewById(R.id.image);
}
Program: 33378
Project: 33378
Buggy source:
float getFixDragTrans(float delta,float viewSize,float contentSize){
  if (contentSize <= viewSize) {
    return 0;
  }
  return delta;
}

Fixed version (ground truth):
float getFixDragTrans(float delta,float viewSize,float contentSize){
  if (contentSize <= viewSize) {
    return 0f;
  }
  return delta;
}