nus-yam/ex-repair huggingface dataset:
Program: 10928
Project: 10928
Buggy source:
public void testStartModuleInvalidToken() throws Exception {
  harness.createProjectAndAddModule("String_Node_Str");
  IModule[] modules=server.getModules();
  assertEquals("String_Node_Str" + Arrays.toString(modules),1,modules.length);
  int moduleState=server.getModulePublishState(modules);
  assertEquals(IServer.PUBLISH_STATE_UNKNOWN,moduleState);
  CloudFoundryClient client=getClient();
  Field field=CloudFoundryClient.class.getDeclaredField("String_Node_Str");
  field.setAccessible(true);
  field.set(client,"String_Node_Str");
  serverBehavior.deployOrStartModule(modules,true,null);
  moduleState=server.getModuleState(modules);
  assertEquals(IServer.STATE_STARTED,moduleState);
  moduleState=server.getModulePublishState(modules);
  ApplicationModule appModule=cloudServer.getApplication(modules[0]);
  List<String> uris=appModule.getApplication().getUris();
  assertEquals(Collections.singletonList(harness.getUrl("String_Node_Str")),uris);
  URI uri=new URI("String_Node_Str" + harness.getUrl("String_Node_Str") + "String_Node_Str");
  assertEquals("String_Node_Str",getContent(uri));
}

Fixed version (ground truth):
public void testStartModuleInvalidToken() throws Exception {
  harness.createProjectAndAddModule("String_Node_Str");
  IModule[] modules=server.getModules();
  assertEquals("String_Node_Str" + Arrays.toString(modules),1,modules.length);
  int moduleState=server.getModulePublishState(modules);
  assertEquals(IServer.PUBLISH_STATE_UNKNOWN,moduleState);
  CloudFoundryOperations client=getClient();
  Field field=CloudFoundryClient.class.getDeclaredField("String_Node_Str");
  field.setAccessible(true);
  field.set(client,"String_Node_Str");
  serverBehavior.deployOrStartModule(modules,true,null);
  moduleState=server.getModuleState(modules);
  assertEquals(IServer.STATE_STARTED,moduleState);
  moduleState=server.getModulePublishState(modules);
  ApplicationModule appModule=cloudServer.getApplication(modules[0]);
  List<String> uris=appModule.getApplication().getUris();
  assertEquals(Collections.singletonList(harness.getUrl("String_Node_Str")),uris);
  URI uri=new URI("String_Node_Str" + harness.getUrl("String_Node_Str") + "String_Node_Str");
  assertEquals("String_Node_Str",getContent(uri));
}
Program: 10929
Project: 10929
Buggy source:
public void testSetPasswordMigrateUpdatesClient() throws CoreException {
  ((ServerWorkingCopy)serverWC).setAttribute("String_Node_Str","String_Node_Str");
  ((ServerWorkingCopy)serverWC).setAttribute("String_Node_Str","String_Node_Str");
  serverWC.save(true,null);
  assertEquals("String_Node_Str",cloudFoundryServer.getUsername());
  assertEquals("String_Node_Str",cloudFoundryServer.getPassword());
  CloudFoundryServerBehaviour CloudFoundryServerBehaviour=(CloudFoundryServerBehaviour)serverWC.loadAdapter(CloudFoundryServerBehaviour.class,null);
  CloudFoundryClient client=CloudFoundryServerBehaviour.getClient();
  serverWC=server.createWorkingCopy();
  cloudFoundryServer.setPassword("String_Node_Str");
  cloudFoundryServer.setUsername("String_Node_Str");
  cloudFoundryServer.setUrl("String_Node_Str");
  serverWC.save(true,null);
  assertEquals("String_Node_Str",cloudFoundryServer.getUsername());
  assertEquals("String_Node_Str",cloudFoundryServer.getPassword());
  assertNotSame("String_Node_Str",client,CloudFoundryServerBehaviour.getClient());
}

