nus-yam/ex-repair huggingface dataset:
Program: 29090
Project: 29090
Buggy source:
public PoolProperties(){
  maxPoolSize=Integer.parseInt(ejbContainer.getMaxPoolSize());
  poolIdleTimeoutInSeconds=Integer.parseInt(ejbContainer.getPoolIdleTimeoutInSeconds());
  poolResizeQuantity=Integer.parseInt(ejbContainer.getPoolResizeQuantity());
  steadyPoolSize=Integer.parseInt(ejbContainer.getSteadyPoolSize());
  if (beanPoolDes != null) {
    int temp=0;
    if ((temp=beanPoolDes.getMaxPoolSize()) != -1) {
      maxPoolSize=temp;
    }
    if ((temp=beanPoolDes.getPoolIdleTimeoutInSeconds()) != -1) {
      poolIdleTimeoutInSeconds=temp;
    }
    if ((temp=beanPoolDes.getPoolResizeQuantity()) != -1) {
      poolResizeQuantity=temp;
    }
    if ((temp=beanPoolDes.getSteadyPoolSize()) != -1) {
      steadyPoolSize=temp;
    }
  }
}

Fixed version (ground truth):
public PoolProperties(EntityContainer entityContainer){
  maxPoolSize=Integer.parseInt(entityContainer.ejbContainer.getMaxPoolSize());
  poolIdleTimeoutInSeconds=Integer.parseInt(entityContainer.ejbContainer.getPoolIdleTimeoutInSeconds());
  poolResizeQuantity=Integer.parseInt(entityContainer.ejbContainer.getPoolResizeQuantity());
  steadyPoolSize=Integer.parseInt(entityContainer.ejbContainer.getSteadyPoolSize());
  if (entityContainer.beanPoolDes != null) {
    int temp=0;
    if ((temp=entityContainer.beanPoolDes.getMaxPoolSize()) != -1) {
      maxPoolSize=temp;
    }
    if ((temp=entityContainer.beanPoolDes.getPoolIdleTimeoutInSeconds()) != -1) {
      poolIdleTimeoutInSeconds=temp;
    }
    if ((temp=entityContainer.beanPoolDes.getPoolResizeQuantity()) != -1) {
      poolResizeQuantity=temp;
    }
    if ((temp=entityContainer.beanPoolDes.getSteadyPoolSize()) != -1) {
      steadyPoolSize=temp;
    }
  }
}
Program: 29091
Project: 29091
Buggy source:
/** 
 * Cleans up the CoordinatorLogSection and returns it to the pool for re-use Note: the implementation of the cache does not ensure that when an object is re-used there are no outstanding references to that object. However, the risk involved is minimal since reUse() replaces the existing call to finalize(). The existing call to finalize also does not ensure that there are no outstanding references to the object being finalized.
 * @param
 * @return
 * @see
 */
synchronized void reUse(){
  if (unwrittenObjects != null)   unwrittenObjects.removeAllElements();
  if (unwrittenData != null)   unwrittenData.removeAllElements();
  if (writtenObjects != null)   writtenObjects.removeAllElements();
  if (writtenData != null)   writtenData.removeAllElements();
  sectionName=null;
  unwrittenEmpty=true;
  writtenEmpty=true;
  headerLength=0;
  SectionPool.putCoordinatorLogSection(this);
}

Fixed version (ground truth):
/** 
 * Cleans up the CoordinatorLogSection and returns it to the pool for re-use Note: the implementation of the cache does not ensure that when an object is re-used there are no outstanding references to that object. However, the risk involved is minimal since reUse() replaces the existing call to finalize(). The existing call to finalize also does not ensure that there are no outstanding references to the object being finalized.
 * @param
 * @return
 * @see
 */
synchronized void reUse(){
  if (unwrittenObjects != null)   unwrittenObjects.removeAllElements();
  if (unwrittenData != null)   unwrittenData.removeAllElements();
  if (writtenObjects != null)   writtenObjects.removeAllElements();
  if (writtenData != null)   writtenData.removeAllElements();
  sectionName=null;
  unwrittenEmpty=true;
  writtenEmpty=true;
  SectionPool.putCoordinatorLogSection(this);
}
Program: 29092
Project: 29092
Buggy source:
/** 
 * Opens the log file for all CoordinatorLogs in this process. <p> If the log has already been opened, the operation uses the opened LogFile.
 * @param
 * @return  Indicates success of the operation.
 * @see
 */
private static boolean openLog(String logPath){
  boolean result=false;
  String logName;
  CoordinatorLogStateHolder logStateHolder=getStateHolder(logPath);
  if (logStateHolder.log == null) {
    logStateHolder.log=new Log(logPath);
    if (!logStateHolder.log.initialise()) {
      logStateHolder.log=null;
      _logger.log(Level.SEVERE,"String_Node_Str");
      String msg=LogFormatter.getLocalizedMessage(_logger,"String_Node_Str");
      throw new org.omg.CORBA.INTERNAL(msg);
    }
  }
  String serverName=null;
  if (logStateHolder.log != null && (serverName=Configuration.getServerName(logPath)) != null) {
    logStateHolder.logFile=logStateHolder.log.open(serverName,CoordinatorLogPool.getCoordinatorLog(logPath));
    if (logStateHolder.logFile == null) {
      _logger.log(Level.SEVERE,"String_Node_Str",serverName);
      String msg=LogFormatter.getLocalizedMessage(_logger,"String_Node_Str");
      throw new org.omg.CORBA.INTERNAL(msg);
    }
 else     Configuration.setLogFile(logPath,logStateHolder.logFile);
  }
  result=(logStateHolder.log != null && logStateHolder.logFile != null);
  return result;
}

Fixed version (ground truth):
/** 
 * Opens the log file for all CoordinatorLogs in this process. <p> If the log has already been opened, the operation uses the opened LogFile.
 * @param
 * @return  Indicates success of the operation.
 * @see
 */
