nus-yam/ex-repair huggingface dataset:
Program: 41145
Project: 41145
Buggy source:
/** 
 * Searches for a MechanismFactory by using the scheme from the given name. The search first checks the local cache of mechanism factories before moving on to search in the classpath.
 * @param name The name of the authentication mechanism to search for..
 * @return a mechanism factory instance matching the URI's scheme.
 * @throws IOException if an error occurs while locating the factory.
 */
protected static MechanismFactory findMechanismFactory(String name) throws IOException {
  if (name == null || name.isEmpty()) {
    throw new IOException("String_Node_Str" + name + "String_Node_Str");
  }
  MechanismFactory factory=null;
  try {
    factory=MECHANISM_FACTORY_FINDER.newInstance(name);
  }
 catch (  Throwable e) {
    throw new IOException("String_Node_Str" + name + "String_Node_Str",e);
  }
  return factory;
}

Fixed version (ground truth):
/** 
 * Searches for a MechanismFactory by using the scheme from the given name. The search first checks the local cache of mechanism factories before moving on to search in the classpath.
 * @param name The name of the authentication mechanism to search for..
 * @return a mechanism factory instance matching the URI's scheme.
 * @throws IOException if an error occurs while locating the factory.
 */
protected static MechanismFactory findMechanismFactory(String name) throws IOException {
  if (name == null || name.isEmpty()) {
    throw new IOException("String_Node_Str");
  }
  MechanismFactory factory=null;
  try {
    factory=MECHANISM_FACTORY_FINDER.newInstance(name);
  }
 catch (  Throwable e) {
    throw new IOException("String_Node_Str" + name + "String_Node_Str",e);
  }
  return factory;
}
Program: 41146
Project: 41146
Buggy source:
/** 
 * Searches for a DiscoveryAgentFactory by using the scheme from the given URI. The search first checks the local cache of discovery agent factories before moving on to search in the classpath.
 * @param location The URI whose scheme will be used to locate a DiscoveryAgentFactory.
 * @return a DiscoveryAgentFactory instance matching the URI's scheme.
 * @throws IOException if an error occurs while locating the factory.
 */
protected static DiscoveryAgentFactory findAgentFactory(URI location) throws IOException {
  String scheme=location.getScheme();
  if (scheme == null) {
    throw new IOException("String_Node_Str" + location + "String_Node_Str");
  }
  DiscoveryAgentFactory factory=null;
  if (factory == null) {
    try {
      factory=AGENT_FACTORY_FINDER.newInstance(scheme);
    }
 catch (    Throwable e) {
      throw new IOException("String_Node_Str" + scheme + "String_Node_Str",e);
    }
  }
  return factory;
}

Fixed version (ground truth):
/** 
 * Searches for a DiscoveryAgentFactory by using the scheme from the given URI. The search first checks the local cache of discovery agent factories before moving on to search in the classpath.
 * @param location The URI whose scheme will be used to locate a DiscoveryAgentFactory.
 * @return a DiscoveryAgentFactory instance matching the URI's scheme.
 * @throws IOException if an error occurs while locating the factory.
 */
protected static DiscoveryAgentFactory findAgentFactory(URI location) throws IOException {
  String scheme=location.getScheme();
  if (scheme == null || scheme.isEmpty()) {
    throw new IOException("String_Node_Str");
  }
  DiscoveryAgentFactory factory=null;
  if (factory == null) {
    try {
      factory=AGENT_FACTORY_FINDER.newInstance(scheme);
    }
 catch (    Throwable e) {
      throw new IOException("String_Node_Str" + scheme + "String_Node_Str",e);
    }
  }
  return factory;
}
Program: 41151
Project: 41151
Buggy source:
@Test(timeout=10000) public void testCreateAndCloseConnection() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectClose();
    connection.close();
  }
 }

Fixed version (ground truth):
@Test(timeout=10000) public void testCreateAndCloseConnection() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectClose();
    connection.close();
  }
 }
Program: 41152
Project: 41152
Buggy source:
@Test(timeout=5000) public void testCreateTransactedSession() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    CoordinatorMatcher txCoordinatorMatcher=new CoordinatorMatcher();
    txCoordinatorMatcher.withCapabilities(arrayContaining(TxnCapability.LOCAL_TXN));
    testPeer.expectSenderAttach(txCoordinatorMatcher,false,false);
    Session session=connection.createSession(true,Session.SESSION_TRANSACTED);
    assertNotNull("String_Node_Str",session);
  }
 }

