nus-yam/ex-repair huggingface dataset:
Program: 28845
Project: 28845
Buggy source:
/** 
 * Extracts the named jar file from the ear.
 * @param jarEntryName name of the jar file
 * @param earFile application archive
 * @param jarFile locaton of the jar file where the jar entry will beextracted
 * @return the named jar file from the ear
 * @exception ZipFileException if an error while extracting the jar
 */
public static void extractJar(String jarEntryName,JarFile earFile,File jarFile) throws ZipFileException {
  try {
    File parent=jarFile.getParentFile();
    if (!parent.exists()) {
      parent.mkdirs();
    }
    ZipEntry jarEntry=earFile.getEntry(jarEntryName);
    if (jarEntryName == null) {
      throw new ZipFileException(jarEntryName + "String_Node_Str" + earFile.getName());
    }
    InputStream is=earFile.getInputStream(jarEntry);
    FileOutputStream fos=new FileOutputStream(jarFile);
    FileUtils.copy(is,fos,jarEntry.getSize());
  }
 catch (  IOException e) {
    throw new ZipFileException(e);
  }
}

Fixed version (ground truth):
/** 
 * Extracts the named jar file from the ear.
 * @param jarEntryName name of the jar file
 * @param earFile application archive
 * @param jarFile locaton of the jar file where the jar entry will beextracted
 * @return the named jar file from the ear
 * @exception ZipFileException if an error while extracting the jar
 */
public static void extractJar(String jarEntryName,JarFile earFile,File jarFile) throws ZipFileException {
  try {
    File parent=jarFile.getParentFile();
    if (!parent.exists()) {
      if (!parent.mkdirs()) {
        throw new ZipFileException("String_Node_Str" + parent);
      }
    }
    ZipEntry jarEntry=earFile.getEntry(jarEntryName);
    if (jarEntry == null) {
      throw new ZipFileException(jarEntryName + "String_Node_Str" + earFile.getName());
    }
    InputStream is=earFile.getInputStream(jarEntry);
    FileOutputStream fos=new FileOutputStream(jarFile);
    FileUtils.copy(is,fos,jarEntry.getSize());
  }
 catch (  IOException e) {
    throw new ZipFileException(e);
  }
}
Program: 28847
Project: 28847
Buggy source:
private void checkExplodeDir() throws ZipFileException {
  String explodeDirName=explodeDir.getPath();
  explodeDir.mkdirs();
  insist(explodeDir.exists(),"String_Node_Str" + explodeDirName);
  insist(explodeDir.isDirectory(),"String_Node_Str" + explodeDirName);
  insist(explodeDir.canWrite(),"String_Node_Str" + explodeDirName);
}

Fixed version (ground truth):
private void checkExplodeDir() throws ZipFileException {
  String explodeDirName=explodeDir.getPath();
  insist(explodeDir.mkdirs(),"String_Node_Str" + explodeDirName);
  insist(explodeDir.exists(),"String_Node_Str" + explodeDirName);
  insist(explodeDir.isDirectory(),"String_Node_Str" + explodeDirName);
  insist(explodeDir.canWrite(),"String_Node_Str" + explodeDirName);
}
Program: 28848
Project: 28848
Buggy source:
private String readDeploymentConfig(final InputStream is) throws IOException {
  String encoding=null;
  XMLEventReader rdr=null;
  try {
    is.mark(Integer.MAX_VALUE);
    rdr=xmlInputFactory.createXMLEventReader(new InputStreamReader(is));
    while (rdr.hasNext()) {
      final XMLEvent ev=rdr.nextEvent();
      if (ev.isStartDocument()) {
        final StartDocument sd=(StartDocument)ev;
        encoding=sd.getCharacterEncodingScheme();
        rdr.close();
        break;
      }
    }
  }
 catch (  XMLStreamException e) {
    if (rdr != null) {
      try {
        rdr.close();
      }
 catch (      XMLStreamException inner) {
        throw new IOException(e);
      }
    }
    throw new IOException(e);
  }
  if (encoding == null) {
    encoding="String_Node_Str";
  }
  is.reset();
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  int bytesRead;
  final byte[] buffer=new byte[1024];
  while ((bytesRead=is.read(buffer)) != -1) {
    baos.write(buffer,0,bytesRead);
  }
  try {
    rdr.close();
  }
 catch (  XMLStreamException ex) {
    throw new IOException(ex);
  }
  is.close();
  return new String(baos.toByteArray(),encoding);
}

Fixed version (ground truth):
private String readDeploymentConfig(final InputStream is) throws IOException {
  String encoding=null;
  XMLEventReader rdr=null;
  try {
    is.mark(Integer.MAX_VALUE);
    rdr=xmlInputFactory.createXMLEventReader(new InputStreamReader(is));
    while (rdr.hasNext()) {
      final XMLEvent ev=rdr.nextEvent();
      if (ev.isStartDocument()) {
        final StartDocument sd=(StartDocument)ev;
        encoding=sd.getCharacterEncodingScheme();
        break;
      }
    }
  }
 catch (  XMLStreamException e) {
    if (rdr != null) {
      try {
        rdr.close();
      }
 catch (      XMLStreamException inner) {
        throw new IOException(e);
      }
    }
    throw new IOException(e);
  }
  if (encoding == null) {
    encoding="String_Node_Str";
  }
  is.reset();
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  int bytesRead;
  final byte[] buffer=new byte[1024];
  while ((bytesRead=is.read(buffer)) != -1) {
    baos.write(buffer,0,bytesRead);
  }
  try {
    rdr.close();
  }
 catch (  XMLStreamException ex) {
    throw new IOException(ex);
  }
  is.close();
  return new String(baos.toByteArray(),encoding);
}
Program: 28850
Project: 28850
Buggy source:
public java.lang.Object run() throws Exception {
  ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
  PolicyContext.setContextID(null);
  return null;
}

