nus-yam/ex-repair huggingface dataset:
Program: 55494
Project: 55494
Buggy source:
/** 
 * Configures the maximum number of retries. This number should be a trade-off between having enough retries to survive a database outage due to failure and a responsive and not stalling application. The default value for the maximum number is 3. <p/> <p><b>Note:</b>Consider using a   {@link BackOffPolicy} which ensures that there isenough time left between the retry attempts instead of increasing this value to a high number. The back-off policy ensures that there is a delay in between the retry operations.</p>
 * @param maxNumberOfRetries - the maximum number of retries should be a positive number, otherwise all retries will fail.
 */
public void setMaxNumberOfRetries(int maxNumberOfRetries){
  this.maxNumberOfRetries=maxNumberOfRetries;
}

Fixed version (ground truth):
/** 
 * Configures the maximum number of retries. This number should be a trade-off between having enough retries to survive a database outage due to failure and a responsive and not stalling application. The default value for the maximum number is 3. <p><b>Note:</b>Consider using a   {@link BackOffPolicy} which ensures that there isenough time left between the retry attempts instead of increasing this value to a high number. The back-off policy ensures that there is a delay in between the retry operations.</p>
 * @param maxNumberOfRetries - the maximum number of retries should be a positive number, otherwise all retries will fail.
 */
public void setMaxNumberOfRetries(int maxNumberOfRetries){
  this.maxNumberOfRetries=maxNumberOfRetries;
}
Program: 55495
Project: 55495
Buggy source:
private boolean isRetryAbleException(Throwable throwable){
  boolean retryAble=this.binaryExceptionClassifier.classify(throwable);
  if (!retryAble) {
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("String_Node_Str",throwable.getClass().getName());
    }
    if (throwable.getCause() != null) {
      return isRetryAbleException(throwable.getCause());
    }
    return false;
  }
 else {
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("String_Node_Str",throwable.getClass().getName());
    }
    return retryAble;
  }
}

Fixed version (ground truth):
private boolean isRetryAbleException(Throwable throwable){
  boolean retryAble=this.binaryExceptionClassifier.classify(throwable);
  if (!retryAble) {
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("String_Node_Str",throwable.getClass().getName());
    }
    if (throwable.getCause() != null) {
      return isRetryAbleException(throwable.getCause());
    }
    return false;
  }
 else {
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("String_Node_Str",throwable.getClass().getName());
    }
    return true;
  }
}
Program: 55497
Project: 55497
Buggy source:
@Test public void testDestinationResolverIsCreatedIfNull() throws Exception {
  AbstractMessageListenerContainer container=new StubAbstractMessageListenerContainer();
  container.setAmazonSqs(Mockito.mock(AmazonSQSAsync.class));
  container.setMessageListener(Mockito.mock(MessageListener.class));
  container.setDestinationName("String_Node_Str");
  container.afterPropertiesSet();
  DestinationResolver destinationResolver=container.getDestinationResolver();
  Assert.assertNotNull(destinationResolver);
  Assert.assertTrue(CachingDestinationResolver.class.isInstance(destinationResolver));
}

Fixed version (ground truth):
@Test public void testDestinationResolverIsCreatedIfNull() throws Exception {
  AbstractMessageListenerContainer container=new StubAbstractMessageListenerContainer();
  container.setAmazonSqs(Mockito.mock(AmazonSQSAsync.class));
  container.setMessageListener(Mockito.mock(MessageListener.class));
  container.setDestinationName("String_Node_Str");
  container.afterPropertiesSet();
  DestinationResolver<String> destinationResolver=container.getDestinationResolver();
  Assert.assertNotNull(destinationResolver);
  Assert.assertTrue(CachingDestinationResolver.class.isInstance(destinationResolver));
}
Program: 55498
Project: 55498
Buggy source:
private static String nullSafeGetTextValue(JsonNode jsonNode,String attribute){
  return jsonNode.has(attribute) ? jsonNode.get(attribute).getValueAsText() : null;
}