Fixed version (ground truth):
@Test(timeout=5000) public void testCreateTransactedSession() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    CoordinatorMatcher txCoordinatorMatcher=new CoordinatorMatcher();
    txCoordinatorMatcher.withCapabilities(arrayContaining(TxnCapability.LOCAL_TXN));
    testPeer.expectSenderAttach(txCoordinatorMatcher,false,false);
    Session session=connection.createSession(true,Session.SESSION_TRANSACTED);
    assertNotNull("String_Node_Str",session);
  }
 }
Program: 41153
Project: 41153
Buggy source:
@Test(timeout=5000) public void testConnectionMetaDataVersion() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    ConnectionMetaData meta=connection.getMetaData();
    assertTrue("String_Node_Str",meta.getProviderMajorVersion() != 0);
  }
 }

Fixed version (ground truth):
@Test(timeout=5000) public void testConnectionMetaDataVersion() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    ConnectionMetaData meta=connection.getMetaData();
    assertTrue("String_Node_Str",meta.getProviderMajorVersion() != 0);
  }
 }
Program: 41154
Project: 41154
Buggy source:
@Test(timeout=10000) public void testCreateAutoAckSession() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    assertNotNull("String_Node_Str",session);
  }
 }

Fixed version (ground truth):
@Test(timeout=10000) public void testCreateAutoAckSession() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    assertNotNull("String_Node_Str",session);
  }
 }
Program: 41155
Project: 41155
Buggy source:
Connection establishConnecton(TestAmqpPeer testPeer,String optionsString,Symbol[] serverCapabilities,Map<Symbol,Object> serverProperties) throws JMSException {
  testPeer.expectPlainConnect("String_Node_Str","String_Node_Str",serverCapabilities,serverProperties);
  testPeer.expectBegin(true);
  final String baseURI="String_Node_Str" + PORT;
  String brokerURI=baseURI;
  if (optionsString != null) {
    brokerURI=baseURI + optionsString;
  }
  ConnectionFactory factory=new JmsConnectionFactory(brokerURI);
  Connection connection=factory.createConnection("String_Node_Str","String_Node_Str");
  connection.setClientID("String_Node_Str");
  assertNull(testPeer.getThrowable());
  return connection;
}

Fixed version (ground truth):
Connection establishConnecton(TestAmqpPeer testPeer,String optionsString,Symbol[] serverCapabilities,Map<Symbol,Object> serverProperties) throws JMSException {
  testPeer.expectPlainConnect("String_Node_Str","String_Node_Str",serverCapabilities,serverProperties);
  testPeer.expectBegin(true);
  final String baseURI="String_Node_Str" + getAvailablePort();
  String brokerURI=baseURI;
  if (optionsString != null) {
    brokerURI=baseURI + optionsString;
  }
  ConnectionFactory factory=new JmsConnectionFactory(brokerURI);
  Connection connection=factory.createConnection("String_Node_Str","String_Node_Str");
  connection.setClientID("String_Node_Str");
  assertNull(testPeer.getThrowable());
  return connection;
}
Program: 41164
Project: 41164
Buggy source:
private void receivedMessageWithMessageIdTestImpl(Object underlyingAmqpMessageId) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId(underlyingAmqpMessageId);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    String expectedBaseIdString=new AmqpMessageIdHelper().toBaseMessageIdString(underlyingAmqpMessageId);
    assertEquals("String_Node_Str" + expectedBaseIdString,receivedMessage.getJMSMessageID());
  }
 }

Fixed version (ground truth):
private void receivedMessageWithMessageIdTestImpl(Object underlyingAmqpMessageId) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId(underlyingAmqpMessageId);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    String expectedBaseIdString=new AmqpMessageIdHelper().toBaseMessageIdString(underlyingAmqpMessageId);
    assertEquals("String_Node_Str" + expectedBaseIdString,receivedMessage.getJMSMessageID());
  }
 }