Fixed version (ground truth):
public Object run() throws Exception {
  ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
  PolicyContext.setContextID(null);
  return null;
}
Program: 28851
Project: 28851
Buggy source:
/** 
 * This method is similiar to the runMethod, except it keeps the semantics same as the one in reflection. On failure, if the exception is caused due to reflection, it returns the InvocationTargetException.  This method is called from the containers for ejbTimeout, WebService and MDBs.
 * @param beanClassMethod, the bean class method to be invoked
 * @param isLocal,         true if this invocation is through the local EJB view
 * @param o                the object on which this method is to beinvoked in this case the ejb,
 * @param oa               the parameters for the method,
 * @param c,               the container instancecan be a null value, where in the container will be queried to find its security manager.
 * @return Object, the result of the execution of the method.
 */
public Object invoke(Method beanClassMethod,boolean isLocal,Object o,Object[] oa) throws Throwable {
  final Method meth=beanClassMethod;
  final Object obj=o;
  final Object[] objArr=oa;
  Object ret=null;
  if ((isLocal && this.getUsesCallerIdentity()) || System.getSecurityManager() == null) {
    ret=this.runMethod(meth,obj,objArr);
  }
 else {
    PrivilegedExceptionAction pea=new PrivilegedExceptionAction(){
      public java.lang.Object run() throws Exception {
        return meth.invoke(obj,objArr);
      }
    }
;
    try {
      ret=this.doAsPrivileged(pea);
    }
 catch (    PrivilegedActionException pae) {
      Throwable cause=pae.getCause();
      throw cause;
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * This method is similiar to the runMethod, except it keeps the semantics same as the one in reflection. On failure, if the exception is caused due to reflection, it returns the InvocationTargetException.  This method is called from the containers for ejbTimeout, WebService and MDBs.
 * @param beanClassMethod, the bean class method to be invoked
 * @param isLocal,         true if this invocation is through the local EJB view
 * @param o                the object on which this method is to beinvoked in this case the ejb,
 * @param oa               the parameters for the method,
 * @param c,               the container instancecan be a null value, where in the container will be queried to find its security manager.
 * @return Object, the result of the execution of the method.
 */
public Object invoke(Method beanClassMethod,boolean isLocal,Object o,Object[] oa) throws Throwable {
  final Method meth=beanClassMethod;
  final Object obj=o;
  final Object[] objArr=oa;
  Object ret=null;
  if ((isLocal && this.getUsesCallerIdentity()) || System.getSecurityManager() == null) {
    ret=this.runMethod(meth,obj,objArr);
  }
 else {
    PrivilegedExceptionAction pea=new PrivilegedExceptionAction(){
      public Object run() throws Exception {
        return meth.invoke(obj,objArr);
      }
    }
;
    try {
      ret=this.doAsPrivileged(pea);
    }
 catch (    PrivilegedActionException pae) {
      Throwable cause=pae.getCause();
      throw cause;
    }
  }
  return ret;
}
Program: 28852
Project: 28852
Buggy source:
/** 
 * This method iniitalizes the EJBSecurityManager
 */
public EJBSecurityManager(EjbDescriptor ejbDescriptor,InvocationManager invMgr,EJBSecurityManagerFactory fact) throws Exception {
  this.deploymentDescriptor=(EjbDescriptor)ejbDescriptor;
  this.invMgr=invMgr;
  roleMapperFactory=Globals.get(SecurityRoleMapperFactory.class);
  policy=Policy.getPolicy();
  ejbSFM=fact;
  boolean runas=!(deploymentDescriptor.getUsesCallerIdentity());
  if (runas) {
    runAs=deploymentDescriptor.getRunAsIdentity();
    if (runAs != null) {
      if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE,deploymentDescriptor.getEjbClassName() + "String_Node_Str" + runAs.getPrincipal()+ "String_Node_Str"+ runAs.getRoleName()+ "String_Node_Str");
      }
    }
  }
 else {
    runAs=null;
  }
  initialize();
}

Fixed version (ground truth):
public EJBSecurityManager(EjbDescriptor ejbDescriptor,InvocationManager invMgr,EJBSecurityManagerFactory fact) throws Exception {
  this.deploymentDescriptor=(EjbDescriptor)ejbDescriptor;
  this.invMgr=invMgr;
  roleMapperFactory=Globals.get(SecurityRoleMapperFactory.class);
  policy=Policy.getPolicy();
  ejbSFM=fact;
  boolean runas=!(deploymentDescriptor.getUsesCallerIdentity());
  if (runas) {
    runAs=deploymentDescriptor.getRunAsIdentity();
    if (runAs != null) {
      if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE,deploymentDescriptor.getEjbClassName() + "String_Node_Str" + runAs.getPrincipal()+ "String_Node_Str"+ runAs.getRoleName()+ "String_Node_Str");
      }
    }
  }
 else {
    runAs=null;
  }
  initialize();
}
Program: 28853
Project: 28853
Buggy source:
public Object doAsPrivileged(PrivilegedExceptionAction pea) throws Throwable {
  SecurityContext sc=SecurityContext.getCurrent();
  Set principalSet=sc.getPrincipalSet();
  AccessControlContext acc=(AccessControlContext)accessControlContextCache.get(principalSet);
  if (acc == null) {
    final ProtectionDomain[] pdArray=new ProtectionDomain[1];
    pdArray[0]=getCachedProtectionDomain(principalSet,false);
    try {
      if (principalSet != null) {
        final Subject s=sc.getSubject();
        acc=(AccessControlContext)AccessController.doPrivileged(new PrivilegedExceptionAction(){
          public java.lang.Object run() throws Exception {
            return new AccessControlContext(new AccessControlContext(pdArray),new SubjectDomainCombiner(s));
          }
        }
);
      }
 else {
        acc=new AccessControlContext(pdArray);
      }
      if (principalSet != null) {
        accessControlContextCache.put(new HashSet(principalSet),acc);
      }
      _logger.fine("String_Node_Str");
    }
 catch (    Exception e) {
      _logger.log(Level.SEVERE,"String_Node_Str",e);
      acc=null;
      throw e;
    }
  }
  Object rvalue=null;
  String oldContextId=setPolicyContext(this.contextId);
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + this.contextId + "String_Node_Str");
  }
  try {
    rvalue=AccessController.doPrivileged(pea,acc);
  }
  finally {
    resetPolicyContext(oldContextId,this.contextId);
  }
  return rvalue;
}