Fixed version (ground truth):
private static String nullSafeGetTextValue(JsonNode jsonNode,String attribute){
  return jsonNode.has(attribute) ? jsonNode.get(attribute).asText() : null;
}
Program: 55499
Project: 55499
Buggy source:
@Override public NotificationMessage fromMessage(Message<String> message){
  try {
    JsonNode jsonNode=this.objectMapper.readValue(message.getPayload(),JsonNode.class);
    if (!jsonNode.has("String_Node_Str")) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    if (!"String_Node_Str".equals(jsonNode.get("String_Node_Str").getTextValue())) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    if (!jsonNode.has("String_Node_Str")) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    return new NotificationMessage(nullSafeGetTextValue(jsonNode,"String_Node_Str"),nullSafeGetTextValue(jsonNode,"String_Node_Str"));
  }
 catch (  IOException e) {
    throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public NotificationMessage fromMessage(Message<String> message){
  try {
    JsonNode jsonNode=this.objectMapper.readValue(message.getPayload(),JsonNode.class);
    if (!jsonNode.has("String_Node_Str")) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    if (!"String_Node_Str".equals(jsonNode.get("String_Node_Str").asText())) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    if (!jsonNode.has("String_Node_Str")) {
      throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str");
    }
    return new NotificationMessage(nullSafeGetTextValue(jsonNode,"String_Node_Str"),nullSafeGetTextValue(jsonNode,"String_Node_Str"));
  }
 catch (  IOException e) {
    throw new MessageConversionException("String_Node_Str" + message.getPayload() + "String_Node_Str",e);
  }
}
Program: 55500
Project: 55500
Buggy source:
private static void addRegionProviderBeanDefinition(Element element,ParserContext parserContext,BeanDefinitionBuilder parent){
  if (StringUtils.hasText(element.getAttribute("String_Node_Str")) && StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    parserContext.getReaderContext().error("String_Node_Str",element);
    return;
  }
  if (StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    parent.addConstructorArgReference(element.getAttribute("String_Node_Str"));
    return;
  }
  BeanDefinitionBuilder beanDefinitionBuilder=BeanDefinitionBuilder.rootBeanDefinition(StaticRegionProvider.class);
  if (StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    beanDefinitionBuilder.addConstructorArgValue(S3ServiceEndpoint.valueOf(element.getAttribute("String_Node_Str")));
    parent.addConstructorArgValue(beanDefinitionBuilder.getBeanDefinition());
  }
 else {
    beanDefinitionBuilder.addConstructorArgValue(S3ServiceEndpoint.US_STANDARD);
  }
  parent.addConstructorArgValue(beanDefinitionBuilder.getBeanDefinition());
}

Fixed version (ground truth):
private static void addRegionProviderBeanDefinition(Element element,ParserContext parserContext,BeanDefinitionBuilder parent){
  if (StringUtils.hasText(element.getAttribute("String_Node_Str")) && StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    parserContext.getReaderContext().error("String_Node_Str",element);
    return;
  }
  if (StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    parent.addConstructorArgReference(element.getAttribute("String_Node_Str"));
    return;
  }
  BeanDefinitionBuilder beanDefinitionBuilder=BeanDefinitionBuilder.rootBeanDefinition(StaticRegionProvider.class);
  if (StringUtils.hasText(element.getAttribute("String_Node_Str"))) {
    beanDefinitionBuilder.addConstructorArgValue(Region.valueOf(element.getAttribute("String_Node_Str")));
    parent.addConstructorArgValue(beanDefinitionBuilder.getBeanDefinition());
  }
 else {
    beanDefinitionBuilder.addConstructorArgValue(Region.US_STANDARD);
  }
  parent.addConstructorArgValue(beanDefinitionBuilder.getBeanDefinition());
}
Program: 55501
Project: 55501
Buggy source:
private void createBucketWithFile(String bucketName,Region region){
  this.amazonS3.createBucket(bucketName,region);
  ObjectMetadata objectMetadata=new ObjectMetadata();
  objectMetadata.setContentLength(bucketName.getBytes().length);
  this.amazonS3.putObject(bucketName,DEFAULT_FILENAME,new ByteArrayInputStream(bucketName.getBytes()),objectMetadata);
}

Fixed version (ground truth):
private void createBucketWithFile(String bucketName,Region region){
  if (!isBucketAlreadyExisting(bucketName)) {
    this.amazonS3.createBucket(bucketName,region);
  }
  ObjectMetadata objectMetadata=new ObjectMetadata();
  objectMetadata.setContentLength(bucketName.getBytes().length);
  this.amazonS3.putObject(bucketName,DEFAULT_FILENAME,new ByteArrayInputStream(bucketName.getBytes()),objectMetadata);
}
Program: 55502
Project: 55502
Buggy source:
public AmazonEC2PropertyPlaceHolder(String accessKey,String secretKey,InstanceIdProvider instanceIdProvider){
  this.amazonEC2=new AmazonEC2Client(new BasicAWSCredentials(accessKey,secretKey));
  this.instanceIdProvider=instanceIdProvider;
}

Fixed version (ground truth):
public AmazonEC2PropertyPlaceHolder(String accessKey,String secretKey,InstanceIdProvider instanceIdProvider){
  this.amazonEC2=new AmazonEC2Client(new BasicAWSCredentials(accessKey,secretKey));
  this.instanceIdProvider=instanceIdProvider;
  super.setValueSeparator(DEFAULT_VALUE_SEPARATOR);
}
Program: 55504
Project: 55504
Buggy source:
public Object invoke(Object target,Method method,Object[] arguments) throws Throwable {
  if (method.getDeclaringClass() == ResourceLoader.class) {
    return ReflectionUtils.invokeMethod(method,this.resourceLoader,arguments);
  }
  return ReflectionUtils.invokeMethod(method,this.delegate,arguments);
}

Fixed version (ground truth):
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (method.getDeclaringClass() == ResourceLoader.class) {
    return ReflectionUtils.invokeMethod(method,this.resourceLoader,args);
  }
  return ReflectionUtils.invokeMethod(method,this.delegate,args);
}
Program: 55505
Project: 55505
Buggy source:
@Override public long contentLength() throws IOException {
  assertThatResourceExists();
  return objectMetadata.getContentLength();
}

Fixed version (ground truth):
@Override public long contentLength() throws IOException {
  assertThatResourceExists();
  return this.objectMetadata.getContentLength();
}
Program: 55506
Project: 55506
Buggy source:
@Override public long lastModified() throws IOException {
  assertThatResourceExists();
  return objectMetadata.getLastModified().getTime();
}

Fixed version (ground truth):
@Override public long lastModified() throws IOException {
  assertThatResourceExists();
  return this.objectMetadata.getLastModified().getTime();
}
Program: 55507
Project: 55507
Buggy source:
public Resource getResource(String location){
  if (location.startsWith(S3_PROTOCOL_PREFIX)) {
    Matcher matcher=S3_LOCATION_PATTERN.matcher(location);
    if (matcher.matches()) {
      return new SimpleStorageResource(getBucketNameFromUri(matcher),getObjectNameFromUri(matcher),this.getAmazonS3());
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + location + "String_Node_Str");
    }
  }
  return delegate.getResource(location);
}