private static boolean openLog(String logPath){
  boolean result=false;
  String logName;
  CoordinatorLogStateHolder logStateHolder=getStateHolder(logPath);
  if (logStateHolder.log == null) {
    logStateHolder.log=new Log(logPath);
    if (!logStateHolder.log.initialise()) {
      logStateHolder.log=null;
      _logger.log(Level.SEVERE,"String_Node_Str");
      String msg=LogFormatter.getLocalizedMessage(_logger,"String_Node_Str");
      throw new org.omg.CORBA.INTERNAL(msg);
    }
  }
  String serverName=null;
  if (logStateHolder.log != null && (serverName=Configuration.getServerName(logPath)) != null) {
    logStateHolder.logFile=logStateHolder.log.open(serverName,CoordinatorLogPool.getCoordinatorLog(logPath));
    if (logStateHolder.logFile == null) {
      _logger.log(Level.SEVERE,"String_Node_Str",serverName);
      String msg=LogFormatter.getLocalizedMessage(_logger,"String_Node_Str");
      throw new org.omg.CORBA.INTERNAL(msg);
    }
 else     Configuration.setLogFile(logPath,logStateHolder.logFile);
  }
  result=(logStateHolder.logFile != null);
  return result;
}
Program: 29093
Project: 29093
Buggy source:
/** 
 * Distributes before completion operations to all registered Synchronization objects. <p> Returns a boolean to indicate success/failure.
 * @param
 * @return  Indicates success of the operation.
 * @see
 */
