nus-yam/ex-repair huggingface dataset:
Program: 111091
Project: 111091
Buggy source:
/** 
 * get folder name from path <p/> <pre> getFolderName(null)               =   null getFolderName("")                 =   "" getFolderName("   ")              =   "" getFolderName("a.mp3")            =   "" getFolderName("a.b.rmvb")         =   "" getFolderName("abc")              =   "" getFolderName("c:\\")              =   "c:" getFolderName("c:\\a")             =   "c:" getFolderName("c:\\a.b")           =   "c:" getFolderName("c:a.txt\\a")        =   "c:a.txt" getFolderName("c:a\\b\\c\\d.txt")    =   "c:a\\b\\c" getFolderName("/home/admin")      =   "/home" getFolderName("/home/admin/a.txt/b.mp3")  =   "/home/admin/a.txt" </pre>
 * @param filePath
 * @return
 */
public static String getFolderName(String filePath){
  if (BasicUtils.judgeNotNull(filePath)) {
    return filePath;
  }
  int filePosi=filePath.lastIndexOf(File.separator);
  return (filePosi == -1) ? "String_Node_Str" : filePath.substring(0,filePosi);
}

Fixed version (ground truth):
/** 
 * get folder name from path <p/> <pre> getFolderName(null)               =   null getFolderName("")                 =   "" getFolderName("   ")              =   "" getFolderName("a.mp3")            =   "" getFolderName("a.b.rmvb")         =   "" getFolderName("abc")              =   "" getFolderName("c:\\")              =   "c:" getFolderName("c:\\a")             =   "c:" getFolderName("c:\\a.b")           =   "c:" getFolderName("c:a.txt\\a")        =   "c:a.txt" getFolderName("c:a\\b\\c\\d.txt")    =   "c:a\\b\\c" getFolderName("/home/admin")      =   "/home" getFolderName("/home/admin/a.txt/b.mp3")  =   "/home/admin/a.txt" </pre>
 * @param filePath
 * @return
 */
public static String getFolderName(String filePath){
  if (isFileExist(filePath)) {
    return filePath;
  }
  int filePosi=filePath.lastIndexOf(File.separator);
  return (filePosi == -1) ? "String_Node_Str" : filePath.substring(0,filePosi);
}
Program: 111092
Project: 111092
Buggy source:
/** 
 * Creates the directory named by the trailing filename of this file, including the complete directory path required to create this directory. <br/> <br/> <ul> <strong>Attentions:</strong> <li>makeDirs("C:\\Users\\Trinea") can only create users folder</li> <li>makeFolder("C:\\Users\\Trinea\\") can create Trinea folder</li> </ul>
 * @param filePath
 * @return true if the necessary directories have been created or the target directory already exists, false one ofthe directories can not be created. <ul> <li>if  {@link FileUtils#getFolderName(String)} return null, return false</li><li>if target directory already exists, return true</li> <li>return  {@link java.io.File#}</li> </ul>
 */
public static boolean makeDirs(String filePath){
  String folderName=getFolderName(filePath);
  if (BasicUtils.judgeNotNull(folderName)) {
    return false;
  }
  File folder=new File(folderName);
  return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs();
}

Fixed version (ground truth):
/** 
 * Creates the directory named by the trailing filename of this file, including the complete directory path required to create this directory. <br/> <br/> <ul> <strong>Attentions:</strong> <li>makeDirs("C:\\Users\\Trinea") can only create users folder</li> <li>makeFolder("C:\\Users\\Trinea\\") can create Trinea folder</li> </ul>
 * @param filePath
 * @return true if the necessary directories have been created or the target directory already exists, false one ofthe directories can not be created. <ul> <li>if  {@link FileUtils#getFolderName(String)} return null, return false</li><li>if target directory already exists, return true</li> <li>return  {@link java.io.File#}</li> </ul>
 */
public static boolean makeDirs(String filePath){
  String folderName=getFolderName(filePath);
  File folder=new File(folderName);
  Logs.d(folder.getAbsolutePath() + "String_Node_Str" + folder.exists());
  if (folder.exists()) {
    return false;
  }
  return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs();
}
Program: 111093
Project: 111093
Buggy source:
/** 
 * @deprecated
 * @param fileName
 * @param content
 * @throws IOException
 */
public static void writeFileFromString(String fileName,String content) throws IOException {
  FileOutputStream fileOutputStream=new FileOutputStream(new File(fileName));
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(fileOutputStream);
  bufferedOutputStream.write(content.getBytes());
  bufferedOutputStream.flush();
  bufferedOutputStream.close();
  fileOutputStream.close();
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @param content
 * @throws IOException
 * @deprecated
 */
public static void writeFileFromString(String fileName,String content) throws IOException {
  FileOutputStream fileOutputStream=new FileOutputStream(new File(fileName));
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(fileOutputStream);
  bufferedOutputStream.write(content.getBytes());
  bufferedOutputStream.flush();
  bufferedOutputStream.close();
  fileOutputStream.close();
}
Program: 111094
Project: 111094
Buggy source:
public static void getUseCookie(Context context,String url,HashMap hashMap,AsyncHttpResponseHandler responseHandler){
  PersistentCookieStore myCookieStore=new PersistentCookieStore(context);
  if (BasicUtils.judgeNotNull(hashMap)) {
    Iterator iterator=hashMap.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry entry=(Map.Entry)iterator.next();
      Object key=entry.getKey();
      Object value=entry.getValue();
      Cookie cookie=new BasicClientCookie(key.toString(),value.toString());
      myCookieStore.addCookie(cookie);
    }
  }
  client.setCookieStore(myCookieStore);
  client.get(getAbsoluteUrl(url),responseHandler);
}