Fixed version (ground truth):
public Object doAsPrivileged(PrivilegedExceptionAction pea) throws Throwable {
  SecurityContext sc=SecurityContext.getCurrent();
  Set principalSet=sc.getPrincipalSet();
  AccessControlContext acc=(AccessControlContext)accessControlContextCache.get(principalSet);
  if (acc == null) {
    final ProtectionDomain[] pdArray=new ProtectionDomain[1];
    pdArray[0]=getCachedProtectionDomain(principalSet,false);
    try {
      if (principalSet != null) {
        final Subject s=sc.getSubject();
        acc=(AccessControlContext)AccessController.doPrivileged(new PrivilegedExceptionAction(){
          public Object run() throws Exception {
            return new AccessControlContext(new AccessControlContext(pdArray),new SubjectDomainCombiner(s));
          }
        }
);
      }
 else {
        acc=new AccessControlContext(pdArray);
      }
      if (principalSet != null) {
        accessControlContextCache.put(new HashSet(principalSet),acc);
      }
      _logger.fine("String_Node_Str");
    }
 catch (    Exception e) {
      _logger.log(Level.SEVERE,"String_Node_Str",e);
      acc=null;
      throw e;
    }
  }
  Object rvalue=null;
  String oldContextId=setPolicyContext(this.contextId);
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + this.contextId + "String_Node_Str");
  }
  try {
    rvalue=AccessController.doPrivileged(pea,acc);
  }
  finally {
    resetPolicyContext(oldContextId,this.contextId);
  }
  return rvalue;
}
Program: 28854
Project: 28854
Buggy source:
@Override public void resetPolicyContext(){
  if (System.getSecurityManager() == null) {
    ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
    PolicyContext.setContextID(null);
    return;
  }
  try {
    AppservAccessController.doPrivileged(new PrivilegedExceptionAction(){
      public java.lang.Object run() throws Exception {
        ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
        PolicyContext.setContextID(null);
        return null;
      }
    }
);
  }
 catch (  java.security.PrivilegedActionException pae) {
    Throwable cause=pae.getCause();
    if (cause instanceof java.security.AccessControlException) {
      _logger.log(Level.SEVERE,"String_Node_Str",cause);
    }
 else {
      _logger.log(Level.SEVERE,"String_Node_Str",cause);
    }
    throw new RuntimeException(cause);
  }
}

Fixed version (ground truth):
@Override public void resetPolicyContext(){
  if (System.getSecurityManager() == null) {
    ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
    PolicyContext.setContextID(null);
    return;
  }
  try {
    AppservAccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws Exception {
        ((PolicyContextHandlerImpl)PolicyContextHandlerImpl.getInstance()).reset();
        PolicyContext.setContextID(null);
        return null;
      }
    }
);
  }
 catch (  PrivilegedActionException pae) {
    Throwable cause=pae.getCause();
    if (cause instanceof java.security.AccessControlException) {
      _logger.log(Level.SEVERE,"String_Node_Str",cause);
    }
 else {
      _logger.log(Level.SEVERE,"String_Node_Str",cause);
    }
    throw new RuntimeException(cause);
  }
}
Program: 28855
Project: 28855
Buggy source:
/** 
 * Runs a business method of an EJB withint the bean's policy context. The original policy context is restored after method execution. This method should only be used by com.sun.enterprise.security.SecurityUtil.
 * @param beanClassMethod the EJB business method
 * @param obj             the EJB bean instance
 * @param oa              parameters passed to beanClassMethod
 * @return return value from beanClassMethod
 * @throws java.lang.reflect.InvocationTargetException if the underlying method throws an exception
 * @throws Throwable                 other throwables in other cases
 */
public Object runMethod(Method beanClassMethod,Object obj,Object[] oa) throws Throwable {
  String oldCtxID=setPolicyContext(this.contextId);
  Object ret=null;
  try {
    ret=beanClassMethod.invoke(obj,oa);
  }
  finally {
    resetPolicyContext(oldCtxID,this.contextId);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Runs a business method of an EJB within the bean's policy context. The original policy context is restored after method execution. This method should only be used by com.sun.enterprise.security.SecurityUtil.
 * @param beanClassMethod the EJB business method
 * @param obj             the EJB bean instance
 * @param oa              parameters passed to beanClassMethod
 * @return return value from beanClassMethod
 * @throws java.lang.reflect.InvocationTargetException if the underlying method throws an exception
 * @throws Throwable                 other throwables in other cases
 */
public Object runMethod(Method beanClassMethod,Object obj,Object[] oa) throws Throwable {
  String oldCtxID=setPolicyContext(this.contextId);
  Object ret=null;
  try {
    ret=beanClassMethod.invoke(obj,oa);
  }
  finally {
    resetPolicyContext(oldCtxID,this.contextId);
  }
  return ret;
}
Program: 28856
Project: 28856
Buggy source:
private void initialize() throws Exception {
  if (ejbStatsProvider == null) {
synchronized (EjbSecurityStatsProvider.class) {
      if (ejbStatsProvider == null) {
        ejbStatsProvider=new EjbSecurityStatsProvider();
        StatsProviderManager.register("String_Node_Str",PluginPoint.SERVER,"String_Node_Str",ejbStatsProvider);
      }
    }
  }
  contextId=getContextID(deploymentDescriptor);
  String appName=deploymentDescriptor.getApplication().getRegistrationName();
  roleMapperFactory.setAppNameForContext(appName,contextId);
  codesource=getApplicationCodeSource(contextId);
  ejbName=deploymentDescriptor.getName();
  realmName=deploymentDescriptor.getApplication().getRealm();
  if (realmName == null) {
    Set iorConfigs=deploymentDescriptor.getIORConfigurationDescriptors();
    Iterator iter=iorConfigs.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        EjbIORConfigurationDescriptor iorConfig=(EjbIORConfigurationDescriptor)iter.next();
        realmName=iorConfig.getRealmName();
      }
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + contextId);
    _logger.fine("String_Node_Str" + ejbName + "String_Node_Str"+ codebase);
  }
  loadPolicyConfiguration(deploymentDescriptor);
  uncheckedMethodPermissionCache=PermissionCacheFactory.createPermissionCache(this.contextId,this.codesource,EJBMethodPermission.class,this.ejbName);
  auditManager=this.ejbSFM.getAuditManager();
}

