nus-yam/ex-repair huggingface dataset:
Program: 41611
Project: 41611
Buggy source:
/** 
 * Remove a URI from the pool if present, otherwise has no effect.
 * @param uri The URI to attempt to remove from the pool.
 * @returns true if the given URI was removed from the pool.
 */
public boolean remove(URI uri){
  if (uri == null) {
    return false;
  }
synchronized (uris) {
    for (    URI candidate : uris) {
      if (compareURIs(uri,candidate)) {
        return uris.remove(candidate);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove a URI from the pool if present, otherwise has no effect.
 * @param uri The URI to attempt to remove from the pool.
 * @return true if the given URI was removed from the pool.
 */
public boolean remove(URI uri){
  if (uri == null) {
    return false;
  }
synchronized (uris) {
    for (    URI candidate : uris) {
      if (compareURIs(uri,candidate)) {
        return uris.remove(candidate);
      }
    }
  }
  return false;
}
Program: 41612
Project: 41612
Buggy source:
/** 
 * When a redirect type exception is received this method is called to create the appropriate redirect exception type containing the error details needed.
 * @param error the Symbol that defines the redirection error type.
 * @param message the basic error message that should used or amended for the returned exception.
 * @param condition the ErrorCondition that describes the redirection.
 * @returns an Exception that captures the details of the redirection error.
 */
@SuppressWarnings("String_Node_Str") protected Exception createRedirectException(Symbol error,String message,ErrorCondition condition){
  Exception result=null;
  Map<String,Object> info=condition.getInfo();
  if (info == null) {
    result=new IOException(message + "String_Node_Str");
  }
 else {
    String hostname=(String)info.get("String_Node_Str");
    String networkHost=(String)info.get("String_Node_Str");
    if (networkHost == null || networkHost.isEmpty()) {
      result=new IOException(message + "String_Node_Str");
    }
    int port=0;
    try {
      port=Integer.valueOf(info.get("String_Node_Str").toString());
    }
 catch (    Exception ex) {
      result=new IOException(message + "String_Node_Str");
    }
    result=new ProviderRedirectedException(message,hostname,networkHost,port);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * When a redirect type exception is received this method is called to create the appropriate redirect exception type containing the error details needed.
 * @param error the Symbol that defines the redirection error type.
 * @param message the basic error message that should used or amended for the returned exception.
 * @param condition the ErrorCondition that describes the redirection.
 * @return an Exception that captures the details of the redirection error.
 */
@SuppressWarnings("String_Node_Str") protected Exception createRedirectException(Symbol error,String message,ErrorCondition condition){
  Exception result=null;
  Map<String,Object> info=condition.getInfo();
  if (info == null) {
    result=new IOException(message + "String_Node_Str");
  }
 else {
    String hostname=(String)info.get("String_Node_Str");
    String networkHost=(String)info.get("String_Node_Str");
    if (networkHost == null || networkHost.isEmpty()) {
      result=new IOException(message + "String_Node_Str");
    }
    int port=0;
    try {
      port=Integer.valueOf(info.get("String_Node_Str").toString());
    }
 catch (    Exception ex) {
      result=new IOException(message + "String_Node_Str");
    }
    result=new ProviderRedirectedException(message,hostname,networkHost,port);
  }
  return result;
}
Program: 41613
Project: 41613
Buggy source:
/** 
 * Indicates if this DiscoveryAgent requires a ScheduledExecutorService in order to perform its discovery work.
 * @returns true if the agent requires that its parent provide it with a scheduler.
 */
boolean isSchedulerRequired();

Fixed version (ground truth):
/** 
 * Indicates if this DiscoveryAgent requires a ScheduledExecutorService in order to perform its discovery work.
 * @return true if the agent requires that its parent provide it with a scheduler.
 */
boolean isSchedulerRequired();
Program: 41614
Project: 41614
Buggy source:
@Test(timeout=5000) public void testCreateTemporaryTopicFailsWhenLinkRefusedAndAttachResponseWriteIsDeferred() throws Exception {
  doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(false,true);
}

Fixed version (ground truth):
@Test(timeout=5000) public void testCreateTemporaryTopicFailsWhenLinkRefusedAndAttachResponseWriteIsDeferred() throws Exception {
  doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(true,true);
}
Program: 41615
Project: 41615
Buggy source:
private void doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(boolean topic,boolean deferAttachResponseWrite) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    testPeer.expectAndRefuseTempQueueCreationAttach(AmqpError.UNAUTHORIZED_ACCESS,"String_Node_Str",false);
    try {
      if (topic) {
        session.createTemporaryTopic();
      }
 else {
        session.createTemporaryQueue();
      }
      fail("String_Node_Str");
    }
 catch (    JMSSecurityException jmsse) {
    }
    testPeer.waitForAllHandlersToComplete(1000);
  }
 }

Fixed version (ground truth):
private void doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(boolean topic,boolean deferAttachResponseWrite) throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    try {
      if (topic) {
        testPeer.expectAndRefuseTempTopicCreationAttach(AmqpError.UNAUTHORIZED_ACCESS,"String_Node_Str",false);
        session.createTemporaryTopic();
      }
 else {
        testPeer.expectAndRefuseTempQueueCreationAttach(AmqpError.UNAUTHORIZED_ACCESS,"String_Node_Str",false);
        session.createTemporaryQueue();
      }
      fail("String_Node_Str");
    }
 catch (    JMSSecurityException jmsse) {
    }
    testPeer.waitForAllHandlersToComplete(1000);
  }
 }
Program: 41616
Project: 41616
Buggy source:
@Test(timeout=5000) public void testCreateTemporaryTopicFailsWhenLinkRefusedAndAttachResponseWriteIsNotDeferred() throws Exception {
  doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(false,false);
}

Fixed version (ground truth):
@Test(timeout=5000) public void testCreateTemporaryTopicFailsWhenLinkRefusedAndAttachResponseWriteIsNotDeferred() throws Exception {
  doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(true,false);
}
Program: 41617
Project: 41617
Buggy source:
private static TrustManager[] loadTrustManagers(TransportSslOptions options) throws Exception {
  if (options.getTrustStoreLocation() == null) {
    return null;
  }
  TrustManagerFactory fact=TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  String storeLocation=options.getKeyStoreLocation();
  String storePassword=options.getKeyStorePassword();
  String storeType=options.getStoreType();
  LOG.trace("String_Node_Str",storeLocation,storeType);
  KeyStore trustStore=loadStore(storeLocation,storePassword,storeType);
  fact.init(trustStore);
  return fact.getTrustManagers();
}

Fixed version (ground truth):
private static TrustManager[] loadTrustManagers(TransportSslOptions options) throws Exception {
  if (options.getTrustStoreLocation() == null) {
    return null;
  }
  TrustManagerFactory fact=TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  String storeLocation=options.getTrustStoreLocation();
  String storePassword=options.getTrustStorePassword();
  String storeType=options.getStoreType();
  LOG.trace("String_Node_Str",storeLocation,storeType);
  KeyStore trustStore=loadStore(storeLocation,storePassword,storeType);
  fact.init(trustStore);
  return fact.getTrustManagers();
}
Program: 41619
Project: 41619
Buggy source:
/** 
 * Triggers a pull request from the connected Provider.  An attempt is made to set a timeout on the pull request however some providers will not honor this value and the pull will remain active until a message is dispatched. The timeout value can be one of: < 0 to indicate that the request should expire immediately if no message. = 0 to indicate that the request should never time out. > 1 to indicate that the request should expire after the given time in milliseconds.
 * @param timeout The amount of time the pull request should remain valid.
 */
protected void sendPullCommand(long timeout) throws JMSException {
  if (messageQueue.isEmpty() && (getPrefetchSize() == 0 || isBrowser())) {
    connection.pull(getConsumerId(),timeout);
  }
}

Fixed version (ground truth):
/** 
 * Triggers a pull request from the connected Provider.  An attempt is made to set a timeout on the pull request however some providers will not honor this value and the pull will remain active until a message is dispatched. <p> The timeout value can be one of: <br>  {@literal < 0} to indicate that the request should expire immediately if no message.<br>{@literal = 0} to indicate that the request should never time out.<br>{@literal > 1} to indicate that the request should expire after the given time in milliseconds.
 * @param timeout The amount of time the pull request should remain valid.
 */
protected void sendPullCommand(long timeout) throws JMSException {
  if (messageQueue.isEmpty() && (getPrefetchSize() == 0 || isBrowser())) {
    connection.pull(getConsumerId(),timeout);
  }
}
Program: 41620
Project: 41620
Buggy source:
/** 
 * Called to indicate that the underlying connection to the Broker has been established for the first time.  For a fault tolerant provider this event should only ever be triggered once with the interruption and recovery events following on for future
 * @param ex The exception that indicates the cause of this Provider failure.
 */
void onConnectionEstablished(URI remoteURI);

Fixed version (ground truth):
/** 
 * Called to indicate that the underlying connection to the Broker has been established for the first time.  For a fault tolerant provider this event should only ever be triggered once with the interruption and recovery events following on for future
 * @param remoteURI The URI of the Broker that the client has now connected to.
 */
void onConnectionEstablished(URI remoteURI);
Program: 41621
Project: 41621
Buggy source:
/** 
 * Sets any additional Mechanism specific properties using a Map<String, Object>
 * @param options the map of additional properties that this Mechanism should utilize.
 */
void setProperties(Map<String,Object> options);

Fixed version (ground truth):
/** 
 * Sets any additional Mechanism specific properties using a   {@code Map<String, Object>}
 * @param options the map of additional properties that this Mechanism should utilize.
 */
void setProperties(Map<String,Object> options);
Program: 41622
Project: 41622
Buggy source:
/** 
 * Validates that the expression can be used in == or <> expression. Cannot not be NULL TRUE or FALSE litterals.
 * @param expr
 */
public static void checkEqualOperand(Expression expr){
  if (expr instanceof ConstantExpression) {
    Object value=((ConstantExpression)expr).getValue();
    if (value == null) {
      throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Validates that the expression can be used in   {@literal == or <>} expressions. Cannotnot be NULL TRUE or FALSE literals.
 * @param expr
 */
public static void checkEqualOperand(Expression expr){
  if (expr instanceof ConstantExpression) {
    Object value=((ConstantExpression)expr).getValue();
    if (value == null) {
      throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
    }
  }
}
Program: 41623
Project: 41623
Buggy source:
/** 
 * Only Numeric expressions can be used in >, >=, < or <= expressions.s
 * @param expr
 */
public static void checkLessThanOperand(Expression expr){
  if (expr instanceof ConstantExpression) {
    Object value=((ConstantExpression)expr).getValue();
    if (value instanceof Number) {
      return;
    }
    throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
  }
  if (expr instanceof BooleanExpression) {
    throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Only Numeric expressions can be used in   {@literal >, >=, < or <=} expressions.
 * @param expr
 */
public static void checkLessThanOperand(Expression expr){
  if (expr instanceof ConstantExpression) {
    Object value=((ConstantExpression)expr).getValue();
    if (value instanceof Number) {
      return;
    }
    throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
  }
  if (expr instanceof BooleanExpression) {
    throw new RuntimeException("String_Node_Str" + expr + "String_Node_Str");
  }
}
Program: 41624
Project: 41624
Buggy source:
/** 
 * Constructor for an JmsQueueBrowser - used internally
 * @param session
 * @param id
 * @param destination
 * @param selector
 * @throws javax.jms.JMSException
 */
protected JmsQueueBrowser(JmsSession session,JmsDestination destination,String selector) throws JMSException {
  this.session=session;
  this.destination=destination;
  this.selector=selector;
}

Fixed version (ground truth):
/** 
 * Constructor for an JmsQueueBrowser - used internally
 * @param session
 * @param destination
 * @param selector
 * @throws javax.jms.JMSException
 */
protected JmsQueueBrowser(JmsSession session,JmsDestination destination,String selector) throws JMSException {
  this.session=session;
  this.destination=destination;
  this.selector=selector;
}
Program: 41625
Project: 41625
Buggy source:
/** 
 * Sets a value which will be used to override any ttl value that may otherwise be set based on the expiration value when sending the underlying AMQP message. A value of 0 means to clear the ttl field rather than set it to anything.
 * @param ttl the value to use, in range 0 <= x <= 2^32 - 1
 * @throws MessageFormatException
 */
public void setAmqpTimeToLiveOverride(Long ttl) throws MessageFormatException {
  if (ttl != null) {
    if (ttl >= 0 && ttl <= UINT_MAX) {
      userSpecifiedTTL=ttl;
    }
 else {
      throw new MessageFormatException(JMS_AMQP_TTL + "String_Node_Str");
    }
  }
 else {
    userSpecifiedTTL=null;
  }
}

Fixed version (ground truth):
/** 
 * Sets a value which will be used to override any ttl value that may otherwise be set based on the expiration value when sending the underlying AMQP message. A value of 0 means to clear the ttl field rather than set it to anything.
 * @param ttl the value to use, in range  {@literal 0 <= x <= 2^32 - 1}
 * @throws MessageFormatException
 */
public void setAmqpTimeToLiveOverride(Long ttl) throws MessageFormatException {
  if (ttl != null) {
    if (ttl >= 0 && ttl <= UINT_MAX) {
      userSpecifiedTTL=ttl;
    }
 else {
      throw new MessageFormatException(JMS_AMQP_TTL + "String_Node_Str");
    }
  }
 else {
    userSpecifiedTTL=null;
  }
}
Program: 41626
Project: 41626
Buggy source:
/** 
 * Gets the current setting controlling how many Connect / Reconnect attempts must occur before a warn message is logged.  A value of   {@code <= 0} indicates that there will beno warn message logged regardless of how many reconnect attempts occur.
 * @return the current number of connection attempts before warn logging is triggered.
 */
public int getWarnAfterReconnectAttempts(){
  return warnAfterReconnectAttempts;
}

Fixed version (ground truth):
/** 
 * Gets the current setting controlling how many Connect / Reconnect attempts must occur before a warn message is logged.  A value of   {@literal <= 0} indicates that there will beno warn message logged regardless of how many reconnect attempts occur.
 * @return the current number of connection attempts before warn logging is triggered.
 */
public int getWarnAfterReconnectAttempts(){
  return warnAfterReconnectAttempts;
}
Program: 41627
Project: 41627
Buggy source:
/** 
 * Sets the number of Connect / Reconnect attempts that must occur before a warn message is logged indicating that the transport is not connected.  This can be useful when the client is running inside some container or service as it gives an indication of some problem with the client connection that might not otherwise be visible.  To disable the log messages this value should be set to a value @{code attempts <= 0}
 * @param warnAfterReconnectAttempts The number of failed connection attempts that must happen before a warning is logged.
 */
public void setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts){
  this.warnAfterReconnectAttempts=warnAfterReconnectAttempts;
}

Fixed version (ground truth):
/** 
 * Sets the number of Connect / Reconnect attempts that must occur before a warn message is logged indicating that the transport is not connected.  This can be useful when the client is running inside some container or service as it gives an indication of some problem with the client connection that might not otherwise be visible.  To disable the log messages this value should be set to a value   {@literal <= 0}
 * @param warnAfterReconnectAttempts The number of failed connection attempts that must happen before a warning is logged.
 */
public void setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts){
  this.warnAfterReconnectAttempts=warnAfterReconnectAttempts;
}
Program: 41628
Project: 41628
Buggy source:
/** 
 * Does a proper compare on the Id's
 * @param id1
 * @param id2
 * @return 0 if equal else a positive if id1 is > id2 ...
 */
public static int compare(String id1,String id2){
  int result=-1;
  String seed1=IdGenerator.getSeedFromId(id1);
  String seed2=IdGenerator.getSeedFromId(id2);
  if (seed1 != null && seed2 != null) {
    result=seed1.compareTo(seed2);
    if (result == 0) {
      long count1=IdGenerator.getSequenceFromId(id1);
      long count2=IdGenerator.getSequenceFromId(id2);
      result=(int)(count1 - count2);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Does a proper compare on the Id's
 * @param id1
 * @param id2
 * @return 0 if equal else a positive if {@literal id1 > id2} ...
 */
public static int compare(String id1,String id2){
  int result=-1;
  String seed1=IdGenerator.getSeedFromId(id1);
  String seed2=IdGenerator.getSeedFromId(id2);
  if (seed1 != null && seed2 != null) {
    result=seed1.compareTo(seed2);
    if (result == 0) {
      long count1=IdGenerator.getSequenceFromId(id1);
      long count2=IdGenerator.getSequenceFromId(id2);
      result=(int)(count1 - count2);
    }
  }
  return result;
}
Program: 41629
Project: 41629
Buggy source:
/** 
 * Used to get an enqueued message. The amount of time this method blocks is based on the timeout value. - if timeout==-1 then it blocks until a message is received. - if timeout==0 then it it tries to not block at all, it returns a message if it is available - if timeout>0 then it blocks up to timeout amount of time. Expired messages will consumed by this method.
 * @return null if we timeout or if the consumer is closed.
 * @throws InterruptedException if the wait is interrupted.
 */
JmsInboundMessageDispatch dequeue(long timeout) throws InterruptedException ;

Fixed version (ground truth):
/** 
 * Used to get an enqueued message. The amount of time this method blocks is based on the timeout value. - if timeout==-1 then it blocks until a message is received. - if timeout==0 then it it tries to not block at all, it returns a message if it is available - if   {@literal timeout > 0} then itblocks up to timeout amount of time. Expired messages will consumed by this method.
 * @return null if we timeout or if the consumer is closed.
 * @throws InterruptedException if the wait is interrupted.
 */
JmsInboundMessageDispatch dequeue(long timeout) throws InterruptedException ;
Program: 41630
Project: 41630
Buggy source:
/** 
 * Parse properties from a named resource -eg. a URI or a simple name e.g. foo?name="fred"&size=2
 * @param uri the URI whose parameters are to be parsed.
 * @return <Code>Map</Code> of properties
 * @throws Exception if an error occurs while parsing the query options.
 */
public static Map<String,String> parseParameters(String uri) throws Exception {
  if (uri == null) {
    return Collections.emptyMap();
  }
  return parseQuery(stripUpto(uri,'?'));
}

Fixed version (ground truth):
/** 
 * Parse properties from a named resource -eg. a URI or a simple name e.g.  {@literal foo?name="fred"&size=2}
 * @param uri the URI whose parameters are to be parsed.
 * @return <Code>Map</Code> of properties
 * @throws Exception if an error occurs while parsing the query options.
 */
public static Map<String,String> parseParameters(String uri) throws Exception {
  if (uri == null) {
    return Collections.emptyMap();
  }
  return parseQuery(stripUpto(uri,'?'));
}
Program: 41631
Project: 41631
Buggy source:
/** 
 * @param topic
 * @param name
 * @param messageSelector
 * @param noLocal
 * @return the durable TopicSubscriber
 * @throws IllegalStateException
 * @throws JMSException
 * @see javax.jms.Session#createDurableSubscriber(javax.jms.Topic,java.lang.String,java.lang.String,boolean)
 */
@Override public TopicSubscriber createDurableSubscriber(Topic topic,String name,String messageSelector,boolean noLocal) throws IllegalStateException {
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param topic
 * @param name
 * @param messageSelector
 * @param noLocal
 * @return the durable TopicSubscriber
 * @throws JMSException
 * @see javax.jms.Session#createDurableSubscriber(javax.jms.Topic,java.lang.String,java.lang.String,boolean)
 */
@Override public TopicSubscriber createDurableSubscriber(Topic topic,String name,String messageSelector,boolean noLocal) throws JMSException {
  throw new IllegalStateException("String_Node_Str");
}
Program: 41632
Project: 41632
Buggy source:
/** 
 * @param destination
 * @param messageSelector
 * @param NoLocal
 * @return the MessageConsumer
 * @throws JMSException
 * @see javax.jms.Session#createConsumer(javax.jms.Destination,java.lang.String,boolean)
 */
@Override public MessageConsumer createConsumer(Destination destination,String messageSelector,boolean noLocal) throws JMSException {
  checkClosed();
  checkDestination(destination);
  messageSelector=checkSelector(messageSelector);
  JmsDestination dest=JmsMessageTransformation.transformDestination(connection,destination);
  JmsMessageConsumer result=new JmsMessageConsumer(getNextConsumerId(),this,dest,messageSelector,noLocal);
  result.init();
  return result;
}

Fixed version (ground truth):
/** 
 * @param destination
 * @param messageSelector
 * @param noLocal
 * @return the MessageConsumer
 * @throws JMSException
 * @see javax.jms.Session#createConsumer(javax.jms.Destination,java.lang.String,boolean)
 */
@Override public MessageConsumer createConsumer(Destination destination,String messageSelector,boolean noLocal) throws JMSException {
  checkClosed();
  checkDestination(destination);
  messageSelector=checkSelector(messageSelector);
  JmsDestination dest=JmsMessageTransformation.transformDestination(connection,destination);
  JmsMessageConsumer result=new JmsMessageConsumer(getNextConsumerId(),this,dest,messageSelector,noLocal);
  result.init();
  return result;
}
Program: 41633
Project: 41633
Buggy source:
/** 
 * Constructor
 * @param s
 * @param destination
 */
protected JmsTopicPublisher(JmsProducerId id,JmsSession session,JmsDestination destination) throws JMSException {
  super(id,session,destination);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param session
 * @param destination
 */
protected JmsTopicPublisher(JmsProducerId id,JmsSession session,JmsDestination destination) throws JMSException {
  super(id,session,destination);
}
Program: 41634
Project: 41634
Buggy source:
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation. The Set returned may be manipulated by the receiver without impacting the facade, and an empty set will be returned if there are no matching properties.
 * @param message the JmsMessageFacade instance to read from
 * @param excludeStandardJMSHeaders whether the standard JMS header names should be excluded from the returned set
 * @return a Set<String> containing the names of all intercepted properties with a value.
 * @throws JMSException if an error occurs while gathering the message property names.
 */
public static Set<String> getPropertyNames(JmsMessageFacade message,boolean excludeStandardJMSHeaders) throws JMSException {
  Set<String> names=new HashSet<String>();
  for (  Entry<String,PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) {
    if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) {
      continue;
    }
    if (entry.getValue().propertyExists(message)) {
      names.add(entry.getKey());
    }
  }
  names.addAll(message.getPropertyNames());
  return names;
}

Fixed version (ground truth):
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation. The Set returned may be manipulated by the receiver without impacting the facade, and an empty set will be returned if there are no matching properties.
 * @param message the JmsMessageFacade instance to read from
 * @param excludeStandardJMSHeaders whether the standard JMS header names should be excluded from the returned set
 * @return a {@code Set<String>} containing the names of all intercepted properties with a value.
 * @throws JMSException if an error occurs while gathering the message property names.
 */
public static Set<String> getPropertyNames(JmsMessageFacade message,boolean excludeStandardJMSHeaders) throws JMSException {
  Set<String> names=new HashSet<String>();
  for (  Entry<String,PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) {
    if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) {
      continue;
    }
    if (entry.getValue().propertyExists(message)) {
      names.add(entry.getKey());
    }
  }
  names.addAll(message.getPropertyNames());
  return names;
}
Program: 41635
Project: 41635
Buggy source:
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.
 * @param message the JmsMessageFacade instance to read property names from.
 * @return a Set<String> containing the names of all intercepted properties.
 * @throws JMSException if an error occurs while gathering the message property names.
 */
public static Set<String> getAllPropertyNames(JmsMessageFacade message) throws JMSException {
  Set<String> names=new HashSet<String>(PROPERTY_INTERCEPTERS.keySet());
  names.addAll(message.getPropertyNames());
  return names;
}

Fixed version (ground truth):
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.
 * @param message the JmsMessageFacade instance to read property names from.
 * @return a {@code Set<String>} containing the names of all intercepted properties.
 * @throws JMSException if an error occurs while gathering the message property names.
 */
public static Set<String> getAllPropertyNames(JmsMessageFacade message) throws JMSException {
  Set<String> names=new HashSet<String>(PROPERTY_INTERCEPTERS.keySet());
  names.addAll(message.getPropertyNames());
  return names;
}
Program: 41636
Project: 41636
Buggy source:
/** 
 * @param transport the transport type name to use when creating a new provider.
 */
public void setTransportType(String transportType){
  this.transportType=transportType;
}

Fixed version (ground truth):
/** 
 * @param transportType the transport type name to use when creating a new provider.
 */
public void setTransportType(String transportType){
  this.transportType=transportType;
}
Program: 41637
Project: 41637
Buggy source:
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation. The Set returned may be manipulated by the receiver without impacting the facade, and an empty set will be returned if there are no matching properties.
 * @return a Set<String> containing the names of all intercepted properties with a value.
 */
public static Set<String> getPropertyNames(AmqpJmsMessageFacade message){
  Set<String> names=new HashSet<String>();
  for (  Entry<String,PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) {
    if (entry.getValue().propertyExists(message)) {
      names.add(entry.getKey());
    }
  }
  return message.getApplicationPropertyNames(names);
}

Fixed version (ground truth):
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation. The Set returned may be manipulated by the receiver without impacting the facade, and an empty set will be returned if there are no matching properties.
 * @return a {@code Set<String>} containing the names of all intercepted properties with a value.
 */
public static Set<String> getPropertyNames(AmqpJmsMessageFacade message){
  Set<String> names=new HashSet<String>();
  for (  Entry<String,PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) {
    if (entry.getValue().propertyExists(message)) {
      names.add(entry.getKey());
    }
  }
  return message.getApplicationPropertyNames(names);
}
Program: 41638
Project: 41638
Buggy source:
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.
 * @return a Set<String> containing the names of all intercepted properties.
 */
public static Set<String> getAllPropertyNames(){
  return PROPERTY_INTERCEPTERS.keySet();
}

Fixed version (ground truth):
/** 
 * For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.
 * @return a {@code Set<String>} containing the names of all intercepted properties.
 */
public static Set<String> getAllPropertyNames(){
  return PROPERTY_INTERCEPTERS.keySet();
}
Program: 41639
Project: 41639
Buggy source:
/** 
 * Sets the password value for this Mechanism.  The Mechanism can ignore this value if it does not utilize a password in it's authentication processing.
 * @param username The user name given.
 */
void setPassword(String value);

Fixed version (ground truth):
/** 
 * Sets the password value for this Mechanism.  The Mechanism can ignore this value if it does not utilize a password in it's authentication processing.
 * @param username The user name given.
 */
void setPassword(String username);
Program: 41640
Project: 41640
Buggy source:
/** 
 * Sets the user name value for this Mechanism.  The Mechanism can ignore this value if it does not utilize user name in it's authentication processing.
 * @param username The user name given.
 */
void setUsername(String value);

Fixed version (ground truth):
/** 
 * Sets the user name value for this Mechanism.  The Mechanism can ignore this value if it does not utilize user name in it's authentication processing.
 * @param username The user name given.
 */
void setUsername(String username);
Program: 41641
Project: 41641
Buggy source:
/** 
 * Encodes the value of string so that it looks like it would look like when it was provided in a selector.
 * @param string
 * @return the encoded String
 */
public static String encodeString(String s){
  StringBuffer b=new StringBuffer();
  b.append('\'');
  for (int i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (c == '\'') {
      b.append(c);
    }
    b.append(c);
  }
  b.append('\'');
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Encodes the value of string so that it looks like it would look like when it was provided in a selector.
 * @param s the original string
 * @return the encoded String
 */
public static String encodeString(String s){
  StringBuffer b=new StringBuffer();
  b.append('\'');
  for (int i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (c == '\'') {
      b.append(c);
    }
    b.append(c);
  }
  b.append('\'');
  return b.toString();
}
Program: 41642
Project: 41642
Buggy source:
/** 
 * When using the   {@link java.net.InetAddress#getHostName()} method in anenvironment where neither a proper DNS lookup nor an <tt>/etc/hosts</tt> entry exists for a given host, the following exception will be thrown: <code> java.net.UnknownHostException: &lt;hostname&gt;: &lt;hostname&gt; at java.net.InetAddress.getLocalHost(InetAddress.java:1425) ... </code> Instead of just throwing an UnknownHostException and giving up, this method grabs a suitable hostname from the exception and prevents the exception from being thrown. If a suitable hostname cannot be acquired from the exception, only then is the <tt>UnknownHostException</tt> thrown.
 * @return The hostname
 * @throws UnknownHostException
 * @see {@link java.net.InetAddress#getLocalHost()}
 * @see {@link java.net.InetAddress#getHostName()}
 */
public static String getLocalHostName() throws UnknownHostException {
  try {
    return (InetAddress.getLocalHost()).getHostName();
  }
 catch (  UnknownHostException uhe) {
    String host=uhe.getMessage();
    if (host != null) {
      int colon=host.indexOf(':');
      if (colon > 0) {
        return host.substring(0,colon);
      }
    }
    throw uhe;
  }
}

Fixed version (ground truth):
/** 
 * When using the   {@link java.net.InetAddress#getHostName()} method in anenvironment where neither a proper DNS lookup nor an <tt>/etc/hosts</tt> entry exists for a given host, the following exception will be thrown: <code> java.net.UnknownHostException: &lt;hostname&gt;: &lt;hostname&gt; at java.net.InetAddress.getLocalHost(InetAddress.java:1425) ... </code> Instead of just throwing an UnknownHostException and giving up, this method grabs a suitable hostname from the exception and prevents the exception from being thrown. If a suitable hostname cannot be acquired from the exception, only then is the <tt>UnknownHostException</tt> thrown.
 * @return The hostname
 * @throws UnknownHostException
 * @see java.net.InetAddress#getLocalHost()
 * @see java.net.InetAddress#getHostName()
 */
public static String getLocalHostName() throws UnknownHostException {
  try {
    return (InetAddress.getLocalHost()).getHostName();
  }
 catch (  UnknownHostException uhe) {
    String host=uhe.getMessage();
    if (host != null) {
      int colon=host.indexOf(':');
      if (colon > 0) {
        return host.substring(0,colon);
      }
    }
    throw uhe;
  }
}
Program: 41643
Project: 41643
Buggy source:
/** 
 * Awaits the termination of the thread pool. <p/> This implementation will log every 2nd second at INFO level that we are waiting, so the end user can see we are not hanging in case it takes longer time to terminate the pool.
 * @param executorService the thread pool
 * @param shutdownAwaitTermination time in millis to use as timeout
 * @return <tt>true</tt> if the pool is terminated, or <tt>false</tt> if we timed out
 * @throws InterruptedException is thrown if we are interrupted during the waiting
 */
public static boolean awaitTermination(ExecutorService executorService,long shutdownAwaitTermination) throws InterruptedException {
  if (executorService == null) {
    return true;
  }
  StopWatch watch=new StopWatch();
  long interval=Math.min(2000,shutdownAwaitTermination);
  boolean done=false;
  while (!done && interval > 0) {
    if (executorService.awaitTermination(interval,TimeUnit.MILLISECONDS)) {
      done=true;
    }
 else {
      LOG.debug("String_Node_Str",TimeUtils.printDuration(watch.taken()),executorService);
      interval=Math.min(2000,shutdownAwaitTermination - watch.taken());
    }
  }
  return done;
}

Fixed version (ground truth):
/** 
 * Awaits the termination of the thread pool. <p> This implementation will log every 2nd second at INFO level that we are waiting, so the end user can see we are not hanging in case it takes longer time to terminate the pool.
 * @param executorService the thread pool
 * @param shutdownAwaitTermination time in millis to use as timeout
 * @return <tt>true</tt> if the pool is terminated, or <tt>false</tt> if we timed out
 * @throws InterruptedException is thrown if we are interrupted during the waiting
 */
public static boolean awaitTermination(ExecutorService executorService,long shutdownAwaitTermination) throws InterruptedException {
  if (executorService == null) {
    return true;
  }
  StopWatch watch=new StopWatch();
  long interval=Math.min(2000,shutdownAwaitTermination);
  boolean done=false;
  while (!done && interval > 0) {
    if (executorService.awaitTermination(interval,TimeUnit.MILLISECONDS)) {
      done=true;
    }
 else {
      LOG.debug("String_Node_Str",TimeUtils.printDuration(watch.taken()),executorService);
      interval=Math.min(2000,shutdownAwaitTermination - watch.taken());
    }
  }
  return done;
}
Program: 41644
Project: 41644
Buggy source:
/** 
 * Shutdown the given executor service graceful at first, and then aggressively if the await termination timeout was hit. <p/> Will try to perform an orderly shutdown by giving the running threads time to complete tasks, before going more aggressively by doing a  {@link #shutdownNow(java.util.concurrent.ExecutorService)} which forces a shutdown. Theparameter <tt>shutdownAwaitTermination</tt> is used as timeout value waiting for orderly shutdown to complete normally, before going aggressively.
 * @param executorService the executor service to shutdown
 * @param shutdownAwaitTermination timeout in millis to wait for orderly shutdown
 */
public static void shutdownGraceful(ExecutorService executorService,long shutdownAwaitTermination){
  doShutdown(executorService,shutdownAwaitTermination);
}

Fixed version (ground truth):
/** 
 * Shutdown the given executor service graceful at first, and then aggressively if the await termination timeout was hit. <p> Will try to perform an orderly shutdown by giving the running threads time to complete tasks, before going more aggressively by doing a  {@link #shutdownNow(java.util.concurrent.ExecutorService)} which forces a shutdown. Theparameter <tt>shutdownAwaitTermination</tt> is used as timeout value waiting for orderly shutdown to complete normally, before going aggressively.
 * @param executorService the executor service to shutdown
 * @param shutdownAwaitTermination timeout in millis to wait for orderly shutdown
 */
public static void shutdownGraceful(ExecutorService executorService,long shutdownAwaitTermination){
  doShutdown(executorService,shutdownAwaitTermination);
}
Program: 41645
Project: 41645
Buggy source:
/** 
 * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. This method differs from the   {@link parseQuery} method in that it handles composite URItypes and will extract the URI options from the outermost composite URI.
 * @param uri The URI whose query should be extracted and processed.
 * @return A Mapping of the URI options.
 * @throws URISyntaxException
 */
public static Map<String,String> parseParameters(URI uri) throws URISyntaxException {
  if (!isCompositeURI(uri)) {
    if (uri.getQuery() == null) {
      return Collections.emptyMap();
    }
 else {
      try {
        return PropertyUtil.parseQuery(PropertyUtil.stripPrefix(uri.getQuery(),"String_Node_Str"));
      }
 catch (      Exception e) {
        throw new URISyntaxException(uri.toString(),e.getMessage());
      }
    }
  }
 else {
    CompositeData data=URISupport.parseComposite(uri);
    Map<String,String> parameters=new HashMap<String,String>();
    parameters.putAll(data.getParameters());
    if (parameters.isEmpty()) {
      parameters=Collections.emptyMap();
    }
    return parameters;
  }
}

Fixed version (ground truth):
/** 
 * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. This method handles composite URI types and will extract the URI options from the outermost composite URI.
 * @param uri The URI whose query should be extracted and processed.
 * @return A Mapping of the URI options.
 * @throws URISyntaxException
 */
public static Map<String,String> parseParameters(URI uri) throws URISyntaxException {
  if (!isCompositeURI(uri)) {
    if (uri.getQuery() == null) {
      return Collections.emptyMap();
    }
 else {
      try {
        return PropertyUtil.parseQuery(PropertyUtil.stripPrefix(uri.getQuery(),"String_Node_Str"));
      }
 catch (      Exception e) {
        throw new URISyntaxException(uri.toString(),e.getMessage());
      }
    }
  }
 else {
    CompositeData data=URISupport.parseComposite(uri);
    Map<String,String> parameters=new HashMap<String,String>();
    parameters.putAll(data.getParameters());
    if (parameters.isEmpty()) {
      parameters=Collections.emptyMap();
    }
    return parameters;
  }
}
Program: 41646
Project: 41646
Buggy source:
/** 
 * @returns if the currently transaction has been marked as being failed.
 */
boolean isFailed();

Fixed version (ground truth):
/** 
 * @return if the currently transaction has been marked as being failed.
 */
boolean isFailed();
Program: 41647
Project: 41647
Buggy source:
/** 
 * Creates an instance of a basic JmsObjectMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @returns a newly created and initialized JmsObjectMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsObjectMessage createObjectMessage() throws JMSException ;

Fixed version (ground truth):
/** 
 * Creates an instance of a basic JmsObjectMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @return a newly created and initialized JmsObjectMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsObjectMessage createObjectMessage() throws JMSException ;
Program: 41648
Project: 41648
Buggy source:
/** 
 * Creates an instance of a basic JmsStreamMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @returns a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsStreamMessage createStreamMessage() throws JMSException ;

Fixed version (ground truth):
/** 
 * Creates an instance of a basic JmsStreamMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @return a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsStreamMessage createStreamMessage() throws JMSException ;
Program: 41649
Project: 41649
Buggy source:
/** 
 * Creates an instance of a basic JmsTextMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @returns a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsTextMessage createTextMessage() throws JMSException ;

Fixed version (ground truth):
/** 
 * Creates an instance of a basic JmsTextMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @return a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsTextMessage createTextMessage() throws JMSException ;
Program: 41650
Project: 41650
Buggy source:
/** 
 * Creates an instance of a basic JmsBytesMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @returns a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsBytesMessage createBytesMessage() throws JMSException ;

Fixed version (ground truth):
/** 
 * Creates an instance of a basic JmsBytesMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @return a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsBytesMessage createBytesMessage() throws JMSException ;
Program: 41651
Project: 41651
Buggy source:
/** 
 * Creates an instance of a basic JmsMapMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @returns a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsMapMessage createMapMessage() throws JMSException ;

Fixed version (ground truth):
/** 
 * Creates an instance of a basic JmsMapMessage object.  The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
 * @return a newly created and initialized JmsTextMessage instance.
 * @throws JMSException if the provider cannot create the message for some reason.
 */
JmsMapMessage createMapMessage() throws JMSException ;
Program: 41652
Project: 41652
Buggy source:
/** 
 * Performs a copy of this message facade into a new instance.  Calling this method results in a call to reset() prior to the message copy meaning any in use streams will be closed on return.
 * @returns a deep copy of this Message Facade including a complete copyof the byte contents of the wrapped message.
 */
@Override JmsBytesMessageFacade copy() throws JMSException ;

Fixed version (ground truth):
/** 
 * Performs a copy of this message facade into a new instance.  Calling this method results in a call to reset() prior to the message copy meaning any in use streams will be closed on return.
 * @return a deep copy of this Message Facade including a complete copyof the byte contents of the wrapped message.
 */
@Override JmsBytesMessageFacade copy() throws JMSException ;
Program: 41653
Project: 41653
Buggy source:
/** 
 * Determines whether an item exists in this Map based message.
 * @returns true if the item exists in the Map, false otherwise.
 */
boolean itemExists(String key);

Fixed version (ground truth):
/** 
 * Determines whether an item exists in this Map based message.
 * @return true if the item exists in the Map, false otherwise.
 */
boolean itemExists(String key);
Program: 41654
Project: 41654
Buggy source:
/** 
 * Gets the value stored in the Map at the specified key.
 * @param key the key to use to access a value in the Map.
 * @returns the item associated with the given key, or null if not present.
 */
Object get(String key);

Fixed version (ground truth):
/** 
 * Gets the value stored in the Map at the specified key.
 * @param key the key to use to access a value in the Map.
 * @return the item associated with the given key, or null if not present.
 */
Object get(String key);