Fixed version (ground truth):
public static void getUseCookie(Context context,String url,HashMap hashMap,AsyncHttpResponseHandler responseHandler){
  PersistentCookieStore myCookieStore=new PersistentCookieStore(context);
  if (BasicUtils.judgeNotNull(hashMap)) {
    Iterator iterator=hashMap.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry entry=(Map.Entry)iterator.next();
      Object key=entry.getKey();
      Object value=entry.getValue();
      Cookie cookie=new BasicClientCookie(key.toString(),value.toString());
      myCookieStore.addCookie(cookie);
    }
  }
  AsyncHttpClient client=new AsyncHttpClient();
  client.setCookieStore(myCookieStore);
  client.get(getAbsoluteUrl(url),responseHandler);
}
Program: 111095
Project: 111095
Buggy source:
public static void post(String url,AsyncHttpResponseHandler responseHandler){
  client.post(getAbsoluteUrl(url),responseHandler);
}

Fixed version (ground truth):
public static void post(String url,AsyncHttpResponseHandler responseHandler){
  AsyncHttpClient client=new AsyncHttpClient();
  client.post(getAbsoluteUrl(url),responseHandler);
}
Program: 111096
Project: 111096
Buggy source:
public static void get(String url,AsyncHttpResponseHandler responseHandler){
  client.setTimeout(TIME_OUT);
  client.get(getAbsoluteUrl(url),responseHandler);
}

Fixed version (ground truth):
public static void get(String url,AsyncHttpResponseHandler responseHandler){
  AsyncHttpClient client=new AsyncHttpClient();
  client.setTimeout(TIME_OUT);
  client.get(getAbsoluteUrl(url),responseHandler);
}
Program: 111097
Project: 111097
Buggy source:
public static void getWithCookie(Context context,String url,RequestParams params,AsyncHttpResponseHandler responseHandler){
  PersistentCookieStore myCookieStore=new PersistentCookieStore(context);
  client.setCookieStore(myCookieStore);
  client.get(getAbsoluteUrl(url),params,responseHandler);
}

Fixed version (ground truth):
public static void getWithCookie(Context context,String url,RequestParams params,AsyncHttpResponseHandler responseHandler){
  AsyncHttpClient client=new AsyncHttpClient();
  PersistentCookieStore myCookieStore=new PersistentCookieStore(context);
  client.setCookieStore(myCookieStore);
  client.get(getAbsoluteUrl(url),params,responseHandler);
}
Program: 111098
Project: 111098
Buggy source:
protected DefaultDockerClient.Builder getBuilder() throws DockerCertificateException {
  return DefaultDockerClient.fromEnv().readTimeoutMillis(NO_TIMEOUT);
}