Program: 41171
Project: 41171
Buggy source:
/** 
 * Tests that lack of the absolute-expiry-time and ttl fields on a message results in it returning 0 for for JMSExpiration
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithNoAbsoluteExpiryOrTtlReturnsJMSExpirationZero() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertEquals(0L,receivedMessage.getJMSExpiration());
  }
 }

Fixed version (ground truth):
/** 
 * Tests that lack of the absolute-expiry-time and ttl fields on a message results in it returning 0 for for JMSExpiration
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithNoAbsoluteExpiryOrTtlReturnsJMSExpirationZero() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertEquals(0L,receivedMessage.getJMSExpiration());
  }
 }
Program: 41173
Project: 41173
Buggy source:
/** 
 * Tests that setting a non-zero value in the absolute-expiry-time field on a message results in it returning this value for JMSExpiration
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithAbsoluteExpiryReturnsJMSExpirationNonZero() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    long timestamp=System.currentTimeMillis();
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setAbsoluteExpiryTime(new Date(timestamp));
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertEquals(timestamp,receivedMessage.getJMSExpiration());
  }
 }

Fixed version (ground truth):
/** 
 * Tests that setting a non-zero value in the absolute-expiry-time field on a message results in it returning this value for JMSExpiration
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithAbsoluteExpiryReturnsJMSExpirationNonZero() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    long timestamp=System.currentTimeMillis();
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setAbsoluteExpiryTime(new Date(timestamp));
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertEquals(timestamp,receivedMessage.getJMSExpiration());
  }
 }
Program: 41175
Project: 41175
Buggy source:
/** 
 * Tests that lack of the reply-to set on a message results in it returning null for JMSReplyTo and not the consumer destination as happens for JMSDestination.
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithNoReplyToReturnsNull() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertNull(receivedMessage.getJMSReplyTo());
  }
 }

Fixed version (ground truth):
/** 
 * Tests that lack of the reply-to set on a message results in it returning null for JMSReplyTo and not the consumer destination as happens for JMSDestination.
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithNoReplyToReturnsNull() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    assertNull(receivedMessage.getJMSReplyTo());
  }
 }
Program: 41178
Project: 41178
Buggy source:
@Test(timeout=2000) public void testReceiveMessageWithoutMessageId() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,null,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(2000);
    assertNull(receivedMessage.getJMSMessageID());
  }
 }

Fixed version (ground truth):
@Test(timeout=2000) public void testReceiveMessageWithoutMessageId() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,null,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(2000);
    assertNull(receivedMessage.getJMSMessageID());
  }
 }
Program: 41180
Project: 41180
Buggy source:
/** 
 * @param userName
 * @param password
 * @return a QueueConnection
 * @throws JMSException
 * @see javax.jms.QueueConnectionFactory#createQueueConnection(java.lang.String,java.lang.String)
 */
@Override public QueueConnection createQueueConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsQueueConnection result=new JmsQueueConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}

Fixed version (ground truth):
/** 
 * @param username
 * @param password
 * @return a QueueConnection
 * @throws JMSException
 * @see javax.jms.QueueConnectionFactory#createQueueConnection(java.lang.String,java.lang.String)
 */
@Override public QueueConnection createQueueConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsQueueConnection result=new JmsQueueConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}
Program: 41181
Project: 41181
Buggy source:
/** 
 * @param userName
 * @param password
 * @return a TopicConnection
 * @throws JMSException
 * @see javax.jms.TopicConnectionFactory#createTopicConnection(java.lang.String,java.lang.String)
 */
@Override public TopicConnection createTopicConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsTopicConnection result=new JmsTopicConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}

Fixed version (ground truth):
/** 
 * @param username
 * @param password
 * @return a TopicConnection
 * @throws JMSException
 * @see javax.jms.TopicConnectionFactory#createTopicConnection(java.lang.String,java.lang.String)
 */
@Override public TopicConnection createTopicConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsTopicConnection result=new JmsTopicConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}
Program: 41182
Project: 41182
Buggy source:
/** 
 * @param userName
 * @param password
 * @return Connection
 * @throws JMSException
 * @see javax.jms.ConnectionFactory#createConnection(java.lang.String,java.lang.String)
 */
@Override public Connection createConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsConnection result=new JmsConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}

Fixed version (ground truth):
/** 
 * @param username
 * @param password
 * @return Connection
 * @throws JMSException
 * @see javax.jms.ConnectionFactory#createConnection(java.lang.String,java.lang.String)
 */