boolean distributeBefore(){
  boolean result=true;
  for (int i=0; i < registered.size() && result == true; i++) {
    Synchronization sync=(Synchronization)registered.elementAt(i);
    try {
      if (_logger.isLoggable(Level.FINEST)) {
        _logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str" + sync);
      }
      sync.before_completion();
      if (_logger.isLoggable(Level.FINEST)) {
        _logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str" + sync);
      }
    }
 catch (    RuntimeException rex) {
      throw rex;
    }
catch (    Throwable exc) {
      if (!(exc instanceof INVALID_TRANSACTION)) {
        _logger.log(Level.WARNING,"String_Node_Str",new java.lang.Object[]{exc.toString(),"String_Node_Str"});
      }
      result=false;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Distributes before completion operations to all registered Synchronization objects. <p> Returns a boolean to indicate success/failure.
 * @param
 * @return  Indicates success of the operation.
 * @see
 */
boolean distributeBefore(){
  boolean result=true;
  for (int i=0; i < registered.size() && result == true; i++) {
    Synchronization sync=(Synchronization)registered.elementAt(i);
    try {
      if (_logger.isLoggable(Level.FINEST)) {
        _logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str" + sync);
      }
      sync.before_completion();
      if (_logger.isLoggable(Level.FINEST)) {
        _logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str" + sync);
      }
    }
 catch (    RuntimeException rex) {
      throw rex;
    }
catch (    Throwable exc) {
      _logger.log(Level.WARNING,"String_Node_Str",new java.lang.Object[]{exc.toString(),"String_Node_Str"});
      result=false;
    }
  }
  return result;
}
Program: 29094
Project: 29094
Buggy source:
public void addReadOnlyBeanRefreshEventHandler(long ejbID,ClassLoader loader,ReadOnlyBeanRefreshEventHandler handler){
  refreshHandlers.put(ejbID,new ReadOnlyBeanRefreshHandlerInfo(ejbID,loader,handler));
  _logger.log(Level.INFO,"String_Node_Str" + ejbID + "String_Node_Str"+ handler);
}

Fixed version (ground truth):
public void addReadOnlyBeanRefreshEventHandler(long ejbID,ClassLoader loader,ReadOnlyBeanRefreshEventHandler handler){
  refreshHandlers.put(ejbID,new ReadOnlyBeanRefreshHandlerInfo(loader,handler));
  _logger.log(Level.INFO,"String_Node_Str" + ejbID + "String_Node_Str"+ handler);
}
Program: 29095
Project: 29095
Buggy source:
public ReadOnlyBeanRefreshHandlerInfo(long ejbId,ClassLoader loader,ReadOnlyBeanRefreshEventHandler handler){
  this.ejbId=ejbId;
  this.loader=loader;
  this.handler=handler;
}

Fixed version (ground truth):
public ReadOnlyBeanRefreshHandlerInfo(ClassLoader loader,ReadOnlyBeanRefreshEventHandler handler){
  this.loader=loader;
  this.handler=handler;
}
Program: 29096
Project: 29096
Buggy source:
/** 
 * Copies file from source to destination
 * @param src
 * @param dest
 * @throws IOException
 */
private static void copyFile(File src,File dest) throws IOException {
  if (!dest.exists()) {
    dest.getParentFile().mkdirs();
    dest.createNewFile();
  }
  FileChannel srcChannel=null;
  FileChannel destChannel=null;
  try {
    srcChannel=new FileInputStream(src).getChannel();
    destChannel=new FileOutputStream(dest).getChannel();
    destChannel.transferFrom(srcChannel,0,srcChannel.size());
  }
  finally {
    if (srcChannel != null) {
      srcChannel.close();
    }
    if (destChannel != null) {
      destChannel.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Copies file from source to destination
 * @param src
 * @param dest
 * @throws IOException
 */
private static void copyFile(File src,File dest) throws IOException {
  if (!dest.exists()) {
    mkDirs(dest.getParentFile());
    mkFile(dest);
  }
  FileChannel srcChannel=null;
  FileChannel destChannel=null;
  try {
    srcChannel=new FileInputStream(src).getChannel();
    destChannel=new FileOutputStream(dest).getChannel();
    destChannel.transferFrom(srcChannel,0,srcChannel.size());
  }
  finally {
    if (srcChannel != null) {
      srcChannel.close();
    }
    if (destChannel != null) {
      destChannel.close();
    }
  }
}
Program: 29097
Project: 29097
Buggy source:
private void deletePublishedFiles(Set<String> publishedFiles){
  if (publishedFiles != null) {
    for (    String path : publishedFiles) {
      File f=new File(path);
      if (f.exists()) {
        f.delete();
      }
    }
  }
}

Fixed version (ground truth):
private void deletePublishedFiles(Set<String> publishedFiles){
  if (publishedFiles != null) {
    for (    String path : publishedFiles) {
      File f=new File(path);
      if (f.exists()) {
        FileUtils.deleteFile(f);
      }
    }
  }
}
Program: 29101
Project: 29101
Buggy source:
public static void moveFile(String sourceFile,String destFile) throws IOException {
  FileUtils.copy(sourceFile,destFile);
  new File(sourceFile).delete();
}

Fixed version (ground truth):
public static void moveFile(String sourceFile,String destFile) throws IOException {
  FileUtils.copy(sourceFile,destFile);
  FileUtils.deleteFile(new File(sourceFile));
}
Program: 29102
Project: 29102
Buggy source:
private void dumpMessage(MessageTrace message,PrintWriter out) throws Exception {
  ByteArrayInputStream bais=new ByteArrayInputStream(message.getMessage(true).getBytes());
  StreamSource ss=new StreamSource(bais);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  StreamResult sr=new StreamResult(baos);
  TransformerFactory factory=TransformerFactory.newInstance();
  Transformer transformer=factory.newTransformer();
  transformer.setOutputProperty(OutputKeys.METHOD,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
  transformer.transform(ss,sr);
  out.print("String_Node_Str");
  String value=baos.toString();
  value=value.replaceAll("String_Node_Str","String_Node_Str");
  value=value.replaceAll("String_Node_Str","String_Node_Str");
  out.write(value);
  out.print("String_Node_Str");
}

Fixed version (ground truth):
private void dumpMessage(MessageTrace message,PrintWriter out) throws Exception {
  ByteArrayInputStream bais=new ByteArrayInputStream(message.getMessage(true).getBytes());
  StreamSource ss=new StreamSource(bais);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  StreamResult sr=new StreamResult(baos);
  TransformerFactory factory=TransformerFactory.newInstance();
  Transformer transformer=factory.newTransformer();
  transformer.setOutputProperty(OutputKeys.METHOD,"String_Node_Str");
  transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
  transformer.transform(ss,sr);
  out.print("String_Node_Str");
  out.write(encodeHTML(baos.toString()));
  out.print("String_Node_Str");
}
Program: 29104
Project: 29104
Buggy source:
private Set getPropertiesForCall(int methodType,Object args[]){
  Set callProperties=null;
switch (methodType) {
case CREATE_CALL_PORT:
case CREATE_CALL_OPERATION_QNAME:
case CREATE_CALL_OPERATION_STRING:
case GET_CALLS:
    QName port=(QName)args[0];
  ServiceRefPortInfo portInfo=serviceRef.getPortInfoByPort(port);
if (portInfo != null) {
  callProperties=portInfo.getCallProperties();
}
break;
case CREATE_CALL_NO_ARGS:
callProperties=serviceRef.getCallProperties();
break;
}
return callProperties;
}

Fixed version (ground truth):
private Set getPropertiesForCall(int methodType,Object args[]){
  Set callProperties=null;
switch (methodType) {
case CREATE_CALL_PORT:
case CREATE_CALL_OPERATION_QNAME:
case CREATE_CALL_OPERATION_STRING:
case GET_CALLS:
    QName port=(QName)args[0];
  ServiceRefPortInfo portInfo=serviceRef.getPortInfoByPort(port);
if (portInfo != null) {
  callProperties=portInfo.getCallProperties();
}
break;
case CREATE_CALL_NO_ARGS:
callProperties=serviceRef.getCallProperties();
break;
default :
break;
}
return callProperties;
}
Program: 29106
Project: 29106
Buggy source:
private Service getConfiguredServiceDelegate() throws Exception {
synchronized (this) {
    if (configuredServiceDelegate == null) {
      Service configuredService=wsUtil.createConfiguredService(serviceRef);
      wsUtil.configureHandlerChain(serviceRef,configuredService,configuredService.getPorts(),classLoader);
      configuredServiceDelegate=configuredService;
      addMessageSecurityHandler(configuredService);
    }
  }
  return configuredServiceDelegate;
}

Fixed version (ground truth):
private Service getConfiguredServiceDelegate() throws Exception {
  if (configuredServiceDelegate == null) {
    Service configuredService=wsUtil.createConfiguredService(serviceRef);
    wsUtil.configureHandlerChain(serviceRef,configuredService,configuredService.getPorts(),classLoader);
    configuredServiceDelegate=configuredService;
    addMessageSecurityHandler(configuredService);
  }
  return configuredServiceDelegate;
}
Program: 29107
Project: 29107
Buggy source:
@SuppressWarnings("String_Node_Str") private LinkedList<String> asList(final Iterator<Map.Entry<String,Entry>> mapEntries){
  return new LinkedList<String>(){
{
      while (mapEntries.hasNext()) {
        Map.Entry<String,Entry> mapEntry=mapEntries.next();
        add(mapEntry.getKey() + "String_Node_Str" + mapEntry.getValue());
      }
    }
  }
;
}

Fixed version (ground truth):
private LinkedList<String> asList(final Iterator<Map.Entry<String,Entry>> mapEntries){
  LinkedList<String> list=new LinkedList<String>();
  while (mapEntries.hasNext()) {
    Map.Entry<String,Entry> mapEntry=mapEntries.next();
    list.add(mapEntry.getKey() + "String_Node_Str" + mapEntry.getValue());
  }
  return list;
}
Program: 29108
Project: 29108
Buggy source:
private void receive(InputStream in,OriginatorFinder origFinder) throws IOException {
  ContextBootstrap.debug(MessageID.PROPAGATION_STARTED,"String_Node_Str");
  ContextAccessController accessController=ContextBootstrap.getContextAccessController();
  wireAdapter.prepareToReadFrom(in);
  SimpleMap map=getMapAndCreateIfNeeded();
  map.prepareToPropagate();
  for (String key=wireAdapter.readKey(); key != null; key=wireAdapter.readKey()) {
    try {
      Entry entry=wireAdapter.readEntry();
      if (entry == null)       break;
      entry.init(origFinder.isOriginator(key),accessController.isEveryoneAllowedToRead(key));
      if (entry != null)       map.put(key,entry);
    }
 catch (    ClassNotFoundException e) {
      ContextBootstrap.getLoggerAdapter().log(Level.ERROR,e,MessageID.ERROR_UNABLE_TO_INSTANTIATE_CONTEXT_FROM_THE_WIRE);
    }
  }
  for (  ContextLifecycle context : map.getAddedContextLifecycles()) {
    context.contextAdded();
  }
  ContextBootstrap.debug(MessageID.PROPAGATION_COMPLETED,"String_Node_Str");
}

Fixed version (ground truth):
private void receive(InputStream in,OriginatorFinder origFinder) throws IOException {
  ContextBootstrap.debug(MessageID.PROPAGATION_STARTED,"String_Node_Str");
  ContextAccessController accessController=ContextBootstrap.getContextAccessController();
  wireAdapter.prepareToReadFrom(in);
  SimpleMap map=getMapAndCreateIfNeeded();
  map.prepareToPropagate();
  for (String key=wireAdapter.readKey(); key != null; key=wireAdapter.readKey()) {
    try {
      Entry entry=wireAdapter.readEntry();
      if (entry == null) {
        break;
      }
 else {
        entry.init(origFinder.isOriginator(key),accessController.isEveryoneAllowedToRead(key));
        map.put(key,entry);
      }
    }
 catch (    ClassNotFoundException e) {
      ContextBootstrap.getLoggerAdapter().log(Level.ERROR,e,MessageID.ERROR_UNABLE_TO_INSTANTIATE_CONTEXT_FROM_THE_WIRE);
    }
  }
  for (  ContextLifecycle context : map.getAddedContextLifecycles()) {
    context.contextAdded();
  }
  ContextBootstrap.debug(MessageID.PROPAGATION_COMPLETED,"String_Node_Str");
}
Program: 29111
Project: 29111
Buggy source:
@Override protected void readHeader(ObjectInputStream ois,Catalog catalog) throws IOException {
  this.wlsCatalog=catalog;
}

Fixed version (ground truth):
@Override protected void readHeader(ObjectInputStream ois,Catalog catalog) throws IOException {
  wlsCatalog=catalog;
}
Program: 29112
Project: 29112
Buggy source:
private Object initiateInstance(Class svcClass,ServiceReferenceDescriptor desc) throws Exception {
  WsUtil wsu=new WsUtil();
  URL wsdlFile=wsu.privilegedGetServiceRefWsdl(desc);
  String genXmlDir;
  if (desc.getBundleDescriptor().getApplication() != null) {
    genXmlDir=desc.getBundleDescriptor().getApplication().getGeneratedXMLDirectory();
    if (!desc.getBundleDescriptor().getApplication().isVirtual()) {
      String subDirName=desc.getBundleDescriptor().getModuleDescriptor().getArchiveUri();
      genXmlDir+=(File.separator + subDirName.replaceAll("String_Node_Str","String_Node_Str"));
    }
  }
 else {
    genXmlDir=desc.getBundleDescriptor().getModuleDescriptor().getArchiveUri();
  }
  Object obj=null;
  java.lang.reflect.Constructor cons=svcClass.getConstructor(new Class[]{java.net.URL.class,javax.xml.namespace.QName.class});
  obj=cons.newInstance(wsdlFile,desc.getServiceName());
  return obj;
}

Fixed version (ground truth):
private Object initiateInstance(Class svcClass,ServiceReferenceDescriptor desc) throws Exception {
  WsUtil wsu=new WsUtil();
  URL wsdlFile=wsu.privilegedGetServiceRefWsdl(desc);
  Object obj=null;
  java.lang.reflect.Constructor cons=svcClass.getConstructor(new Class[]{java.net.URL.class,javax.xml.namespace.QName.class});
  obj=cons.newInstance(wsdlFile,desc.getServiceName());
  return obj;
}
Program: 29113
Project: 29113
Buggy source:
public void setMessageContext(SOAPMessageContext soapMessageCtx){
  hashcode=soapMessageCtx.hashCode();
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    soapMessageCtx.getMessage().writeTo(baos);
  }
 catch (  Exception e) {
    WebServiceEngineImpl.sLogger.log(Level.WARNING,"String_Node_Str" + e.getMessage());
  }
  soapMessage=baos.toString();
}

Fixed version (ground truth):
public void setMessageContext(SOAPMessageContext soapMessageCtx){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    soapMessageCtx.getMessage().writeTo(baos);
  }
 catch (  Exception e) {
    WebServiceEngineImpl.sLogger.log(Level.WARNING,"String_Node_Str" + e.getMessage());
  }
  soapMessage=baos.toString();
}
Program: 29115
Project: 29115
Buggy source:
private Properties getMergedValues(AdminObject adminObject,Properties mergedVals,String raName) throws ConnectorRuntimeException {
  Set ddVals=adminObject.getConfigProperties();
  String className=adminObject.getAdminObjectClass();
  if (className != null && className.length() != 0) {
    Properties introspectedVals=configParserUtil.introspectJavaBean(className,ddVals,false,raName);
    mergedVals=configParserUtil.mergeProps(ddVals,introspectedVals);
  }
  return mergedVals;
}

Fixed version (ground truth):
private Properties getMergedValues(AdminObject adminObject,String raName) throws ConnectorRuntimeException {
  Set ddVals=adminObject.getConfigProperties();
  String className=adminObject.getAdminObjectClass();
  Properties mergedVals=null;
  if (className != null && className.length() != 0) {
    Properties introspectedVals=configParserUtil.introspectJavaBean(className,ddVals,false,raName);
    mergedVals=configParserUtil.mergeProps(ddVals,introspectedVals);
  }
  return mergedVals;
}
Program: 29116
Project: 29116
Buggy source:
private void addPool(ResourcePool pool){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + pool.getPoolInfo() + "String_Node_Str");
  }
synchronized (poolTable) {
    poolTable.put(pool.getPoolStatus().getPoolInfo(),pool);
  }
}

Fixed version (ground truth):
private void addPool(ResourcePool pool){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + pool.getPoolInfo() + "String_Node_Str");
  }
  poolTable.put(pool.getPoolStatus().getPoolInfo(),pool);
}
Program: 29117
Project: 29117
Buggy source:
/** 
 * Kill the pool with the specified pool name
 * @param poolInfo - The name of the pool to kill
 */
public void killPool(PoolInfo poolInfo){
  ResourcePool pool=poolTable.get(poolInfo);
  if (pool != null) {
    pool.cancelResizerTask();
    pool.emptyPool();
    if (_logger.isLoggable(Level.FINE)) {
      _logger.fine("String_Node_Str" + pool + "String_Node_Str");
    }
synchronized (poolTable) {
      poolTable.remove(poolInfo);
    }
    if (listener != null) {
      listener.poolDestroyed(poolInfo);
    }
    ManagedConnectionFactory mcf=ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
    if (mcf != null) {
      if (mcf instanceof MCFLifecycleListener) {
        ((MCFLifecycleListener)mcf).mcfDestroyed();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Kill the pool with the specified pool name
 * @param poolInfo - The name of the pool to kill
 */
public void killPool(PoolInfo poolInfo){
  ResourcePool pool=poolTable.get(poolInfo);
  if (pool != null) {
    pool.cancelResizerTask();
    pool.emptyPool();
    if (_logger.isLoggable(Level.FINE)) {
      _logger.fine("String_Node_Str" + pool + "String_Node_Str");
    }
    poolTable.remove(poolInfo);
    if (listener != null) {
      listener.poolDestroyed(poolInfo);
    }
    ManagedConnectionFactory mcf=ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
    if (mcf != null) {
      if (mcf instanceof MCFLifecycleListener) {
        ((MCFLifecycleListener)mcf).mcfDestroyed();
      }
    }
  }
}
Program: 29118
Project: 29118
Buggy source:
/** 
 * Stop this Context component. destroy all the caches created and flush/clear the cached content
 * @exception LifecycleException if a shutdown error occurs
 */
public void stop() throws LifecycleException {
  disable();
  try {
    defaultHelper.destroy();
  }
 catch (  Exception e) {
  }
  Enumeration<CacheHelper> helpers=Collections.enumeration(cacheHelpers.values());
  while (helpers.hasMoreElements()) {
    CacheHelper cacheHelper=helpers.nextElement();
    try {
      cacheHelper.destroy();
    }
 catch (    Exception e) {
    }
  }
  cacheHelpers.clear();
  cacheMappings.clear();
  cacheHelpersByFilterName.clear();
  listeners.clear();
}

Fixed version (ground truth):
/** 
 * Stop this Context component. destroy all the caches created and flush/clear the cached content
 * @exception LifecycleException if a shutdown error occurs
 */
public void stop() throws LifecycleException {
  disable();
  try {
    if (defaultHelper != null) {
      defaultHelper.destroy();
    }
  }
 catch (  Exception e) {
  }
  Enumeration<CacheHelper> helpers=Collections.enumeration(cacheHelpers.values());
  while (helpers.hasMoreElements()) {
    CacheHelper cacheHelper=helpers.nextElement();
    try {
      cacheHelper.destroy();
    }
 catch (    Exception e) {
    }
  }
  cacheHelpers.clear();
  cacheMappings.clear();
  cacheHelpersByFilterName.clear();
  listeners.clear();
}
Program: 29119
Project: 29119
Buggy source:
/** 
 * cache-mapping for this servlet-name or the URLpattern
 * @param request incoming request
 * @return cache-mapping object; uses servlet name or the URL patternto lookup in the CacheManager for the mapping.
 */
private CacheMapping lookupCacheMapping(HttpServletRequest request){
  String name=(String)request.getAttribute(ATTR_CACHING_FILTER_NAME);
  return manager.getCacheMapping(name);
}

Fixed version (ground truth):
/** 
 * cache-mapping for this servlet-name or the URLpattern
 * @param request incoming request
 * @return cache-mapping object; uses servlet name or the URL patternto lookup in the CacheManager for the mapping.
 */
private CacheMapping lookupCacheMapping(HttpServletRequest request){
  String name=(String)request.getAttribute(ATTR_CACHING_FILTER_NAME);
  if (manager != null) {
    return manager.getCacheMapping(name);
  }
 else {
    return null;
  }
}
Program: 29123
Project: 29123
Buggy source:
/** 
 * Log a message summarizing the specified request and response, according to the format specified by the <code>pattern</code> property.
 * @param request Request being processed
 * @param response Response being processed
 */
public int invoke(Request request,Response response){
  if (formatter.needTimeTaken()) {
    request.setNote(Constants.REQUEST_START_TIME_NOTE,System.currentTimeMillis());
  }
  return INVOKE_NEXT;
}

Fixed version (ground truth):
/** 
 * Log a message summarizing the specified request and response, according to the format specified by the <code>pattern</code> property.
 * @param request Request being processed
 * @param response Response being processed
 */
public int invoke(Request request,Response response){
  if (formatter != null && formatter.needTimeTaken()) {
    request.setNote(Constants.REQUEST_START_TIME_NOTE,System.currentTimeMillis());
  }
  return INVOKE_NEXT;
}
Program: 29124
Project: 29124
Buggy source:
public void postInvoke(Request request,Response response) throws IOException {
  if (!started || condition != null && null != request.getRequest().getAttribute(condition)) {
    return;
  }
synchronized (lock) {
    if (charBuffer.position() == charBuffer.limit()) {
      charBuffer.limit(charBuffer.capacity());
    }
    int pos=charBuffer.position();
    for (int i=0; i < 2; i++) {
      try {
        formatter.appendLogEntry(request,response,charBuffer);
        charBuffer.put("String_Node_Str");
        if (flushRealTime) {
          log();
        }
        break;
      }
 catch (      BufferOverflowException ex) {
        charBuffer.position(pos);
        log();
        if (i + 1 == 2) {
          _logger.log(Level.SEVERE,ACCESS_LOG_UNABLE_TO_WRITE,new Object[]{ex});
          return;
        }
      }
    }
  }
}

Fixed version (ground truth):
public void postInvoke(Request request,Response response) throws IOException {
  if (!started || condition != null && null != request.getRequest().getAttribute(condition)) {
    return;
  }
synchronized (lock) {
    if (charBuffer.position() == charBuffer.limit()) {
      charBuffer.limit(charBuffer.capacity());
    }
    int pos=charBuffer.position();
    for (int i=0; i < 2; i++) {
      try {
        if (formatter != null) {
          formatter.appendLogEntry(request,response,charBuffer);
          charBuffer.put("String_Node_Str");
          if (flushRealTime) {
            log();
          }
          break;
        }
      }
 catch (      BufferOverflowException ex) {
        charBuffer.position(pos);
        log();
        if (i + 1 == 2) {
          _logger.log(Level.SEVERE,ACCESS_LOG_UNABLE_TO_WRITE,new Object[]{ex});
          return;
        }
      }
    }
  }
}
Program: 29125
Project: 29125
Buggy source:
/** 
 * Returns true if the archive contains beans.xml as defined by packaging rules of Weld 
 */
@Override public boolean handles(ReadableArchive archive){
  boolean isWeldArchive=false;
  if (isEntryPresent(archive,WeldUtils.WEB_INF)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.WEB_INF_BEANS_XML);
    if (!isWeldArchive) {
      if (isEntryPresent(archive,WeldUtils.WEB_INF_LIB)) {
        isWeldArchive=scanLibDir(archive,WeldUtils.WEB_INF_LIB);
      }
    }
  }
  String archiveName=archive.getName();
  if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_JAR_SUFFIX)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML);
  }
  if (!isWeldArchive && isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML)) {
    isWeldArchive=true;
  }
  if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_RAR_SUFFIX)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML);
  }
  return isWeldArchive;
}