Fixed version (ground truth):
public Resource getResource(String location){
  if (location.startsWith(S3_PROTOCOL_PREFIX)) {
    Matcher matcher=S3_LOCATION_PATTERN.matcher(location);
    if (matcher.matches()) {
      return new SimpleStorageResource(getBucketNameFromUri(matcher),getObjectNameFromUri(matcher),this.getAmazonS3());
    }
 else {
      throw new IllegalArgumentException(String.format("String_Node_Str",location));
    }
  }
  return this.delegate.getResource(location);
}
Program: 55508
Project: 55508
Buggy source:
public ClassLoader getClassLoader(){
  return delegate.getClassLoader();
}

Fixed version (ground truth):
public ClassLoader getClassLoader(){
  return this.delegate.getClassLoader();
}
Program: 55509
Project: 55509
Buggy source:
public void handle(HttpExchange httpExchange) throws IOException {
  httpExchange.sendResponseHeaders(200,this.result.length());
  OutputStream outputStream=httpExchange.getResponseBody();
  OutputStreamWriter outputStreamWriter=new OutputStreamWriter(outputStream);
  outputStreamWriter.write(this.result);
  outputStreamWriter.flush();
  httpExchange.close();
}

Fixed version (ground truth):
public void handle(HttpExchange exchange) throws IOException {
  exchange.sendResponseHeaders(200,this.result.length());
  OutputStream outputStream=exchange.getResponseBody();
  OutputStreamWriter outputStreamWriter=new OutputStreamWriter(outputStream);
  outputStreamWriter.write(this.result);
  outputStreamWriter.flush();
  exchange.close();
}
Program: 55512
Project: 55512
Buggy source:
@Test public void testResolveUserWithOutUserDataDefinedForInstance() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserTagsForInstance(false);
  amazonEC2PropertyPlaceHolder.setUserDataAttributeEncoding("String_Node_Str");
  amazonEC2PropertyPlaceHolder.setUserDataAttributeSeparator("String_Node_Str");
  amazonEC2PropertyPlaceHolder.setValueSeparator("String_Node_Str");
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstanceAttributeRequest describeInstanceAttributeRequest=new DescribeInstanceAttributeRequest("String_Node_Str",AmazonEC2PropertyPlaceHolder.USER_DATA_ATTRIBUTE_NAME);
  DescribeInstanceAttributeResult describeInstanceAttributeResult=new DescribeInstanceAttributeResult().withInstanceAttribute(new InstanceAttribute().withUserData(null));
  Mockito.when(amazonEC2.describeInstanceAttribute(Matchers.refEq(describeInstanceAttributeRequest))).thenReturn(describeInstanceAttributeResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertNull(amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
}

Fixed version (ground truth):
@Test public void testResolveUserWithOutUserDataDefinedForInstance() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserTagsForInstance(false);
  amazonEC2PropertyPlaceHolder.setUserDataAttributeEncoding("String_Node_Str");
  amazonEC2PropertyPlaceHolder.setUserDataAttributeSeparator("String_Node_Str");
  amazonEC2PropertyPlaceHolder.setValueSeparator("String_Node_Str");
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstanceAttributeRequest describeInstanceAttributeRequest=new DescribeInstanceAttributeRequest("String_Node_Str",AmazonEC2PropertyPlaceHolder.USER_DATA_ATTRIBUTE_NAME);
  DescribeInstanceAttributeResult describeInstanceAttributeResult=new DescribeInstanceAttributeResult().withInstanceAttribute(new InstanceAttribute().withUserData(null));
  Mockito.when(amazonEC2.describeInstanceAttribute(describeInstanceAttributeRequest)).thenReturn(describeInstanceAttributeResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertNull(amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
}
Program: 55513
Project: 55513
Buggy source:
@Test public void testResolveUserDataProperties() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserTagsForInstance(false);
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstanceAttributeRequest describeInstanceAttributeRequest=new DescribeInstanceAttributeRequest("String_Node_Str",AmazonEC2PropertyPlaceHolder.USER_DATA_ATTRIBUTE_NAME);
  String encodedUserData=Base64.encodeBase64String("String_Node_Str".getBytes("String_Node_Str"));
  DescribeInstanceAttributeResult describeInstanceAttributeResult=new DescribeInstanceAttributeResult().withInstanceAttribute(new InstanceAttribute().withUserData(encodedUserData));
  Mockito.when(amazonEC2.describeInstanceAttribute(Matchers.refEq(describeInstanceAttributeRequest))).thenReturn(describeInstanceAttributeResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
}

Fixed version (ground truth):
@Test public void testResolveUserDataProperties() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserTagsForInstance(false);
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstanceAttributeRequest describeInstanceAttributeRequest=new DescribeInstanceAttributeRequest("String_Node_Str",AmazonEC2PropertyPlaceHolder.USER_DATA_ATTRIBUTE_NAME);
  String encodedUserData=Base64.encodeBase64String("String_Node_Str".getBytes("String_Node_Str"));
  DescribeInstanceAttributeResult describeInstanceAttributeResult=new DescribeInstanceAttributeResult().withInstanceAttribute(new InstanceAttribute().withUserData(encodedUserData));
  Mockito.when(amazonEC2.describeInstanceAttribute(describeInstanceAttributeRequest)).thenReturn(describeInstanceAttributeResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
}
Program: 55515
Project: 55515
Buggy source:
@org.junit.Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendMail() throws Exception {
  SimpleMailMessage simpleMailMessage=new SimpleMailMessage();
  simpleMailMessage.setFrom(this.senderAddress);
  simpleMailMessage.setTo(this.recipientAddress);
  simpleMailMessage.setSubject("String_Node_Str");
  simpleMailMessage.setText("String_Node_Str");
  mailSender.send(simpleMailMessage);
}

Fixed version (ground truth):
@org.junit.Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendMail() throws Exception {
  SimpleMailMessage simpleMailMessage=new SimpleMailMessage();
  simpleMailMessage.setFrom(this.senderAddress);
  simpleMailMessage.setTo(this.recipientAddress);
  simpleMailMessage.setSubject("String_Node_Str");
  simpleMailMessage.setText("String_Node_Str");
  this.mailSender.send(simpleMailMessage);
}
Program: 55516
Project: 55516
Buggy source:
@Test public void testExistingDataSourceInstance() throws Exception {
  Properties properties=new Properties();
  properties.load(new ClassPathResource("String_Node_Str").getInputStream());
  String accessKey=properties.getProperty("String_Node_Str");
  String secretKey=properties.getProperty("String_Node_Str");
  AmazonRDSDataSourceFactoryBean factoryBean=new AmazonRDSDataSourceFactoryBean(accessKey,secretKey);
  factoryBean.setDatabaseName("String_Node_Str");
  CommonsDbcpDataSourceFactory dataSourceFactory=new CommonsDbcpDataSourceFactory();
  Properties dbProperties=new Properties();
  dbProperties.setProperty("String_Node_Str","String_Node_Str");
  dbProperties.setProperty("String_Node_Str","String_Node_Str");
  dataSourceFactory.setConnectionProperties(dbProperties);
  factoryBean.setDataSourceFactory(dataSourceFactory);
  factoryBean.setDbInstanceIdentifier("String_Node_Str");
  factoryBean.setMasterUserName("String_Node_Str");
  factoryBean.setMasterUserPassword("String_Node_Str");
  factoryBean.afterPropertiesSet();
  DataSource dataSource=factoryBean.getObject();
  JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);
  jdbcTemplate.query("String_Node_Str",new RowMapper<Object>(){
    public Object mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return null;
    }
  }
);
  factoryBean.destroy();
}

