nus-yam/ex-repair huggingface dataset:
Program: 134740
Project: 134740
Buggy source:
/** 
 * Enable/Disable all the control in the GUI than can cause the invalidation of the logs
 * @param enabled If true the controls are enabled
 */
@Override public void setEnabled(boolean enabled){
  getLogLevelCB().setEnabled(enabled);
  pauseBtn.setEnabled(enabled);
  clearLogsBtn.setEnabled(enabled);
  filtersBtn.setEnabled(enabled);
  getDiscardLevelCB().setEnabled(enabled);
  super.setEnabled(enabled);
}

Fixed version (ground truth):
/** 
 * Enable/Disable all the control in the GUI than can cause the invalidation of the logs
 * @param enabled If true the controls are enabled
 */
@Override public void setEnabled(boolean enabled){
  getLogLevelCB().setEnabled(enabled);
  pauseBtn.setEnabled(enabled);
  clearLogsBtn.setEnabled(enabled);
  boolean filtersBtnEnabled=(filtersBtnEnabledOverwrite != null ? filtersBtnEnabledOverwrite.booleanValue() : enabled);
  filtersBtn.setEnabled(filtersBtnEnabled);
  getDiscardLevelCB().setEnabled(enabled);
  super.setEnabled(enabled);
}
Program: 134741
Project: 134741
Buggy source:
/** 
 * Enable/disable the filter menu item and the filter button in the tool bar
 * @param enable true enables the widgets
 */
public void enableFiltersWidgets(boolean enable){
  toolBar.getFiltersBtn().setEnabled(enable);
  menuBar.getFiltersMenuItem().setEnabled(enable);
  menuBar.getEngineFiltersMenuItem().setEnabled(enable);
}

Fixed version (ground truth):
/** 
 * Enable/disable the filter menu item and the filter button in the tool bar. <p> Calling this method overwrites the setting of the tool bar's "filtersBtn" via   {@link LogToolBar#setEnabled(boolean)}. This feature is needed to disable this button when jlog runs inside the OMC, because there we get calls to LogToolBar#setEnabled(true) for every table update, menu opening etc.
 * @param enable true enables the widgets
 */
public void enableFiltersWidgets(boolean enable){
  toolBar.enableFiltersButtonOverwrite(enable);
  menuBar.getFiltersMenuItem().setEnabled(enable);
  menuBar.getEngineFiltersMenuItem().setEnabled(enable);
}
Program: 134742
Project: 134742
Buggy source:
/** 
 * The table will show only logs that pass this filter. Previously installed jlog filters will get removed. <p> If the given filter is null, all filters will be removed.
 * @param filter
 */
public void setFilter(Filter filter){
  FiltersVector filters=new FiltersVector();
  filters.add(filter);
  filters.activateFilter(filter,true);
  boolean shouldAppend=false;
  logEntryTable.setFilters(filters,shouldAppend);
  client.setTableFilterLbl();
}

Fixed version (ground truth):
/** 
 * The table will show only logs that pass this filter. Previously installed jlog filters will get removed. <p> If the given filter is null, all filters will be removed.
 * @param filter
 */
public void setFilter(Filter filter){
  FiltersVector filters=new FiltersVector();
  if (filter != null) {
    filters.add(filter);
    filters.activateFilter(filter,true);
  }
  boolean shouldAppend=false;
  logEntryTable.setFilters(filters,shouldAppend);
  client.setTableFilterLbl();
}
Program: 134743
Project: 134743
Buggy source:
protected TypesafeLogBase(Logger logger,String logName,AcsLogLevel level,String msg,String array,String antenna){
  this.logger=logger;
  if (logger instanceof AcsLogger) {
    ((AcsLogger)logger).addLoggerClass(TypesafeLogBase.class);
    ((AcsLogger)logger).addLoggerClass(this.getClass());
  }
  nameValue=new LinkedHashMap<String,Object>();
  nameValue.put("String_Node_Str",logName);
  lr=new AcsLogRecord(level,msg,nameValue,logger.getName());
  lr.setAudience("String_Node_Str");
  lr.setArray(array);
  lr.setAntenna(antenna);
}

Fixed version (ground truth):
protected TypesafeLogBase(Logger logger,String logName,AcsLogLevel level,String audience,String msg,String array,String antenna){
  this.logger=logger;
  if (logger instanceof AcsLogger) {
    ((AcsLogger)logger).addLoggerClass(TypesafeLogBase.class);
    ((AcsLogger)logger).addLoggerClass(this.getClass());
  }
  nameValue=new LinkedHashMap<String,Object>();
  nameValue.put("String_Node_Str",logName);
  lr=new AcsLogRecord(level,msg,nameValue,logger.getName());
  lr.setAudience(audience);
  lr.setArray(array);
  lr.setAntenna(antenna);
}
Program: 134744
Project: 134744
Buggy source:
/** 
 * Constructor
 * @param folder The folder to write the manifest into
 * @param pluginFolder The root folder of the plugin
 * @param finalJarsLocations 
 * @param bundleByReference 
 * @param dependencies The plugins this plugin depends on
 * @param Logger The logger
 */