Fixed version (ground truth):
/** 
 * Returns true if the archive contains beans.xml as defined by packaging rules of Weld 
 */
@Override public boolean handles(ReadableArchive archive){
  boolean isWeldArchive=false;
  if (isEntryPresent(archive,WeldUtils.WEB_INF)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.WEB_INF_BEANS_XML) || isEntryPresent(archive,WeldUtils.WEB_INF_CLASSES_META_INF_BEANS_XML);
    if (!isWeldArchive) {
      if (isEntryPresent(archive,WeldUtils.WEB_INF_LIB)) {
        isWeldArchive=scanLibDir(archive,WeldUtils.WEB_INF_LIB);
      }
    }
  }
  String archiveName=archive.getName();
  if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_JAR_SUFFIX)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML);
  }
  if (!isWeldArchive && isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML)) {
    isWeldArchive=true;
  }
  if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_RAR_SUFFIX)) {
    isWeldArchive=isEntryPresent(archive,WeldUtils.META_INF_BEANS_XML);
  }
  return isWeldArchive;
}
Program: 29127
Project: 29127
Buggy source:
@Override public void combineConnectorResourceDefinitionDescriptors(JndiNameEnvironment env){
  for (  ConnectorResourceDefinitionDescriptor crdd : env.getConnectorResourceDefinitionDescriptors()) {
    ConnectorResourceDefinitionDescriptor desc=getConnectorResourceDefinitionDescriptor(crdd.getName());
    if (desc != null) {
      if (desc.isConflict(crdd)) {
        conflictConnectorResourceDefinition=true;
      }
    }
 else {
      addConnectorResourceDefinitionDescriptor(null);
    }
  }
}