Fixed version (ground truth):
private void initialize() throws Exception {
  if (ejbStatsProvider == null) {
synchronized (EjbSecurityStatsProvider.class) {
      if (ejbStatsProvider == null) {
        ejbStatsProvider=new EjbSecurityStatsProvider();
        StatsProviderManager.register("String_Node_Str",PluginPoint.SERVER,"String_Node_Str",ejbStatsProvider);
      }
    }
  }
  contextId=getContextID(deploymentDescriptor);
  String appName=deploymentDescriptor.getApplication().getRegistrationName();
  roleMapperFactory.setAppNameForContext(appName,contextId);
  codesource=getApplicationCodeSource(contextId);
  ejbName=deploymentDescriptor.getName();
  realmName=deploymentDescriptor.getApplication().getRealm();
  if (realmName == null) {
    Set<EjbIORConfigurationDescriptor> iorConfigs=deploymentDescriptor.getIORConfigurationDescriptors();
    Iterator<EjbIORConfigurationDescriptor> iter=iorConfigs.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        realmName=iter.next().getRealmName();
      }
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + contextId);
    _logger.fine("String_Node_Str" + ejbName + "String_Node_Str"+ codebase);
  }
  loadPolicyConfiguration(deploymentDescriptor);
  uncheckedMethodPermissionCache=PermissionCacheFactory.createPermissionCache(this.contextId,this.codesource,EJBMethodPermission.class,this.ejbName);
  auditManager=this.ejbSFM.getAuditManager();
}
Program: 28857
Project: 28857
Buggy source:
public void afterPostInvoke(ComponentInvocationType invType,ComponentInvocation prevInv,ComponentInvocation curInv) throws InvocationException {
  if (invType == ComponentInvocationType.EJB_INVOCATION) {
    try {
      ((EjbInvocation)curInv).getEjbSecurityManager().postInvoke(curInv);
    }
 catch (    Exception ex) {
      _logger.log(Level.SEVERE,"String_Node_Str",ex);
      ((EjbInvocation)curInv).exception=ex;
    }
  }
}

Fixed version (ground truth):
public void afterPostInvoke(ComponentInvocationType invType,ComponentInvocation prevInv,ComponentInvocation curInv) throws InvocationException {
  if (invType == ComponentInvocationType.EJB_INVOCATION) {
    assert(curInv instanceof EjbInvocation);
    try {
      ((EjbInvocation)curInv).getEjbSecurityManager().postInvoke(curInv);
    }
 catch (    Exception ex) {
      _logger.log(Level.SEVERE,"String_Node_Str",ex);
      ((EjbInvocation)curInv).exception=ex;
    }
  }
}
Program: 28858
Project: 28858
Buggy source:
public void beforePreInvoke(ComponentInvocationType invType,ComponentInvocation prevInv,ComponentInvocation newInv) throws InvocationException {
  if (invType == ComponentInvocationType.EJB_INVOCATION) {
    try {
      if (!newInv.isPreInvokeDone()) {
        ((EjbInvocation)newInv).getEjbSecurityManager().preInvoke(newInv);
      }
    }
 catch (    Exception ex) {
      _logger.log(Level.SEVERE,"String_Node_Str",ex);
      throw new InvocationException(ex);
    }
  }
}

Fixed version (ground truth):
public void beforePreInvoke(ComponentInvocationType invType,ComponentInvocation prevInv,ComponentInvocation newInv) throws InvocationException {
  if (invType == ComponentInvocationType.EJB_INVOCATION) {
    assert(newInv instanceof EjbInvocation);
    try {
      if (!newInv.isPreInvokeDone()) {
        ((EjbInvocation)newInv).getEjbSecurityManager().preInvoke(newInv);
      }
    }
 catch (    Exception ex) {
      _logger.log(Level.SEVERE,"String_Node_Str",ex);
      throw new InvocationException(ex);
    }
  }
}
Program: 28860
Project: 28860
Buggy source:
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public WebRuleSet(String prefix){
  super();
  this.namespaceURI=null;
  this.prefix=prefix;
}

Fixed version (ground truth):
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public WebRuleSet(String prefix){
  super();
  this.prefix=prefix;
}
Program: 28861
Project: 28861
Buggy source:
public void configHttpProperties(Http http,Transport transport,Ssl ssl){
  setAllowTrace(ConfigBeansUtilities.toBoolean(http.getTraceEnabled()));
  setMaxKeepAliveRequests(Integer.parseInt(http.getMaxConnections()));
  setKeepAliveTimeoutInSeconds(Integer.parseInt(http.getTimeoutSeconds()));
  setAuthPassthroughEnabled(ConfigBeansUtilities.toBoolean(http.getAuthPassThroughEnabled()));
  setMaxPostSize(Integer.parseInt(http.getMaxPostSizeBytes()));
  setProperty("String_Node_Str",http.getCompression());
  setProperty("String_Node_Str",http.getCompressableMimeType());
  if (http.getNoCompressionUserAgents() != null) {
    setProperty("String_Node_Str",http.getNoCompressionUserAgents());
  }
  setProperty("String_Node_Str",http.getCompressionMinSizeBytes());
  if (http.getRestrictedUserAgents() != null) {
    setProperty("String_Node_Str",http.getRestrictedUserAgents());
  }
  setProperty("String_Node_Str",Boolean.valueOf(ConfigBeansUtilities.toBoolean(http.getCometSupportEnabled())).toString());
  setProperty("String_Node_Str",Boolean.valueOf(ConfigBeansUtilities.toBoolean(http.getRcmSupportEnabled())).toString());
  setConnectionUploadTimeout(Integer.parseInt(http.getConnectionUploadTimeoutMillis()));
  setDisableUploadTimeout(!ConfigBeansUtilities.toBoolean(http.getUploadTimeoutEnabled()));
  setURIEncoding(http.getUriEncoding());
  setChunkingDisabled(!ConfigBeansUtilities.toBoolean(http.getChunkingEnabled()));
  configSslOptions(ssl);
}

