nus-yam/ex-repair huggingface dataset:
Program: 39942
Project: 39942
Buggy source:
private void listenToSocket() throws IOException {
  InputStream usbdInputStream=mSocket.getInputStream();
  byte[] buffer=new byte[100];
  while (true) {
    int count=usbdInputStream.read(buffer);
    if (count < 0) {
      throw new IOException("String_Node_Str");
    }
    Log.e(TAG,"String_Node_Str" + count + "String_Node_Str");
    int pos, start;
    for (pos=0, start=0; pos < count; pos++) {
      if (buffer[pos] == 0) {
        handleEvent(new String(buffer,start,pos - start));
        start=pos + 1;
      }
    }
  }
}

Fixed version (ground truth):
private void listenToSocket() throws IOException {
  InputStream usbdInputStream=mSocket.getInputStream();
  byte[] buffer=new byte[100];
  while (true) {
    int count=usbdInputStream.read(buffer);
    if (count < 0) {
      throw new IOException("String_Node_Str");
    }
    int pos, start;
    for (pos=0, start=0; pos < count; pos++) {
      if (buffer[pos] == 0) {
        handleEvent(new String(buffer,start,pos - start));
        start=pos + 1;
      }
    }
  }
}
Program: 39943
Project: 39943
Buggy source:
public synchronized void stop(){
  Log.e(TAG,"String_Node_Str");
  mRunning=false;
  if (mSocket != null) {
    try {
      mSocket.shutdownInput();
    }
 catch (    IOException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
  mWriteThread.quit();
}

Fixed version (ground truth):
public synchronized void stop(){
  Log.d(TAG,"String_Node_Str");
  mRunning=false;
  if (mSocket != null) {
    try {
      mSocket.shutdownInput();
    }
 catch (    IOException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
  mWriteThread.quit();
}
Program: 39944
Project: 39944
Buggy source:
private synchronized void closeSocket(){
  Log.e(TAG,"String_Node_Str");
  try {
    if (mOutputStream != null) {
      mOutputStream.close();
    }
    mOutputStream=null;
    if (mSocket != null) {
      mSocket.close();
    }
    mSocket=null;
  }
 catch (  IOException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private synchronized void closeSocket(){
  try {
    if (mOutputStream != null) {
      mOutputStream.close();
    }
    mOutputStream=null;
    if (mSocket != null) {
      mSocket.close();
    }
    mSocket=null;
  }
 catch (  IOException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
}
Program: 39945
Project: 39945
Buggy source:
private synchronized void writeCommand(String cmd,String arg){
  Log.e(TAG,"String_Node_Str" + cmd);
  if (mOutputStream == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  String line=cmd;
  if (arg != null) {
    line+=arg;
  }
  line+='\0';
  try {
    mOutputStream.write(line.getBytes());
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private synchronized void writeCommand(String cmd,String arg){
  if (mOutputStream == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  String line=cmd;
  if (arg != null) {
    line+=arg;
  }
  line+='\0';
  Log.d(TAG,"String_Node_Str" + line + "String_Node_Str");
  try {
    mOutputStream.write(line.getBytes());
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 39947
Project: 39947
Buggy source:
public String getServerUrl(){
  if (server == null) {
    return null;
  }
  StringBuilder buf=new StringBuilder();
  boolean first=true;
  for (  String s : server.split("String_Node_Str")) {
    if (s.trim().length() == 0)     continue;
    if (first)     first=false;
 else     buf.append(' ');
    buf.append(addPrefix(s));
  }
  return buf.toString();
}

Fixed version (ground truth):
@CheckForNull public String getServerUrl(){
  if (server == null) {
    return null;
  }
  StringBuilder buf=new StringBuilder();
  boolean first=true;
  for (  String s : server.split("String_Node_Str")) {
    if (s.trim().length() == 0)     continue;
    if (first)     first=false;
 else     buf.append(' ');
    buf.append(addPrefix(s));
  }
  return buf.toString();
}
Program: 39948
Project: 39948
Buggy source:
public static String toProviderUrl(String serverUrl,String rootDN){
  if (serverUrl == null) {
    return null;
  }
  StringBuilder buf=new StringBuilder();
  boolean first=true;
  for (  String s : serverUrl.split("String_Node_Str")) {
    if (s.trim().length() == 0)     continue;
    if (first)     first=false;
 else     buf.append(' ');
    s=addPrefix(s);
    buf.append(s);
    if (!s.endsWith("String_Node_Str"))     buf.append('/');
    buf.append(fixNull(rootDN));
  }
  return buf.toString();
}

Fixed version (ground truth):
@Nullable public static String toProviderUrl(@CheckForNull String serverUrl,@CheckForNull String rootDN){
  if (serverUrl == null) {
    return null;
  }
  StringBuilder buf=new StringBuilder();
  boolean first=true;
  for (  String s : serverUrl.split("String_Node_Str")) {
    if (s.trim().length() == 0)     continue;
    if (first)     first=false;
 else     buf.append(' ');
    s=addPrefix(s);
    buf.append(s);
    if (!s.endsWith("String_Node_Str"))     buf.append('/');
    buf.append(fixNull(rootDN));
  }
  return buf.toString();
}
Program: 39952
Project: 39952
Buggy source:
public DefaultReverseProxyAuthenticator(String username,GrantedAuthority[] authorities){
  this.username=username;
  this.authorities=authorities;
}

Fixed version (ground truth):
public DefaultReverseProxyAuthenticator(String username,@CheckForNull GrantedAuthority[] authorities){
  this.username=username;
  this.authorities=authorities != null ? Arrays.copyOf(authorities,authorities.length) : null;
}
Program: 39953
Project: 39953
Buggy source:
public void setMessageSource(MessageSource messageSource){
  Assert.notNull("String_Node_Str");
  messages=new MessageSourceAccessor(messageSource);
}

Fixed version (ground truth):
public void setMessageSource(@Nonnull MessageSource messageSource){
  Assert.notNull("String_Node_Str");
  messages=new MessageSourceAccessor(messageSource);
}
Program: 39954
Project: 39954
Buggy source:
/** 
 * Constructor for group search scenarios. <tt>userRoleAttributes</tt> may still be set as a property.
 */
public DefaultReverseProxyAuthoritiesPopulator(Hashtable<String,GrantedAuthority[]> authContext){
  this.authContext=authContext;
  reverseProxyTemplate=new ReverseProxySearchTemplate();
}

Fixed version (ground truth):
/** 
 * Constructor for group search scenarios. <tt>userRoleAttributes</tt> may still be set as a property.
 */
public DefaultReverseProxyAuthoritiesPopulator(Hashtable<String,GrantedAuthority[]> authContext){
  this.authContext=new Hashtable<>(authContext);
  reverseProxyTemplate=new ReverseProxySearchTemplate();
}
Program: 39955
Project: 39955
Buggy source:
public void setAuthorities(GrantedAuthority[] authorities){
  this.authorities=authorities;
}

Fixed version (ground truth):
public void setAuthorities(@CheckForNull GrantedAuthority[] authorities){
  this.authorities=authorities != null ? Arrays.copyOf(authorities,authorities.length) : null;
}
Program: 39956
Project: 39956
Buggy source:
public GrantedAuthority[] getAuthorities(){
  return authorities;
}

Fixed version (ground truth):
@CheckForNull @SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public GrantedAuthority[] getAuthorities(){
  return authorities;
}
Program: 39957
Project: 39957
Buggy source:
public String getUsername(){
  return username;
}

Fixed version (ground truth):
@CheckForNull public String getUsername(){
  return username;
}
Program: 39959
Project: 39959
Buggy source:
@Override public SecurityComponents createSecurityComponents(){
  Binding binding=new Binding();
  binding.setVariable("String_Node_Str",this);
  BeanBuilder builder=new BeanBuilder(Jenkins.getInstance().pluginManager.uberClassLoader);
  String fileName;
  if (getLDAPURL() != null) {
    fileName="String_Node_Str";
  }
 else {
    fileName="String_Node_Str";
  }
  try {
    File override=new File(Jenkins.getInstance().getRootDir(),fileName);
    builder.parse(override.exists() ? new AutoCloseInputStream(new FileInputStream(override)) : getClass().getResourceAsStream(fileName),binding);
  }
 catch (  FileNotFoundException e) {
    throw new Error("String_Node_Str" + fileName,e);
  }
  WebApplicationContext appContext=builder.createApplicationContext();
  if (getLDAPURL() != null) {
    ldapTemplate=new LdapTemplate(findBean(InitialDirContextFactory.class,appContext));
  }
  if (getLDAPURL() != null) {
    proxyTemplate=new ReverseProxySearchTemplate();
    return new SecurityComponents(findBean(AuthenticationManager.class,appContext),new ReverseProxyUserDetailsService(appContext));
  }
 else {
    return new SecurityComponents(new AuthenticationManager(){
      public Authentication authenticate(      Authentication authentication){
        return authentication;
      }
    }
,new UserDetailsService(){
      public UserDetails loadUserByUsername(      String username) throws UsernameNotFoundException, DataAccessException {
        throw new UsernameNotFoundException(username);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public SecurityComponents createSecurityComponents(){
  Binding binding=new Binding();
  binding.setVariable("String_Node_Str",this);
  BeanBuilder builder=new BeanBuilder(Jenkins.getInstance().pluginManager.uberClassLoader);
  String fileName;
  if (getLDAPURL() != null) {
    fileName="String_Node_Str";
  }
 else {
    fileName="String_Node_Str";
  }
  try {
    File override=new File(Jenkins.getInstance().getRootDir(),fileName);
    builder.parse(override.exists() ? new AutoCloseInputStream(new FileInputStream(override)) : getClass().getResourceAsStream(fileName),binding);
  }
 catch (  FileNotFoundException e) {
    throw new Error("String_Node_Str" + fileName,e);
  }
  WebApplicationContext appContext=builder.createApplicationContext();
  if (getLDAPURL() == null) {
    proxyTemplate=new ReverseProxySearchTemplate();
    return new SecurityComponents(findBean(AuthenticationManager.class,appContext),new ReverseProxyUserDetailsService(appContext));
  }
 else {
    ldapTemplate=new LdapTemplate(findBean(InitialDirContextFactory.class,appContext));
    return new SecurityComponents(new AuthenticationManager(){
      public Authentication authenticate(      Authentication authentication){
        return authentication;
      }
    }
,new UserDetailsService(){
      public UserDetails loadUserByUsername(      String username) throws UsernameNotFoundException, DataAccessException {
        throw new UsernameNotFoundException(username);
      }
    }
);
  }
}
Program: 39961
Project: 39961
Buggy source:
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,Preference preference){
  boolean value;
  if (preference == mLauncherEndlessLoop) {
    value=mLauncherEndlessLoop.isChecked();
    Settings.System.putInt(getContentResolver(),Settings.System.LAUNCHER_ENDLESS_LOOP,value ? 1 : 0);
    restartLauncher2(activityManager);
  }
  return true;
}

Fixed version (ground truth):
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,Preference preference){
  boolean value;
  if (preference == mLauncherEndlessLoop) {
    value=mLauncherEndlessLoop.isChecked();
    Settings.System.putInt(getContentResolver(),Settings.System.LAUNCHER_ENDLESS_LOOP,value ? 1 : 0);
    restartLauncher2(activityManager);
  }
  if (preference == mScreenPreference) {
    alertbox("String_Node_Str","String_Node_Str" + "String_Node_Str");
  }
  return true;
}
Program: 39962
Project: 39962
Buggy source:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (DBG)   Log.v(TAG,"String_Node_Str");
  if (key == mScreenPreference.getKey()) {
    if (DBG)     Log.v(TAG,"String_Node_Str");
    registerScreenChange(mScreenPreference.getEntry().toString());
    restartLauncher2(activityManager);
  }
}

Fixed version (ground truth):
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (DBG)   Log.v(TAG,"String_Node_Str");
  if (key == mScreenPreference.getKey()) {
    if (DBG)     Log.v(TAG,"String_Node_Str");
    registerScreenChange(mScreenPreference.getEntry().toString());
    PackageUtils packageUtility=new PackageUtils(this,LAUNCHER);
    packageUtility.initiateClearUserData();
  }
}
Program: 39963
Project: 39963
Buggy source:
public void printDependenciesMap(){
  for (  DeployableServiceSpec spec : deployableServiceSpecs) {
    System.out.print(spec.getName() + "String_Node_Str");
    if (spec.getDependencies() != null) {
      for (      ServiceDependency dep : spec.getDependencies()) {
        System.out.print(dep.getServiceSpecName() + "String_Node_Str");
      }
    }
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public void printDependenciesMap(){
  for (  DeployableServiceSpec spec : deployableServiceSpecs) {
    System.out.print(spec.getName() + "String_Node_Str" + spec.getEndpointName()+ "String_Node_Str");
    if (spec.getDependencies() != null) {
      for (      ServiceDependency dep : spec.getDependencies()) {
        System.out.print(dep.getServiceSpecName() + "String_Node_Str");
      }
    }
    System.out.println("String_Node_Str");
  }
}
Program: 39964
Project: 39964
Buggy source:
@Override public void setInvocationAddress(final String role,final String name,final List<String> endpoints){
  super.setInvocationAddress(role,name,endpoints);
  if (endpoints.size() == 2) {
    secondTargetType=TrackerType.valueOf(role);
  }
}

Fixed version (ground truth):
@Override public void setInvocationAddress(final String role,final String name,final List<String> endpoints){
  super.setInvocationAddress(role,name,endpoints);
  if (targets.size() == 2) {
    secondTargetType=TrackerType.valueOf(role);
  }
}
Program: 39965
Project: 39965
Buggy source:
public AlwaysCreateESBNodeSelector(){
  String npmUri=ChoreographyDeployerConfiguration.get(DEPLOYMENT_MANAGER_URI_PROPERTY);
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory nodeFac=new ESBNodeFactory(npm);
  this.selector=new AlwaysCreateSelector<EasyESBNode,ResourceImpact>(nodeFac);
}

Fixed version (ground truth):
public AlwaysCreateESBNodeSelector(){
  String npmUri=Owners.getDefault();
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory nodeFac=new ESBNodeFactory(npm);
  this.selector=new AlwaysCreateSelector<EasyESBNode,ResourceImpact>(nodeFac);
}
Program: 39966
Project: 39966
Buggy source:
public LimitedRoundRobinESBNodeSelector(){
  int nodeLimit=this.getNodeLimit();
  String npmUri=ChoreographyDeployerConfiguration.get(DEPLOYMENT_MANAGER_URI_PROPERTY);
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory factory=new ESBNodeFactory(npm);
  ESBNodeRetriever retriever=new ESBNodeRetriever();
  this.selector=new LimitedRoundRobinSelector<EasyESBNode,ResourceImpact>(nodeLimit,retriever,factory);
}

Fixed version (ground truth):
public LimitedRoundRobinESBNodeSelector(){
  int nodeLimit=this.getNodeLimit();
  String npmUri=Owners.getDefault();
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory factory=new ESBNodeFactory(npm);
  ESBNodeRetriever retriever=new ESBNodeRetriever();
  this.selector=new LimitedRoundRobinSelector<EasyESBNode,ResourceImpact>(nodeLimit,retriever,factory);
}
Program: 39967
Project: 39967
Buggy source:
public SingletonESBNodeSelector(){
  String npmUri=ChoreographyDeployerConfiguration.get(DEPLOYMENT_MANAGER_URI_PROPERTY);
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory nodeFac=new ESBNodeFactory(npm);
  this.selector=new SingletonSelector<EasyESBNode,ResourceImpact>(nodeFac);
}

Fixed version (ground truth):
public SingletonESBNodeSelector(){
  String npmUri=Owners.getDefault();
  NodePoolManager npm=new NodesClient(npmUri);
  ESBNodeFactory nodeFac=new ESBNodeFactory(npm);
  this.selector=new SingletonSelector<EasyESBNode,ResourceImpact>(nodeFac);
}
Program: 39968
Project: 39968
Buggy source:
@Override public void run(){
  logger.info("String_Node_Str" + enacter.getId());
  try {
    long t0=System.nanoTime();
    ok=enacter.verifyAnswer();
    long tf=System.nanoTime();
    report.addCheckTime(tf - t0);
    if (ok) {
      int all=Experiment.CHORS_QTY * Experiment.CHORS_SIZE;
      logger.info("String_Node_Str" + all + "String_Node_Str"+ enacter.getId());
      servicesWorking=all;
    }
 else {
      verifyServicePerService();
    }
  }
 catch (  MalformedURLException e) {
    logger.error("String_Node_Str" + enacter.getId());
    ok=false;
  }
  logger.info("String_Node_Str" + enacter.getId() + "String_Node_Str"+ ok);
}

Fixed version (ground truth):
@Override public void run(){
  logger.info("String_Node_Str" + enacter.getId());
  try {
    long t0=System.nanoTime();
    ok=enacter.verifyAnswer();
    long tf=System.nanoTime();
    report.addCheckTime(tf - t0);
    if (ok) {
      int all=Experiment.CHORS_SIZE;
      logger.info("String_Node_Str" + all + "String_Node_Str"+ enacter.getId());
      servicesWorking=all;
    }
 else {
      verifyServicePerService();
    }
  }
 catch (  MalformedURLException e) {
    logger.error("String_Node_Str" + enacter.getId());
    ok=false;
  }
  logger.info("String_Node_Str" + enacter.getId() + "String_Node_Str"+ ok);
}
Program: 39969
Project: 39969
Buggy source:
public String getExpectedPathIds(final int chorSize){
  final StringBuffer answer=new StringBuffer();
  for (int i=0; i < chorSize; i++) {
    answer.append(i);
    answer.append(' ');
  }
  answer.deleteCharAt(answer.length() - 1);
  return answer.toString();
}

Fixed version (ground truth):
public String getExpectedPathIds(final int chorSize){
  final StringBuffer answer=new StringBuffer();
  for (int i=0; i < chorSize; i++) {
    answer.append(i);
    answer.append(' ');
  }
  if (answer.length() > 0) {
    answer.deleteCharAt(answer.length() - 1);
  }
  return answer.toString();
}
Program: 39970
Project: 39970
Buggy source:
private void initTravelAgencySpecs(){
  if (packageType == PackageType.COMMAND_LINE) {
    travelSpec=new DeployableServiceSpec(serviceType,packageType,null,null,TRAVEL_AGENCY_JAR,TRAVEL_AGENCY_PORT,TRAVEL_AGENCY,1);
  }
 else {
    travelSpec=new DeployableServiceSpec(serviceType,packageType,null,null,TRAVEL_AGENCY_JAR,TRAVEL_AGENCY,1);
  }
  List<String> roles=new ArrayList<String>();
  roles.add(TRAVEL_AGENCY);
  List<ChoreographyServiceDependency> dependencies=new ArrayList<ChoreographyServiceDependency>();
  dependencies.add(new ChoreographyServiceDependency(AIRLINE,AIRLINE));
  travelAgencyChoreographyServiceSpec=new ChoreographyServiceSpec(travelSpec,null,null,roles,dependencies,TRAVEL_AGENCY);
}

Fixed version (ground truth):
private void initTravelAgencySpecs(){
  if (packageType == PackageType.COMMAND_LINE) {
    travelSpec=new DeployableServiceSpec(serviceType,packageType,null,null,TRAVEL_AGENCY_JAR,TRAVEL_AGENCY_PORT,TRAVEL_AGENCY,1);
  }
 else {
    travelSpec=new DeployableServiceSpec(serviceType,packageType,null,null,TRAVEL_AGENCY_WAR,TRAVEL_AGENCY,1);
  }
  List<String> roles=new ArrayList<String>();
  roles.add(TRAVEL_AGENCY);
  List<ChoreographyServiceDependency> dependencies=new ArrayList<ChoreographyServiceDependency>();
  dependencies.add(new ChoreographyServiceDependency(AIRLINE,AIRLINE));
  travelAgencyChoreographyServiceSpec=new ChoreographyServiceSpec(travelSpec,null,null,roles,dependencies,TRAVEL_AGENCY);
}
Program: 39971
Project: 39971
Buggy source:
private void initAirlineSpecs(){
  if (packageType == PackageType.COMMAND_LINE) {
    airlineSpec=new DeployableServiceSpec(serviceType,packageType,null,null,AIRLINE_JAR,AIRLINE_PORT,AIRLINE,1);
  }
 else {
    airlineSpec=new DeployableServiceSpec(serviceType,packageType,null,null,AIRLINE_JAR,AIRLINE,1);
  }
  List<String> roles=new ArrayList<String>();
  roles.add(AIRLINE);
  airlineChoreographyServiceSpec=new ChoreographyServiceSpec(airlineSpec,null,null,roles,AIRLINE);
}

Fixed version (ground truth):
private void initAirlineSpecs(){
  if (packageType == PackageType.COMMAND_LINE) {
    airlineSpec=new DeployableServiceSpec(serviceType,packageType,null,null,AIRLINE_JAR,AIRLINE_PORT,AIRLINE,1);
  }
 else {
    airlineSpec=new DeployableServiceSpec(serviceType,packageType,null,null,AIRLINE_WAR,AIRLINE,1);
  }
  List<String> roles=new ArrayList<String>();
  roles.add(AIRLINE);
  airlineChoreographyServiceSpec=new ChoreographyServiceSpec(airlineSpec,null,null,roles,AIRLINE);
}
Program: 39973
Project: 39973
Buggy source:
public List<ServiceInstance> getInstances(){
  return Collections.unmodifiableList(serviceInstances);
}

Fixed version (ground truth):
public List<ServiceInstance> getInstances(){
  return serviceInstances;
}
Program: 39974
Project: 39974
Buggy source:
/** 
 * Client requests a service instances by ID
 * @param serviceID of service of required instances
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstances(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId + "String_Node_Str"+ serviceId);
  Service service;
  try {
    service=serviceDeployer.getService(serviceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service.getInstances()).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service instances by ID
 * @param serviceID of service of required instances
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstances(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId + "String_Node_Str"+ serviceId);
  Service service;
  try {
    service=servicesManager.getService(serviceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service.getInstances()).build();
}
Program: 39975
Project: 39975
Buggy source:
/** 
 * Client requests remove a service by ID
 * @param serviceID
 */
@DELETE @Path("String_Node_Str") public Response deleteService(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId);
  try {
    serviceDeployer.deleteService(serviceId);
  }
 catch (  ServiceNotDeletedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceNotFoundException e) {
    return Response.status(Status.NOT_FOUND).build();
  }
  logger.info("String_Node_Str" + serviceId + "String_Node_Str");
  return Response.ok().build();
}

Fixed version (ground truth):
/** 
 * Client requests remove a service by ID
 * @param serviceID
 */
@DELETE @Path("String_Node_Str") public Response deleteService(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId);
  try {
    servicesManager.deleteService(serviceId);
  }
 catch (  ServiceNotDeletedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceNotFoundException e) {
    return Response.status(Status.NOT_FOUND).build();
  }
  logger.info("String_Node_Str" + serviceId + "String_Node_Str");
  return Response.ok().build();
}
Program: 39976
Project: 39976
Buggy source:
/** 
 * Update a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 * @throws UnhandledModificationException 
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response updateService(JAXBElement<ServiceSpec> serviceSpecXML,@PathParam("String_Node_Str") String serviceId,@Context UriInfo uriInfo){
  ServiceSpec serviceSpec=serviceSpecXML.getValue();
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + serviceSpec.getName());
  Service service;
  try {
    service=serviceDeployer.updateService(serviceId,serviceSpec);
  }
 catch (  ServiceNotModifiedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  UnhandledModificationException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(serviceSpec.getName() + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getName());
  Response build=Response.ok(service).build();
  return build;
}

Fixed version (ground truth):
/** 
 * Update a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 * @throws UnhandledModificationException 
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response updateService(JAXBElement<ServiceSpec> serviceSpecXML,@PathParam("String_Node_Str") String serviceId,@Context UriInfo uriInfo){
  ServiceSpec serviceSpec=serviceSpecXML.getValue();
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + serviceSpec.getName());
  Service service;
  try {
    service=servicesManager.updateService(serviceId,serviceSpec);
  }
 catch (  ServiceNotModifiedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  UnhandledModificationException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(serviceSpec.getName() + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getName());
  Response build=Response.ok(service).build();
  return build;
}
Program: 39977
Project: 39977
Buggy source:
/** 
 * Client requests a service instance by ID
 * @param serviceID of service of required instance
 * @param instanceID of required instance
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstance(@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String instanceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId + "String_Node_Str"+ serviceId);
  Service service;
  ServiceInstance instance;
  try {
    service=serviceDeployer.getService(serviceId);
    instance=service.getInstance(instanceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceInstanceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(instance).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service instance by ID
 * @param serviceID of service of required instance
 * @param instanceID of required instance
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstance(@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String instanceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId + "String_Node_Str"+ serviceId);
  Service service;
  ServiceInstance instance;
  try {
    service=servicesManager.getService(serviceId);
    instance=service.getInstance(instanceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceInstanceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(instance).build();
}
Program: 39978
Project: 39978
Buggy source:
/** 
 * Client requests a service by ID
 * @param serviceID of required service
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getService(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId);
  Service service;
  try {
    service=serviceDeployer.getService(serviceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service by ID
 * @param serviceID of required service
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getService(@PathParam("String_Node_Str") String serviceId){
  if (serviceId == null || serviceId.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + serviceId);
  Service service;
  try {
    service=servicesManager.getService(serviceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service).build();
}
Program: 39979
Project: 39979
Buggy source:
@Test public void shouldDeployAWarServiceInANode() throws Exception {
  Service service=deployer.createService(spec);
  ServiceInstance instance=service.getInstances().get(0);
  String url=instance.getNativeUri();
  System.out.println("String_Node_Str" + url);
  npm.upgradeNode(instance.getNode().getId());
  Thread.sleep(1000);
  client=WebClient.create(url);
  String body=client.get(String.class);
  String excerpt="String_Node_Str";
  assertTrue(body.contains(excerpt));
}

Fixed version (ground truth):
@Test public void shouldDeployAWarServiceInANode() throws Exception {
  Service service=servicesManager.createService(spec);
  ServiceInstance instance=service.getInstances().get(0);
  String url=instance.getNativeUri();
  System.out.println("String_Node_Str" + url);
  npm.upgradeNode(instance.getNode().getId());
  Thread.sleep(1000);
  client=WebClient.create(url);
  String body=client.get(String.class);
  String excerpt="String_Node_Str";
  assertTrue(body.contains(excerpt));
}
Program: 39980
Project: 39980
Buggy source:
@Before public void setUp() throws Exception {
  Configuration.set("String_Node_Str","String_Node_Str");
  npm=new NodesClient(deploymentManagerHost);
  deployer=new ServicesClient(deploymentManagerHost);
  spec.setName("String_Node_Str");
  spec.setPackageUri(JAR_LOCATION);
  spec.setPackageType(PackageType.COMMAND_LINE);
  spec.setEndpointName("String_Node_Str");
  spec.setPort(8042);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  Configuration.set("String_Node_Str","String_Node_Str");
  npm=new NodesClient(deploymentManagerHost);
  servicesManager=new ServicesClient(deploymentManagerHost);
  spec.setName("String_Node_Str");
  spec.setPackageUri(JAR_LOCATION);
  spec.setPackageType(PackageType.COMMAND_LINE);
  spec.setEndpointName("String_Node_Str");
  spec.setPort(8042);
}
Program: 39981
Project: 39981
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + legacyHostname + "String_Node_Str"+ legacyIp+ "String_Node_Str"+ node+ "String_Node_Str"+ easyEsbNodeAdminEndpoint+ "String_Node_Str"+ nativeUri+ "String_Node_Str"+ instanceId+ "String_Node_Str"+ serviceId+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + node.getHostname() + "String_Node_Str"+ node.getIp()+ "String_Node_Str"+ node+ "String_Node_Str"+ easyEsbNodeAdminEndpoint+ "String_Node_Str"+ nativeUri+ "String_Node_Str"+ instanceId+ "String_Node_Str"+ service.getSpec().getUUID()+ "String_Node_Str";
}
Program: 39982
Project: 39982
Buggy source:
/** 
 * Client requests a service instances by ID
 * @param serviceID of service of required instances
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstances(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=serviceDeployer.getService(uuid);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service.getInstances()).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service instances by ID
 * @param serviceID of service of required instances
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstances(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=servicesManager.getService(uuid);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service.getInstances()).build();
}
Program: 39983
Project: 39983
Buggy source:
/** 
 * Client requests remove a service by ID
 * @param serviceID
 */
@DELETE @Path("String_Node_Str") public Response deleteService(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  try {
    serviceDeployer.deleteService(uuid);
  }
 catch (  ServiceNotDeletedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceNotFoundException e) {
    return Response.status(Status.NOT_FOUND).build();
  }
  logger.info("String_Node_Str" + uuid + "String_Node_Str");
  return Response.ok().build();
}

Fixed version (ground truth):
/** 
 * Client requests remove a service by ID
 * @param serviceID
 */
@DELETE @Path("String_Node_Str") public Response deleteService(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  try {
    servicesManager.deleteService(uuid);
  }
 catch (  ServiceNotDeletedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceNotFoundException e) {
    return Response.status(Status.NOT_FOUND).build();
  }
  logger.info("String_Node_Str" + uuid + "String_Node_Str");
  return Response.ok().build();
}
Program: 39984
Project: 39984
Buggy source:
/** 
 * Update a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 * @throws UnhandledModificationException 
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response updateService(JAXBElement<DeployedServiceSpec> serviceSpecXML,@PathParam("String_Node_Str") String uuid,@Context UriInfo uriInfo){
  DeployedServiceSpec serviceSpec=serviceSpecXML.getValue();
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=servicesManager.updateService(serviceId,serviceSpec);
  }
 catch (  ServiceNotModifiedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  UnhandledModificationException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(uuid + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getSpec().getUUID());
  Response build=Response.ok(service).build();
  return build;
}

Fixed version (ground truth):
/** 
 * Update a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 * @throws UnhandledModificationException 
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response updateService(JAXBElement<DeployedServiceSpec> serviceSpecXML,@PathParam("String_Node_Str") String uuid,@Context UriInfo uriInfo){
  DeployedServiceSpec serviceSpec=serviceSpecXML.getValue();
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=servicesManager.updateService(uuid,serviceSpec);
  }
 catch (  ServiceNotModifiedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  UnhandledModificationException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(uuid + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getSpec().getUUID());
  Response build=Response.ok(service).build();
  return build;
}
Program: 39985
Project: 39985
Buggy source:
/** 
 * Client requests a service instance by ID
 * @param serviceID of service of required instance
 * @param instanceID of required instance
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstance(@PathParam("String_Node_Str") String uuid,@PathParam("String_Node_Str") String instanceId){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + instanceId + "String_Node_Str"+ uuid);
  DeployedService service;
  ServiceInstance instance;
  try {
    service=serviceDeployer.getService(uuid);
    instance=service.getInstance(instanceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceInstanceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(instance).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service instance by ID
 * @param serviceID of service of required instance
 * @param instanceID of required instance
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getServiceInstance(@PathParam("String_Node_Str") String uuid,@PathParam("String_Node_Str") String instanceId){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + instanceId + "String_Node_Str"+ uuid);
  DeployedService service;
  ServiceInstance instance;
  try {
    service=servicesManager.getService(uuid);
    instance=service.getInstance(instanceId);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
catch (  ServiceInstanceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(instance).build();
}
Program: 39986
Project: 39986
Buggy source:
/** 
 * Deploys a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 */
@POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response deployService(JAXBElement<DeployedServiceSpec> serviceSpecXML,@Context UriInfo uriInfo){
  DeployedServiceSpec serviceSpec=serviceSpecXML.getValue();
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + serviceSpec.getPackageUri());
  Service service;
  try {
    service=servicesManager.createService(serviceSpec);
  }
 catch (  ServiceNotDeployedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(service.getSpec().getUUID() + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getSpec().getUUID());
  URI location=uriBuilder.build();
  return Response.created(location).entity(service).build();
}

Fixed version (ground truth):
/** 
 * Deploys a service
 * @param serviceSpecXML Request's body content with a ServiceSpec XML
 * @return HTTP code 201 and Location header if the service was successfully deployed;HTTP code 400 if request can not be properly parsed;  HTTP code 500 if any other error occurs.
 */
@POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response deployService(DeployedServiceSpec serviceSpec,@Context UriInfo uriInfo){
  if (serviceSpec.getPackageUri() == null || serviceSpec.getPackageUri().isEmpty() || serviceSpec.getPackageType() == null)   return Response.status(Status.BAD_REQUEST).build();
  logger.debug("String_Node_Str" + serviceSpec.getPackageUri());
  Service service;
  try {
    service=servicesManager.createService(serviceSpec);
  }
 catch (  ServiceNotDeployedException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  logger.info(service.getSpec().getUUID() + "String_Node_Str" + service.getUris());
  UriBuilder uriBuilder=uriInfo.getBaseUriBuilder();
  uriBuilder=uriBuilder.path(ServicesResource.class).path(service.getSpec().getUUID());
  URI location=uriBuilder.build();
  return Response.created(location).entity(service).build();
}
Program: 39987
Project: 39987
Buggy source:
/** 
 * Client requests a service by ID
 * @param serviceID of required service
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getService(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=serviceDeployer.getService(uuid);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service).build();
}

Fixed version (ground truth):
/** 
 * Client requests a service by ID
 * @param serviceID of required service
 * @return a service found
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_XML) public Response getService(@PathParam("String_Node_Str") String uuid){
  if (uuid == null || uuid.isEmpty()) {
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.debug("String_Node_Str" + uuid);
  DeployedService service;
  try {
    service=servicesManager.getService(uuid);
  }
 catch (  ServiceNotFoundException e) {
    return Response.status(Status.INTERNAL_SERVER_ERROR).build();
  }
  return Response.ok(service).build();
}
Program: 39988
Project: 39988
Buggy source:
@Test public void shouldDeployAWarServiceInANode() throws Exception {
  Service service=servicesManager.createService(spec);
  ServiceInstance instance=service.getInstances().get(0);
  String url=instance.getNativeUri();
  System.out.println("String_Node_Str" + url);
  npm.upgradeNode(instance.getNode().getId());
  Thread.sleep(1000);
  client=WebClient.create(url);
  String body=client.get(String.class);
  String excerpt="String_Node_Str";
  assertTrue(body.contains(excerpt));
}

Fixed version (ground truth):
@Test public void shouldDeployAWarServiceInANode() throws Exception {
  Service service=servicesManager.createService(spec);
  ServiceInstance instance=((DeployedService)service).getInstances().get(0);
  String url=instance.getNativeUri();
  System.out.println("String_Node_Str" + url);
  npm.upgradeNode(instance.getNode().getId());
  Thread.sleep(1000);
  client=WebClient.create(url);
  String body=client.get(String.class);
  String excerpt="String_Node_Str";
  assertTrue(body.contains(excerpt));
}
Program: 39989
Project: 39989
Buggy source:
private ServiceSpec getSpec(){
  ServiceSpec airlineSpec=new ServiceSpec();
  airlineSpec.setName("String_Node_Str");
  airlineSpec.setPackageUri("String_Node_Str");
  airlineSpec.setType(ServiceType.SOAP);
  airlineSpec.setEndpointName("String_Node_Str");
  airlineSpec.setPort(1234);
  airlineSpec.setPackageType(PackageType.COMMAND_LINE);
  return airlineSpec;
}

Fixed version (ground truth):
private DeployedServiceSpec getSpec(){
  return new DeployedServiceSpec(ServiceType.SOAP,PackageType.COMMAND_LINE,null,null,"String_Node_Str",1234,"String_Node_Str",1);
}
Program: 39990
Project: 39990
Buggy source:
@Before public void setUp() throws ServiceNotDeployedException {
  ServicesManager servicesManagerMock=mock(ServicesManager.class);
  when(servicesManagerMock.createService(getSpec())).thenReturn(getService());
  this.servicesResources=new ServicesResource(servicesManagerMock,null);
}

Fixed version (ground truth):
@Before public void setUp() throws ServiceNotDeployedException {
  ServicesManager servicesManagerMock=mock(ServicesManager.class);
  when(servicesManagerMock.createService(getSpec())).thenReturn(getService());
  this.servicesResources=new ServicesResourceForTest(servicesManagerMock,null);
}
Program: 39991
Project: 39991
Buggy source:
@Test public void shouldCreateService() throws IllegalArgumentException, UriBuilderException, URISyntaxException, ServiceInstanceNotFoundException {
  String uri="String_Node_Str";
  UriBuilder uriBuilder=mock(UriBuilder.class);
  UriInfo uriInfo=mock(UriInfo.class);
  when(uriInfo.getBaseUriBuilder()).thenReturn(uriBuilder);
  when(uriBuilder.path(any(Class.class))).thenReturn(uriBuilder);
  when(uriBuilder.path(any(String.class))).thenReturn(uriBuilder);
  when(uriBuilder.build()).thenReturn(new URI(uri));
  Response response=this.servicesResources.createService(getSpec(),uriInfo);
  assertEquals(201,response.getStatus());
  Service entity=(Service)response.getEntity();
  assertEquals("String_Node_Str",entity.getName());
  assertEquals(getSpec(),entity.getSpec());
  assertEquals(1,entity.getInstances().size());
  assertEquals(getService().getInstance("String_Node_Str"),entity.getInstance("String_Node_Str"));
  assertEquals(uri,response.getMetadata().get("String_Node_Str").get(0));
}

Fixed version (ground truth):
@Test public void shouldCreateService() throws IllegalArgumentException, UriBuilderException, URISyntaxException, ServiceInstanceNotFoundException {
  String uri="String_Node_Str";
  UriBuilder uriBuilder=mock(UriBuilder.class);
  UriInfo uriInfo=mock(UriInfo.class);
  when(uriInfo.getBaseUriBuilder()).thenReturn(uriBuilder);
  when(uriBuilder.path(any(Class.class))).thenReturn(uriBuilder);
  when(uriBuilder.path(any(String.class))).thenReturn(uriBuilder);
  when(uriBuilder.build()).thenReturn(new URI(uri));
  Response response=this.servicesResources.deployService(getSpec(),uriInfo);
  assertEquals(201,response.getStatus());
  Service entity=(Service)response.getEntity();
  assertEquals("String_Node_Str",entity.getSpec().getUUID());
  assertEquals(getSpec(),entity.getSpec());
  assertEquals(1,((DeployedService)entity).getInstances().size());
  assertEquals(getService().getInstance("String_Node_Str"),((DeployedService)entity).getInstance("String_Node_Str"));
  assertEquals(uri,response.getMetadata().get("String_Node_Str").get(0));
}