@Override public Connection createConnection(String username,String password) throws JMSException {
  try {
    String connectionId=getConnectionIdGenerator().generateId();
    Provider provider=createProvider(brokerURI);
    JmsConnection result=new JmsConnection(connectionId,provider,getClientIdGenerator());
    return configureConnection(result,username,password);
  }
 catch (  Exception e) {
    throw JmsExceptionSupport.create(e);
  }
}
Program: 41183
Project: 41183
Buggy source:
/** 
 * Adds the given Transaction synchronization to the current list.
 * @param synchronization the transaction synchronization to add.
 */
public void addSynchronization(JmsTxSynchronization s){
  if (synchronizations == null) {
    synchronizations=new ArrayList<JmsTxSynchronization>(10);
  }
  synchronizations.add(s);
}

Fixed version (ground truth):
/** 
 * Adds the given Transaction synchronization to the current list.
 * @param s the transaction synchronization to add.
 */
public void addSynchronization(JmsTxSynchronization s){
  if (synchronizations == null) {
    synchronizations=new ArrayList<JmsTxSynchronization>(10);
  }
  synchronizations.add(s);
}
Program: 41184
Project: 41184
Buggy source:
/** 
 * Called from the session when a new Message has been dispatched to this Consumer from the connection.
 * @param facade the newly arrived message.
 */