Fixed version (ground truth):
@Override public void combineConnectorResourceDefinitionDescriptors(JndiNameEnvironment env){
  for (  ConnectorResourceDefinitionDescriptor crdd : env.getConnectorResourceDefinitionDescriptors()) {
    ConnectorResourceDefinitionDescriptor desc=getConnectorResourceDefinitionDescriptor(crdd.getName());
    if (desc != null) {
      if (desc.isConflict(crdd)) {
        conflictConnectorResourceDefinition=true;
      }
    }
 else {
      addConnectorResourceDefinitionDescriptor(crdd);
    }
  }
}
Program: 29128
Project: 29128
Buggy source:
@Override public void combineJMSDestinationDefinitionDescriptors(JndiNameEnvironment env){
  for (  JMSDestinationDefinitionDescriptor jmsddd : env.getJMSDestinationDefinitionDescriptors()) {
    JMSDestinationDefinitionDescriptor desc=getJMSDestinationDefinitionDescriptor(jmsddd.getName());
    if (desc != null) {
      if (desc.isConflict(jmsddd)) {
        conflictJMSDestinationDefinition=true;
      }
    }
 else {
      addJMSDestinationDefinitionDescriptor(null);
    }
  }
}

Fixed version (ground truth):
@Override public void combineJMSDestinationDefinitionDescriptors(JndiNameEnvironment env){
  for (  JMSDestinationDefinitionDescriptor jmsddd : env.getJMSDestinationDefinitionDescriptors()) {
    JMSDestinationDefinitionDescriptor desc=getJMSDestinationDefinitionDescriptor(jmsddd.getName());
    if (desc != null) {
      if (desc.isConflict(jmsddd)) {
        conflictJMSDestinationDefinition=true;
      }
    }
 else {
      addJMSDestinationDefinitionDescriptor(jmsddd);
    }
  }
}
Program: 29129
Project: 29129
Buggy source:
@Override public void combineJMSConnectionFactoryDefinitionDescriptors(JndiNameEnvironment env){
  for (  JMSConnectionFactoryDefinitionDescriptor jmscfdd : env.getJMSConnectionFactoryDefinitionDescriptors()) {
    JMSConnectionFactoryDefinitionDescriptor desc=getJMSConnectionFactoryDefinitionDescriptor(jmscfdd.getName());
    if (desc != null) {
      if (desc.isConflict(jmscfdd)) {
        conflictJMSConnectionFactoryDefinition=true;
      }
    }
 else {
      addJMSConnectionFactoryDefinitionDescriptor(null);
    }
  }
}