Fixed version (ground truth):
public void configHttpProperties(Http http,Transport transport,Ssl ssl){
  setAllowTrace(ConfigBeansUtilities.toBoolean(http.getTraceEnabled()));
  setMaxKeepAliveRequests(Integer.parseInt(http.getMaxConnections()));
  setKeepAliveTimeoutInSeconds(Integer.parseInt(http.getTimeoutSeconds()));
  setAuthPassthroughEnabled(ConfigBeansUtilities.toBoolean(http.getAuthPassThroughEnabled()));
  setMaxPostSize(Integer.parseInt(http.getMaxPostSizeBytes()));
  setProperty("String_Node_Str",http.getCompression());
  setProperty("String_Node_Str",http.getCompressableMimeType());
  if (http.getNoCompressionUserAgents() != null) {
    setProperty("String_Node_Str",http.getNoCompressionUserAgents());
  }
  setProperty("String_Node_Str",http.getCompressionMinSizeBytes());
  if (http.getRestrictedUserAgents() != null) {
    setProperty("String_Node_Str",http.getRestrictedUserAgents());
  }
  setProperty("String_Node_Str",Boolean.valueOf(ConfigBeansUtilities.toBoolean(http.getCometSupportEnabled())).toString());
  setProperty("String_Node_Str",Boolean.valueOf(ConfigBeansUtilities.toBoolean(http.getRcmSupportEnabled())).toString());
  setConnectionUploadTimeout(Integer.parseInt(http.getConnectionUploadTimeoutMillis()));
  setDisableUploadTimeout(!ConfigBeansUtilities.toBoolean(http.getUploadTimeoutEnabled()));
  setURIEncoding(http.getUriEncoding());
  configSslOptions(ssl);
}
Program: 28862
Project: 28862
Buggy source:
private Resources getResources(){
  if (globalResources == null) {
    globalResources=domainProvider.get().getResources();
  }
  return globalResources;
}

Fixed version (ground truth):
public Resources getResources(){
  if (globalResources == null) {
    globalResources=domainProvider.get().getResources();
  }
  return globalResources;
}
Program: 28863
Project: 28863
Buggy source:
private static String validateField(Field f,ConfigProperty property){
  Class c=f.getDeclaringClass();
  Class returnType=f.getType();
  Class type=property.type();
  if (type.equals(Object.class)) {
    type=returnType;
  }
 else {
    if (!returnType.isAssignableFrom(type)) {
      return "String_Node_Str" + type + "String_Node_Str"+ "String_Node_Str"+ returnType+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.getName()+ "String_Node_Str"+ c+ "String_Node_Str";
    }
  }
  return SUCCESS;
}

Fixed version (ground truth):
private static String validateField(Field f,ConfigProperty property){
  Class c=f.getDeclaringClass();
  Class returnType=f.getType();
  Class type=property.type();
  if (!type.equals(Object.class)) {
    if (!returnType.isAssignableFrom(type)) {
      return "String_Node_Str" + type + "String_Node_Str"+ "String_Node_Str"+ returnType+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.getName()+ "String_Node_Str"+ c+ "String_Node_Str";
    }
  }
  return SUCCESS;
}
Program: 28864
Project: 28864
Buggy source:
private static String validateMethod(Method m,ConfigProperty property){
  if (!m.getName().startsWith("String_Node_Str")) {
    return "String_Node_Str" + m.getName() + "String_Node_Str";
  }
  int modifier=m.getModifiers();
  if (Modifier.isPrivate(modifier)) {
    return "String_Node_Str" + "String_Node_Str" + m.getName() + "String_Node_Str"+ "String_Node_Str"+ m.getDeclaringClass().getName()+ "String_Node_Str";
  }
  Class type=property.type();
  Class[] parameters=m.getParameterTypes();
  Class propertyType;
  if (parameters.length != 0) {
    if (parameters.length == 1) {
      propertyType=parameters[0];
    }
 else {
      return "String_Node_Str" + m.getName() + "String_Node_Str";
    }
  }
 else {
    return "String_Node_Str" + m.getName() + "String_Node_Str";
  }
  if (type.equals(Object.class)) {
    type=propertyType;
  }
 else   if (!propertyType.isAssignableFrom(type)) {
    if (type.isPrimitive()) {
      type=getWrapperClass(type.getName());
    }
 else     if (propertyType.isPrimitive()) {
      propertyType=getWrapperClass(propertyType.getName());
    }
    if (!propertyType.isAssignableFrom(type)) {
      return "String_Node_Str" + type + "String_Node_Str"+ "String_Node_Str"+ propertyType+ "String_Node_Str"+ "String_Node_Str";
    }
  }
  return SUCCESS;
}

Fixed version (ground truth):
private static String validateMethod(Method m,ConfigProperty property){
  if (!m.getName().startsWith("String_Node_Str")) {
    return "String_Node_Str" + m.getName() + "String_Node_Str";
  }
  int modifier=m.getModifiers();
  if (Modifier.isPrivate(modifier)) {
    return "String_Node_Str" + "String_Node_Str" + m.getName() + "String_Node_Str"+ "String_Node_Str"+ m.getDeclaringClass().getName()+ "String_Node_Str";
  }
  Class type=property.type();
  Class[] parameters=m.getParameterTypes();
  Class propertyType;
  if (parameters.length != 0) {
    if (parameters.length == 1) {
      propertyType=parameters[0];
    }
 else {
      return "String_Node_Str" + m.getName() + "String_Node_Str";
    }
  }
 else {
    return "String_Node_Str" + m.getName() + "String_Node_Str";
  }
  if (!type.equals(Object.class) && !propertyType.isAssignableFrom(type)) {
    if (type.isPrimitive()) {
      type=getWrapperClass(type.getName());
    }
 else     if (propertyType.isPrimitive()) {
      propertyType=getWrapperClass(propertyType.getName());
    }
    if (!propertyType.isAssignableFrom(type)) {
      return "String_Node_Str" + type + "String_Node_Str"+ "String_Node_Str"+ propertyType+ "String_Node_Str"+ "String_Node_Str";
    }
  }
  return SUCCESS;
}
Program: 28865
Project: 28865
Buggy source:
/** 
 * Adds the requested resource adapter to the ConnectorClassLoader. A ConnectorClassLoader is created with the moduleDir as its search path and this classloader is added to the classloader chain.
 * @param rarName   the resourceAdapter module name to add
 * @param moduleDir the directory location where the RAR contents are exploded
 */