Fixed version (ground truth):
@Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testExistingDataSourceInstance() throws Exception {
  Properties properties=new Properties();
  properties.load(new ClassPathResource("String_Node_Str").getInputStream());
  String accessKey=properties.getProperty("String_Node_Str");
  String secretKey=properties.getProperty("String_Node_Str");
  AmazonRDSDataSourceFactoryBean factoryBean=new AmazonRDSDataSourceFactoryBean(accessKey,secretKey);
  factoryBean.setDatabaseName("String_Node_Str");
  CommonsDbcpDataSourceFactory dataSourceFactory=new CommonsDbcpDataSourceFactory();
  Properties dbProperties=new Properties();
  dbProperties.setProperty("String_Node_Str","String_Node_Str");
  dbProperties.setProperty("String_Node_Str","String_Node_Str");
  dataSourceFactory.setConnectionProperties(dbProperties);
  factoryBean.setDataSourceFactory(dataSourceFactory);
  factoryBean.setDbInstanceIdentifier("String_Node_Str");
  factoryBean.setMasterUserName("String_Node_Str");
  factoryBean.setMasterUserPassword("String_Node_Str");
  factoryBean.afterPropertiesSet();
  DataSource dataSource=factoryBean.getObject();
  JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);
  jdbcTemplate.query("String_Node_Str",new RowMapper<Object>(){
    public Object mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return null;
    }
  }
);
  factoryBean.destroy();
}
Program: 55518
Project: 55518
Buggy source:
@Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendAndReceiveStringMessage() throws Exception {
  String messageContent="String_Node_Str";
  stringMessageOperations.convertAndSend(messageContent);
  String receivedMessage=(String)stringMessageOperations.receiveAndConvert();
  Assert.assertEquals(messageContent,receivedMessage);
}