Fixed version (ground truth):
public void testSetPasswordMigrateUpdatesClient() throws CoreException {
  ((ServerWorkingCopy)serverWC).setAttribute("String_Node_Str","String_Node_Str");
  ((ServerWorkingCopy)serverWC).setAttribute("String_Node_Str","String_Node_Str");
  serverWC.save(true,null);
  assertEquals("String_Node_Str",cloudFoundryServer.getUsername());
  assertEquals("String_Node_Str",cloudFoundryServer.getPassword());
  CloudFoundryServerBehaviour CloudFoundryServerBehaviour=(CloudFoundryServerBehaviour)serverWC.loadAdapter(CloudFoundryServerBehaviour.class,null);
  CloudFoundryOperations client=CloudFoundryServerBehaviour.getClient();
  serverWC=server.createWorkingCopy();
  cloudFoundryServer.setPassword("String_Node_Str");
  cloudFoundryServer.setUsername("String_Node_Str");
  cloudFoundryServer.setUrl("String_Node_Str");
  serverWC.save(true,null);
  assertEquals("String_Node_Str",cloudFoundryServer.getUsername());
  assertEquals("String_Node_Str",cloudFoundryServer.getPassword());
  assertNotSame("String_Node_Str",client,CloudFoundryServerBehaviour.getClient());
}
Program: 10930
Project: 10930
Buggy source:
protected void initMockedRestTemplate(String email,String password,String token,URL cloudControllerUrl) throws CoreException {
  Class<?> cls=CloudFoundryClient.class;
  Field restTemplateField;
  try {
    restTemplateField=cls.getDeclaredField("String_Node_Str");
    RestTemplate mockedTemplate=new MockRestTemplate(new TestConnectionDescriptor(cloudControllerUrl,email,token,password));
    restTemplateField.setAccessible(true);
    restTemplateField.set(this,mockedTemplate);
  }
 catch (  SecurityException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
catch (  NoSuchFieldException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
catch (  IllegalAccessException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
}

Fixed version (ground truth):
protected void initMockedRestTemplate(String email,String password,URL cloudControllerUrl) throws CoreException {
  Class<?> cls=CloudFoundryClient.class;
  Field restTemplateField;
  try {
    restTemplateField=cls.getDeclaredField("String_Node_Str");
    RestTemplate mockedTemplate=new MockRestTemplate(new TestConnectionDescriptor(cloudControllerUrl,email,null,password));
    restTemplateField.setAccessible(true);
    restTemplateField.set(this,mockedTemplate);
  }
 catch (  SecurityException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
catch (  NoSuchFieldException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
catch (  IllegalAccessException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
}
Program: 10931
Project: 10931
Buggy source:
public CFClientMockedRestTemplate(String email,String password,String token,URL cloudControllerUrl) throws CoreException {
  super(email,password,token,cloudControllerUrl,new RequestFactory());
  initMockedRestTemplate(email,password,token,cloudControllerUrl);
}

Fixed version (ground truth):
public CFClientMockedRestTemplate(String userName,String password,URL url) throws MalformedURLException, CoreException {
  super(new CloudCredentials(userName,password),url);
  initMockedRestTemplate(userName,password,url);
}
Program: 10932
Project: 10932
Buggy source:
@Override public boolean performFinish(){
  if (!deferServiceAddition) {
    try {
      getContainer().run(true,false,new IRunnableWithProgress(){
        public void run(        IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          try {
            cloudServer.getBehaviour().createService(new CloudService[]{page.getService()},monitor);
          }
 catch (          CoreException e) {
            throw new InvocationTargetException(e);
          }
catch (          OperationCanceledException e) {
            throw new InterruptedException();
          }
 finally {
            monitor.done();
          }
        }
      }
);
      return true;
    }
 catch (    InvocationTargetException e) {
      if (e.getCause() instanceof CoreException) {
        Status status=new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,NLS.bind("String_Node_Str",cloudServer.getServer().getName(),e.getCause().getMessage()),e);
        StatusManager.getManager().handle(status,StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
      }
    }
catch (    InterruptedException e) {
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (!deferServiceAddition) {
    try {
      getContainer().run(true,false,new IRunnableWithProgress(){
        public void run(        IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          try {
            cloudServer.getBehaviour().createService(new CloudService[]{page.getService()},monitor);
          }
 catch (          CoreException e) {
            throw new InvocationTargetException(e);
          }
catch (          OperationCanceledException e) {
            throw new InterruptedException();
          }
 finally {
            monitor.done();
          }
        }
      }
);
      return true;
    }
 catch (    InvocationTargetException e) {
      if (e.getCause() != null) {
        Status status=new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,NLS.bind("String_Node_Str",cloudServer.getServer().getName(),e.getCause().getMessage() != null ? e.getCause().getMessage() : e.getCause().toString()),e);
        StatusManager.getManager().handle(status,StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
      }
    }
catch (    InterruptedException e) {
    }
    return false;
  }
  return true;
}
Program: 10933
Project: 10933
Buggy source:
protected String getErrorMessage(Exception exception,String url){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(url);
  if (exception != null && exception.getLocalizedMessage() != null) {
    builder.append("String_Node_Str");
    builder.append(exception.getLocalizedMessage());
  }
  return builder.toString();
}

Fixed version (ground truth):
protected String getErrorMessage(Exception exception,String url){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(url);
  if (exception != null) {
    String errorMessage=exception.getMessage() != null ? exception.getMessage() : exception.toString();
    if (errorMessage != null) {
      builder.append("String_Node_Str");
      builder.append(errorMessage);
    }
  }
  return builder.toString();
}
Program: 10934
Project: 10934
Buggy source:
protected void setSpace(String space){
  setAttribute(PROP_SPACE_ID,space);
}

Fixed version (ground truth):
public void setSpace(CloudSpace space){
  this.secureStoreDirty=true;
  if (space != null) {
    this.cloudSpace=new CloudFoundrySpace(space);
    internalSetOrg(cloudSpace.getOrgName());
    internalSetSpace(cloudSpace.getSpaceName());
  }
 else {
    internalSetOrg(null);
    internalSetSpace(null);
  }
  updateServerId();
}
Program: 10935
Project: 10935
Buggy source:
private void update(boolean clearSpaceDescriptor){
  isFinished=true;
  setWizardError(null);
  String selection=getURLSelection();
  if (CloudFoundryURLNavigation.canEnableCloudFoundryNavigation(selection)) {
    cfSignupButton.setVisible(true);
  }
 else {
    cfSignupButton.setVisible(false);
  }
  if (cloudSpaceListener != null) {
    spacesDescriptor=clearSpaceDescriptor ? null : spacesDescriptor;
    cloudSpaceListener.handleCloudSpaceSelection(spacesDescriptor);
  }
  if (folder.getSelectionIndex() == 0) {
    String message="String_Node_Str";
    isFinished=false;
    if (emailText.getText() == null || emailText.getText().length() == 0) {
      message="String_Node_Str";
    }
 else     if (passwordText.getText() == null || passwordText.getText().length() == 0) {
      message="String_Node_Str";
    }
 else     if (urlCombo.getSelectionIndex() < 0) {
      message=NLS.bind("String_Node_Str",service);
    }
 else {
      isFinished=true;
      message=NLS.bind(DEFAULT_DESCRIPTION,service);
    }
    validateButton.setEnabled(isFinished);
    registerAccountButton.setEnabled(CloudFoundryBrandingExtensionPoint.supportsRegistration(serverTypeId,urlCombo.getText()));
    setWizardDescription(message);
    if (wizardHandle != null) {
      wizardHandle.update();
    }
 else     if (getWizardContainer() != null) {
      getWizardContainer().updateButtons();
    }
  }
 else   if (folder.getSelectionIndex() == 1) {
    setWizardDescription(NLS.bind("String_Node_Str",service));
  }
}

Fixed version (ground truth):
private void update(boolean clearSpaceDescriptor){
  isFinished=true;
  setWizardError(null);
  String selection=getURLSelection();
  if (CloudFoundryURLNavigation.canEnableCloudFoundryNavigation(selection)) {
    cfSignupButton.setVisible(true);
  }
 else {
    cfSignupButton.setVisible(false);
  }
  if (clearSpaceDescriptor) {
    spacesDescriptor=null;
    if (cfServer != null) {
      cfServer.setSpace(null);
    }
  }
  if (cloudSpaceListener != null) {
    cloudSpaceListener.handleCloudSpaceSelection(spacesDescriptor);
  }
  if (folder.getSelectionIndex() == 0) {
    String message="String_Node_Str";
    isFinished=false;
    if (emailText.getText() == null || emailText.getText().length() == 0) {
      message="String_Node_Str";
    }
 else     if (passwordText.getText() == null || passwordText.getText().length() == 0) {
      message="String_Node_Str";
    }
 else     if (urlCombo.getSelectionIndex() < 0) {
      message=NLS.bind("String_Node_Str",service);
    }
 else {
      isFinished=true;
      message=NLS.bind(DEFAULT_DESCRIPTION,service);
    }
    validateButton.setEnabled(isFinished);
    registerAccountButton.setEnabled(CloudFoundryBrandingExtensionPoint.supportsRegistration(serverTypeId,urlCombo.getText()));
    setWizardDescription(message);
    if (wizardHandle != null) {
      wizardHandle.update();
    }
 else     if (getWizardContainer() != null) {
      getWizardContainer().updateButtons();
    }
  }
 else   if (folder.getSelectionIndex() == 1) {
    setWizardDescription(NLS.bind("String_Node_Str",service));
  }
}
Program: 10937
Project: 10937
Buggy source:
public void setSpace(CloudSpace space){
  this.secureStoreDirty=true;
  if (space != null) {
    this.cloudSpace=new CloudFoundrySpace(space);
    internalSetOrg(cloudSpace.getOrgName());
    internalSetSpace(cloudSpace.getSpaceName());
  }
 else {
    internalSetOrg(null);
    internalSetSpace(null);
  }
  updateServerId();
}

Fixed version (ground truth):
public void setSpace(CloudSpace space){
  this.secureStoreDirty=true;
  if (space != null) {
    this.cloudSpace=new CloudFoundrySpace(space);
    internalSetOrg(cloudSpace.getOrgName());
    internalSetSpace(cloudSpace.getSpaceName());
  }
 else {
    internalSetOrg(null);
    internalSetSpace(null);
    cloudSpace=null;
  }
  updateServerId();
}
Program: 10938
Project: 10938
Buggy source:
public static CloudSpacesDescriptor getCloudSpaceDescriptor(CloudFoundryOperations operations,IProgressMonitor monitor) throws CoreException {
  SubMonitor progress=SubMonitor.convert(monitor);
  progress.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  boolean supportsSpaces=false;
  List<CloudSpace> actualSpaces=new ArrayList<CloudSpace>();
  try {
    supportsSpaces=operations.supportsSpaces();
    if (supportsSpaces) {
      List<CloudSpace> foundSpaces=operations.getSpaces();
      if (foundSpaces != null) {
        actualSpaces.addAll(foundSpaces);
      }
    }
    CloudSpacesDescriptor descriptor=new CloudSpacesDescriptor(actualSpaces,supportsSpaces);
    return descriptor;
  }
 catch (  RestClientException e) {
    throw CloudUtil.toCoreException(e);
  }
catch (  RuntimeException e) {
    if (e.getCause() instanceof IOException) {
      CloudFoundryPlugin.getDefault().getLog().log(new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,"String_Node_Str",e.getCause()));
      throw new CoreException(new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,"String_Node_Str"));
    }
 else {
      throw e;
    }
  }
 finally {
    progress.done();
  }
}

Fixed version (ground truth):
private static CloudSpacesDescriptor getCloudSpaceDescriptor(CloudFoundryOperations operations,IProgressMonitor monitor) throws CoreException {
  SubMonitor progress=SubMonitor.convert(monitor);
  progress.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  boolean supportsSpaces=false;
  List<CloudSpace> actualSpaces=new ArrayList<CloudSpace>();
  try {
    supportsSpaces=operations.supportsSpaces();
    if (supportsSpaces) {
      List<CloudSpace> foundSpaces=operations.getSpaces();
      if (foundSpaces != null) {
        actualSpaces.addAll(foundSpaces);
      }
    }
    CloudSpacesDescriptor descriptor=new CloudSpacesDescriptor(actualSpaces,supportsSpaces);
    return descriptor;
  }
 catch (  RuntimeException e) {
    if (e.getCause() instanceof IOException) {
      CloudFoundryPlugin.getDefault().getLog().log(new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,"String_Node_Str",e.getCause()));
      throw new CoreException(new Status(IStatus.ERROR,CloudFoundryPlugin.PLUGIN_ID,"String_Node_Str"));
    }
 else {
      throw e;
    }
  }
 finally {
    progress.done();
  }
}
Program: 10939
Project: 10939
Buggy source:
/** 
 * Runnable context can be null. If so, default Eclipse progress service will be used as a runnable context. Display URL should be true if the display URL is passed. If so, and attempt will be made to parse the actual URL.
 * @param userName must not be null
 * @param password must not be null
 * @param urlText must not be null. Can be either display or actual URL
 * @param displayURL true if URL is display URL
 * @param context may be optional
 * @param fork if true, an attempt will be made to get the cloud spacesasynchronously
 * @return spaces descriptor, or null if it couldn't be determined
 * @throws CoreException
 */
public static CloudSpacesDescriptor getCloudSpaces(final String userName,final String password,final String urlText,final boolean displayURL,IRunnableContext context) throws CoreException {
  try {
    final CloudSpacesDescriptor[] supportsSpaces=new CloudSpacesDescriptor[1];
    ICoreRunnable coreRunner=new ICoreRunnable(){
      public void run(      IProgressMonitor monitor) throws CoreException {
        String url=urlText;
        if (displayURL) {
          url=getUrlFromDisplayText(urlText);
        }
        supportsSpaces[0]=CloudSpaceServerLookup.getCloudSpaceDescriptor(new CloudCredentials(userName,password),url,monitor);
      }
    }
;
    if (context != null) {
      runForked(coreRunner,context);
    }
 else {
      runForked(coreRunner);
    }
    return supportsSpaces[0];
  }
 catch (  OperationCanceledException e) {
    new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Runnable context can be null. If so, default Eclipse progress service will be used as a runnable context. Display URL should be true if the display URL is passed. If so, and attempt will be made to parse the actual URL.
 * @param userName must not be null
 * @param password must not be null
 * @param urlText must not be null. Can be either display or actual URL
 * @param displayURL true if URL is display URL
 * @param context may be optional
 * @param fork if true, an attempt will be made to get the cloud spacesasynchronously
 * @return spaces descriptor, or null if it couldn't be determined
 * @throws CoreException
 */
public static CloudSpacesDescriptor getCloudSpaces(final String userName,final String password,final String urlText,final boolean displayURL,IRunnableContext context) throws CoreException {
  try {
    final CloudSpacesDescriptor[] supportsSpaces=new CloudSpacesDescriptor[1];
    ICoreRunnable coreRunner=new ICoreRunnable(){
      public void run(      IProgressMonitor monitor) throws CoreException {
        String url=urlText;
        if (displayURL) {
          url=getUrlFromDisplayText(urlText);
        }
        supportsSpaces[0]=CloudSpaceServerLookup.getCloudSpaceDescriptor(new CloudCredentials(userName,password),url,monitor);
      }
    }
;
    if (context != null) {
      runForked(coreRunner,context);
    }
 else {
      runForked(coreRunner);
    }
    return supportsSpaces[0];
  }
 catch (  OperationCanceledException e) {
    throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
  }
}
Program: 10941
Project: 10941
Buggy source:
public static Test suite(boolean heartbeat){
  TestSuite suite=new ManagedTestSuite(AllCloudFoundryTests.class.getName());
  if (!heartbeat) {
    suite.addTestSuite(CloudFoundryServerBehaviourTest.class);
  }
  suite.addTestSuite(ServerCredentialsStoreTest.class);
  suite.addTestSuite(CloudFoundryServerTest.class);
  suite.addTestSuite(CloudUtilTest.class);
  suite.addTestSuite(DeploymentURLTest.class);
  suite.addTestSuite(CloudFoundryServicesTest.class);
  suite.addTestSuite(CaldecottTunnelTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(boolean heartbeat){
  TestSuite suite=new ManagedTestSuite(AllCloudFoundryTests.class.getName());
  if (!heartbeat) {
    suite.addTestSuite(CloudFoundryServerBehaviourTest.class);
  }
  suite.addTestSuite(ServerCredentialsStoreTest.class);
  suite.addTestSuite(CloudFoundryServerTest.class);
  suite.addTestSuite(CloudUtilTest.class);
  suite.addTestSuite(DeploymentURLTest.class);
  suite.addTestSuite(CloudFoundryServicesTest.class);
  return suite;
}
Program: 10942
Project: 10942
Buggy source:
public synchronized void addDescriptor(CloudFoundryServer server,CaldecottTunnelDescriptor descriptor){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors == null) {
    descriptors=new HashMap<String,CaldecottTunnelDescriptor>();
    caldecottTunnels.put(id,descriptors);
  }
  descriptors.put(descriptor.getServiceName(),descriptor);
  usedPorts.add(descriptor.tunnelPort());
}

Fixed version (ground truth):
public synchronized void addDescriptor(CloudFoundryServer server,CaldecottTunnelDescriptor descriptor){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors == null) {
    descriptors=new HashMap<String,CaldecottTunnelDescriptor>();
    caldecottTunnels.put(id,descriptors);
  }
  descriptors.put(descriptor.getServiceName(),descriptor);
}
Program: 10944
Project: 10944
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  List<CloudService> toDelete=new ArrayList<CloudService>();
  CloudService service=getMysqlService();
  if (service != null) {
    toDelete.add(service);
  }
  service=getMongodbService();
  if (service != null) {
    toDelete.add(service);
  }
  service=getPostgresqlService();
  if (service != null) {
    toDelete.add(service);
  }
  for (  CloudService serviceToDelete : toDelete) {
    deleteService(serviceToDelete);
  }
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  List<CloudService> services=getAllServices();
  for (  CloudService service : services) {
    deleteService(service);
    CloudFoundryTestUtil.waitIntervals(2000);
  }
}
Program: 10945
Project: 10945
Buggy source:
public void addFacet(){
  if (canAddFacet()) {
    try {
      IFacetedProject facetedProject=ProjectFacetsManager.create(project);
      if (facetedProject != null) {
        facetedProject.installProjectFacet(FACET.getDefaultVersion(),null,null);
      }
    }
 catch (    CoreException e) {
      CloudFoundryPlugin.logError(e);
    }
  }
}

Fixed version (ground truth):
public void addFacet(IProgressMonitor monitor){
  if (canAddFacet()) {
    try {
      IFacetedProject facetedProject=ProjectFacetsManager.create(project);
      if (facetedProject == null) {
        facetedProject=ProjectFacetsManager.create(project,true,monitor);
      }
      if (facetedProject != null) {
        facetedProject.installProjectFacet(FACET.getDefaultVersion(),null,null);
      }
    }
 catch (    CoreException e) {
      CloudFoundryPlugin.logError(e);
    }
  }
}
Program: 10946
Project: 10946
Buggy source:
@Override public IModuleResource[] members() throws CoreException {
  return computeDefaultRuntimeClasspathMembers();
}

Fixed version (ground truth):
@Override public IModuleResource[] members() throws CoreException {
  return computeRuntimeClasspathMembers();
}
Program: 10948
Project: 10948
Buggy source:
public String getOptions(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getOptions(){
  StringWriter options=new StringWriter();
  options.append("String_Node_Str");
  options.append("String_Node_Str");
  options.append("String_Node_Str");
  options.append("String_Node_Str");
  options.append(getClassPathOptionArg());
  return options.toString();
}
Program: 10949
Project: 10949
Buggy source:
public static boolean canHandle(IProject project){
  StandaloneFacetHandler handler=new StandaloneFacetHandler(project);
  return CloudUtil.getFramework(project) == null && CloudFoundryProjectUtil.hasNature(project,JavaCore.NATURE_ID) && handler.hasFacet();
}

Fixed version (ground truth):
public static boolean canHandle(IProject project){
  StandaloneFacetHandler handler=new StandaloneFacetHandler(project);
  return CloudFoundryProjectUtil.hasNature(project,JavaCore.NATURE_ID) && handler.hasFacet();
}
Program: 10950
Project: 10950
Buggy source:
public IModule[] createModules(IProject project){
  if (canCreateModule(project)) {
    IModule module=createModule(project.getName(),project.getName(),CloudFoundryServer.ID_JAVA_STANDALONE_APP,CloudFoundryServer.ID_JAVA_STANDALONE_APP_VERSION,project);
    return new IModule[]{module};
  }
  return new IModule[0];
}

Fixed version (ground truth):
public IModule[] createModules(IProject project){
  if (canCreateModule(project)) {
    IModule module=createModule(project.getName(),project.getName(),CloudFoundryServer.ID_JAVA_STANDALONE_APP,CloudFoundryServer.ID_JAVA_STANDALONE_APP_VERSION,project);
    if (module != null) {
      return new IModule[]{module};
    }
  }
  return null;
}
Program: 10951
Project: 10951
Buggy source:
public boolean hasFacet(){
  try {
    IFacetedProject facetedProject=ProjectFacetsManager.create(project);
    return facetedProject.hasProjectFacet(FACET);
  }
 catch (  CoreException e) {
    CloudFoundryPlugin.logError(e);
    return false;
  }
}

Fixed version (ground truth):
public boolean hasFacet(){
  try {
    IFacetedProject facetedProject=ProjectFacetsManager.create(project);
    return facetedProject != null && facetedProject.hasProjectFacet(FACET);
  }
 catch (  CoreException e) {
    CloudFoundryPlugin.logError(e);
    return false;
  }
}
Program: 10952
Project: 10952
Buggy source:
public boolean addFacet(){
  if (!hasFacet()) {
    try {
      IFacetedProject facetedProject=ProjectFacetsManager.create(project);
      facetedProject.installProjectFacet(FACET.getDefaultVersion(),null,null);
      return true;
    }
 catch (    CoreException e) {
      CloudFoundryPlugin.logError(e);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean addFacet(){
  if (!hasFacet()) {
    try {
      IFacetedProject facetedProject=ProjectFacetsManager.create(project);
      if (facetedProject != null) {
        facetedProject.installProjectFacet(FACET.getDefaultVersion(),null,null);
        return true;
      }
    }
 catch (    CoreException e) {
      CloudFoundryPlugin.logError(e);
    }
  }
  return false;
}
Program: 10953
Project: 10953
Buggy source:
public synchronized int getUnusedPort(int base){
  boolean contains=true;
  while (contains) {
    contains=usedPorts.contains(new Integer(base));
    if (!contains) {
      return base;
    }
 else {
      base++;
    }
  }
  return -1;
}

Fixed version (ground truth):
public synchronized int getUnusedPort(){
  int base=PORT_BASE;
  Set<Integer> used=new HashSet<Integer>();
  for (  Entry<String,Map<String,CaldecottTunnelDescriptor>> entry : caldecottTunnels.entrySet()) {
    for (    Entry<String,CaldecottTunnelDescriptor> descEntry : entry.getValue().entrySet()) {
      used.add(descEntry.getValue().tunnelPort());
    }
  }
  while (used.contains(base)) {
    base++;
  }
  return base;
}
Program: 10954
Project: 10954
Buggy source:
public synchronized CaldecottTunnelDescriptor removeDescriptor(CloudFoundryServer server,String serviceName){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors != null) {
    CaldecottTunnelDescriptor descr=descriptors.remove(serviceName);
    if (descr != null) {
      Integer port=new Integer(descr.tunnelPort());
      usedPorts.remove(port);
    }
  }
  return null;
}

Fixed version (ground truth):
public synchronized CaldecottTunnelDescriptor removeDescriptor(CloudFoundryServer server,String serviceName){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors != null) {
    CaldecottTunnelDescriptor descr=descriptors.remove(serviceName);
    return descr;
  }
  return null;
}
Program: 10955
Project: 10955
Buggy source:
public synchronized void addDescriptor(CloudFoundryServer server,CaldecottTunnelDescriptor descriptor){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors == null) {
    descriptors=new HashMap<String,CaldecottTunnelDescriptor>();
    caldecottTunnels.put(id,descriptors);
  }
  Integer port=new Integer(descriptor.tunnelPort());
  usedPorts.add(port);
  descriptors.put(descriptor.getServiceName(),descriptor);
}

Fixed version (ground truth):
public synchronized void addDescriptor(CloudFoundryServer server,CaldecottTunnelDescriptor descriptor){
  String id=server.getServerId();
  Map<String,CaldecottTunnelDescriptor> descriptors=caldecottTunnels.get(id);
  if (descriptors == null) {
    descriptors=new HashMap<String,CaldecottTunnelDescriptor>();
    caldecottTunnels.put(id,descriptors);
  }
  descriptors.put(descriptor.getServiceName(),descriptor);
}
Program: 10956
Project: 10956
Buggy source:
public synchronized int getUnusedPort(){
  int base=CaldecottTunnelHandler.PORT_BASE;
  while (usedPorts.contains(base)) {
    base++;
  }
  return base;
}

Fixed version (ground truth):
public synchronized int getUnusedPort(){
  int base=CaldecottTunnelHandler.BASE_PORT;
  while (usedPorts.contains(base)) {
    base++;
  }
  return base;
}
Program: 10957
Project: 10957
Buggy source:
public Map<String,String> getTunnelInfo(CloudFoundryClient client,String serviceName,IProgressMonitor monitor){
  Throwable t=null;
  Map<String,String> info=null;
  int ticks=10;
  IProgressMonitor subMonitor=new SubProgressMonitor(monitor,ticks);
  subMonitor.beginTask("String_Node_Str" + serviceName,ticks);
  int i=0;
  while (i < ticks && !subMonitor.isCanceled()) {
    try {
      info=TunnelHelper.getTunnelServiceInfo(client,serviceName);
    }
 catch (    Throwable th) {
      t=th;
    }
    subMonitor.worked(i++);
    if (info == null) {
      long sleepTime=5000;
      try {
        Thread.sleep(sleepTime);
      }
 catch (      InterruptedException e) {
      }
    }
 else {
      break;
    }
  }
  if (info == null) {
    CloudFoundryPlugin.logError("String_Node_Str" + serviceName + "String_Node_Str",t);
  }
  subMonitor.done();
  return info;
}

Fixed version (ground truth):
public Map<String,String> getTunnelInfo(final CloudFoundryClient client,final String serviceName,IProgressMonitor monitor){
  int ticks=5;
  long sleepTime=5000;
  monitor.setTaskName("String_Node_Str" + serviceName);
  Map<String,String> info=new WaitWithProgressJob<Map<String,String>>(ticks,sleepTime){
    @Override protected Map<String,String> runInWait(    IProgressMonitor monitor){
      return TunnelHelper.getTunnelServiceInfo(client,serviceName);
    }
  }
.run(monitor);
  if (info == null) {
    CloudFoundryPlugin.logError("String_Node_Str" + serviceName + "String_Node_Str");
  }
  return info;
}
Program: 10958
Project: 10958
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  try {
    Collection<CaldecottTunnelDescriptor> descriptors=CloudFoundryPlugin.getCaldecottTunnelCache().getDescriptors(cloudServer);
    if (descriptors != null) {
      for (      CaldecottTunnelDescriptor desc : descriptors) {
        stopAndDeleteCaldecottTunnel(desc.getServiceName(),monitor);
      }
    }
  }
 catch (  CoreException e) {
    return CloudFoundryPlugin.getErrorStatus(e);
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
public T run(IProgressMonitor monitor){
  Throwable t=null;
  T result=null;
  int i=0;
  while (i < ticks && !monitor.isCanceled()) {
    try {
      result=runInWait(monitor);
    }
 catch (    Throwable th) {
      t=th;
    }
    if (result == null) {
      try {
        Thread.sleep(sleepTime);
      }
 catch (      InterruptedException e) {
      }
    }
 else {
      break;
    }
    i++;
  }
  if (result == null && t != null) {
    CloudFoundryPlugin.logError(t);
  }
  return result;
}
Program: 10959
Project: 10959
Buggy source:
public boolean bindServiceToCaldecottApp(CloudApplication caldecottApp,String serviceName,IProgressMonitor monitor) throws CoreException {
  List<String> updateCaldecottServices=new ArrayList<String>();
  List<String> existingServices=caldecottApp.getServices();
  if (existingServices != null) {
    updateCaldecottServices.addAll(existingServices);
  }
  IModule caldecottModule=getCaldecottModule(monitor);
  if (!updateCaldecottServices.contains(serviceName)) {
    updateCaldecottServices.add(serviceName);
    CloudFoundryServerBehaviour behaviour=cloudServer.getBehaviour();
    behaviour.stopModule(new IModule[]{caldecottModule},monitor);
    behaviour.updateServices(TunnelHelper.getTunnelAppName(),updateCaldecottServices,monitor);
    behaviour.startModule(new IModule[]{caldecottModule},monitor);
    return caldecottApp.getServices().contains(serviceName);
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean bindServiceToCaldecottApp(CloudApplication caldecottApp,String serviceName,IProgressMonitor monitor) throws CoreException {
  List<String> updateCaldecottServices=new ArrayList<String>();
  List<String> existingServices=caldecottApp.getServices();
  if (existingServices != null) {
    updateCaldecottServices.addAll(existingServices);
  }
  IModule caldecottModule=getCaldecottModule(monitor);
  if (!updateCaldecottServices.contains(serviceName)) {
    updateCaldecottServices.add(serviceName);
    CloudFoundryServerBehaviour behaviour=cloudServer.getBehaviour();
    behaviour.stopModule(new IModule[]{caldecottModule},monitor);
    behaviour.updateServices(TunnelHelper.getTunnelAppName(),updateCaldecottServices,monitor);
    behaviour.startModule(new IModule[]{caldecottModule},monitor);
    setDeploymentServices(serviceName,monitor);
    return caldecottApp.getServices().contains(serviceName);
  }
 else {
    return true;
  }
}
Program: 10961
Project: 10961
Buggy source:
@Override protected Boolean doRun(CloudFoundryClient client,SubMonitor progress) throws CoreException {
  Thread t=Thread.currentThread();
  ClassLoader oldLoader=t.getContextClassLoader();
  boolean deployed=false;
  try {
    t.setContextClassLoader(CloudFoundryServerBehaviour.class.getClassLoader());
    TunnelHelper.deployTunnelApp(client);
    deployed=true;
  }
 catch (  TunnelException te) {
    CloudFoundryPlugin.logError(te);
  }
 finally {
    t.setContextClassLoader(oldLoader);
  }
  if (deployed) {
    cloudServer.getBehaviour().refreshModules(progress);
  }
  return deployed;
}

Fixed version (ground truth):
@Override protected Boolean doRun(CloudFoundryClient client,SubMonitor progress) throws CoreException {
  progress.setTaskName("String_Node_Str");
  Thread t=Thread.currentThread();
  ClassLoader oldLoader=t.getContextClassLoader();
  boolean deployed=false;
  try {
    t.setContextClassLoader(CloudFoundryServerBehaviour.class.getClassLoader());
    TunnelHelper.deployTunnelApp(client);
    deployed=true;
  }
 catch (  TunnelException te) {
    CloudFoundryPlugin.logError(te);
  }
 finally {
    t.setContextClassLoader(oldLoader);
  }
  if (deployed) {
    cloudServer.getBehaviour().refreshModules(progress);
  }
  return deployed;
}
Program: 10962
Project: 10962
Buggy source:
protected void deployCaldecottApp(IProgressMonitor monitor) throws CoreException {
  Request<Boolean> request=cloudServer.getBehaviour().new Request<Boolean>(){
    @Override protected Boolean doRun(    CloudFoundryClient client,    SubMonitor progress) throws CoreException {
      Thread t=Thread.currentThread();
      ClassLoader oldLoader=t.getContextClassLoader();
      boolean deployed=false;
      try {
        t.setContextClassLoader(CloudFoundryServerBehaviour.class.getClassLoader());
        TunnelHelper.deployTunnelApp(client);
        deployed=true;
      }
 catch (      TunnelException te) {
        CloudFoundryPlugin.logError(te);
      }
 finally {
        t.setContextClassLoader(oldLoader);
      }
      if (deployed) {
        cloudServer.getBehaviour().refreshModules(progress);
      }
      return deployed;
    }
  }
;
  request.run(monitor);
}

Fixed version (ground truth):
protected void deployCaldecottApp(IProgressMonitor monitor) throws CoreException {
  Request<Boolean> request=cloudServer.getBehaviour().new Request<Boolean>(){
    @Override protected Boolean doRun(    CloudFoundryClient client,    SubMonitor progress) throws CoreException {
      progress.setTaskName("String_Node_Str");
      Thread t=Thread.currentThread();
      ClassLoader oldLoader=t.getContextClassLoader();
      boolean deployed=false;
      try {
        t.setContextClassLoader(CloudFoundryServerBehaviour.class.getClassLoader());
        TunnelHelper.deployTunnelApp(client);
        deployed=true;
      }
 catch (      TunnelException te) {
        CloudFoundryPlugin.logError(te);
      }
 finally {
        t.setContextClassLoader(oldLoader);
      }
      if (deployed) {
        cloudServer.getBehaviour().refreshModules(progress);
      }
      return deployed;
    }
  }
;
  request.run(monitor);
}
Program: 10963
Project: 10963
Buggy source:
/** 
 * Returns a list of applicable Caldecott Actions given the selection, or empty list if not actions are applicable.
 * @param selection
 * @param editorPage
 * @return non-null list of actions. May be empty.
 */
public List<IAction> getCaldecottActions(IStructuredSelection selection,final CloudFoundryApplicationsEditorPage editorPage){
  Collection<String> selectedServices=AddServiceStartCaldecottAction.getServiceNames(selection);
  List<IAction> actions=new ArrayList<IAction>();
  final CaldecottTunnelHandler handler=new CaldecottTunnelHandler(cloudServer);
  if (selectedServices != null && !selectedServices.isEmpty()) {
    final List<String> servicesWithTunnels=new ArrayList<String>();
    final List<String> servicesToAdd=getServicesWithNoTunnel(selectedServices,handler,servicesWithTunnels);
    if (!servicesToAdd.isEmpty()) {
      actions.add(new AddServiceStartCaldecottAction(servicesToAdd,cloudServer.getBehaviour(),editorPage,"String_Node_Str"));
    }
 else     if (!servicesWithTunnels.isEmpty()) {
      actions.add(new DisconnectCaldecottTunnelAction(editorPage,handler,servicesWithTunnels));
      IAction showCaldecottTunnelInfo=new Action("String_Node_Str",CloudFoundryImages.CONNECT){
        public void run(){
          displayCaldecottTunnels(servicesWithTunnels);
        }
      }
;
      actions.add(showCaldecottTunnelInfo);
    }
  }
  return actions;
}

Fixed version (ground truth):
/** 
 * Returns a list of applicable Caldecott Actions given the selection, or empty list if not actions are applicable.
 * @param selection
 * @param editorPage
 * @return non-null list of actions. May be empty.
 */
public List<IAction> getCaldecottActions(IStructuredSelection selection,final CloudFoundryApplicationsEditorPage editorPage){
  Collection<String> selectedServices=ModifyServicesForApplicationAction.getServiceNames(selection);
  List<IAction> actions=new ArrayList<IAction>();
  final CaldecottTunnelHandler handler=new CaldecottTunnelHandler(cloudServer);
  if (selectedServices != null && !selectedServices.isEmpty()) {
    final List<String> servicesWithTunnels=new ArrayList<String>();
    final List<String> servicesToAdd=getServicesWithNoTunnel(selectedServices,handler,servicesWithTunnels);
    if (!servicesToAdd.isEmpty()) {
      actions.add(new AddServiceStartCaldecottAction(servicesToAdd,cloudServer.getBehaviour(),editorPage,"String_Node_Str"));
    }
 else     if (!servicesWithTunnels.isEmpty()) {
      actions.add(new DisconnectCaldecottTunnelAction(editorPage,handler,servicesWithTunnels));
      IAction showCaldecottTunnelInfo=new Action("String_Node_Str",CloudFoundryImages.CONNECT){
        public void run(){
          displayCaldecottTunnels(servicesWithTunnels);
        }
      }
;
      actions.add(showCaldecottTunnelInfo);
    }
  }
  return actions;
}
Program: 10964
Project: 10964
Buggy source:
/** 
 * Stops the application and does a full publish of the application before restarting it. Should not be called for incremental updates.
 * @param modules
 * @param monitor
 * @return
 * @throws CoreException
 */
public ApplicationModule debugModule(IModule[] modules,IProgressMonitor monitor) throws CoreException {
  return doDebugModule(modules,true,monitor);
}

Fixed version (ground truth):
/** 
 * Stops the application and does a full publish of the application before restarting it. Should not be called for incremental updates.
 * @param modules
 * @param monitor
 * @return
 * @throws CoreException
 */
public ApplicationModule debugModule(IModule[] modules,IProgressMonitor monitor) throws CoreException {
  boolean incrementalPublish=false;
  return doDebugModule(modules,incrementalPublish,monitor);
}
Program: 10965
Project: 10965
Buggy source:
protected File getFile(IModuleResource moduleResource){
  File file=(File)moduleResource.getAdapter(File.class);
  if (file == null) {
    IFile iFile=(IFile)moduleResource.getAdapter(IFile.class);
    if (iFile != null) {
      file=iFile.getFullPath().toFile();
    }
  }
  return file;
}

Fixed version (ground truth):
protected File getFile(IModuleResource moduleResource){
  File file=(File)moduleResource.getAdapter(File.class);
  if (file == null) {
    IFile iFile=(IFile)moduleResource.getAdapter(IFile.class);
    if (iFile != null) {
      IPath location=iFile.getLocation();
      if (location != null) {
        return new File(location.toString());
      }
    }
  }
  return file;
}
Program: 10966
Project: 10966
Buggy source:
public DeployedResourceEntry getDeployedResourcesEntry(){
  DeployedResourceEntry deployedResourcesEntry=CloudFoundryPlugin.getDefault().getDeployedResourcesCache().getEntry(appName,getName());
  if (recalculate || deployedResourcesEntry == null) {
    deployedResourcesEntry=computeNewDeployedResourceEntry();
  }
  return deployedResourcesEntry;
}

Fixed version (ground truth):
public DeployedResourceEntry getDeployedResourcesEntry(){
  DeployedResourceEntry deployedResourcesEntry=CloudFoundryPlugin.getDefault().getDeployedResourcesCache().getEntry(appName,getName());
  if (canComputeResourceEntry() && (recalculate || deployedResourcesEntry == null)) {
    byte[] sha1=super.getSha1Digest();
    long fileSize=super.getSize();
    deployedResourcesEntry=new DeployedResourceEntry(sha1,fileSize,zipRelativeName);
    CloudFoundryPlugin.getDefault().getDeployedResourcesCache().add(appName,deployedResourcesEntry);
  }
  return deployedResourcesEntry;
}
Program: 10968
Project: 10968
Buggy source:
public void readCustomers() throws IOException, FFPojoException {
  InputStream inputStream=getClass().getClassLoader().getResourceAsStream(INPUT_TXT_RESOURCE_CLASSPATH);
  new FFPojoFlatFileReaderBuilder().withInputStream(inputStream).withRecordClass(Customer.class).read(new ReadProcessor(){
    public void process(    Object item){
      Customer cust=(Customer)item;
      System.out.printf("String_Node_Str",cust.getId(),cust.getName(),cust.getEmail());
    }
  }
);
}

Fixed version (ground truth):
public void readCustomers() throws IOException, FFPojoException {
  InputStream inputStream=getClass().getClassLoader().getResourceAsStream(INPUT_TXT_RESOURCE_CLASSPATH);
  List<Customer> read=new FFPojoFlatFileReaderBuilder().withInputStream(inputStream).withRecordClass(Customer.class).read();
}
Program: 10969
Project: 10969
Buggy source:
public synchronized AddClassBuilder withInputStream(final InputStream inputStream){
  return new AddClassBuilder(){
    public FFReaderBuilder withRecordClasses(    List<Class<?>> clazz){
      classes.addAll(clazz);
      return read(inputStream);
    }
    public FFReaderBuilder withRecordClass(    Class<?> clazz){
      classes.add(clazz);
      return read(inputStream);
    }
  }
;
}

Fixed version (ground truth):
public AddClassBuilder withInputStream(final InputStream inputStream){
  return new AddClassBuilder(){
    public FFReaderBuilder withRecordClasses(    List<Class<?>> clazz){
      classes.addAll(clazz);
      return read(inputStream);
    }
    public FFReaderBuilder withRecordClass(    Class<?> clazz){
      classes.add(clazz);
      return read(inputStream);
    }
  }
;
}
Program: 10970
Project: 10970
Buggy source:
public Object next(){
  if (!this.hasNext()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  try {
    Object record=parseRecordFromText(nextLine);
    this.recordText=nextLine;
    recordIndex++;
    nextLine=inputStreamReader.readLine();
    return record;
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
catch (  RecordParserException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
}

Fixed version (ground truth):
public Object next(){
  if (!this.hasNext()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  try {
    String currLine=nextLine;
    nextLine=inputStreamReader.readLine();
    Object record=parseRecordFromText(currLine);
    this.recordText=nextLine;
    recordIndex++;
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
catch (  RecordParserException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
}
Program: 10971
Project: 10971
Buggy source:
public Object next(){
  if (!this.hasNext()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  try {
    String currLine=nextLine;
    nextLine=inputStreamReader.readLine();
    Object record=parseRecordFromText(currLine);
    this.recordText=nextLine;
    recordIndex++;
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
catch (  RecordParserException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
}

Fixed version (ground truth):
public Object next(){
  if (!this.hasNext()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  try {
    String currLine=nextLine;
    nextLine=inputStreamReader.readLine();
    Object record=parseRecordFromText(currLine);
    this.recordText=nextLine;
    recordIndex++;
    return record;
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
catch (  RecordParserException e) {
    throw new RuntimeException("String_Node_Str" + (recordIndex + 1),e);
  }
}
Program: 10972
Project: 10972
Buggy source:
/** 
 * Check en url. Add http:// before if missing.
 * @param url The url to check.
 * @return The modified url if necessary.
 */
public static String checkUrl(String url){
  if ((url != null) && (url.length() > 0)) {
    if ((!url.startsWith("String_Node_Str")) && (!url.startsWith("String_Node_Str")) && (!url.startsWith(Constants.URL_ABOUT_BLANK))&& (!url.startsWith(Constants.URL_ABOUT_START))) {
      url="String_Node_Str" + url;
    }
  }
  return url;
}

Fixed version (ground truth):
/** 
 * Check en url. Add http:// before if missing.
 * @param url The url to check.
 * @return The modified url if necessary.
 */
public static String checkUrl(String url){
  if ((url != null) && (url.length() > 0)) {
    if ((!url.startsWith("String_Node_Str")) && (!url.startsWith("String_Node_Str")) && (!url.startsWith("String_Node_Str"))&& (!url.startsWith(Constants.URL_ABOUT_BLANK))&& (!url.startsWith(Constants.URL_ABOUT_START))) {
      url="String_Node_Str" + url;
    }
  }
  return url;
}
Program: 10973
Project: 10973
Buggy source:
/** 
 * Update the fav icon display.
 */
private void updateFavIcon(){
  mUrlEditText.setCompoundDrawablesWithIntrinsicBounds(new BitmapDrawable(mCurrentWebView.getFavicon()),null,mUrlEditText.getCompoundDrawables()[2],null);
}

Fixed version (ground truth):
/** 
 * Update the fav icon display.
 */
private void updateFavIcon(){
  mUrlEditText.setCompoundDrawables(getNormalizedFavicon(),null,mUrlEditText.getCompoundDrawables()[2],null);
}