public void addResourceAdapter(String rarName,String moduleDir){
  try {
    File file=new File(moduleDir);
    ASURLClassLoader cl=new ASURLClassLoader(parent);
    cl.appendURL(file.toURI().toURL());
    appendJars(file,cl);
    classLoaderChain.add(cl);
    rarModuleClassLoaders.put(rarName,cl);
  }
 catch (  MalformedURLException ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Adds the requested resource adapter to the ConnectorClassLoader. A ConnectorClassLoader is created with the moduleDir as its search path and this classloader is added to the classloader chain.
 * @param rarName   the resourceAdapter module name to add
 * @param moduleDir the directory location where the RAR contents are exploded
 */
public void addResourceAdapter(String rarName,String moduleDir){
  try {
    File file=new File(moduleDir);
    ASURLClassLoader cl=AccessController.doPrivileged(new PrivilegedAction<ASURLClassLoader>(){
      public ASURLClassLoader run(){
        return new ASURLClassLoader(parent);
      }
    }
);
    cl.appendURL(file.toURI().toURL());
    appendJars(file,cl);
    classLoaderChain.add(cl);
    rarModuleClassLoaders.put(rarName,cl);
  }
 catch (  MalformedURLException ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
}
Program: 28866
Project: 28866
Buggy source:
public ConnectorClassLoader run(){
  return new ConnectorClassLoader(parent);
}

Fixed version (ground truth):
public ASURLClassLoader run(){
  return new ASURLClassLoader(parent);
}
Program: 28867
Project: 28867
Buggy source:
public Resources getGlobalResources(){
  ResourceInfo resourceInfo=null;
  return getRuntime().getResources(resourceInfo);
}

Fixed version (ground truth):
public Resources getGlobalResources(){
  return getRuntime().getResources();
}
Program: 28869
Project: 28869
Buggy source:
private void registerMSDReferredByApplication(String appName,MailSessionDescriptor msd){
  if (!msd.isDeployed()) {
    CommonResourceProxy proxy=mailSessionProxyProvider.get();
    org.glassfish.resourcebase.resources.naming.ResourceNamingService resourceNamingService=resourceNamingServiceProvider.get();
    proxy.setDescriptor(msd);
    String moduleName=null;
    if (msd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      msd.setResourceId(appName);
    }
    if (msd.getName().startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX) || msd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      ResourceInfo resourceInfo=new ResourceInfo(msd.getName(),appName,moduleName);
      try {
        resourceNamingService.publishObject(resourceInfo,proxy,true);
        msd.setDeployed(true);
      }
 catch (      NamingException e) {
        Object params[]=new Object[]{appName,msd.getName(),e};
        _logger.log(Level.WARNING,"String_Node_Str",params);
      }
    }
  }
}

Fixed version (ground truth):
private void registerMSDReferredByApplication(String appName,MailSessionDescriptor msd){
  if (!msd.isDeployed()) {
    CommonResourceProxy proxy=mailSessionProxyProvider.get();
    org.glassfish.resourcebase.resources.naming.ResourceNamingService resourceNamingService=resourceNamingServiceProvider.get();
    proxy.setDescriptor(msd);
    if (msd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      msd.setResourceId(appName);
    }
    if (msd.getName().startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX) || msd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      ResourceInfo resourceInfo=new ResourceInfo(msd.getName(),appName);
      try {
        resourceNamingService.publishObject(resourceInfo,proxy,true);
        msd.setDeployed(true);
      }
 catch (      NamingException e) {
        Object params[]=new Object[]{appName,msd.getName(),e};
        _logger.log(Level.WARNING,"String_Node_Str",params);
      }
    }
  }
}
Program: 28870
Project: 28870
Buggy source:
/** 
 * check whether the resource is unused
 * @param h ResourceHandle
 * @return boolean representing resource usefullness
 */
protected boolean isResourceUnused(ResourceHandle h){
  return h.getResourceState().isFree() && !((AssocWithThreadResourceHandle)h).isAssociated();
}

Fixed version (ground truth):
/** 
 * check whether the resource is unused
 * @param h ResourceHandle
 * @return boolean representing resource usefullness
 */
protected boolean isResourceUnused(ResourceHandle h){
  if (h instanceof AssocWithThreadResourceHandle) {
    return h.getResourceState().isFree() && !((AssocWithThreadResourceHandle)h).isAssociated();
  }
 else {
    return h.getResourceState().isFree();
  }
}
Program: 28871
Project: 28871
Buggy source:
/** 
 * destroys the resource
 * @param resourceHandle resource to be destroyed
 */
public void deleteResource(ResourceHandle resourceHandle){
  try {
    super.deleteResource(resourceHandle);
  }
  finally {
synchronized (resourceHandle.lock) {
      ((AssocWithThreadResourceHandle)resourceHandle).setDirty();
    }
  }
}

Fixed version (ground truth):
/** 
 * destroys the resource
 * @param resourceHandle resource to be destroyed
 */
public void deleteResource(ResourceHandle resourceHandle){
  try {
    super.deleteResource(resourceHandle);
  }
  finally {
    if (resourceHandle instanceof AssocWithThreadResourceHandle) {
synchronized (resourceHandle.lock) {
        ((AssocWithThreadResourceHandle)resourceHandle).setDirty();
      }
    }
  }
}
Program: 28872
Project: 28872
Buggy source:
protected void notifyWaitingThreads(){
  Object waitMonitor=null;
synchronized (waitQueue) {
    if (waitQueue.getQueueLength() > 0) {
      waitMonitor=waitQueue.remove();
      if (poolLifeCycleListener != null) {
        poolLifeCycleListener.connectionRequestDequeued();
      }
    }
  }
  if (waitMonitor != null) {
synchronized (waitMonitor) {
      if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE,"String_Node_Str" + waitMonitor.toString());
      }
      waitMonitor.notify();
    }
  }
 else {
    logFine("String_Node_Str");
  }
}