Fixed version (ground truth):
@Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendAndReceiveStringMessage() throws Exception {
  String messageContent="String_Node_Str";
  this.stringMessageOperations.convertAndSend(messageContent);
  String receivedMessage=(String)this.stringMessageOperations.receiveAndConvert();
  Assert.assertEquals(messageContent,receivedMessage);
}
Program: 55519
Project: 55519
Buggy source:
@Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendAndReceiveObjectMessage() throws Exception {
  List<String> payload=Collections.singletonList("String_Node_Str");
  objectMessageOperations.convertAndSend(payload);
  @SuppressWarnings({"String_Node_Str"}) List<String> result=(List<String>)objectMessageOperations.receiveAndConvert();
  Assert.assertEquals("String_Node_Str",result.get(0));
}

Fixed version (ground truth):
@Test @IfProfileValue(name="String_Node_Str",value="String_Node_Str") public void testSendAndReceiveObjectMessage() throws Exception {
  List<String> payload=Collections.singletonList("String_Node_Str");
  this.objectMessageOperations.convertAndSend(payload);
  @SuppressWarnings({"String_Node_Str"}) List<String> result=(List<String>)this.objectMessageOperations.receiveAndConvert();
  Assert.assertEquals("String_Node_Str",result.get(0));
}
Program: 55520
Project: 55520
Buggy source:
/** 
 * Determine the maximum total number of attempts to make when selecting random nodes to recommend.
 * @param context of the current computation.
 * @return maximum number of attempts. By default 10 * {@link com.graphaware.reco.generic.context.Context#limit()}
 */
protected int numberOfAttempts(Context<Node,Node> context){
  return context.config().limit() * 10;
}

Fixed version (ground truth):
/** 
 * Determine the maximum total number of attempts to make when selecting random nodes to recommend.
 * @param context of the current computation.
 * @return maximum number of attempts. By default 10 * {@link Context#config()} {@link Config#limit()}
 */
protected int numberOfAttempts(Context<Node,Node> context){
  return context.config().limit() * 10;
}
Program: 55521
Project: 55521
Buggy source:
/** 
 * Determine the maximum number of random nodes to recommend. <p/> The reason for this setting is the following: usually, this engine will be used as the last one to make up the desired number of recommendations. If only   {@link com.graphaware.reco.generic.context.Context#limit()} recommendationswere produced, there could be a possibility that the produced recommendations are the ones already computed by previous engines, thus not making up the desired number. The higher the return value of this method, the lower the chance of the desired number of recommendations not being satisfied.
 * @param context of the current computation.
 * @return maximum number of recommendations. By default 2 * {@link com.graphaware.reco.generic.context.Context#limit()}
 */
protected int numberOfRecommendations(Context<Node,Node> context){
  return context.config().limit() * 2;
}

Fixed version (ground truth):
/** 
 * Determine the maximum number of random nodes to recommend. <p/> The reason for this setting is the following: usually, this engine will be used as the last one to make up the desired number of recommendations. If only   {@link Context#config()} {@link Config#limit()} recommendationswere produced, there could be a possibility that the produced recommendations are the ones already computed by previous engines, thus not making up the desired number. The higher the return value of this method, the lower the chance of the desired number of recommendations not being satisfied.
 * @param context of the current computation.
 * @return maximum number of recommendations. By default 2 * {@link Context#config()} {@link Config#limit()}
 */
protected int numberOfRecommendations(Context<Node,Node> context){
  return context.config().limit() * 2;
}
Program: 55522
Project: 55522
Buggy source:
/** 
 * {@inheritDoc}<p/> A maximum of   {@link com.graphaware.reco.generic.context.Context#limit()} number of nodes is returned, each witha score determined by  {@link #score(org.neo4j.graphdb.Node)}. The total number of attempts made to find a suitable node is determined by   {@link #numberOfAttempts(com.graphaware.reco.generic.context.Context)}.
 */
@Override protected final Map<Node,PartialScore> doRecommendSingle(Node input,Context<Node,Node> context){
  Map<Node,PartialScore> result=new HashMap<>();
  int attempts=0;
  int numberOfAttempts=numberOfAttempts(context);
  int numberOfRecommendations=numberOfRecommendations(context);
  while (attempts++ < numberOfAttempts && result.size() < numberOfRecommendations) {
    Node node=selector.selectNode(input.getGraphDatabase());
    result.put(node,score(node));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p/> A maximum of   {@link Context#config()} {@link Config#limit()} number of nodes is returned, each witha score determined by  {@link #score(org.neo4j.graphdb.Node)}. The total number of attempts made to find a suitable node is determined by   {@link #numberOfAttempts(com.graphaware.reco.generic.context.Context)}.
 */
@Override protected final Map<Node,PartialScore> doRecommendSingle(Node input,Context<Node,Node> context){
  Map<Node,PartialScore> result=new HashMap<>();
  int attempts=0;
  int numberOfAttempts=numberOfAttempts(context);
  int numberOfRecommendations=numberOfRecommendations(context);
  while (attempts++ < numberOfAttempts && result.size() < numberOfRecommendations) {
    Node node=selector.selectNode(input.getGraphDatabase());
    if (node != null) {
      result.put(node,score(node));
    }
  }
  return result;
}
Program: 55523
Project: 55523
Buggy source:
public Category[] awaitCategoriesLikeName(String partialName){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_categories_like_path)).appendPath(partialName).build().toString();
  return get(url,Category[].class);
}

Fixed version (ground truth):
public Category[] awaitCategoriesLikeName(String partialName){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_categories_like_path));
  if (partialName != null)   uriBuilder.appendPath(partialName);
  return get(uriBuilder.build().toString(),Category[].class);
}
Program: 55524
Project: 55524
Buggy source:
public Poi[] awaitSearchByCategory(Location location,Integer radius,String categoryFoursquareId){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_search_path)).appendQueryParameter("String_Node_Str",location != null ? location.stringValues() : null).appendQueryParameter("String_Node_Str",radius != null ? radius.toString() : null).appendQueryParameter("String_Node_Str",categoryFoursquareId).build().toString();
  return get(url,Poi[].class);
}