@Override public void onMessage(final JmsInboundMessageDispatch envelope){
  lock.lock();
  try {
    if (acknowledgementMode == Session.CLIENT_ACKNOWLEDGE) {
      envelope.getMessage().setAcknowledgeCallback(new Callable<Void>(){
        @Override public Void call() throws Exception {
          if (session.isClosed()) {
            throw new javax.jms.IllegalStateException("String_Node_Str");
          }
          session.acknowledge();
          return null;
        }
      }
);
    }
    this.messageQueue.enqueue(envelope);
  }
  finally {
    lock.unlock();
  }
  if (this.messageListener != null && this.started) {
    session.getExecutor().execute(new Runnable(){
      @Override public void run(){
        JmsInboundMessageDispatch envelope;
        while (session.isStarted() && (envelope=messageQueue.dequeueNoWait()) != null) {
          try {
            messageListener.onMessage(copy(ack(envelope)));
          }
 catch (          Exception e) {
            session.getConnection().onException(e);
          }
        }
      }
    }
);
  }
 else {
    if (availableListener != null) {
      availableListener.onMessageAvailable(this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from the session when a new Message has been dispatched to this Consumer from the connection.
 * @param envelope the newly arrived message.
 */
@Override public void onMessage(final JmsInboundMessageDispatch envelope){
  lock.lock();
  try {
    if (acknowledgementMode == Session.CLIENT_ACKNOWLEDGE) {
      envelope.getMessage().setAcknowledgeCallback(new Callable<Void>(){
        @Override public Void call() throws Exception {
          if (session.isClosed()) {
            throw new javax.jms.IllegalStateException("String_Node_Str");
          }
          session.acknowledge();
          return null;
        }
      }
);
    }
    this.messageQueue.enqueue(envelope);
  }
  finally {
    lock.unlock();
  }
  if (this.messageListener != null && this.started) {
    session.getExecutor().execute(new Runnable(){
      @Override public void run(){
        JmsInboundMessageDispatch envelope;
        while (session.isStarted() && (envelope=messageQueue.dequeueNoWait()) != null) {
          try {
            messageListener.onMessage(copy(ack(envelope)));
          }
 catch (          Exception e) {
            session.getConnection().onException(e);
          }
        }
      }
    }
);
  }
 else {
    if (availableListener != null) {
      availableListener.onMessageAvailable(this);
    }
  }
}
Program: 41185
Project: 41185
Buggy source:
/** 
 * Waits for a response to some Provider requested operation.
 * @return the response from the Provider for this operation.
 * @throws IOException if an error occurs while waiting for the response.
 */
public void sync() throws IOException {
  try {
    latch.await();
  }
 catch (  InterruptedException e) {
    Thread.interrupted();
    throw IOExceptionSupport.create(e);
  }
  failOnError();
}

Fixed version (ground truth):
/** 
 * Waits for a response to some Provider requested operation.
 * @throws IOException if an error occurs while waiting for the response.
 */
public void sync() throws IOException {
  try {
    latch.await();
  }
 catch (  InterruptedException e) {
    Thread.interrupted();
    throw IOExceptionSupport.create(e);
  }
  failOnError();
}
Program: 41186
Project: 41186
Buggy source:
/** 
 * Creates a new AmqpTransaction instance.
 * @param session The session that owns this transaction
 * @param resource The JmsTransactionInfo that defines this Transaction.
 */
public AmqpTransactionContext(AmqpSession session){
  super(session.getJmsResource());
  this.session=session;
}

Fixed version (ground truth):
/** 
 * Creates a new AmqpTransaction instance.
 * @param session The session that owns this transaction
 */
public AmqpTransactionContext(AmqpSession session){
  super(session.getJmsResource());
  this.session=session;
}
Program: 41187
Project: 41187
Buggy source:
/** 
 * When used as a pooled cache of tags the unused tags should always be returned once the transfer has been settled.
 * @param tag a previously borrowed tag that is no longer in use.
 */
public void returnTag(byte[] data){
  if (tagPool != null && tagPool.size() < maxPoolSize) {
    tagPool.add(data);
  }
}

Fixed version (ground truth):
/** 
 * When used as a pooled cache of tags the unused tags should always be returned once the transfer has been settled.
 * @param data a previously borrowed tag that is no longer in use.
 */
public void returnTag(byte[] data){
  if (tagPool != null && tagPool.size() < maxPoolSize) {
    tagPool.add(data);
  }
}
Program: 41188
Project: 41188
Buggy source:
/** 
 * The AmqpConnection instance that is associated with this Message.
 * @return
 */
public AmqpConnection getConnection(){
  return connection;
}

Fixed version (ground truth):
/** 
 * The AmqpConnection instance that is associated with this Message.
 * @return the connection
 */
public AmqpConnection getConnection(){
  return connection;
}
Program: 41189
Project: 41189
Buggy source:
/** 
 * Returns the suffix of the given string after removing the first "ID:" prefix (if present).
 * @param string the string to process
 * @return the suffix, or the original String if the "ID:" prefix is not present
 */
public String stripMessageIdPrefix(String id){
  if (hasMessageIdPrefix(id)) {
    return strip(id,JMS_ID_PREFIX_LENGTH);
  }
 else {
    return id;
  }
}

Fixed version (ground truth):
/** 
 * Returns the suffix of the given string after removing the first "ID:" prefix (if present).
 * @param id the string to process
 * @return the suffix, or the original String if the "ID:" prefix is not present
 */
public String stripMessageIdPrefix(String id){
  if (hasMessageIdPrefix(id)) {
    return strip(id,JMS_ID_PREFIX_LENGTH);
  }
 else {
    return id;
  }
}
Program: 41190
Project: 41190
Buggy source:
/** 
 * Create an instance of the SSL transport
 * @param listener The TransportListener that will handle events from this Transport instance.
 * @param remoteLocation The location that is being connected to.
 * @param JmsSslContext The JMS Framework SslContext to use for this SSL connection.
 */
public SslTransport(TransportListener listener,URI remoteLocation,JmsSslContext context){
  super(listener,remoteLocation);
  this.context=context;
}

Fixed version (ground truth):
/** 
 * Create an instance of the SSL transport
 * @param listener The TransportListener that will handle events from this Transport instance.
 * @param remoteLocation The location that is being connected to.
 * @param context The JMS Framework SslContext to use for this SSL connection.
 */
public SslTransport(TransportListener listener,URI remoteLocation,JmsSslContext context){
  super(listener,remoteLocation);
  this.context=context;
}
Program: 41191
Project: 41191
Buggy source:
/** 
 * Given a map of properties, filter out only those prefixed with the given value, the values filtered are returned in a new Map instance.
 * @param properties The map of properties to filter.
 * @param optionPrefix The prefix value to use when filtering.
 * @return a filter map with only values that match the given prefix.
 */
public static Map<String,String> filterProperties(Map<String,String> props,String optionPrefix){
  if (props == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HashMap<String,String> rc=new HashMap<String,String>(props.size());
  for (Iterator<Entry<String,String>> iter=props.entrySet().iterator(); iter.hasNext(); ) {
    Entry<String,String> entry=iter.next();
    if (entry.getKey().startsWith(optionPrefix)) {
      String name=entry.getKey().substring(optionPrefix.length());
      rc.put(name,entry.getValue());
      iter.remove();
    }
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * Given a map of properties, filter out only those prefixed with the given value, the values filtered are returned in a new Map instance.
 * @param props The map of properties to filter.
 * @param optionPrefix The prefix value to use when filtering.
 * @return a filter map with only values that match the given prefix.
 */
public static Map<String,String> filterProperties(Map<String,String> props,String optionPrefix){
  if (props == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HashMap<String,String> rc=new HashMap<String,String>(props.size());
  for (Iterator<Entry<String,String>> iter=props.entrySet().iterator(); iter.hasNext(); ) {
    Entry<String,String> entry=iter.next();
    if (entry.getKey().startsWith(optionPrefix)) {
      String name=entry.getKey().substring(optionPrefix.length());
      rc.put(name,entry.getValue());
      iter.remove();
    }
  }
  return rc;
}
Program: 41192
Project: 41192
Buggy source:
/** 
 * Creates a URI with the given query, removing an previous query value from the given URI.
 * @param uri The source URI whose existing query is replaced with the newly supplied one.
 * @param query The new URI query string that should be appended to the given URI.
 * @return a new URI that is a combination of the original URI and the given query string.
 * @throws URISyntaxException
 */
public static URI eraseQuery(URI uri) throws URISyntaxException {
  return replaceQuery(uri,(String)null);
}

Fixed version (ground truth):
/** 
 * Creates a URI with the given query, removing an previous query value from the given URI.
 * @param uri The source URI whose existing query is replaced with the newly supplied one.
 * @return a new URI that is a combination of the original URI and the given query string.
 * @throws URISyntaxException
 */
public static URI eraseQuery(URI uri) throws URISyntaxException {
  return replaceQuery(uri,(String)null);
}
Program: 41194
Project: 41194
Buggy source:
/** 
 * Verify that when   {@link BytesMessage#readBytes(byte[], int))} is calledwith a length that is greater than the size of the provided array, an  {@link IndexOutOfBoundsException} is thrown.
 */
@Test(expected=IndexOutOfBoundsException.class) public void testReadBytesWithLengthGreatThanArraySizeThrowsIOOBE() throws Exception {
  JmsBytesMessage bytesMessage=factory.createBytesMessage();
  bytesMessage.reset();
  bytesMessage.readBytes(new byte[1],2);
}

Fixed version (ground truth):
/** 
 * Verify that when   {@link BytesMessage#readBytes(byte[],int)} is calledwith a length that is greater than the size of the provided array, an  {@link IndexOutOfBoundsException} is thrown.
 */
@Test(expected=IndexOutOfBoundsException.class) public void testReadBytesWithLengthGreatThanArraySizeThrowsIOOBE() throws Exception {
  JmsBytesMessage bytesMessage=factory.createBytesMessage();
  bytesMessage.reset();
  bytesMessage.readBytes(new byte[1],2);
}
Program: 41195
Project: 41195
Buggy source:
/** 
 * Verify that when   {@link BytesMessage#readBytes(byte[], int))} is calledwith a negative length that an  {@link IndexOutOfBoundsException} is thrown.
 */
@Test(expected=IndexOutOfBoundsException.class) public void testReadBytesWithNegativeLengthThrowsIOOBE() throws Exception {
  JmsBytesMessage bytesMessage=factory.createBytesMessage();
  bytesMessage.reset();
  bytesMessage.readBytes(new byte[0],-1);
}

Fixed version (ground truth):
/** 
 * Verify that when   {@link BytesMessage#readBytes(byte[],int)} is calledwith a negative length that an  {@link IndexOutOfBoundsException} is thrown.
 */
@Test(expected=IndexOutOfBoundsException.class) public void testReadBytesWithNegativeLengthThrowsIOOBE() throws Exception {
  JmsBytesMessage bytesMessage=factory.createBytesMessage();
  bytesMessage.reset();
  bytesMessage.readBytes(new byte[0],-1);
}
Program: 41196
Project: 41196
Buggy source:
/** 
 * Test that calling   {@link ObjectMessage#clearBody()} of a received messagecauses the body of the underlying  {@link AmqpObjectMessage} to be emptied.
 */
@Test public void testClearBodyOnReceivedObjectMessageClearsUnderlyingMessageBody() throws Exception {
  String content="String_Node_Str";
  JmsDefaultObjectMessageFacade facade=new JmsDefaultObjectMessageFacade();
  facade.setObject(content);
  JmsObjectMessage objectMessage=new JmsObjectMessage(facade);
  objectMessage.onDispatch();
  assertNotNull("String_Node_Str",facade.getSerializedObject());
  objectMessage.clearBody();
  assertNull("String_Node_Str",objectMessage.getObject());
  assertNull("String_Node_Str",facade.getSerializedObject());
}

Fixed version (ground truth):
/** 
 * Test that calling   {@link ObjectMessage#clearBody()} of a received messagecauses the body of the underlying message facade to be emptied.
 */
@Test public void testClearBodyOnReceivedObjectMessageClearsUnderlyingMessageBody() throws Exception {
  String content="String_Node_Str";
  JmsDefaultObjectMessageFacade facade=new JmsDefaultObjectMessageFacade();
  facade.setObject(content);
  JmsObjectMessage objectMessage=new JmsObjectMessage(facade);
  objectMessage.onDispatch();
  assertNotNull("String_Node_Str",facade.getSerializedObject());
  objectMessage.clearBody();
  assertNull("String_Node_Str",objectMessage.getObject());
  assertNull("String_Node_Str",facade.getSerializedObject());
}
Program: 41197
Project: 41197
Buggy source:
/** 
 * Test that a message with the   {@value AmqpMessageSupport#JMS_MSG_TYPE}annotation set to    {@value AmqpMessageSupport#JMS_OBJECT_MESSAGE} andcontent-type set to  {@value AmqpMessageSupport.OCTET_STREAM_CONTENT_TYPE} istreated as a  {@link JmsObjectMessage} with {@link AmqpJmsObjectMessageFacade}containing a   {@link AmqpSerializedObjectDelegate}.
 */
@Test public void testCreateObjectMessageFromMessageTypeAnnotation() throws Exception {
  createObjectMessageFromMessageTypeAnnotationTestImpl(true);
}

Fixed version (ground truth):
/** 
 * Test that a message with the   {@value AmqpMessageSupport#JMS_MSG_TYPE}annotation set to    {@value AmqpMessageSupport#JMS_OBJECT_MESSAGE} andcontent-type set to  {@value AmqpMessageSupport#OCTET_STREAM_CONTENT_TYPE} istreated as a  {@link JmsObjectMessage} with {@link AmqpJmsObjectMessageFacade}containing a   {@link AmqpSerializedObjectDelegate}.
 */
@Test public void testCreateObjectMessageFromMessageTypeAnnotation() throws Exception {
  createObjectMessageFromMessageTypeAnnotationTestImpl(true);
}
Program: 41198
Project: 41198
Buggy source:
/** 
 * Test that   {@link MessageImpl#getJMSType()} returns the expected value for a messagereceived with the  {@link ClientProperties#X_OPT_JMS_TYPE} message annotation set.
 */
@Test public void testGetJMSTypeWithReceivedMessage() throws Exception {
  String myJMSType="String_Node_Str";
  Message message=Proton.message();
  Map<Symbol,Object> annotationsMap=new HashMap<Symbol,Object>();
  annotationsMap.put(Symbol.valueOf(AmqpMessageSupport.JMS_TYPE),myJMSType);
  message.setMessageAnnotations(new MessageAnnotations(annotationsMap));
  AmqpJmsMessageFacade amqpMessageFacade=createReceivedMessageFacade(createMockAmqpConsumer(),message);
  assertEquals("String_Node_Str",myJMSType,amqpMessageFacade.getType());
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpJmsMessageFacade#getType()} returns the expected value for a messagereceived with the  {@link AmqpMessageSupport#JMS_TYPE} message annotation set.
 */
@Test public void testGetJMSTypeWithReceivedMessage() throws Exception {
  String myJMSType="String_Node_Str";
  Message message=Proton.message();
  Map<Symbol,Object> annotationsMap=new HashMap<Symbol,Object>();
  annotationsMap.put(Symbol.valueOf(AmqpMessageSupport.JMS_TYPE),myJMSType);
  message.setMessageAnnotations(new MessageAnnotations(annotationsMap));
  AmqpJmsMessageFacade amqpMessageFacade=createReceivedMessageFacade(createMockAmqpConsumer(),message);
  assertEquals("String_Node_Str",myJMSType,amqpMessageFacade.getType());
}
Program: 41199
Project: 41199
Buggy source:
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(String)} returns a stringindicating an AMQP encoded binary when given a Binary object.
 */
@Test public void testToBaseMessageIdStringWithBinary(){
  byte[] bytes=new byte[]{(byte)0x00,(byte)0xAB,(byte)0x09,(byte)0xFF};
  Binary binary=new Binary(bytes);
  String expected=AmqpMessageIdHelper.AMQP_BINARY_PREFIX + "String_Node_Str";
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(binary);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(Object)} returns a stringindicating an AMQP encoded binary when given a Binary object.
 */
@Test public void testToBaseMessageIdStringWithBinary(){
  byte[] bytes=new byte[]{(byte)0x00,(byte)0xAB,(byte)0x09,(byte)0xFF};
  Binary binary=new Binary(bytes);
  String expected=AmqpMessageIdHelper.AMQP_BINARY_PREFIX + "String_Node_Str";
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(binary);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}
Program: 41200
Project: 41200
Buggy source:
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(String)} returns the givenbasic string unchanged
 */
@Test public void testToBaseMessageIdStringWithString(){
  String stringMessageId="String_Node_Str";
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(stringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",stringMessageId,baseMessageIdString);
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(Object)} returns the givenbasic string unchanged
 */
@Test public void testToBaseMessageIdStringWithString(){
  String stringMessageId="String_Node_Str";
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(stringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",stringMessageId,baseMessageIdString);
}
Program: 41201
Project: 41201
Buggy source:
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(String)} returns a stringindicating an AMQP encoded string, when the given string happens to already begin with the  {@link AmqpMessageIdHelper#AMQP_UUID_PREFIX}.
 */
@Test public void testToBaseMessageIdStringWithStringBeginningWithEncodingPrefixForUUID(){
  String uuidStringMessageId=AmqpMessageIdHelper.AMQP_UUID_PREFIX + UUID.randomUUID();
  String expected=AmqpMessageIdHelper.AMQP_STRING_PREFIX + uuidStringMessageId;
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(uuidStringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(Object)} returns a stringindicating an AMQP encoded string, when the given string happens to already begin with the  {@link AmqpMessageIdHelper#AMQP_UUID_PREFIX}.
 */
@Test public void testToBaseMessageIdStringWithStringBeginningWithEncodingPrefixForUUID(){
  String uuidStringMessageId=AmqpMessageIdHelper.AMQP_UUID_PREFIX + UUID.randomUUID();
  String expected=AmqpMessageIdHelper.AMQP_STRING_PREFIX + uuidStringMessageId;
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(uuidStringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}
Program: 41202
Project: 41202
Buggy source:
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(String)} returns a stringindicating an AMQP encoded ulong when given a UnsignedLong object.
 */
@Test public void testToBaseMessageIdStringWithUnsignedLong(){
  UnsignedLong uLongMessageId=UnsignedLong.valueOf(123456789L);
  String expected=AmqpMessageIdHelper.AMQP_ULONG_PREFIX + uLongMessageId.toString();
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(uLongMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(Object)} returns a stringindicating an AMQP encoded ulong when given a UnsignedLong object.
 */
@Test public void testToBaseMessageIdStringWithUnsignedLong(){
  UnsignedLong uLongMessageId=UnsignedLong.valueOf(123456789L);
  String expected=AmqpMessageIdHelper.AMQP_ULONG_PREFIX + uLongMessageId.toString();
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(uLongMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}
Program: 41203
Project: 41203
Buggy source:
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(String)} returns a stringindicating an AMQP encoded string, when the given string happens to already begin with the  {@link AmqpMessageIdHelper#AMQP_BINARY_PREFIX}.
 */
@Test public void testToBaseMessageIdStringWithStringBeginningWithEncodingPrefixForBinary(){
  String binaryStringMessageId=AmqpMessageIdHelper.AMQP_BINARY_PREFIX + "String_Node_Str";
  String expected=AmqpMessageIdHelper.AMQP_STRING_PREFIX + binaryStringMessageId;
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(binaryStringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}

Fixed version (ground truth):
/** 
 * Test that   {@link AmqpMessageIdHelper#toBaseMessageIdString(Object)} returns a stringindicating an AMQP encoded string, when the given string happens to already begin with the  {@link AmqpMessageIdHelper#AMQP_BINARY_PREFIX}.
 */
@Test public void testToBaseMessageIdStringWithStringBeginningWithEncodingPrefixForBinary(){
  String binaryStringMessageId=AmqpMessageIdHelper.AMQP_BINARY_PREFIX + "String_Node_Str";
  String expected=AmqpMessageIdHelper.AMQP_STRING_PREFIX + binaryStringMessageId;
  String baseMessageIdString=_messageIdHelper.toBaseMessageIdString(binaryStringMessageId);
  assertNotNull("String_Node_Str",baseMessageIdString);
  assertEquals("String_Node_Str",expected,baseMessageIdString);
}