Fixed version (ground truth):
protected void notifyWaitingThreads(){
  Object waitMonitor=null;
synchronized (waitQueue) {
    if (waitQueue.getQueueLength() > 0) {
      waitMonitor=waitQueue.remove();
      if (poolLifeCycleListener != null) {
        poolLifeCycleListener.connectionRequestDequeued();
      }
    }
  }
  if (waitMonitor != null) {
synchronized (waitMonitor) {
      if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE,"String_Node_Str" + waitMonitor.toString());
      }
      waitMonitor.notifyAll();
    }
  }
 else {
    logFine("String_Node_Str");
  }
}
Program: 28873
Project: 28873
Buggy source:
private synchronized boolean incrementPoolSize(){
  if (poolSize >= maxPoolSize)   return false;
  poolSize++;
  return true;
}

Fixed version (ground truth):
private synchronized boolean incrementPoolSize(){
  if (poolSize >= maxPoolSize) {
    _logger.info("String_Node_Str" + poolSize);
    return false;
  }
  poolSize++;
  return true;
}
Program: 28874
Project: 28874
Buggy source:
@Override protected ResourceHandle getUnenlistedResource(ResourceSpec spec,ResourceAllocator alloc,Transaction tran) throws PoolingException {
  ResourceHandle handle=null;
  if (incrementPoolSize()) {
    try {
      handle=createSingleResource(alloc);
    }
 catch (    PoolingException ex) {
      decrementPoolSize();
      throw ex;
    }
    ResourceState state=new ResourceState();
    handle.setResourceState(state);
    state.setEnlisted(false);
    setResourceStateToBusy(handle);
    return handle;
  }
  _logger.info("String_Node_Str" + poolSize);
  String msg=localStrings.getStringWithDefault("String_Node_Str","String_Node_Str");
  throw new PoolingException(msg);
}

Fixed version (ground truth):
@Override protected ResourceHandle getUnenlistedResource(ResourceSpec spec,ResourceAllocator alloc,Transaction tran) throws PoolingException {
  ResourceHandle handle=null;
  if (incrementPoolSize()) {
    try {
      handle=createSingleResource(alloc);
    }
 catch (    PoolingException ex) {
      decrementPoolSize();
      throw ex;
    }
    ResourceState state=new ResourceState();
    handle.setResourceState(state);
    state.setEnlisted(false);
    setResourceStateToBusy(handle);
    return handle;
  }
  String msg=localStrings.getStringWithDefault("String_Node_Str","String_Node_Str");
  throw new PoolingException(msg);
}
Program: 28875
Project: 28875
Buggy source:
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<JobInfo> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    JobInfo job : expiredJobs) {
      jobManagerService.purgeJob(job.jobId);
      jobManagerService.purgeCompletedJobForId(job.jobId);
      logger.fine("String_Node_Str" + job.jobId);
    }
  }
}

Fixed version (ground truth):
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<JobInfo> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    JobInfo job : expiredJobs) {
      jobManagerService.purgeJob(job.jobId);
      jobManagerService.purgeCompletedJobForId(job.jobId);
      logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str",job.jobId));
    }
  }
}
Program: 28876
Project: 28876
Buggy source:
@Override public <T extends ConfigBeanProxy>NotProcessed changed(TYPE type,Class<T> changedType,T changedInstance){
  NotProcessed np=null;
switch (type) {
case CHANGE:
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("String_Node_Str" + changedType.getName() + "String_Node_Str"+ changedInstance);
    }
  np=handleChangeEvent(changedInstance);
break;
default :
}
return np;
}

Fixed version (ground truth):
@Override public <T extends ConfigBeanProxy>NotProcessed changed(TYPE type,Class<T> changedType,T changedInstance){
  NotProcessed np=null;
switch (type) {
case CHANGE:
    if (logger.isLoggable(Level.FINE)) {
      logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str",changedType.getName(),changedInstance));
    }
  np=handleChangeEvent(changedInstance);
break;
default :
}
return np;
}
Program: 28877
Project: 28877
Buggy source:
public OutputBuffer(int size,boolean chunkingDisabled){
  this.size=size;
  this.isChunkingDisabled=chunkingDisabled;
}

Fixed version (ground truth):
/** 
 * Alternate constructor which allows specifying the initial buffer size.
 * @param size Buffer size to use
 */
public OutputBuffer(int size){
  this.size=size;
}
Program: 28878
Project: 28878
Buggy source:
public Response(boolean chunkingDisabled){
  outputBuffer=new OutputBuffer(chunkingDisabled);
  outputStream=new CoyoteOutputStream(outputBuffer);
  writer=createWriter(outputBuffer);
  urlEncoder.addSafeCharacter('/');
}

Fixed version (ground truth):
public Response(boolean chunkingDisabled){
  outputBuffer=new OutputBuffer();
  outputStream=new CoyoteOutputStream(outputBuffer);
  writer=createWriter(outputBuffer);
  urlEncoder.addSafeCharacter('/');
}
Program: 28879
Project: 28879
Buggy source:
/** 
 * Creates and returns Response object.
 * @return Response object
 */
@Override public Response createResponse(){
  PECoyoteResponse response=new PECoyoteResponse(isChunkingDisabled());
  response.setConnector(this);
  return response;
}

Fixed version (ground truth):
/** 
 * Creates and returns Response object.
 * @return Response object
 */
@Override public Response createResponse(){
  PECoyoteResponse response=new PECoyoteResponse();
  response.setConnector(this);
  return response;
}
Program: 28880
Project: 28880
Buggy source:
/** 
 * Log a message on the Logger associated with our Container (if any)
 * @param message Message to be logged
 * @param t Associated exception
 */
private void log(String message,Throwable t){
  org.apache.catalina.Logger logger=null;
  String containerName=null;
  String msg=MessageFormat.format(rb.getString(WEB_APP_LOADER_EXCEPTION),new Object[]{containerName,message});
  if (container != null) {
    logger=container.getLogger();
    containerName=container.getName();
  }
  if (logger != null) {
    logger.log(msg,t);
  }
 else {
    log.log(Level.WARNING,msg,t);
  }
}

Fixed version (ground truth):
/** 
 * Log a message on the Logger associated with our Container (if any)
 * @param message Message to be logged
 * @param t Associated exception
 */