Fixed version (ground truth):
public Poi[] awaitSearchByCategory(Location location,Integer radius,String categoryFoursquareId){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_search_path));
  if (location != null)   uriBuilder.appendQueryParameter("String_Node_Str",location.stringValues());
  if (radius != null)   uriBuilder.appendQueryParameter("String_Node_Str",radius.toString());
  if (categoryFoursquareId != null)   uriBuilder.appendQueryParameter("String_Node_Str",categoryFoursquareId);
  return get(uriBuilder.build().toString(),Poi[].class);
}
Program: 55525
Project: 55525
Buggy source:
public Poi[] awaitRoute(String poiFoursquareId){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_route_path)).appendQueryParameter("String_Node_Str",poiFoursquareId).build().toString();
  return get(url,Poi[].class);
}

Fixed version (ground truth):
public Poi[] awaitRoute(String poiFoursquareId){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_route_path));
  if (poiFoursquareId != null)   uriBuilder.appendQueryParameter("String_Node_Str",poiFoursquareId);
  return get(uriBuilder.build().toString(),Poi[].class);
}
Program: 55526
Project: 55526
Buggy source:
public Recommendation[] awaitRecommendations(String accessToken,Location location,Integer radius){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_recommend_path)).appendQueryParameter("String_Node_Str",accessToken).appendQueryParameter("String_Node_Str",location != null ? location.stringValues() : null).appendQueryParameter("String_Node_Str",radius != null ? radius.toString() : null).build().toString();
  return get(url,Recommendation[].class);
}

Fixed version (ground truth):
public Recommendation[] awaitRecommendations(String accessToken,Location location,Integer radius){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_pois_path)).appendEncodedPath(getString(R.string.gf_api_pois_recommend_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  if (location != null)   uriBuilder.appendQueryParameter("String_Node_Str",location.stringValues());
  if (radius != null)   uriBuilder.appendQueryParameter("String_Node_Str",radius.toString());
  return get(uriBuilder.build().toString(),Recommendation[].class);
}
Program: 55527
Project: 55527
Buggy source:
public User[] awaitSelfUserFriends(String accessToken){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_friends_path)).appendQueryParameter("String_Node_Str",accessToken).build().toString();
  return get(url,User[].class);
}

Fixed version (ground truth):
public User[] awaitSelfUserFriends(String accessToken){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_friends_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  return get(uriBuilder.build().toString(),User[].class);
}
Program: 55528
Project: 55528
Buggy source:
public String awaitAccessToken(String foursquareAuthorizationCode){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_register_with_foursquare_path)).appendQueryParameter("String_Node_Str",foursquareAuthorizationCode).build().toString();
  return get(url,AccessToken.class).getToken();
}

Fixed version (ground truth):
public String awaitAccessToken(String foursquareAuthorizationCode){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_register_with_foursquare_path));
  if (foursquareAuthorizationCode != null)   uriBuilder.appendQueryParameter("String_Node_Str",foursquareAuthorizationCode);
  return get(uriBuilder.build().toString(),AccessToken.class).getToken();
}
Program: 55529
Project: 55529
Buggy source:
public User awaitSelfUser(String accessToken){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendQueryParameter("String_Node_Str",accessToken).build().toString();
  return get(url,User.class);
}

Fixed version (ground truth):
public User awaitSelfUser(String accessToken){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  return get(uriBuilder.build().toString(),User.class);
}
Program: 55530
Project: 55530
Buggy source:
public Category[] awaitUserLikes(String accessToken,String userFoursquareId){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendPath(userFoursquareId).appendEncodedPath(getString(R.string.gf_api_users_likes_path)).appendQueryParameter("String_Node_Str",accessToken).build().toString();
  return get(url,Category[].class);
}

Fixed version (ground truth):
public Category[] awaitUserLikes(String accessToken,String userFoursquareId){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path));
  if (userFoursquareId != null)   uriBuilder.appendPath(userFoursquareId);
  uriBuilder.appendEncodedPath(getString(R.string.gf_api_users_likes_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  return get(uriBuilder.build().toString(),Category[].class);
}
Program: 55531
Project: 55531
Buggy source:
public UpdateResponse awaitAddLike(String accessToken,String categoryFoursquareId){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_update_path)).appendEncodedPath(getString(R.string.gf_api_users_add_like_path)).appendQueryParameter("String_Node_Str",accessToken).appendQueryParameter("String_Node_Str",categoryFoursquareId).build().toString();
  return put(url,null,UpdateResponse.class);
}