Fixed version (ground truth):
protected DefaultDockerClient.Builder getBuilder() throws DockerCertificateException {
  return DefaultDockerClient.fromEnv().readTimeoutMillis(0);
}
Program: 111102
Project: 111102
Buggy source:
private void updateGitInformation(Log log){
  try {
    Repository repo=new Git().getRepo();
    if (repo != null) {
      this.repo=repo.getConfig().getString("String_Node_Str","String_Node_Str","String_Node_Str");
      final ObjectId head=repo.resolve("String_Node_Str");
      if (head != null && !isNullOrEmpty(head.getName())) {
        this.commit=head.getName();
      }
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void updateGitInformation(Log log){
  try {
    final Repository repo=new Git().getRepo();
    if (repo != null) {
      this.repo=repo.getConfig().getString("String_Node_Str","String_Node_Str","String_Node_Str");
      final ObjectId head=repo.resolve("String_Node_Str");
      if (head != null && !isNullOrEmpty(head.getName())) {
        this.commit=head.getName();
      }
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 111103
Project: 111103
Buggy source:
public String getCommitId() throws GitAPIException, DockerException, IOException, MojoExecutionException {
  if (repo == null) {
    throw new MojoExecutionException("String_Node_Str");
  }
  final StringBuilder result=new StringBuilder();
  try {
    final ObjectId head=repo.resolve("String_Node_Str");
    if (head == null || isNullOrEmpty(head.getName())) {
      return null;
    }
    result.append(head.getName().substring(0,7));
    final org.eclipse.jgit.api.Git git=new org.eclipse.jgit.api.Git(repo);
    for (    Ref gitTag : git.tagList().call()) {
      if (gitTag.getObjectId().equals(head)) {
        final String name=gitTag.getName();
        result.append("String_Node_Str");
        result.append(name.substring(name.lastIndexOf('/') + 1));
        break;
      }
    }
    final Status status=git.status().call();
    if (status.hasUncommittedChanges()) {
      result.append("String_Node_Str");
    }
  }
  finally {
    repo.close();
  }
  return result.length() == 0 ? null : result.toString();
}

Fixed version (ground truth):
public String getCommitId() throws GitAPIException, DockerException, IOException, MojoExecutionException {
  if (repo == null) {
    throw new MojoExecutionException("String_Node_Str");
  }
  final StringBuilder result=new StringBuilder();
  try {
    final ObjectId head=repo.resolve("String_Node_Str");
    if (head == null || isNullOrEmpty(head.getName())) {
      return null;
    }
    result.append(head.getName().substring(0,7));
    final org.eclipse.jgit.api.Git git=new org.eclipse.jgit.api.Git(repo);
    for (    final Ref gitTag : git.tagList().call()) {
      if (gitTag.getObjectId().equals(head)) {
        final String name=gitTag.getName();
        result.append("String_Node_Str");
        result.append(name.substring(name.lastIndexOf('/') + 1));
        break;
      }
    }
    final Status status=git.status().call();
    if (status.hasUncommittedChanges()) {
      result.append("String_Node_Str");
    }
  }
  finally {
    repo.close();
  }
  return result.length() == 0 ? null : result.toString();
}
Program: 111104
Project: 111104
Buggy source:
protected void execute(final DockerClient docker) throws MojoExecutionException, DockerException, IOException, InterruptedException {
  final String imageNameWithoutTag=parseImageName(imageName)[0];
  if (imageTags == null) {
    imageTags=Collections.singletonList("String_Node_Str");
  }
  for (  final String imageTag : imageTags) {
    String currImageName=imageNameWithoutTag + ((isNullOrEmpty(imageTag)) ? "String_Node_Str" : ("String_Node_Str" + imageTag));
    getLog().info("String_Node_Str" + currImageName);
    try {
      for (      RemovedImage removedImage : docker.removeImage(currImageName,true,false)) {
        getLog().info("String_Node_Str" + removedImage.imageId());
      }
    }
 catch (    ImageNotFoundException|NotFoundException e) {
      getLog().warn("String_Node_Str" + imageName + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void execute(final DockerClient docker) throws MojoExecutionException, DockerException, IOException, InterruptedException {
  final String imageNameWithoutTag=parseImageName(imageName)[0];
  if (imageTags == null) {
    imageTags=Collections.singletonList("String_Node_Str");
  }
  for (  final String imageTag : imageTags) {
    final String currImageName=imageNameWithoutTag + ((isNullOrEmpty(imageTag)) ? "String_Node_Str" : ("String_Node_Str" + imageTag));
    getLog().info("String_Node_Str" + currImageName);
    try {
      for (      final RemovedImage removedImage : docker.removeImage(currImageName,true,false)) {
        getLog().info("String_Node_Str" + removedImage.imageId());
      }
    }
 catch (    ImageNotFoundException|NotFoundException e) {
      getLog().warn("String_Node_Str" + imageName + "String_Node_Str");
    }
  }
}
Program: 111105
Project: 111105
Buggy source:
@Test public void testSettingsNoEmail() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  Server server=mockServer();
  server.setConfiguration(new Xpp3Dom(CONFIGURATION_PROPERTY));
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}

Fixed version (ground truth):
@Test public void testSettingsNoEmail() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  final Server server=mockServer();
  server.setConfiguration(new Xpp3Dom(CONFIGURATION_PROPERTY));
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}
Program: 111106
Project: 111106
Buggy source:
@Test public void testSettingsNoConfiguration() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  Server server=mockServer();
  server.setConfiguration(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}

Fixed version (ground truth):
@Test public void testSettingsNoConfiguration() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  final Server server=mockServer();
  server.setConfiguration(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}
Program: 111107
Project: 111107
Buggy source:
@Test public void testSettingsNoUsername() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  Server server=mockServer();
  server.setUsername(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}

Fixed version (ground truth):
@Test public void testSettingsNoUsername() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  final Server server=mockServer();
  server.setUsername(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}
Program: 111108
Project: 111108
Buggy source:
@Test public void testSettingsNoPassword() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  Server server=mockServer();
  server.setPassword(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}

Fixed version (ground truth):
@Test public void testSettingsNoPassword() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  final Server server=mockServer();
  server.setPassword(null);
  when(settings.getServer(SERVER_ID)).thenReturn(server);
  Throwable cause=null;
  try {
    sut.execute();
  }
 catch (  MojoExecutionException exception) {
    cause=exception.getCause();
  }
  assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);
}
Program: 111109
Project: 111109
Buggy source:
private Server mockServer(){
  Server server=new Server();
  server.setUsername(USERNAME);
  server.setPassword(PASSWORD);
  Xpp3Dom email=new Xpp3Dom(EMAIL_PROPERTY);
  email.setValue(EMAIL);
  Xpp3Dom configuration=new Xpp3Dom(CONFIGURATION_PROPERTY);
  configuration.addChild(email);
  server.setConfiguration(configuration);
  return server;
}

Fixed version (ground truth):
private Server mockServer(){
  final Server server=new Server();
  server.setUsername(USERNAME);
  server.setPassword(PASSWORD);
  final Xpp3Dom email=new Xpp3Dom(EMAIL_PROPERTY);
  email.setValue(EMAIL);
  final Xpp3Dom configuration=new Xpp3Dom(CONFIGURATION_PROPERTY);
  configuration.addChild(email);
  server.setConfiguration(configuration);
  return server;
}
Program: 111110
Project: 111110
Buggy source:
@Test public void testAuthorizationConfiguration() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  when(settings.getServer(SERVER_ID)).thenReturn(mockServer());
  when(builder.authConfig(authConfigCaptor.capture())).thenReturn(builder);
  sut.execute();
  AuthConfig authConfig=authConfigCaptor.getValue();
  assertThat(authConfig).isNotNull();
  assertThat(authConfig.email()).isEqualTo(EMAIL);
  assertThat(authConfig.password()).isEqualTo(PASSWORD);
  assertThat(authConfig.username()).isEqualTo(USERNAME);
  assertThat(authConfig.serverAddress()).isEqualTo(DEFAULT_REGISTRY);
}

Fixed version (ground truth):
@Test public void testAuthorizationConfiguration() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  when(settings.getServer(SERVER_ID)).thenReturn(mockServer());
  when(builder.authConfig(authConfigCaptor.capture())).thenReturn(builder);
  sut.execute();
  final AuthConfig authConfig=authConfigCaptor.getValue();
  assertThat(authConfig).isNotNull();
  assertThat(authConfig.email()).isEqualTo(EMAIL);
  assertThat(authConfig.password()).isEqualTo(PASSWORD);
  assertThat(authConfig.username()).isEqualTo(USERNAME);
  assertThat(authConfig.serverAddress()).isEqualTo(DEFAULT_REGISTRY);
}
Program: 111111
Project: 111111
Buggy source:
@Test public void testAuthorizationConfigurationWithServerAddress() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  ReflectionTestUtils.setField(sut,"String_Node_Str",REGISTRY_URL);
  when(settings.getServer(SERVER_ID)).thenReturn(mockServer());
  when(builder.authConfig(authConfigCaptor.capture())).thenReturn(builder);
  sut.execute();
  AuthConfig authConfig=authConfigCaptor.getValue();
  assertThat(authConfig).isNotNull();
  assertThat(authConfig.serverAddress()).isEqualTo(REGISTRY_URL);
}

Fixed version (ground truth):
@Test public void testAuthorizationConfigurationWithServerAddress() throws Exception {
  ReflectionTestUtils.setField(sut,"String_Node_Str",SERVER_ID);
  ReflectionTestUtils.setField(sut,"String_Node_Str",REGISTRY_URL);
  when(settings.getServer(SERVER_ID)).thenReturn(mockServer());
  when(builder.authConfig(authConfigCaptor.capture())).thenReturn(builder);
  sut.execute();
  final AuthConfig authConfig=authConfigCaptor.getValue();
  assertThat(authConfig).isNotNull();
  assertThat(authConfig.serverAddress()).isEqualTo(REGISTRY_URL);
}
Program: 111112
Project: 111112
Buggy source:
public void testBuildGeneratedDockerFile_CopiesEntireDirectory() throws Exception {
  final File pom=getTestFile("String_Node_Str");
  final BuildMojo mojo=setupMojo(pom);
  final DockerClient docker=mock(DockerClient.class);
  mojo.execute(docker);
  verify(docker).build(eq(Paths.get("String_Node_Str")),eq("String_Node_Str"),any(AnsiProgressHandler.class));
  List<String> expectedDockerFileContents=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",expectedDockerFileContents,Files.readAllLines(Paths.get("String_Node_Str"),UTF_8));
  assertFileExists("String_Node_Str");
  assertFileExists("String_Node_Str");
}

Fixed version (ground truth):
public void testBuildGeneratedDockerFile_CopiesEntireDirectory() throws Exception {
  final File pom=getTestFile("String_Node_Str");
  final BuildMojo mojo=setupMojo(pom);
  final DockerClient docker=mock(DockerClient.class);
  mojo.execute(docker);
  verify(docker).build(eq(Paths.get("String_Node_Str")),eq("String_Node_Str"),any(AnsiProgressHandler.class));
  final List<String> expectedDockerFileContents=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",expectedDockerFileContents,Files.readAllLines(Paths.get("String_Node_Str"),UTF_8));
  assertFileExists("String_Node_Str");
  assertFileExists("String_Node_Str");
}
Program: 111113
Project: 111113
Buggy source:
public ProjectStub(File pom){
  MavenXpp3Reader pomReader=new MavenXpp3Reader();
  Model model;
  try {
    model=pomReader.read(ReaderFactory.newXmlReader(pom));
    setModel(model);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  setGroupId(model.getGroupId());
  setArtifactId(model.getArtifactId());
  setVersion(model.getVersion());
  setName(model.getName());
  setUrl(model.getUrl());
  setPackaging(model.getPackaging());
  setBuild(model.getBuild());
  List<String> compileSourceRoots=new ArrayList<>();
  compileSourceRoots.add(getBasedir() + "String_Node_Str");
  setCompileSourceRoots(compileSourceRoots);
  List<String> testCompileSourceRoots=new ArrayList<>();
  testCompileSourceRoots.add(getBasedir() + "String_Node_Str");
  setTestCompileSourceRoots(testCompileSourceRoots);
  getBuild().setDirectory("String_Node_Str");
  getBuild().setTestOutputDirectory(new File(getBasedir(),"String_Node_Str").getAbsolutePath());
}

Fixed version (ground truth):
public ProjectStub(File pom){
  final MavenXpp3Reader pomReader=new MavenXpp3Reader();
  Model model;
  try {
    model=pomReader.read(ReaderFactory.newXmlReader(pom));
    setModel(model);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  setGroupId(model.getGroupId());
  setArtifactId(model.getArtifactId());
  setVersion(model.getVersion());
  setName(model.getName());
  setUrl(model.getUrl());
  setPackaging(model.getPackaging());
  setBuild(model.getBuild());
  final List<String> compileSourceRoots=new ArrayList<>();
  compileSourceRoots.add(getBasedir() + "String_Node_Str");
  setCompileSourceRoots(compileSourceRoots);
  final List<String> testCompileSourceRoots=new ArrayList<>();
  testCompileSourceRoots.add(getBasedir() + "String_Node_Str");
  setTestCompileSourceRoots(testCompileSourceRoots);
  getBuild().setDirectory("String_Node_Str");
  getBuild().setTestOutputDirectory(new File(getBasedir(),"String_Node_Str").getAbsolutePath());
}
Program: 111114
Project: 111114
Buggy source:
public SettingsStub(){
  super();
  Server server=new Server();
  server.setId("String_Node_Str");
  server.setUsername("String_Node_Str");
  server.setPassword("String_Node_Str");
  Xpp3Dom configuration=new Xpp3Dom("String_Node_Str");
  Xpp3Dom email=new Xpp3Dom("String_Node_Str");
  email.setValue("String_Node_Str");
  configuration.addChild(email);
  server.setConfiguration(configuration);
  addServer(server);
}

Fixed version (ground truth):
public SettingsStub(){
  super();
  final Server server=new Server();
  server.setId("String_Node_Str");
  server.setUsername("String_Node_Str");
  server.setPassword("String_Node_Str");
  final Xpp3Dom configuration=new Xpp3Dom("String_Node_Str");
  final Xpp3Dom email=new Xpp3Dom("String_Node_Str");
  email.setValue("String_Node_Str");
  configuration.addChild(email);
  server.setConfiguration(configuration);
  addServer(server);
}
Program: 111115
Project: 111115
Buggy source:
@Test public void testParseImageNameWithSeperator() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE_WITH_SEPERATOR);
  assertThat(result).containsExactly(IMAGE,null);
}

Fixed version (ground truth):
@Test public void testParseImageNameWithSeperator() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE_WITH_SEPERATOR);
  assertThat(result).containsExactly(IMAGE,null);
}
Program: 111116
Project: 111116
Buggy source:
@Test public void testParseImageNameWithLibrary() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE_WITH_LIBRARY);
  assertThat(result).containsExactly(IMAGE_WITH_LIBRARY,null);
}