Fixed version (ground truth):
@Override public void combineJMSConnectionFactoryDefinitionDescriptors(JndiNameEnvironment env){
  for (  JMSConnectionFactoryDefinitionDescriptor jmscfdd : env.getJMSConnectionFactoryDefinitionDescriptors()) {
    JMSConnectionFactoryDefinitionDescriptor desc=getJMSConnectionFactoryDefinitionDescriptor(jmscfdd.getName());
    if (desc != null) {
      if (desc.isConflict(jmscfdd)) {
        conflictJMSConnectionFactoryDefinition=true;
      }
    }
 else {
      addJMSConnectionFactoryDefinitionDescriptor(jmscfdd);
    }
  }
}
Program: 29130
Project: 29130
Buggy source:
@Override public void combineAdministeredObjectDefinitionDescriptors(JndiNameEnvironment env){
  for (  AdministeredObjectDefinitionDescriptor aodd : env.getAdministeredObjectDefinitionDescriptors()) {
    AdministeredObjectDefinitionDescriptor desc=getAdministeredObjectDefinitionDescriptor(aodd.getName());
    if (desc != null) {
      if (desc.isConflict(aodd)) {
        conflictAdminObjectDefinition=true;
      }
    }
 else {
      addAdministeredObjectDefinitionDescriptor(desc);
    }
  }
}

Fixed version (ground truth):
@Override public void combineAdministeredObjectDefinitionDescriptors(JndiNameEnvironment env){
  for (  AdministeredObjectDefinitionDescriptor aodd : env.getAdministeredObjectDefinitionDescriptors()) {
    AdministeredObjectDefinitionDescriptor desc=getAdministeredObjectDefinitionDescriptor(aodd.getName());
    if (desc != null) {
      if (desc.isConflict(aodd)) {
        conflictAdminObjectDefinition=true;
      }
    }
 else {
      addAdministeredObjectDefinitionDescriptor(aodd);
    }
  }
}
Program: 29132
Project: 29132
Buggy source:
/** 
 * Customized <code>ContextConfig</code> which use the DOL for deployment.
 */