Fixed version (ground truth):
public UpdateResponse awaitAddLike(String accessToken,String categoryFoursquareId){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_update_path)).appendEncodedPath(getString(R.string.gf_api_users_add_like_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  if (categoryFoursquareId != null)   uriBuilder.appendQueryParameter("String_Node_Str",categoryFoursquareId);
  return put(uriBuilder.build().toString(),null,UpdateResponse.class);
}
Program: 55532
Project: 55532
Buggy source:
public UpdateResponse awaitRemoveLike(String accessToken,String categoryFoursquareId){
  String url=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_update_path)).appendEncodedPath(getString(R.string.gf_api_users_remove_like_path)).appendQueryParameter("String_Node_Str",accessToken).appendQueryParameter("String_Node_Str",categoryFoursquareId).build().toString();
  return delete(url,null,UpdateResponse.class);
}

Fixed version (ground truth):
public UpdateResponse awaitRemoveLike(String accessToken,String categoryFoursquareId){
  Uri.Builder uriBuilder=Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_update_path)).appendEncodedPath(getString(R.string.gf_api_users_remove_like_path));
  if (accessToken != null)   uriBuilder.appendQueryParameter("String_Node_Str",accessToken);
  if (categoryFoursquareId != null)   uriBuilder.appendQueryParameter("String_Node_Str",categoryFoursquareId);
  return delete(uriBuilder.build().toString(),null,UpdateResponse.class);
}
Program: 55533
Project: 55533
Buggy source:
private void onSelectRecommendation(Recommendation recommendation){
  getActivity().startActivity(RecommendedRouteActivity.getIntent(getActivity(),currentLocation,recommendation.getPoi()));
}

Fixed version (ground truth):
private void onSelectRecommendation(Recommendation recommendation){
  if (currentLocation != null) {
    getActivity().startActivity(RecommendedRouteActivity.getIntent(getActivity(),currentLocation,recommendation.getPoi()));
  }
}
Program: 55534
Project: 55534
Buggy source:
private void onSelectPoi(Poi poi){
  getActivity().startActivity(RecommendedRouteActivity.getIntent(getActivity(),currentLocation,poi));
}

Fixed version (ground truth):
private void onSelectPoi(Poi poi){
  if (currentLocation != null) {
    getActivity().startActivity(RecommendedRouteActivity.getIntent(getActivity(),currentLocation,poi));
  }
}
Program: 55535
Project: 55535
Buggy source:
private void showCurrentLocationInMap(){
  if (currentLocation != null) {
    LatLng latLng=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());
    googleMap.addMarker(new MarkerOptions().position(latLng).title(getString(R.string.current_location)).icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_map_location)));
    googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,13f));
  }
}

Fixed version (ground truth):
private void showCurrentLocationInMap(){
  if (currentLocation != null) {
    LatLng latLng=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());
    googleMap.addMarker(new MarkerOptions().position(latLng).title(getString(R.string.current_location)).icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_map_location)));
    googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
  }
}
Program: 55536
Project: 55536
Buggy source:
private void onDrawerMenuSelected(int position){
switch (position) {
case 0:
    if (user != null)     startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(getString(R.string.foursquare_user_url,user.getFoursquareId()))));
  drawerLayout.closeDrawers();
break;
case 3:
supportInvalidateOptionsMenu();
setupFragment(new ExploreByLikesFragment());
setTitle(R.string.drawer_explore_by_your_likes_option);
drawerItemAdapter.setSelectedPosition(position);
drawerLayout.closeDrawers();
break;
case 4:
supportInvalidateOptionsMenu();
setupFragment(new ExploreByFriendsLikesFragment());
setTitle(R.string.drawer_explore_by_your_friends_likes_option);
drawerItemAdapter.setSelectedPosition(position);
drawerLayout.closeDrawers();
break;
case 6:
startActivity(new Intent(this,SettingsActivity.class));
drawerLayout.closeDrawers();
break;
}
}

Fixed version (ground truth):
private void onDrawerMenuSelected(int position){
switch (position) {
case 0:
    if (user != null)     startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(getString(R.string.foursquare_user_url,user.getFoursquareId()))));
  drawerLayout.closeDrawers();
break;
case 3:
invalidateOptionsMenu();
setupFragment(new ExploreByLikesFragment());
setTitle(R.string.drawer_explore_by_your_likes_option);
drawerItemAdapter.setSelectedPosition(position);
drawerLayout.closeDrawers();
break;
case 4:
invalidateOptionsMenu();
setupFragment(new ExploreByFriendsLikesFragment());
setTitle(R.string.drawer_explore_by_your_friends_likes_option);
drawerItemAdapter.setSelectedPosition(position);
drawerLayout.closeDrawers();
break;
case 6:
startActivity(new Intent(this,SettingsActivity.class));
drawerLayout.closeDrawers();
break;
}
}
Program: 55538
Project: 55538
Buggy source:
@Override protected void onChildRestoreInstanceState(){
  if (searchTask != null && searchTask.isActive())   onPreSearchRecommendations();
 else   if (getLastRecommendations() != null) {
    onRecommendationsAcquired(getLastRecommendations());
    onSearchRecommendationsFinally();
  }
}