Fixed version (ground truth):
@Test public void testParseImageNameWithLibrary() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE_WITH_LIBRARY);
  assertThat(result).containsExactly(IMAGE_WITH_LIBRARY,null);
}
Program: 111117
Project: 111117
Buggy source:
@Test public void testParseImageNameFromRegistryAndTag() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE_FROM_REG_WITH_TAG);
  assertThat(result).containsExactly(IMAGE_FROM_REGISTRY,TAG);
}

Fixed version (ground truth):
@Test public void testParseImageNameFromRegistryAndTag() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE_FROM_REG_WITH_TAG);
  assertThat(result).containsExactly(IMAGE_FROM_REGISTRY,TAG);
}
Program: 111118
Project: 111118
Buggy source:
@Test public void testParseImageNameWithLibraryAndTag() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE_FROM_LIB_WITH_TAG);
  assertThat(result).containsExactly(IMAGE_WITH_LIBRARY,TAG);
}

Fixed version (ground truth):
@Test public void testParseImageNameWithLibraryAndTag() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE_FROM_LIB_WITH_TAG);
  assertThat(result).containsExactly(IMAGE_WITH_LIBRARY,TAG);
}
Program: 111119
Project: 111119
Buggy source:
@Test public void testParseImageName() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE);
  assertThat(result).containsExactly(IMAGE,null);
}