public WebModuleContextConfig(){
}

Fixed version (ground truth):
/** 
 * Customized <code>ContextConfig</code> which use the DOL for deployment.
 */
public WebModuleContextConfig(Habitat services){
synchronized (this) {
    this.services=services;
  }
}
Program: 29133
Project: 29133
Buggy source:
/** 
 * Get a boolean from the caller's package's LocalStrings.properties
 * @param indexString The string index into the localized string file
 * @return the integer value from LocalStrings or the supplied default if it doesn't exist or is bad.
 */
public boolean getBoolean(String indexString,boolean defaultValue){
  try {
    return new Boolean(getBundle().getString(indexString));
  }
 catch (  Exception e) {
    return defaultValue;
  }
}

Fixed version (ground truth):
/** 
 * Get a boolean from the caller's package's LocalStrings.properties
 * @param indexString The string index into the localized string file
 * @return the integer value from LocalStrings or the supplied default if it doesn't exist or is bad.
 */
public boolean getBoolean(String indexString,boolean defaultValue){
  try {
    return Boolean.valueOf(getBundle().getString(indexString));
  }
 catch (  Exception e) {
    return defaultValue;
  }
}
Program: 29134
Project: 29134
Buggy source:
final static public Map<Integer,String> getProcessTable(){
  return new Jps().pidMap;
}

Fixed version (ground truth):
static public Map<Integer,String> getProcessTable(){
  return new Jps().pidMap;
}
Program: 29135
Project: 29135
Buggy source:
/** 
 * return the platform-specific process-id of a JVM
 * @param mainClassName The main class - this is how we identify the right JVM.  You can pass in a fully-qualified name or just the classname. E.g. com.sun.enterprise.glassfish.bootstrap.ASMain and ASMain work the same.
 * @return the process id if possible otherwise 0
 */
final static public List<Integer> getPid(String mainClassName){
  if (mainClassName == null)   return Collections.emptyList();
  String plainName=plainClassName(mainClassName);
  Jps jps=new Jps();
  List<Integer> ints=new LinkedList<Integer>();
  Set<Map.Entry<Integer,String>> set=jps.pidMap.entrySet();
  Iterator<Map.Entry<Integer,String>> it=set.iterator();
  while (it.hasNext()) {
    Map.Entry<Integer,String> entry=it.next();
    String valueFull=entry.getValue();
    String valuePlain=plainClassName(valueFull);
    if (mainClassName.equals(valueFull) || plainName.equals(valuePlain))     ints.add(entry.getKey());
  }
  return ints;
}

Fixed version (ground truth):
/** 
 * return the platform-specific process-id of a JVM
 * @param mainClassName The main class - this is how we identify the right JVM.  You can pass in a fully-qualified name or just the classname. E.g. com.sun.enterprise.glassfish.bootstrap.ASMain and ASMain work the same.
 * @return the process id if possible otherwise 0
 */
static public List<Integer> getPid(String mainClassName){
  if (mainClassName == null)   return Collections.emptyList();
  String plainName=plainClassName(mainClassName);
  Jps jps=new Jps();
  List<Integer> ints=new LinkedList<Integer>();
  Set<Map.Entry<Integer,String>> set=jps.pidMap.entrySet();
  Iterator<Map.Entry<Integer,String>> it=set.iterator();
  while (it.hasNext()) {
    Map.Entry<Integer,String> entry=it.next();
    String valueFull=entry.getValue();
    String valuePlain=plainClassName(valueFull);
    if (mainClassName.equals(valueFull) || plainName.equals(valuePlain))     ints.add(entry.getKey());
  }
  return ints;
}
Program: 29136
Project: 29136
Buggy source:
private void waitForever() throws InterruptedException {
  process.waitFor();
}

Fixed version (ground truth):
private void waitForever() throws InterruptedException, ProcessManagerException {
  if (process == null)   throw new ProcessManagerException(Strings.get("String_Node_Str"));
  process.waitFor();
}
Program: 29137
Project: 29137
Buggy source:
private void writeStdin() throws ProcessManagerException {
  if (stdinLines == null || stdinLines.length <= 0) {
    return;
  }
  PrintWriter pipe=null;
  try {
    pipe=new PrintWriter(new BufferedWriter(new OutputStreamWriter(process.getOutputStream())));
    for (int i=0; i < stdinLines.length; i++) {
      debug("String_Node_Str" + stdinLines[i] + "String_Node_Str");
      pipe.println(stdinLines[i]);
    }
    pipe.flush();
  }
 catch (  Exception e) {
    throw new ProcessManagerException(e);
  }
 finally {
    try {
      pipe.close();
    }
 catch (    Throwable t) {
    }
  }
}

Fixed version (ground truth):
private void writeStdin() throws ProcessManagerException {
  if (stdinLines == null || stdinLines.length <= 0) {
    return;
  }
  PrintWriter pipe=null;
  if (process == null)   throw new ProcessManagerException(Strings.get("String_Node_Str"));
  try {
    pipe=new PrintWriter(new BufferedWriter(new OutputStreamWriter(process.getOutputStream())));
    for (int i=0; i < stdinLines.length; i++) {
      debug("String_Node_Str" + stdinLines[i] + "String_Node_Str");
      pipe.println(stdinLines[i]);
    }
    pipe.flush();
  }
 catch (  Exception e) {
    throw new ProcessManagerException(e);
  }
 finally {
    try {
      pipe.close();
    }
 catch (    Throwable t) {
    }
  }
}
Program: 29138
Project: 29138
Buggy source:
public void run(){
  try {
    process.waitFor();
  }
 catch (  Exception e) {
  }
  ProcessManager.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  try {
    process.waitFor();
  }
 catch (  Exception e) {
  }
  ProcessManager.debug("String_Node_Str");
}
Program: 29139
Project: 29139
Buggy source:
public final int execute() throws ProcessManagerException {
  try {
    sb_out=new StringBuffer();
    sb_err=new StringBuffer();
    Runtime rt=Runtime.getRuntime();
    process=rt.exec(cmdline);
    readStream("String_Node_Str",process.getErrorStream(),sb_err);
    readStream("String_Node_Str",process.getInputStream(),sb_out);
    writeStdin();
    await();
    try {
      exit=process.exitValue();
    }
 catch (    IllegalThreadStateException tse) {
      process.destroy();
      throw new ProcessManagerTimeoutException(tse);
    }
  }
 catch (  ProcessManagerException pme) {
    throw pme;
  }
catch (  Exception e) {
    if (process != null) {
      process.destroy();
    }
    throw new ProcessManagerException(e);
  }
 finally {
    doWaitForReaderThreads();
  }
  return exit;
}

