Program: 55511
Project: 55511
Buggy source:
@Test public void testResolveUserWithCustomSeparatorsAndCharset() 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);
  String encodedUserData=Base64.encodeBase64String("String_Node_Str".getBytes(Charset.forName("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 testResolveUserWithCustomSeparatorsAndCharset() 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);
  String encodedUserData=Base64.encodeBase64String("String_Node_Str".getBytes(Charset.forName("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()));
}