Fixed version (ground truth):
@Test public void testParseImageName() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE);
  assertThat(result).containsExactly(IMAGE,null);
}
Program: 111120
Project: 111120
Buggy source:
@Test public void testParseImageNameWithTag() throws MojoExecutionException {
  String[] result=Utils.parseImageName(IMAGE_WITH_TAG);
  assertThat(result).containsExactly(IMAGE,TAG);
}

Fixed version (ground truth):
@Test public void testParseImageNameWithTag() throws MojoExecutionException {
  final String[] result=Utils.parseImageName(IMAGE_WITH_TAG);
  assertThat(result).containsExactly(IMAGE,TAG);
}
Program: 111121
Project: 111121
Buggy source:
@Test public void testPushImage() throws Exception {
  DockerClient dockerClient=mock(DockerClient.class);
  Log log=mock(Log.class);
  final DockerBuildInformation buildInfo=mock(DockerBuildInformation.class);
  Utils.pushImage(dockerClient,IMAGE,log,buildInfo,0,1);
  verify(dockerClient).push(eq(IMAGE),any(AnsiProgressHandler.class));
}

Fixed version (ground truth):
@Test public void testPushImage() throws Exception {
  final DockerClient dockerClient=mock(DockerClient.class);
  final Log log=mock(Log.class);
  final DockerBuildInformation buildInfo=mock(DockerBuildInformation.class);
  Utils.pushImage(dockerClient,IMAGE,log,buildInfo,0,1);
  verify(dockerClient).push(eq(IMAGE),any(AnsiProgressHandler.class));
}
Program: 111122
Project: 111122
Buggy source:
/** 
 * Find out the scrollable child view from a ViewGroup.
 * @param viewGroup
 */