Fixed version (ground truth):
public final int execute() throws ProcessManagerException {
  try {
    Runtime rt=Runtime.getRuntime();
    process=rt.exec(cmdline);
    readStream("String_Node_Str",process.getErrorStream(),sb_err);
    readStream("String_Node_Str",process.getInputStream(),sb_out);
    writeStdin();
    await();
    try {
      exit=process.exitValue();
    }
 catch (    IllegalThreadStateException tse) {
      process.destroy();
      throw new ProcessManagerTimeoutException(tse);
    }
  }
 catch (  ProcessManagerException pme) {
    throw pme;
  }
catch (  Exception e) {
    if (process != null) {
      process.destroy();
    }
    throw new ProcessManagerException(e);
  }
 finally {
    doWaitForReaderThreads();
  }
  return exit;
}
Program: 29140
Project: 29140
Buggy source:
private void await() throws InterruptedException {
  if (timeout <= 0) {
    waitForever();
  }
 else {
    waitAwhile();
  }
}

Fixed version (ground truth):
private void await() throws InterruptedException, ProcessManagerException {
  if (timeout <= 0) {
    waitForever();
  }
 else {
    waitAwhile();
  }
}
Program: 29141
Project: 29141
Buggy source:
public String toString(){
  return Arrays.toString(cmdline);
}

Fixed version (ground truth):
@Override public String toString(){
  return Arrays.toString(cmdline);
}
Program: 29142
Project: 29142
Buggy source:
public ProcessManager(List<String> Cmdline){
  cmdline=new String[Cmdline.size()];
  cmdline=(String[])Cmdline.toArray(cmdline);
}

Fixed version (ground truth):
public ProcessManager(List<String> Cmdline){
  cmdline=new String[Cmdline.size()];
  cmdline=(String[])Cmdline.toArray(cmdline);
  sb_out=new StringBuffer();
  sb_err=new StringBuffer();
}
Program: 29143
Project: 29143
Buggy source:
private Map<String,Map<String,Object>> gatherReferencedAttributes(AttributeReference ar){
  Map<String,Map<String,Object>> annos=new HashMap<String,Map<String,Object>>();
  try {
    Class<?> configBeanClass=Class.forName(ar.configBean());
    Method m=configBeanClass.getMethod(ar.methodName());
    for (    Annotation a : m.getAnnotations()) {
      Map<String,Object> anno=new HashMap<String,Object>();
      for (      Method am : a.annotationType().getDeclaredMethods()) {
        String methodName=am.getName();
        Object value=am.invoke(a);
        anno.put(methodName,value);
      }
      annos.put(a.annotationType().getName(),anno);
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(CompositeUtil.class.getName()).log(Level.SEVERE,null,ex.getLocalizedMessage());
  }
  return annos;
}

Fixed version (ground truth):
private Map<String,Map<String,Object>> gatherReferencedAttributes(AttributeReference ar){
  Map<String,Map<String,Object>> annos=new HashMap<String,Map<String,Object>>();
  try {
    Class<?> configBeanClass=Class.forName(ar.configBean());
    Method m=configBeanClass.getMethod(ar.methodName());
    for (    Annotation a : m.getAnnotations()) {
      Map<String,Object> anno=new HashMap<String,Object>();
      for (      Method am : a.annotationType().getDeclaredMethods()) {
        String methodName=am.getName();
        Object value=am.invoke(a);
        anno.put(methodName,value);
      }
      annos.put(a.annotationType().getName(),anno);
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(CompositeUtil.class.getName()).log(Level.SEVERE,ex.getLocalizedMessage());
  }
  return annos;
}
Program: 29144
Project: 29144
Buggy source:
/** 
 * This method will process the annotations for a field to try to determine the default value, if one has been specified.
 * @param annos
 * @return
 */
private Object getDefaultValue(Annotation[] annos){
  Object defval=null;
  if (annos != null) {
    for (    Annotation annotation : annos) {
      if (Default.class.isAssignableFrom(annotation.getClass())) {
        try {
          Default def=(Default)annotation;
          Class clazz=def.generator();
          if (def.useContext()) {
            defval=((DefaultsGenerator)context).getDefaultValue(name);
          }
 else           if (clazz != null) {
            if (DefaultsGenerator.class.isAssignableFrom(clazz)) {
              defval=((DefaultsGenerator)clazz.newInstance()).getDefaultValue(name);
            }
 else {
              Logger.getLogger(ParamMetadata.class.getName()).log(Level.SEVERE,null,"String_Node_Str");
            }
          }
 else {
            defval=parseValue(def.value());
          }
          break;
        }
 catch (        Exception ex) {
          Logger.getLogger(ParamMetadata.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
 else       if (Attribute.class.isAssignableFrom(annotation.getClass())) {
        Attribute attr=(Attribute)annotation;
        defval=attr.defaultValue();
        break;
      }
    }
  }
  return defval;
}

Fixed version (ground truth):
/** 
 * This method will process the annotations for a field to try to determine the default value, if one has been specified.
 * @param annos
 * @return
 */
private Object getDefaultValue(Annotation[] annos){
  Object defval=null;
  if (annos != null) {
    for (    Annotation annotation : annos) {
      if (Default.class.isAssignableFrom(annotation.getClass())) {
        try {
          Default def=(Default)annotation;
          Class clazz=def.generator();
          if (def.useContext()) {
            defval=((DefaultsGenerator)context).getDefaultValue(name);
          }
 else           if (clazz != null && clazz != Void.class) {
            if (DefaultsGenerator.class.isAssignableFrom(clazz)) {
              defval=((DefaultsGenerator)clazz.newInstance()).getDefaultValue(name);
            }
 else {
              Logger.getLogger(ParamMetadata.class.getName()).log(Level.SEVERE,null,"String_Node_Str");
            }
          }
 else {
            defval=parseValue(def.value());
          }
          break;
        }
 catch (        Exception ex) {
          Logger.getLogger(ParamMetadata.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
 else       if (Attribute.class.isAssignableFrom(annotation.getClass())) {
        Attribute attr=(Attribute)annotation;
        defval=attr.defaultValue();
        break;
      }
    }
  }
  return defval;
}