Fixed version (ground truth):
@Override protected void onChildRestoreInstanceState(){
  if (searchTask != null && searchTask.isActive())   onPreSearchRecommendations();
 else   if (getLastRecommendations() != null) {
    onRecommendationsAcquired(getLastRecommendations());
    onSearchRecommendationsFinally();
  }
 else   onPrepareForSearch();
}
Program: 55539
Project: 55539
Buggy source:
@Override protected void onChildRestoreInstanceState(){
  if (searchTask != null && searchTask.isActive())   onPreSearchRecommendations();
 else   if (getLastRecommendations() != null) {
    onRecommendationsAcquired(getLastRecommendations());
    onSearchRecommendationsFinally();
  }
}

Fixed version (ground truth):
@Override protected void onChildRestoreInstanceState(){
  if (searchTask != null && searchTask.isActive())   onPreSearchRecommendations();
 else   if (getLastRecommendations() != null) {
    onRecommendationsAcquired(getLastRecommendations());
    onSearchRecommendationsFinally();
  }
 else   onPrepareForSearch();
}
Program: 55540
Project: 55540
Buggy source:
@Override public void onMapReady(GoogleMap googleMap){
  if (recommendation.getPoiSequence().length > 0) {
    for (    Poi poi : recommendation.getPoiSequence()) {
      Marker marker=googleMap.addMarker(new MarkerOptions().position(new LatLng(poi.getLocation().getLatitude(),poi.getLocation().getLongitude())).title(poi.getName()));
      Picasso.with(this).load(poi.getCategories()[0].getIconUrl()).placeholder(R.drawable.ic_generic_category).into(new PicassoMarker(marker,this));
    }
  }
  if (recommendation.getRoutePoints().length > 0) {
    PolylineOptions pathOptions=new PolylineOptions().color(Color.RED);
    for (int index=0; index < recommendation.getRoutePoints().length; index++) {
      pathOptions.add(new LatLng(recommendation.getRoutePoints()[index].getLatitude(),recommendation.getRoutePoints()[index].getLongitude()));
    }
    googleMap.addPolyline(pathOptions);
  }
  LatLng latLngOrigin=new LatLng(origin.getLatitude(),origin.getLongitude());
  googleMap.addMarker(new MarkerOptions().position(latLngOrigin).title(getString(R.string.your_location)).icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_CYAN)));
  googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLngOrigin,13f));
}

Fixed version (ground truth):
@Override public void onMapReady(GoogleMap googleMap){
  if (recommendation.getPoiSequence().length > 0) {
    for (    Poi poi : recommendation.getPoiSequence()) {
      Marker marker=googleMap.addMarker(new MarkerOptions().position(new LatLng(poi.getLocation().getLatitude(),poi.getLocation().getLongitude())).title(poi.getName()));
      Picasso.with(this).load(poi.getCategories()[0].getIconUrl()).placeholder(R.drawable.ic_generic_category).into(new PicassoMarker(marker,this));
    }
  }
  if (recommendation.getRoutePoints().length > 0) {
    PolylineOptions pathOptions=new PolylineOptions().color(Color.RED);
    for (int index=0; index < recommendation.getRoutePoints().length; index++) {
      pathOptions.add(new LatLng(recommendation.getRoutePoints()[index].getLatitude(),recommendation.getRoutePoints()[index].getLongitude()));
    }
    googleMap.addPolyline(pathOptions);
  }
  LatLng latLngOrigin=new LatLng(origin.getLatitude(),origin.getLongitude());
  googleMap.addMarker(new MarkerOptions().position(latLngOrigin).title(getString(R.string.current_location)).icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_CYAN)));
  googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLngOrigin,13f));
}
Program: 55541
Project: 55541
Buggy source:
protected void onLocateUser(){
  locationRequester.requestSingle(this);
}

Fixed version (ground truth):
protected void onLocateUser(){
  if (isConnected())   locationRequester.requestSingle(this);
 else   onNetworkDisabled();
}
Program: 55542
Project: 55542
Buggy source:
protected void onRecommendationsAcquired(Recommendation[] recommendations){
  this.lastRecommendations=recommendations;
  viewPager.setVisibility(View.VISIBLE);
  pagerStrip.setVisibility(View.VISIBLE);
  if (recommendations != null) {
    swipeRouteDetailFragmentsAdapter.clearFragments();
    for (    Recommendation recommendation : recommendations) {
      RouteDetailFragment fragment=RouteDetailFragment.newInstance(lastLocation,recommendation);
      swipeRouteDetailFragmentsAdapter.addFragment(fragment);
    }
    viewPager.setCurrentItem(0);
  }
}

Fixed version (ground truth):
protected void onRecommendationsAcquired(Recommendation[] recommendations){
  this.lastRecommendations=recommendations;
  viewPager.setVisibility(View.VISIBLE);
  pagerStrip.setVisibility(View.VISIBLE);
  if (recommendations != null) {
    swipeRouteDetailFragmentsAdapter.clearFragments();
    for (    Recommendation recommendation : recommendations) {
      RouteDetailFragment fragment=RouteDetailFragment.newInstance(lastLocation,lastAddress,recommendation);
      swipeRouteDetailFragmentsAdapter.addFragment(fragment);
    }
    viewPager.setCurrentItem(0);
  }
}