public ManifestWriter(File folder,File pluginFolder,boolean bundleByReference,String[] finalJarsLocations,String[] dependencies,String bundleVersion,Logger logger){
  if (folder == null || !folder.canWrite()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (pluginFolder == null || !pluginFolder.canRead()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (logger == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.bundlingByReference=bundleByReference;
  this.finalJarsLocations=finalJarsLocations;
  this.dependencies=dependencies;
  if (bundleVersion != null && !bundleVersion.trim().isEmpty()) {
    this.bundleVersion=bundleVersion;
  }
 else {
    this.bundleVersion="String_Node_Str";
  }
  this.bundleVersion=bundleVersion;
  this.logger=logger;
  manifestFolder=folder;
  this.pluginFolder=pluginFolder;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param folder The folder to write the manifest into
 * @param pluginFolder The root folder of the plugin
 * @param finalJarsLocations 
 * @param bundleByReference 
 * @param dependencies The plugins this plugin depends on
 * @param Logger The logger
 */
public ManifestWriter(File folder,File pluginFolder,boolean bundleByReference,String[] finalJarsLocations,String[] dependencies,String bundleVersion,Logger logger){
  if (folder == null || !folder.canWrite()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (pluginFolder == null || !pluginFolder.canRead()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (logger == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.bundlingByReference=bundleByReference;
  this.finalJarsLocations=finalJarsLocations;
  this.dependencies=dependencies;
  if (bundleVersion != null && !bundleVersion.trim().isEmpty()) {
    this.bundleVersion=bundleVersion;
  }
 else {
    this.bundleVersion="String_Node_Str";
  }
  this.logger=logger;
  manifestFolder=folder;
  this.pluginFolder=pluginFolder;
}
Program: 134745
Project: 134745
Buggy source:
/** 
 * @see alma.acs.component.ComponentLifecycle#cleanUp()
 */
public void cleanUp() throws AcsJComponentCleanUpEx {
  if (threadPool != null) {
    threadPool.shutdown();
    boolean nicePoolShutdown=false;
    try {
      nicePoolShutdown=threadPool.awaitTermination(3,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
    }
    boolean cleanPoolShutdown=nicePoolShutdown;
    if (!nicePoolShutdown) {
      threadPool.shutdownNow();
      try {
        cleanPoolShutdown=threadPool.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException e) {
      }
    }
    String msg="String_Node_Str";
    if (!cleanPoolShutdown) {
      msg+="String_Node_Str";
    }
 else     if (!nicePoolShutdown) {
      msg+="String_Node_Str";
    }
 else {
      msg+="String_Node_Str";
    }
    m_logger.log(AcsLogLevel.DELOUSE,msg);
  }
  if (properties.size() != 0) {
    PropertyImpl[] propertyArray=null;
synchronized (properties) {
      propertyArray=new PropertyImpl[properties.size()];
      properties.keySet().toArray(propertyArray);
    }
    for (int i=0; i < propertyArray.length; i++) {
      try {
        propertyArray[i].destroy();
      }
 catch (      Throwable th) {
        m_logger.log(Level.WARNING,"String_Node_Str");
        th.printStackTrace();
      }
    }
  }
  super.cleanUp();
}

Fixed version (ground truth):
/** 
 * @see alma.acs.component.ComponentLifecycle#cleanUp()
 */
public void cleanUp() throws AcsJComponentCleanUpEx {
  if (threadPool != null) {
    threadPool.shutdown();
    boolean nicePoolShutdown=false;
    try {
      nicePoolShutdown=threadPool.awaitTermination(3,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
    }
    boolean cleanPoolShutdown=nicePoolShutdown;
    if (!nicePoolShutdown) {
      threadPool.shutdownNow();
      try {
        cleanPoolShutdown=threadPool.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException e) {
      }
    }
    String msg="String_Node_Str";
    if (!cleanPoolShutdown) {
      msg+="String_Node_Str";
    }
 else     if (!nicePoolShutdown) {
      msg+="String_Node_Str";
    }
 else {
      msg+="String_Node_Str";
    }
    m_logger.log(AcsLogLevel.DELOUSE,msg);
  }
  if (properties.size() != 0) {
    Destroyable[] propertyArray=null;
synchronized (properties) {
      propertyArray=new Destroyable[properties.size()];
      properties.keySet().toArray(propertyArray);
    }
    for (int i=0; i < propertyArray.length; i++) {
      try {
        propertyArray[i].destroy();
      }
 catch (      Throwable th) {
        m_logger.log(Level.WARNING,"String_Node_Str");
        th.printStackTrace();
      }
    }
  }
  super.cleanUp();
}
Program: 134746
Project: 134746
Buggy source:
/** 
 * Create RO enum structure. Example:  <code> BasicStatesOperations basicStatesEnumImpl =  (BasicStatesOperations)CommonROEnumPropertyImpl.createEnumProperty( BasicStatesOperations.class, BasicStates.class, "state", parentComponent, dataAccess); </code>
 * @param operationsIF CORBA <enum type>Operations class.
 * @param propertyType CORBA enum class.
 * @param name name of the property.
 * @param parentComponent property component.
 * @param dataAccess data access to be used.
 * @return CORBA <enum type>Operations instance.
 * @throws PropertyInitializationFailed
 */
public static Object createEnumProperty(Class operationsIF,Class propertyType,String name,CharacteristicComponentImpl parentComponent,DataAccess dataAccess) throws PropertyInitializationFailed {
  CommonROEnumPropertyImpl propertyImpl;
  if (dataAccess == null)   propertyImpl=new CommonROEnumPropertyImpl(propertyType,name,parentComponent);
 else   propertyImpl=new CommonROEnumPropertyImpl(propertyType,name,parentComponent,dataAccess);
  return Proxy.newProxyInstance(propertyImpl.getClass().getClassLoader(),new Class[]{operationsIF},new ROEnumProxy(propertyImpl));
}

Fixed version (ground truth):
/** 
 * Create RO enum structure. Example:  <code> BasicStatesOperations basicStatesEnumImpl =  (BasicStatesOperations)CommonROEnumPropertyImpl.createEnumProperty( BasicStatesOperations.class, BasicStates.class, "state", parentComponent, dataAccess); </code>
 * @param operationsIF CORBA <enum type>Operations class.
 * @param propertyType CORBA enum class.
 * @param name name of the property.
 * @param parentComponent property component.
 * @param dataAccess data access to be used.
 * @return CORBA <enum type>Operations instance.
 * @throws PropertyInitializationFailed
 */
public static Object createEnumProperty(Class operationsIF,Class propertyType,String name,CharacteristicComponentImpl parentComponent,DataAccess dataAccess) throws PropertyInitializationFailed {
  CommonROEnumPropertyImpl propertyImpl;
  if (dataAccess == null)   propertyImpl=new CommonROEnumPropertyImpl(propertyType,name,parentComponent);
 else   propertyImpl=new CommonROEnumPropertyImpl(propertyType,name,parentComponent,dataAccess);
  return Proxy.newProxyInstance(propertyImpl.getClass().getClassLoader(),new Class[]{operationsIF,Destroyable.class},new ROEnumProxy(propertyImpl));
}
Program: 134747
Project: 134747
Buggy source:
/** 
 * Create RW enum structure. Example:  <code> BasicStatesOperations basicStatesEnumImpl =  (BasicStatesOperations)CommonRWEnumPropertyImpl.createEnumProperty( BasicStatesOperations.class, BasicStates.class, "state", parentComponent, dataAccess); </code>
 * @param operationsIF CORBA <enum type>Operations class.
 * @param propertyType CORBA enum class.
 * @param name name of the property.
 * @param parentComponent property component.
 * @param dataAccess data access to be used.
 * @return CORBA <enum type>Operations instance.
 * @throws PropertyInitializationFailed
 */
public static Object createEnumProperty(Class operationsIF,Class propertyType,String name,CharacteristicComponentImpl parentComponent,DataAccess dataAccess) throws PropertyInitializationFailed {
  CommonRWEnumPropertyImpl propertyImpl;
  if (dataAccess == null)   propertyImpl=new CommonRWEnumPropertyImpl(propertyType,name,parentComponent);
 else   propertyImpl=new CommonRWEnumPropertyImpl(propertyType,name,parentComponent,dataAccess);
  return Proxy.newProxyInstance(propertyImpl.getClass().getClassLoader(),new Class[]{operationsIF},new RWEnumProxy(propertyImpl));
}

Fixed version (ground truth):
/** 
 * Create RW enum structure. Example:  <code> BasicStatesOperations basicStatesEnumImpl =  (BasicStatesOperations)CommonRWEnumPropertyImpl.createEnumProperty( BasicStatesOperations.class, BasicStates.class, "state", parentComponent, dataAccess); </code>
 * @param operationsIF CORBA <enum type>Operations class.
 * @param propertyType CORBA enum class.
 * @param name name of the property.
 * @param parentComponent property component.
 * @param dataAccess data access to be used.
 * @return CORBA <enum type>Operations instance.
 * @throws PropertyInitializationFailed
 */
public static Object createEnumProperty(Class operationsIF,Class propertyType,String name,CharacteristicComponentImpl parentComponent,DataAccess dataAccess) throws PropertyInitializationFailed {
  CommonRWEnumPropertyImpl propertyImpl;
  if (dataAccess == null)   propertyImpl=new CommonRWEnumPropertyImpl(propertyType,name,parentComponent);
 else   propertyImpl=new CommonRWEnumPropertyImpl(propertyType,name,parentComponent,dataAccess);
  return Proxy.newProxyInstance(propertyImpl.getClass().getClassLoader(),new Class[]{operationsIF,Destroyable.class},new RWEnumProxy(propertyImpl));
}
Program: 134748
Project: 134748
Buggy source:
/** 
 * Constructor. <P> Build the ConcurrentComponentAccessUtil with a default number of threads
 * @param contSrv The {@link ContainerServices}
 */
public ConcurrentComponentAccessUtil(ContainerServices contSrv){
  this(contSrv,defaultThreadNumber);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param contSrv The {@link ContainerServices}
 * @param threadPoolSize The number of threads in the thread pool
 * @param prestartCoreThreads 
 */
public ConcurrentComponentAccessUtil(ContainerServices contSrv,int threadPoolSize,boolean prestartCoreThreads){
  super(contSrv);
  totThreads=threadPoolSize;
  executor=new BenchmarkTreadPoolExecutor(totThreads,totThreads,1,TimeUnit.MINUTES,new LinkedBlockingQueue<Runnable>(),contSrv.getThreadFactory());
  executor.allowCoreThreadTimeOut(true);
  if (prestartCoreThreads) {
    int n=executor.prestartAllCoreThreads();
    logger.info(n + "String_Node_Str");
  }
}
Program: 134749
Project: 134749
Buggy source:
/** 
 * Concurrently release the components with the passed names
 * @param compNames The names of the components to release
 * @param if <code>true</code> the methods wait for all the threads to terminate before returningotherwise return immediately TODO: limit the waiting time 
 */
@Override public void releaseComponents(Collection<String> compNames,boolean waitCompsTermination){
  try {
    countDown.await();
  }
 catch (  InterruptedException ie) {
  }
  countDown=new CountDownLatch(compNames.size());
  for (  String compName : compNames) {
    ComponentDeactivator deactivator=new ComponentDeactivator(compName);
    executor.submit(deactivator);
  }
  if (waitCompsTermination) {
    logger.info("String_Node_Str" + countDown.getCount() + "String_Node_Str");
    try {
      countDown.await();
    }
 catch (    InterruptedException ie) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Concurrently releases the components with the passed names. <p> This method overrides the base class version, bringing in a thread pool for parallel  component release, instead of sequentially releaseing every component.  Mostly makes sense for <code>waitCompsTermination == true</code>. <p> To avoid hanging tests, a generous timeout of 30 minutes gets applied.
 * @param compNames The names of the components to release
 * @param waitCompsTermination if <code>true</code> the method waits for all the threads to terminate before returning, otherwise returns immediately
 */
@Override public void releaseComponents(Collection<String> compNames,boolean waitCompsTermination){
  List<Future<Void>> compReleaseFutures=new ArrayList<Future<Void>>();
  for (  String compName : compNames) {
    compReleaseFutures.add(releaseComponentConcurrent(compName));
  }
  if (waitCompsTermination) {
    logger.info("String_Node_Str" + compReleaseFutures.size() + "String_Node_Str");
    boolean printErrorLogs=true;
    for (    Future<Void> future : compReleaseFutures) {
      try {
        future.get(30,TimeUnit.MINUTES);
      }
 catch (      InterruptedException ex) {
        logger.log(Level.WARNING,"String_Node_Str",ex);
      }
catch (      CancellationException ex) {
        logger.log(Level.WARNING,"String_Node_Str",ex);
      }
catch (      ExecutionException ex) {
        logger.log(Level.WARNING,"String_Node_Str",ex.getCause());
      }
catch (      TimeoutException ex) {
        if (printErrorLogs) {
          logger.log(Level.WARNING,"String_Node_Str",ex);
          printErrorLogs=false;
        }
      }
    }
  }
}
Program: 134750
Project: 134750
Buggy source:
/** 
 * The parallel version of   {@link ComponentAccessUtil#getDynamicComponent(ComponentSpec,Class)}get the dynamic component in a thread of the pool.
 * @param compSpec The spec to start the dynamic component
 * @param idlOpInterface The idl interface of the component
 * @return the future task to be able to get the result of the activation of the component
 */
public <T extends ACSComponentOperations>Future<T> getDynamicComponentConcurrent(ComponentSpec compSpec,Class<T> idlOpInterface){
  ComponentActivator<T> activator=new ComponentActivator<T>(compSpec,idlOpInterface);
  return executor.submit(activator);
}

Fixed version (ground truth):
/** 
 * The parallel version of   {@link ComponentAccessUtil#getDynamicComponent(ComponentSpec,Class)}gets the dynamic component in a thread of the pool.
 * @param compSpec The spec to start the dynamic component
 * @param idlOpInterface The idl interface of the component
 * @return the future task to be able to get the result of the activation of the component
 */
public <T extends ACSComponentOperations>Future<T> getDynamicComponentConcurrent(ComponentSpec compSpec,Class<T> idlOpInterface){
  ComponentActivator<T> activator=new ComponentActivator<T>(compSpec,idlOpInterface);
  return executor.submit(activator);
}
Program: 134751
Project: 134751
Buggy source:
@Override public Void call(){
  ConcurrentComponentAccessUtil.this.releaseComponent(name,true);
  countDown.countDown();
  return null;
}

Fixed version (ground truth):
@Override public Void call(){
  ConcurrentComponentAccessUtil.this.releaseComponent(compName,true);
  return null;
}
Program: 134752
Project: 134752
Buggy source:
public BenchmarkTreadPoolExecutor(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeUnit unit,BlockingQueue<Runnable> workQueue){
  super(corePoolSize,maximumPoolSize,keepAliveTime,unit,workQueue);
}

Fixed version (ground truth):
public BenchmarkTreadPoolExecutor(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeUnit unit,BlockingQueue<Runnable> workQueue,ThreadFactory threadFactory){
  super(corePoolSize,maximumPoolSize,keepAliveTime,unit,workQueue,threadFactory);
}
Program: 134753
Project: 134753
Buggy source:
/** 
 * Constructor
 * @param componentName The name of the component to release
 */
public ComponentDeactivator(String componentName){
  this.name=componentName;
}

Fixed version (ground truth):
/** 
 * @param componentName
 * @param sync may be null
 */
public ComponentDeactivator(String componentName){
  this.compName=componentName;
}
Program: 134754
Project: 134754
Buggy source:
/** 
 * Release a component in a dedicated thread of the pool.
 * @param name The name of the component to deactivate
 * @return
 */
public Future<Void> releaseComponentConcurrent(String name){
  ComponentDeactivator deactivator=new ComponentDeactivator(name);
  return executor.submit(deactivator);
}

Fixed version (ground truth):
/** 
 * Releases a component in a dedicated thread of the pool. <p> Note that <code>ComponentAccessUtil#releaseComponent(compName, waitForCompRelease=false)</code> is very similar in the sense that it is also asynchronous, making an async call to the manager instead of spawning a new thread already here in the client.  The main difference though is that in this method we can measure the time it takes to release a component, which is important for performance tests.
 * @param name The name of the component to deactivate
 * @return handle to sync up with the finishing of the component release.
 */
public Future<Void> releaseComponentConcurrent(String name){
  ComponentDeactivator deactivator=new ComponentDeactivator(name);
  return executor.submit(deactivator);
}
Program: 134757
Project: 134757
Buggy source:
/** 
 * {@inheritDoc}<p> This method is thread-safe.
 */
@Override public void publishEvent(T customStruct) throws AcsJException {
  long currentOmgTime=UTCUtility.utcJavaToOmg(System.currentTimeMillis());
  EventDescription desc=new EventDescription(publisherName,currentOmgTime,count);
  nc.pushData(customStruct,desc);
  count++;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p> This method is thread-safe.
 */
@Override public void publishEvent(T customStruct) throws AcsJException {
  long currentOmgTime=UTCUtility.utcJavaToOmg(System.currentTimeMillis());
  EventDescription desc=new EventDescription(publisherName,currentOmgTime,count.getAndIncrement());
  nc.pushData(customStruct,desc);
}
Program: 134758
Project: 134758
Buggy source:
/** 
 * Returns the total number of events published.  Should be used only for testing.
 */
public long getEventCount(){
  return count;
}

Fixed version (ground truth):
/** 
 * Returns the total number of events published.  Should be used only for testing.
 */
public long getEventCount(){
  return count.get();
}
Program: 134760
Project: 134760
Buggy source:
/** 
 * Appends a random number to the given client name. <p> This is used when setting names on NC proxy objects via the TAO extension API. It reduces the risk of creating a new object with an existing name, because TAO has memory bug and will not delete the badly named object even if it throws the correct NameAlreadyUsed exception. <p> This method is synchronized just to overcome residual doubts about the thread safety of random#nextInt.
 * @param clientName
 * @return "clientName-randomNumber"
 * @see #random
 */
public static synchronized String createRandomizedClientName(String clientName){
  StringBuffer clientNameSB=new StringBuffer(clientName);
  clientNameSB.append('-');
  clientNameSB.append(String.format("String_Node_Str",Math.abs(random.nextInt())));
  return clientNameSB.toString();
}

Fixed version (ground truth):
/** 
 * Appends a random number to the given client name. <p> This is used when setting names on NC proxy objects via the TAO extension API. It reduces the risk of creating a new object with an existing name, because TAO has memory bug and will not delete the badly named object even if it throws the correct NameAlreadyUsed exception. <p> This method is synchronized just to overcome residual doubts about the thread safety of random#nextInt.
 * @param clientName
 * @return "clientName-randomNumber"
 * @see #random
 */
public static synchronized String createRandomizedClientName(String clientName){
  StringBuffer clientNameSB=new StringBuffer(clientName);
  clientNameSB.append('-');
  clientNameSB.append(String.format("String_Node_Str",random.nextInt(Integer.MAX_VALUE)));
  return clientNameSB.toString();
}
Program: 134762
Project: 134762
Buggy source:
public void run(){
  processEvent(structToProcess,eDescrip);
}

Fixed version (ground truth):
public void run(){
  processEvent(eventData,eventDesc);
}
Program: 134763
Project: 134763
Buggy source:
/** 
 * Asynchronously calls   {@link #processEvent(Object,EventDescription)},  using   {@link #eventHandlingExecutor}. <p> This method should be called from the subclass-specific method that receives the event, for example <code>push_structured_event</code> in case of Corba NC.
 * @param structToProcess
 * @param eDescrip
 */
protected void processEventAsync(final T structToProcess,final EventDescription eDescrip){
  boolean isReceiverBusyWithPreviousEvent=(eventHandlingExecutor.getQueue().size() > EVENT_QUEUE_CAPACITY / 2);
  boolean thisEventDiscarded=false;
  try {
    eventHandlingExecutor.execute(new Runnable(){
      public void run(){
        processEvent(structToProcess,eDescrip);
      }
    }
);
  }
 catch (  RejectedExecutionException ex) {
    thisEventDiscarded=true;
    numEventsDiscarded++;
  }
  if ((thisEventDiscarded || isReceiverBusyWithPreviousEvent) && receiverTooSlowLogRepeatGuard.checkAndIncrement()) {
    logEventProcessingTooSlowForEventRate(numEventsDiscarded,structToProcess.getClass().getName(),receiverTooSlowLogRepeatGuard.counterAtLastExecution());
    numEventsDiscarded=0;
  }
}

Fixed version (ground truth):
/** 
 * Asynchronously calls   {@link #processEvent(Object,EventDescription)},  using   {@link #eventHandlingExecutor}. <p> This method should be called from the subclass-specific method that receives the event, for example <code>push_structured_event</code> in case of Corba NC.
 * @param eventData (defined as <code>Object</code> instead of <code>T</code> to include data for generic subscription).
 * @param eventDesc
 */
protected void processEventAsync(final Object eventData,final EventDescription eventDesc){
  boolean isReceiverBusyWithPreviousEvent=(eventHandlingExecutor.getQueue().size() > EVENT_QUEUE_CAPACITY / 2);
  boolean thisEventDiscarded=false;
  try {
    eventHandlingExecutor.execute(new Runnable(){
      public void run(){
        processEvent(eventData,eventDesc);
      }
    }
);
  }
 catch (  RejectedExecutionException ex) {
    thisEventDiscarded=true;
    numEventsDiscarded++;
  }
  if ((thisEventDiscarded || isReceiverBusyWithPreviousEvent) && receiverTooSlowLogRepeatGuard.checkAndIncrement()) {
    logEventProcessingTooSlowForEventRate(numEventsDiscarded,eventData.getClass().getName(),receiverTooSlowLogRepeatGuard.counterAtLastExecution());
    numEventsDiscarded=0;
  }
}
Program: 134764
Project: 134764
Buggy source:
public void createConnectionAction(EventDispatcher evtDispatcher,ErrorReporter errRep,SCInstance scInstance,Collection<TriggerEvent> derivedEvents) throws AcsJStateMachineActionEx {
  super.createConnectionAction(evtDispatcher,errRep,scInstance,derivedEvents);
  try {
    if (corbaRef == null) {
      corbaObj=new OSPushConsumerPOATie(NCSubscriber.this);
      corbaRef=OSPushConsumerHelper.narrow(helper.getContainerServices().activateOffShoot(corbaObj));
    }
    channelReconnectionCallback=new AcsNcReconnectionCallback(NCSubscriber.this,logger);
    channelReconnectionCallback.registerForReconnect(services,helper.getNotifyFactory());
    proxySupplier.connect_structured_push_consumer(org.omg.CosNotifyComm.StructuredPushConsumerHelper.narrow(corbaRef));
  }
 catch (  AcsJContainerServicesEx e) {
    LOG_NC_SubscriptionConnect_FAIL.log(logger,channelName,getNotificationFactoryName());
    throw new AcsJStateMachineActionEx(e);
  }
catch (  org.omg.CosEventChannelAdmin.AlreadyConnected e) {
    throw new AcsJStateMachineActionEx(new AcsJIllegalStateEventEx(e));
  }
catch (  org.omg.CosEventChannelAdmin.TypeError ex) {
    LOG_NC_SubscriptionConnect_FAIL.log(logger,channelName,getNotificationFactoryName());
    throw new AcsJStateMachineActionEx(ex);
  }
catch (  AcsJIllegalArgumentEx ex) {
    throw new AcsJStateMachineActionEx(ex);
  }
  LOG_NC_SubscriptionConnect_OK.log(logger,channelName,getNotificationFactoryName());
}

Fixed version (ground truth):
protected void createConnectionAction(EventDispatcher evtDispatcher,ErrorReporter errRep,SCInstance scInstance,Collection<TriggerEvent> derivedEvents) throws AcsJStateMachineActionEx {
  super.createConnectionAction(evtDispatcher,errRep,scInstance,derivedEvents);
  try {
    if (corbaRef == null) {
      corbaObj=new OSPushConsumerPOATie(NCSubscriber.this);
      corbaRef=OSPushConsumerHelper.narrow(helper.getContainerServices().activateOffShoot(corbaObj));
    }
    channelReconnectionCallback=new AcsNcReconnectionCallback(NCSubscriber.this,logger);
    channelReconnectionCallback.registerForReconnect(services,helper.getNotifyFactory());
    proxySupplier.connect_structured_push_consumer(org.omg.CosNotifyComm.StructuredPushConsumerHelper.narrow(corbaRef));
  }
 catch (  AcsJContainerServicesEx e) {
    LOG_NC_SubscriptionConnect_FAIL.log(logger,channelName,getNotificationFactoryName());
    throw new AcsJStateMachineActionEx(e);
  }
catch (  org.omg.CosEventChannelAdmin.AlreadyConnected e) {
    throw new AcsJStateMachineActionEx(new AcsJIllegalStateEventEx(e));
  }
catch (  org.omg.CosEventChannelAdmin.TypeError ex) {
    LOG_NC_SubscriptionConnect_FAIL.log(logger,channelName,getNotificationFactoryName());
    throw new AcsJStateMachineActionEx(ex);
  }
catch (  AcsJIllegalArgumentEx ex) {
    throw new AcsJStateMachineActionEx(ex);
  }
  LOG_NC_SubscriptionConnect_OK.log(logger,channelName,getNotificationFactoryName());
}
Program: 134767
Project: 134767
Buggy source:
/** 
 * Queries the TMCDB and return the list of services to start for the  passed configuration name.
 * @param configurationName The not <code>null</code> and not empty name of the configuration
 * @return The not <code>null</code> list of services to start for the passed configuration
 * @throws HibernateException In case of error getting data from the TMCDB
 */
public List<AcsServiceToStart> getServicesList(String configurationName) throws HibernateException {
  if (configurationName == null || configurationName.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  logger.log(AcsLogLevel.DEBUG,"String_Node_Str" + configurationName);
  Query query=session.createSQLQuery(sqlQuery);
  query.setString(namedParameterName,configurationName);
  List svcs=query.list();
  if (svcs != null) {
    AcsLogLevel lvl=(svcs.size() == 0) ? AcsLogLevel.WARNING : AcsLogLevel.DEBUG;
    logger.log(lvl,"String_Node_Str" + svcs.size() + "String_Node_Str");
  }
 else {
    logger.log(AcsLogLevel.WARNING,"String_Node_Str");
  }
  List<AcsServiceToStart> ret=new ArrayList<TMCDBServicesHelper.AcsServiceToStart>();
  for (  Object s : svcs) {
    ret.add(AcsServiceToStart.instanceFromDBRow((Object[])s));
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Queries the TMCDB and return the list of services to start for the  passed configuration name.
 * @param configurationName The not <code>null</code> and not empty name of the configuration
 * @return The not <code>null</code> list of services to start for the passed configuration
 * @throws HibernateException In case of error getting data from the TMCDB
 */
@SuppressWarnings("String_Node_Str") public List<AcsServiceToStart> getServicesList(String configurationName) throws HibernateException {
  if (configurationName == null || configurationName.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  logger.log(AcsLogLevel.DEBUG,"String_Node_Str" + configurationName);
  Query query=session.createSQLQuery(sqlQuery);
  query.setString(namedParameterName,configurationName);
  List svcs=query.list();
  List<AcsServiceToStart> ret=new ArrayList<TMCDBServicesHelper.AcsServiceToStart>();
  if (svcs != null) {
    AcsLogLevel lvl=(svcs.size() == 0) ? AcsLogLevel.WARNING : AcsLogLevel.DEBUG;
    logger.log(lvl,"String_Node_Str" + svcs.size() + "String_Node_Str");
    for (    Object s : svcs) {
      ret.add(AcsServiceToStart.instanceFromDBRow((Object[])s));
    }
  }
 else {
    logger.log(AcsLogLevel.WARNING,"String_Node_Str");
  }
  return ret;
}
Program: 134768
Project: 134768
Buggy source:
/** 
 * @return The configuration names from the TMCDB
 * @throws HibernateException In case of error getting data from the TMCDB
 */
public Collection getConfigurationNames() throws HibernateException {
  Query query=session.createQuery("String_Node_Str");
  List list=query.list();
  return list;
}

Fixed version (ground truth):
/** 
 * @return The configuration names from the TMCDB
 * @throws HibernateException In case of error getting data from the TMCDB
 */
@SuppressWarnings("String_Node_Str") public Collection getConfigurationNames() throws HibernateException {
  Query query=session.createQuery("String_Node_Str");
  List list=query.list();
  return list;
}
Program: 134770
Project: 134770
Buggy source:
public void registerOption(CmdLineRegisteredOption opt){
  if (opt == null) {
  }
 else {
    m_registeredOptions.put(opt.getName(),opt);
  }
  if (opt.getAlternativeName() != null) {
    m_registeredOptions.put(opt.getAlternativeName(),opt);
  }
}

Fixed version (ground truth):
public void registerOption(CmdLineRegisteredOption opt){
  if (opt == null) {
  }
 else {
    m_registeredOptions.put(opt.getName(),opt);
    if (opt.getAlternativeName() != null) {
      m_registeredOptions.put(opt.getAlternativeName(),opt);
    }
  }
}
Program: 134771
Project: 134771
Buggy source:
/** 
 * Flushes all log records if the remote log service has been made available before. Returns only when the log queue contains no more records, so execution time may be long. Should better not be called from the main thread.
 */
void flushAllAndWait(){
  if (DEBUG) {
    System.out.println("String_Node_Str");
  }
  if (!hasRemoteDispatcher()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    return;
  }
  boolean flushSuccess=true;
  while (realQueueSize() > 0) {
    Future<Boolean> future=flush();
    try {
      flushSuccess=future.get().booleanValue();
    }
 catch (    Exception e) {
      flushSuccess=false;
      if (DEBUG) {
        System.err.println("String_Node_Str" + e.toString());
      }
      try {
        Thread.sleep(100);
      }
 catch (      Exception e2) {
      }
    }
 finally {
      if (DEBUG) {
        System.out.println("String_Node_Str" + flushSuccess);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Flushes all log records if the remote log service has been made available before. Returns only when the log queue contains no more records, so execution time may be long. Should better not be called from the main thread.
 */
void flushAllAndWait(){
  if (DEBUG) {
    System.out.println("String_Node_Str");
  }
  if (!hasRemoteDispatcher()) {
    if (DEBUG) {
      System.out.println("String_Node_Str");
    }
    return;
  }
  boolean flushSuccess=true;
  while (realQueueSize() > 0) {
    Future<Boolean> future=flush();
    try {
      flushSuccess=future.get().booleanValue();
    }
 catch (    Exception e) {
      flushSuccess=false;
      if (DEBUG) {
        System.out.println("String_Node_Str" + e.toString());
      }
      try {
        Thread.sleep(100);
      }
 catch (      Exception e2) {
      }
    }
 finally {
      if (DEBUG) {
        System.out.println("String_Node_Str" + flushSuccess);
      }
    }
  }
}
Program: 134772
Project: 134772
Buggy source:
DispatchingLogQueue(){
  outOfCapacity=false;
  preOverflowFlushPeriod=0;
  currentFlushPeriod=0;
  setMaxQueueSize(1000);
  flushLock=new ReentrantLock();
  queue=new PriorityBlockingQueue<LogRecord>(100,new LogRecordComparator());
  executor=new ScheduledThreadPoolExecutor(1,new DaemonThreadFactory("String_Node_Str"));
  executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
}

Fixed version (ground truth):
DispatchingLogQueue(){
  outOfCapacity=new AtomicBoolean(false);
  preOverflowFlushPeriod=0;
  currentFlushPeriod=0;
  setMaxQueueSize(1000);
  flushLock=new ReentrantLock();
  queue=new PriorityBlockingQueue<LogRecord>(100,new LogRecordComparator());
  executor=new ScheduledThreadPoolExecutor(1,new DaemonThreadFactory("String_Node_Str"));
  executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
}
Program: 134774
Project: 134774
Buggy source:
/** 
 * Extracted from   {@link #flush(boolean)} to improve readability of the code.
 * @param logRecords the records to be sent to the remote logger.
 * @return true if all or at least some log records were permanently taken off the queue.
 */
private boolean flushLogRecords(final LogRecord[] logRecords){
  if (DEBUG) {
    System.out.println("String_Node_Str" + Thread.currentThread().getName());
  }
  boolean flushedSomeRecords=true;
  RemoteLogDispatcher.FailedLogRecords failures=remoteLogDispatcher.sendLogRecords(logRecords);
  List<LogRecord> allFailures=new ArrayList<LogRecord>();
  if (failures.hasSendFailures()) {
    List<LogRecord> sendFailures=failures.getSendFailures();
    allFailures.addAll(sendFailures);
    flushedSomeRecords=(sendFailures.size() < logRecords.length);
    if (DEBUG) {
      System.err.println("String_Node_Str" + sendFailures.size() + "String_Node_Str");
    }
  }
  if (failures.hasSerializationFailures()) {
    for (    LogRecord logRecord : failures.getSerializationFailures()) {
      System.err.println("String_Node_Str" + logRecord.getMessage());
    }
    flushedSomeRecords=true;
  }
  for (  LogRecord e : logRecords) {
    if (!allFailures.contains(e))     queue.remove(e);
  }
  lastFlushFinished=System.currentTimeMillis();
  return flushedSomeRecords;
}

Fixed version (ground truth):
/** 
 * Extracted from   {@link #flush(boolean)} to improve readability of the code.
 * @param logRecords the records to be sent to the remote logger.
 * @return true if all or at least some log records were permanently taken off the queue.
 */
private boolean flushLogRecords(final LogRecord[] logRecords){
  if (DEBUG) {
    System.out.println("String_Node_Str" + Thread.currentThread().getName());
  }
  boolean flushedSomeRecords=true;
  RemoteLogDispatcher.FailedLogRecords failures=remoteLogDispatcher.sendLogRecords(logRecords);
  List<LogRecord> allFailures=new ArrayList<LogRecord>();
  if (failures.hasSendFailures()) {
    List<LogRecord> sendFailures=failures.getSendFailures();
    allFailures.addAll(sendFailures);
    flushedSomeRecords=(sendFailures.size() < logRecords.length);
    if (DEBUG) {
      System.out.println("String_Node_Str" + sendFailures.size() + "String_Node_Str");
    }
  }
  if (failures.hasSerializationFailures()) {
    for (    LogRecord logRecord : failures.getSerializationFailures()) {
      System.out.println("String_Node_Str" + logRecord.getMessage());
    }
    flushedSomeRecords=true;
  }
  for (  LogRecord e : logRecords) {
    if (!allFailures.contains(e))     queue.remove(e);
  }
  lastFlushFinished=System.currentTimeMillis();
  return flushedSomeRecords;
}
Program: 134775
Project: 134775
Buggy source:
public void run(){
  if (queue.size() > 0) {
    if (lastFlushFinished <= System.currentTimeMillis() - periodMillisec) {
      try {
        flush(true);
      }
 catch (      Throwable thr) {
        System.err.println("String_Node_Str" + thr.getMessage());
      }
    }
 else {
      if (DEBUG) {
        System.err.println("String_Node_Str");
      }
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (queue.size() > 0) {
    if (lastFlushFinished <= System.currentTimeMillis() - periodMillisec) {
      try {
        flush(true);
      }
 catch (      Throwable thr) {
        System.out.println("String_Node_Str" + thr.getMessage());
      }
    }
 else {
      if (DEBUG) {
        System.out.println("String_Node_Str");
      }
    }
  }
 else {
    if (DEBUG) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 134778
Project: 134778
Buggy source:
@Override public void unlock(){
  delegate.unlock();
  LockInfo lockInfo=lockInfoMap.remove(Thread.currentThread().getId());
  lockInfo.timeUnlocked=System.currentTimeMillis();
  printProfilingMessage(lockInfo,Thread.currentThread().getName());
}

Fixed version (ground truth):
@Override public void unlock(){
  delegate.unlock();
  if (!delegate.isHeldByCurrentThread()) {
    LockInfo lockInfo=lockInfoMap.remove(Thread.currentThread().getId());
    lockInfo.timeUnlocked=System.currentTimeMillis();
    printProfilingMessage(lockInfo,Thread.currentThread().getName());
  }
 else {
  }
}
Program: 134780
Project: 134780
Buggy source:
/** 
 * Returns human-readable and meaningful name of handle.
 * @param id	handle to stringifys
 * @return	human-readable and meaningful name of handle.
 */
private String getRequestorName(int id){
  int handle=id & HANDLE_MASK;
  boolean invalidHandle=true;
  StringBuffer name=new StringBuffer(30);
switch (id & TYPE_MASK) {
case CONTAINER_MASK:
synchronized (containers) {
      if (containers.isAllocated(handle)) {
        ContainerInfo info=(ContainerInfo)containers.get(handle);
        if (info.getHandle() == id) {
          invalidHandle=false;
          name.append(info.getName());
        }
      }
    }
  break;
case CLIENT_MASK:
synchronized (clients) {
  if (clients.isAllocated(handle)) {
    ClientInfo info=(ClientInfo)clients.get(handle);
    if (info.getHandle() == id) {
      invalidHandle=false;
      name.append(info.getName());
    }
  }
}
break;
case ADMINISTRATOR_MASK:
synchronized (administrators) {
if (administrators.isAllocated(handle)) {
ClientInfo info=(ClientInfo)administrators.get(handle);
if (info.getHandle() == id) {
  invalidHandle=false;
  name.append(info.getName());
}
}
}
break;
case COMPONENT_MASK:
synchronized (components) {
if (components.isAllocated(handle)) {
ComponentInfo info=(ComponentInfo)components.get(handle);
if (info != null && info.getHandle() == id) {
invalidHandle=false;
name.append(info.getName());
}
}
}
break;
case MANAGER_MASK:
name.append("String_Node_Str");
invalidHandle=false;
break;
}
if (invalidHandle) name.append("String_Node_Str");
return name.toString();
}

Fixed version (ground truth):
/** 
 * Returns human-readable and meaningful name of handle.
 * @param id	handle to stringifys
 * @return	human-readable and meaningful name of handle.
 */
private String getRequestorName(int id){
  int reqHandle=id & HANDLE_MASK;
  boolean invalidHandle=true;
  StringBuffer name=new StringBuffer(30);
switch (id & TYPE_MASK) {
case CONTAINER_MASK:
synchronized (containers) {
      if (containers.isAllocated(reqHandle)) {
        ContainerInfo info=(ContainerInfo)containers.get(reqHandle);
        if (info.getHandle() == id) {
          invalidHandle=false;
          name.append(info.getName());
        }
      }
    }
  break;
case CLIENT_MASK:
synchronized (clients) {
  if (clients.isAllocated(reqHandle)) {
    ClientInfo info=(ClientInfo)clients.get(reqHandle);
    if (info.getHandle() == id) {
      invalidHandle=false;
      name.append(info.getName());
    }
  }
}
break;
case ADMINISTRATOR_MASK:
synchronized (administrators) {
if (administrators.isAllocated(reqHandle)) {
ClientInfo info=(ClientInfo)administrators.get(reqHandle);
if (info.getHandle() == id) {
  invalidHandle=false;
  name.append(info.getName());
}
}
}
break;
case COMPONENT_MASK:
synchronized (components) {
if (components.isAllocated(reqHandle)) {
ComponentInfo info=(ComponentInfo)components.get(reqHandle);
if (info != null && info.getHandle() == id) {
invalidHandle=false;
name.append(info.getName());
}
}
}
break;
case MANAGER_MASK:
name.append("String_Node_Str");
invalidHandle=false;
break;
}
if (invalidHandle) name.append("String_Node_Str");
return name.toString();
}
Program: 134781
Project: 134781
Buggy source:
/** 
 * Check for cyclic dependency between components, if detected <code>NoResourcesException</code> exception is thrown.
 * @param requestor
 * @param requestedComponentName
 */
private void checkCyclicDependency(int requestor,String requestedComponentName) throws AcsJCyclicDependencyDetectedEx {
  if ((requestor & TYPE_MASK) != COMPONENT_MASK)   return;
  ComponentInfo componentInfo=null;
synchronized (components) {
    int h=components.first();
    while (h != 0) {
      ComponentInfo info=(ComponentInfo)components.get(h);
      if (info.getName().equals(requestedComponentName)) {
        componentInfo=info;
        break;
      }
 else       h=components.next(h);
    }
    ComponentInfo pendingComponentInfo;
synchronized (pendingActivations) {
      pendingComponentInfo=(ComponentInfo)pendingActivations.get(requestedComponentName);
    }
    if (componentInfo != null && pendingComponentInfo == null)     return;
    if (componentInfo == null)     componentInfo=pendingComponentInfo;
    if (componentInfo == null)     return;
    ArrayList pathList=doCycleCheck(requestor,componentInfo.getHandle());
    if (pathList == null)     return;
    StringBuffer pathBuffer=new StringBuffer();
    for (int i=pathList.size() - 1; i >= 0; i--)     pathBuffer.append(((ComponentInfo)pathList.get(i)).getName()).append("String_Node_Str");
    pathBuffer.append(componentInfo.getName());
    AcsJCyclicDependencyDetectedEx cde=new AcsJCyclicDependencyDetectedEx();
    cde.setCURL(requestedComponentName);
    cde.setRequestor(requestor);
    throw cde;
  }
}

Fixed version (ground truth):
/** 
 * Check for cyclic dependency between components, if detected <code>NoResourcesException</code> exception is thrown.
 * @param requestor
 * @param requestedComponentName
 */
private void checkCyclicDependency(int requestor,String requestedComponentName) throws AcsJCyclicDependencyDetectedEx {
  if ((requestor & TYPE_MASK) != COMPONENT_MASK)   return;
  ComponentInfo componentInfo=null;
synchronized (components) {
    int h=components.first();
    while (h != 0) {
      ComponentInfo info=(ComponentInfo)components.get(h);
      if (info.getName().equals(requestedComponentName)) {
        componentInfo=info;
        break;
      }
 else       h=components.next(h);
    }
    ComponentInfo pendingComponentInfo;
synchronized (pendingActivations) {
      pendingComponentInfo=pendingActivations.get(requestedComponentName);
    }
    if (componentInfo != null && pendingComponentInfo == null)     return;
    if (componentInfo == null)     componentInfo=pendingComponentInfo;
    if (componentInfo == null)     return;
    ArrayList pathList=doCycleCheck(requestor,componentInfo.getHandle());
    if (pathList == null)     return;
    StringBuffer pathBuffer=new StringBuffer();
    for (int i=pathList.size() - 1; i >= 0; i--)     pathBuffer.append(((ComponentInfo)pathList.get(i)).getName()).append("String_Node_Str");
    pathBuffer.append(componentInfo.getName());
    AcsJCyclicDependencyDetectedEx cde=new AcsJCyclicDependencyDetectedEx();
    cde.setCURL(requestedComponentName);
    cde.setRequestor(requestor);
    throw cde;
  }
}
Program: 134782
Project: 134782
Buggy source:
/** 
 * Acquire synchronization lock for named object.
 * @param name	name of the object whose lock to acquire.
 * @param msecs	the number of milleseconds to wait.An argument less than or equal to zero means not to wait at all.
 * @return	<code>true</code> if acquired, <code>false</code> othwerwise.
 */
private boolean acquireSynchronizationObject(String name,long msec){
  ReferenceCountingLock lock;
synchronized (activationSynchronization) {
    lock=(ReferenceCountingLock)activationSynchronization.get(name);
    if (lock == null) {
      lock=new ReferenceCountingLock();
      activationSynchronization.put(name,lock);
    }
 else     lock.increment();
  }
  boolean success=lock.acquire(msec);
  if (!success)   releaseSynchronizationObject(name,false);
  return success;
}

Fixed version (ground truth):
/** 
 * Acquire synchronization lock for named object.
 * @param name	name of the object whose lock to acquire.
 * @param msecs	the number of milleseconds to wait.An argument less than or equal to zero means not to wait at all.
 * @return	<code>true</code> if acquired, <code>false</code> othwerwise.
 */
private boolean acquireSynchronizationObject(String name,long msec){
  ReferenceCountingLock lock;
synchronized (activationSynchronization) {
    lock=activationSynchronization.get(name);
    if (lock == null) {
      lock=new ReferenceCountingLock();
      activationSynchronization.put(name,lock);
    }
 else     lock.increment();
  }
  boolean success=lock.acquire(msec);
  if (!success)   releaseSynchronizationObject(name,false);
  return success;
}