private void findScrollView(ViewGroup viewGroup){
  scrollChild=viewGroup;
  if (viewGroup.getChildCount() > 0) {
    int count=viewGroup.getChildCount();
    View child;
    for (int i=0; i < count; i++) {
      child=viewGroup.getChildAt(i);
      if (child instanceof AbsListView || child instanceof ScrollView || child instanceof ViewPager) {
        scrollChild=child;
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Find out the scrollable child view from a ViewGroup.
 * @param viewGroup
 */
private void findScrollView(ViewGroup viewGroup){
  scrollChild=viewGroup;
  if (viewGroup.getChildCount() > 0) {
    int count=viewGroup.getChildCount();
    View child;
    for (int i=0; i < count; i++) {
      child=viewGroup.getChildAt(i);
      if (child instanceof AbsListView || child instanceof ScrollView || child instanceof ViewPager|| child instanceof WebView) {
        scrollChild=child;
        return;
      }
    }
  }
}
Program: 111123
Project: 111123
Buggy source:
/** 
 * Find out the scrollable child view from a ViewGroup.
 * @param viewGroup
 */
private void findScrollView(ViewGroup viewGroup){
  scrollChild=viewGroup;
  if (viewGroup.getChildCount() > 0) {
    int count=viewGroup.getChildCount();
    View child;
    for (int i=0; i < count; i++) {
      child=viewGroup.getChildAt(i);
      if (child instanceof AbsListView || child instanceof ScrollView) {
        scrollChild=child;
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Find out the scrollable child view from a ViewGroup.
 * @param viewGroup
 */
private void findScrollView(ViewGroup viewGroup){
  scrollChild=viewGroup;
  if (viewGroup.getChildCount() > 0) {
    int count=viewGroup.getChildCount();
    View child;
    for (int i=0; i < count; i++) {
      child=viewGroup.getChildAt(i);
      if (child instanceof AbsListView || child instanceof ScrollView || child instanceof ViewPager) {
        scrollChild=child;
        return;
      }
    }
  }
}
Program: 111124
Project: 111124
Buggy source:
@Override public int clampViewPositionHorizontal(View child,int left,int dx){
  int result=0;
  if (dragEdge == DragEdge.LEFT && left > 0) {
    final int leftBound=getPaddingLeft();
    final int rightBound=horizontalDragRange;
    result=Math.min(Math.max(left,leftBound),rightBound);
  }
 else   if (dragEdge == DragEdge.RIGHT && left < 0) {
    final int leftBound=-horizontalDragRange;
    final int rightBound=getPaddingLeft();
    result=Math.min(Math.max(left,leftBound),rightBound);
  }
  return result;
}

Fixed version (ground truth):
@Override public int clampViewPositionHorizontal(View child,int left,int dx){
  int result=0;
  if (dragEdge == DragEdge.LEFT && !canChildScrollRight() && left > 0) {
    final int leftBound=getPaddingLeft();
    final int rightBound=horizontalDragRange;
    result=Math.min(Math.max(left,leftBound),rightBound);
  }
 else   if (dragEdge == DragEdge.RIGHT && !canChildScrollLeft() && left < 0) {
    final int leftBound=-horizontalDragRange;
    final int rightBound=getPaddingLeft();
    result=Math.min(Math.max(left,leftBound),rightBound);
  }
  return result;
}
Program: 111125
Project: 111125
Buggy source:
@Override public int clampViewPositionVertical(View child,int top,int dy){
  int result=0;
  if (dragEdge == DragEdge.TOP && !canChildScrollUp() && top > 0) {
    final int topBound=getPaddingTop();
    final int bottomBound=verticalDragRange;
    result=Math.min(Math.max(top,topBound),bottomBound);
  }
  return result;
}

Fixed version (ground truth):
@Override public int clampViewPositionVertical(View child,int top,int dy){
  int result=0;
  if (dragEdge == DragEdge.TOP && !canChildScrollUp() && top > 0) {
    final int topBound=getPaddingTop();
    final int bottomBound=verticalDragRange;
    result=Math.min(Math.max(top,topBound),bottomBound);
  }
 else   if (dragEdge == DragEdge.BOTTOM && !canChildScrollDown() && top < 0) {
    final int topBound=-verticalDragRange;
    final int bottomBound=getPaddingTop();
    result=Math.min(Math.max(top,topBound),bottomBound);
  }
  return result;
}
Program: 111126
Project: 111126
Buggy source:
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  if (draggingOffset == 0)   return;
  if (draggingOffset == getDragRange())   return;
  boolean isBack=false;
  if (enableFlingBack && backBySpeed(xvel,yvel)) {
    isBack=!canChildScrollUp();
  }
 else   if (draggingOffset >= finishAnchor) {
    isBack=true;
  }
 else   if (draggingOffset < finishAnchor) {
    isBack=false;
  }
  int finalLeft;
  int finalTop;
switch (dragEdge) {
case LEFT:
    finalLeft=isBack ? horizontalDragRange : 0;
  smoothScrollToX(finalLeft);
break;
case RIGHT:
finalLeft=isBack ? -horizontalDragRange : 0;
smoothScrollToX(finalLeft);
break;
case TOP:
finalTop=isBack ? verticalDragRange : 0;
smoothScrollToY(finalTop);
break;
case BOTTOM:
break;
}
}

Fixed version (ground truth):
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  if (draggingOffset == 0)   return;
  if (draggingOffset == getDragRange())   return;
  boolean isBack=false;
  if (enableFlingBack && backBySpeed(xvel,yvel)) {
    isBack=!canChildScrollUp();
  }
 else   if (draggingOffset >= finishAnchor) {
    isBack=true;
  }
 else   if (draggingOffset < finishAnchor) {
    isBack=false;
  }
  int finalLeft;
  int finalTop;
switch (dragEdge) {
case LEFT:
    finalLeft=isBack ? horizontalDragRange : 0;
  smoothScrollToX(finalLeft);
break;
case RIGHT:
finalLeft=isBack ? -horizontalDragRange : 0;
smoothScrollToX(finalLeft);
break;
case TOP:
finalTop=isBack ? verticalDragRange : 0;
smoothScrollToY(finalTop);
break;
case BOTTOM:
finalTop=isBack ? -verticalDragRange : 0;
smoothScrollToY(finalTop);
break;
}
}
Program: 111128
Project: 111128
Buggy source:
@Override public void getItemOffsets(Rect outRect,View view,RecyclerView parent,RecyclerView.State state){
  if (parent.getChildPosition(view) == 0) {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space;
    outRect.bottom=space / 2;
  }
 else   if (parent.getChildPosition(view) == parent.getChildCount() - 1) {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space / 2;
    outRect.bottom=space;
  }
 else {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space / 2;
    outRect.bottom=space / 2;
  }
}

Fixed version (ground truth):
@Override public void getItemOffsets(Rect outRect,View view,RecyclerView parent,RecyclerView.State state){
  if (parent.getChildPosition(view) == 0) {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space;
    outRect.bottom=space / 2;
  }
 else   if (parent.getChildPosition(view) == parent.getLayoutManager().getItemCount() - 1) {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space / 2;
    outRect.bottom=space;
  }
 else {
    outRect.left=space;
    outRect.right=space;
    outRect.top=space / 2;
    outRect.bottom=space / 2;
  }
}
Program: 111129
Project: 111129
Buggy source:
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
}

Fixed version (ground truth):
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  mTabs.setTranslationY(0);
}
Program: 111131
Project: 111131
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  int headerHeight=getResources().getDimensionPixelSize(R.dimen.header_height);
  int indicatorHeight=QuickReturnUtils.dp2px(getActivity(),5);
  int headerTranslation=-headerHeight + QuickReturnUtils.getActionBarHeight(getActivity()) + indicatorHeight;
  int footerTranslation=-headerHeight + QuickReturnUtils.getActionBarHeight(getActivity());
  QuickReturnListViewOnScrollListener scrollListener=new QuickReturnListViewOnScrollListener(QuickReturnType.BOTH,mCoordinator.getTabs(),headerTranslation,mQuickReturnFooterLinearLayout,-footerTranslation);
  scrollListener.setCanSlideInIdleScrollState(true);
  mListView.setOnScrollListener(scrollListener);
  mPlaceHolderView=getActivity().getLayoutInflater().inflate(R.layout.view_header_placeholder,mListView,false);
  mListView.addHeaderView(mPlaceHolderView);
  ArrayList<Tweet> tweets=new ArrayList<Tweet>();
  for (int i=0; i < 23; i++) {
    Tweet tweet=new Tweet();
    tweet.setAvatarUrl(mAvatarUrls[i]);
    tweet.setDisplayName(mDisplayNames[i]);
    tweet.setUsername(mUsernames[i]);
    tweet.setTimestamp(mTimestamps[i]);
    tweet.setStarCount(mStars[i]);
    tweet.setRetweetCount(mRetweets[i]);
    tweet.setMessage(mMessages[i]);
    tweets.add(tweet);
  }
  TwitterAdapter adapter=new TwitterAdapter(getActivity(),tweets);
  mListView.setAdapter(adapter);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  int headerHeight=getResources().getDimensionPixelSize(R.dimen.twitter_header_height);
  int footerHeight=getResources().getDimensionPixelSize(R.dimen.twitter_footer_height);
  int indicatorHeight=QuickReturnUtils.dp2px(getActivity(),5);
  int headerTranslation=-headerHeight + indicatorHeight;
  int footerTranslation=-footerHeight + indicatorHeight;
  QuickReturnListViewOnScrollListener scrollListener=new QuickReturnListViewOnScrollListener(QuickReturnType.TWITTER,mCoordinator.getTabs(),headerTranslation,mQuickReturnFooterLinearLayout,-footerTranslation);
  scrollListener.setCanSlideInIdleScrollState(true);
  mListView.setOnScrollListener(scrollListener);
  mPlaceHolderView=getActivity().getLayoutInflater().inflate(R.layout.view_header_placeholder,mListView,false);
  mListView.addHeaderView(mPlaceHolderView);
  ArrayList<Tweet> tweets=new ArrayList<Tweet>();
  for (int i=0; i < 23; i++) {
    Tweet tweet=new Tweet();
    tweet.setAvatarUrl(mAvatarUrls[i]);
    tweet.setDisplayName(mDisplayNames[i]);
    tweet.setUsername(mUsernames[i]);
    tweet.setTimestamp(mTimestamps[i]);
    tweet.setStarCount(mStars[i]);
    tweet.setRetweetCount(mRetweets[i]);
    tweet.setMessage(mMessages[i]);
    tweets.add(tweet);
  }
  TwitterAdapter adapter=new TwitterAdapter(getActivity(),tweets);
  mListView.setAdapter(adapter);
}
Program: 111133
Project: 111133
Buggy source:
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
  if (diff != 0) {
switch (mQuickReturnType) {
case HEADER:
      if (diff < 0) {
        mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
      }
 else {
        mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
      }
    mHeader.setTranslationY(mHeaderDiffTotal);
  break;
case FOOTER:
if (diff < 0) {
  mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
  mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mFooter.setTranslationY(-mFooterDiffTotal);
break;
case BOTH:
if (diff < 0) {
mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mHeader.setTranslationY(mHeaderDiffTotal);
mFooter.setTranslationY(-mFooterDiffTotal);
default :
break;
}
}
mPrevScrollY=scrollY;
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
  if (diff != 0) {
switch (mQuickReturnType) {
case HEADER:
      if (diff < 0) {
        mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
      }
 else {
        mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
      }
    mHeader.setTranslationY(mHeaderDiffTotal);
  break;
case FOOTER:
if (diff < 0) {
  mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
  mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mFooter.setTranslationY(-mFooterDiffTotal);
break;
case BOTH:
if (diff < 0) {
mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mHeader.setTranslationY(mHeaderDiffTotal);
mFooter.setTranslationY(-mFooterDiffTotal);
break;
case TWITTER:
if (diff < 0) {
if (scrollY > -mMinHeaderTranslation) mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
if (scrollY > mMinFooterTranslation) mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mHeader.setTranslationY(mHeaderDiffTotal);
mFooter.setTranslationY(-mFooterDiffTotal);
default :
break;
}
}
mPrevScrollY=scrollY;
}
Program: 111137
Project: 111137
Buggy source:
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
  Log.d(getClass().getSimpleName(),"String_Node_Str" + scrollY);
  Log.d(getClass().getSimpleName(),"String_Node_Str" + diff);
  if (diff != 0) {
switch (mQuickReturnType) {
case HEADER:
      if (diff < 0) {
        mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
      }
 else {
        mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
      }
    mHeader.setTranslationY(mHeaderDiffTotal);
  break;
case FOOTER:
if (diff < 0) {
  mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
  mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mFooter.setTranslationY(-mFooterDiffTotal);
break;
case BOTH:
if (diff < 0) {
mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mHeader.setTranslationY(mHeaderDiffTotal);
mFooter.setTranslationY(-mFooterDiffTotal);
default :
break;
}
}
mPrevScrollY=scrollY;
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
  if (diff != 0) {
switch (mQuickReturnType) {
case HEADER:
      if (diff < 0) {
        mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
      }
 else {
        mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
      }
    mHeader.setTranslationY(mHeaderDiffTotal);
  break;
case FOOTER:
if (diff < 0) {
  mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
  mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mFooter.setTranslationY(-mFooterDiffTotal);
break;
case BOTH:
if (diff < 0) {
mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
mHeader.setTranslationY(mHeaderDiffTotal);
mFooter.setTranslationY(-mFooterDiffTotal);
default :
break;
}
}
mPrevScrollY=scrollY;
}
Program: 111139
Project: 111139
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mValues=getResources().getStringArray(R.array.countries);
  ArrayAdapter<String> adapter=new ArrayAdapter<String>(getActivity(),R.layout.list_item,R.id.item_tv,mValues);
  mListView.setAdapter(adapter);
  mListView.setOnScrollListener(mListViewOnScrollListener);
  mPlaceHolderView=getActivity().getLayoutInflater().inflate(R.layout.view_header_placeholder,mListView,false);
  mListView.addHeaderView(mPlaceHolderView);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mListView.setOnScrollListener(mListViewOnScrollListener);
  mPlaceHolderView=getActivity().getLayoutInflater().inflate(R.layout.view_header_placeholder,mListView,false);
  mListView.addHeaderView(mPlaceHolderView);
  mValues=getResources().getStringArray(R.array.countries);
  ArrayAdapter<String> adapter=new ArrayAdapter<String>(getActivity(),R.layout.list_item,R.id.item_tv,mValues);
  mListView.setAdapter(adapter);
}
Program: 111145
Project: 111145
Buggy source:
@Override public void onPageSelected(int position){
  Log.d("String_Node_Str","String_Node_Str" + position);
  for (int i=0; i < mTabsLinearLayout.getChildCount(); i++) {
    TextView tv=(TextView)mTabsLinearLayout.getChildAt(i);
    if (i == position) {
      tv.setTextColor(getResources().getColor(R.color.steel_blue));
    }
 else {
      tv.setTextColor(getResources().getColor(android.R.color.darker_gray));
    }
  }
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  for (int i=0; i < mTabsLinearLayout.getChildCount(); i++) {
    TextView tv=(TextView)mTabsLinearLayout.getChildAt(i);
    if (i == position) {
      tv.setTextColor(getResources().getColor(R.color.steel_blue));
    }
 else {
      tv.setTextColor(getResources().getColor(android.R.color.darker_gray));
    }
  }
}
Program: 111146
Project: 111146
Buggy source:
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  Log.d("String_Node_Str","String_Node_Str" + position);
}

Fixed version (ground truth):
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
}
Program: 111147
Project: 111147
Buggy source:
@Override public void onPageSelected(int position){
  Log.d("String_Node_Str","String_Node_Str" + position);
  for (int i=0; i < mTabsLinearLayout.getChildCount(); i++) {
    TextView tv=(TextView)mTabsLinearLayout.getChildAt(i);
    if (i == position) {
      tv.setTextColor(getResources().getColor(R.color.steel_blue));
    }
 else {
      tv.setTextColor(getResources().getColor(android.R.color.darker_gray));
    }
  }
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  for (int i=0; i < mTabsLinearLayout.getChildCount(); i++) {
    TextView tv=(TextView)mTabsLinearLayout.getChildAt(i);
    if (i == position) {
      tv.setTextColor(getResources().getColor(R.color.steel_blue));
    }
 else {
      tv.setTextColor(getResources().getColor(android.R.color.darker_gray));
    }
  }
}