private void log(String message,Throwable t){
  org.apache.catalina.Logger logger=null;
  String containerName=null;
  if (container != null) {
    logger=container.getLogger();
    containerName=container.getName();
  }
  if (logger != null) {
    String msg=MessageFormat.format(rb.getString(WEB_APP_LOADER_EXCEPTION),new Object[]{containerName,message});
    logger.log(msg,t);
  }
 else {
    String msg=MessageFormat.format(rb.getString(WEB_APP_LOADER_EXCEPTION),new Object[]{containerName,message});
    log.log(Level.WARNING,msg,t);
  }
}
Program: 28881
Project: 28881
Buggy source:
/** 
 * Construct a new CoyoteProcessor associated with the specified connector.
 * @param connector CoyoteConnector that owns this processor
 */
public CoyoteAdapter(Connector connector){
  super();
  this.connector=connector;
  this.debug=connector.getDebug();
}

Fixed version (ground truth):
/** 
 * Construct a new CoyoteProcessor associated with the specified connector.
 * @param connector CoyoteConnector that owns this processor
 */
public CoyoteAdapter(Connector connector){
  super();
  this.connector=connector;
}
Program: 28882
Project: 28882
Buggy source:
/** 
 * Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.
 */
public void initialize() throws LifecycleException {
  if (initialized) {
    if (log.isLoggable(Level.INFO)) {
      log.log(Level.INFO,SERVICE_HAS_BEEN_INIT);
    }
    return;
  }
  initialized=true;
  if (oname == null) {
    try {
      Container engine=this.getContainer();
      domain=engine.getName();
      oname=new ObjectName(domain + "String_Node_Str" + name);
      this.controller=oname;
    }
 catch (    Exception e) {
      String msg=MessageFormat.format(rb.getString(ERROR_REGISTER_SERVICE_EXCEPTION),domain);
      log.log(Level.SEVERE,msg,e);
    }
  }
  if (server == null) {
    ServerFactory.getServer().addService(this);
  }
synchronized (connectorsMonitor) {
    for (int i=0; i < connectors.length; i++) {
      connectors[i].initialize();
    }
  }
}

Fixed version (ground truth):
/** 
 * Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.
 */
public void initialize() throws LifecycleException {
  if (initialized) {
    if (log.isLoggable(Level.INFO)) {
      log.log(Level.INFO,SERVICE_HAS_BEEN_INIT);
    }
    return;
  }
  initialized=true;
  if (oname == null) {
    try {
      Container engine=this.getContainer();
      domain=engine.getName();
      oname=new ObjectName(domain + "String_Node_Str" + name);
    }
 catch (    Exception e) {
      String msg=MessageFormat.format(rb.getString(ERROR_REGISTER_SERVICE_EXCEPTION),domain);
      log.log(Level.SEVERE,msg,e);
    }
  }
  if (server == null) {
    ServerFactory.getServer().addService(this);
  }
synchronized (connectorsMonitor) {
    for (int i=0; i < connectors.length; i++) {
      connectors[i].initialize();
    }
  }
}
Program: 28883
Project: 28883
Buggy source:
/** 
 * This will schedule a cleanup of expired jobs based on configurable values
 */
private void scheduleCleanUp(){
  enableJobManager=Boolean.parseBoolean(System.getProperty("String_Node_Str","String_Node_Str"));
  logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
  long delayBetweenRuns=1200000;
  long initialDelay=1200000;
  if (enableJobManager) {
    delayBetweenRuns=jobManagerService.convert(managedJobConfig.getPollInterval());
    initialDelay=jobManagerService.convert(managedJobConfig.getInitialDelay());
  }
  ScheduledFuture<?> cleanupFuture=scheduler.scheduleAtFixedRate(new JobCleanUpTask(),initialDelay,delayBetweenRuns,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
/** 
 * This will schedule a cleanup of expired jobs based on configurable values
 */
private void scheduleCleanUp(){
  logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
  long delayBetweenRuns=1200000;
  long initialDelay=1200000;
  delayBetweenRuns=jobManagerService.convert(managedJobConfig.getPollInterval());
  initialDelay=jobManagerService.convert(managedJobConfig.getInitialDelay());
  ScheduledFuture<?> cleanupFuture=scheduler.scheduleAtFixedRate(new JobCleanUpTask(),initialDelay,delayBetweenRuns,TimeUnit.MILLISECONDS);
}
Program: 28884
Project: 28884
Buggy source:
@Override public void postConstruct(){
  logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
  enableJobManager=Boolean.parseBoolean(System.getProperty("String_Node_Str","String_Node_Str"));
  if (enableJobManager) {
    managedJobConfig=domain.getExtensionByType(ManagedJobConfig.class);
    ObservableBean bean=(ObservableBean)ConfigSupport.getImpl(managedJobConfig);
    logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
    bean.addListener(this);
  }
  scheduler=Executors.newScheduledThreadPool(10,new ThreadFactory(){
    @Override public Thread newThread(    Runnable r){
      Thread result=new Thread(r);
      result.setDaemon(true);
      return result;
    }
  }
);
  scheduleCleanUp();
}

Fixed version (ground truth):
@Override public void postConstruct(){
  logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
  managedJobConfig=domain.getExtensionByType(ManagedJobConfig.class);
  ObservableBean bean=(ObservableBean)ConfigSupport.getImpl(managedJobConfig);
  logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str"));
  bean.addListener(this);
  scheduler=Executors.newScheduledThreadPool(10,new ThreadFactory(){
    @Override public Thread newThread(    Runnable r){
      Thread result=new Thread(r);
      result.setDaemon(true);
      return result;
    }
  }
);
  scheduleCleanUp();
}
Program: 28885
Project: 28885
Buggy source:
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<Job> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    Job job : expiredJobs) {
      jobManagerService.purgeJob(job.getId());
      logger.fine("String_Node_Str" + job.getId());
    }
  }
}

Fixed version (ground truth):
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<JobInfo> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    JobInfo job : expiredJobs) {
      jobManagerService.purgeJob(job.jobId);
      logger.fine("String_Node_Str" + job.jobId);
    }
  }
}