nus-yam/ex-repair huggingface dataset:
Program: 28575
Project: 28575
Buggy source:
private boolean init(AdminCommandContext context){
  report=context.getActionReport();
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  logger=context.getLogger();
  user=resolver.resolve(user);
  password=DcomUtils.resolvePassword(resolver.resolve(password));
  if (!ok(password)) {
    setError(Strings.get("String_Node_Str"));
    return false;
  }
  testdir=resolver.resolve(testdir).replace('/','\\');
  if (testdir.endsWith("String_Node_Str"))   testdir=testdir.substring(0,testdir.length() - 1);
  if (!ok(windowsdomain))   windowsdomain=host;
  creds=new WindowsCredentials(host,windowsdomain,user,password);
  try {
    wrfs=new WindowsRemoteFileSystem(creds);
  }
 catch (  WindowsException ex) {
    setError(ex.getMessage());
    return false;
  }
  scriptFullPath=testdir + "String_Node_Str" + SCRIPT_NAME;
  return true;
}

Fixed version (ground truth):
private boolean init(AdminCommandContext context){
  report=context.getActionReport();
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  user=resolver.resolve(user);
  password=DcomUtils.resolvePassword(resolver.resolve(password));
  if (!ok(password)) {
    setError(Strings.get("String_Node_Str"));
    return false;
  }
  testdir=resolver.resolve(testdir).replace('/','\\');
  if (testdir.endsWith("String_Node_Str"))   testdir=testdir.substring(0,testdir.length() - 1);
  if (!ok(windowsdomain))   windowsdomain=host;
  creds=new WindowsCredentials(host,windowsdomain,user,password);
  try {
    wrfs=new WindowsRemoteFileSystem(creds);
  }
 catch (  WindowsException ex) {
    setError(ex.getMessage());
    return false;
  }
  scriptFullPath=testdir + "String_Node_Str" + SCRIPT_NAME;
  return true;
}
Program: 28576
Project: 28576
Buggy source:
private void processError(final Throwable t){
  ClassLoader oldCL;
  if (Globals.IS_SECURITY_ENABLED) {
    PrivilegedAction<ClassLoader> pa=new PrivilegedGetTccl();
    oldCL=AccessController.doPrivileged(pa);
  }
 else {
    oldCL=Thread.currentThread().getContextClassLoader();
  }
  try {
    ClassLoader newCL=request.getContext().getLoader().getClassLoader();
    if (Globals.IS_SECURITY_ENABLED) {
      PrivilegedAction<Void> pa=new PrivilegedSetTccl(newCL);
      AccessController.doPrivileged(pa);
    }
 else {
      Thread.currentThread().setContextClassLoader(newCL);
    }
synchronized (lk) {
      if (request.isUpgrade()) {
        HttpUpgradeHandler httpUpgradeHandler=request.getHttpUpgradeHandler();
        try {
          httpUpgradeHandler.destroy();
          request.setUpgrade(false);
          if (request.getResponse() instanceof Response) {
            ((Response)request.getResponse()).setUpgrade(false);
          }
        }
  finally {
          (request.getContext()).fireContainerEvent(ContainerEvent.PRE_DESTROY,httpUpgradeHandler);
        }
        if (grizzlyRequest.getResponse().isSuspended()) {
          grizzlyRequest.getResponse().resume();
        }
      }
      readListener.onError(t);
    }
  }
  finally {
    if (Globals.IS_SECURITY_ENABLED) {
      PrivilegedAction<Void> pa=new PrivilegedSetTccl(oldCL);
      AccessController.doPrivileged(pa);
    }
 else {
      Thread.currentThread().setContextClassLoader(oldCL);
    }
  }
}

Fixed version (ground truth):
private void processError(final Throwable t){
  ClassLoader oldCL;
  if (Globals.IS_SECURITY_ENABLED) {
    PrivilegedAction<ClassLoader> pa=new PrivilegedGetTccl();
    oldCL=AccessController.doPrivileged(pa);
  }
 else {
    oldCL=Thread.currentThread().getContextClassLoader();
  }
  try {
    ClassLoader newCL=request.getContext().getLoader().getClassLoader();
    if (Globals.IS_SECURITY_ENABLED) {
      PrivilegedAction<Void> pa=new PrivilegedSetTccl(newCL);
      AccessController.doPrivileged(pa);
    }
 else {
      Thread.currentThread().setContextClassLoader(newCL);
    }
synchronized (lk) {
      if (request.isUpgrade()) {
        final WebConnection wc=request.getWebConnection();
        try {
          readListener.onError(t);
        }
  finally {
          if (wc != null) {
            try {
              wc.close();
            }
 catch (            Exception ignored) {
            }
          }
        }
      }
    }
  }
  finally {
    if (Globals.IS_SECURITY_ENABLED) {
      PrivilegedAction<Void> pa=new PrivilegedSetTccl(oldCL);
      AccessController.doPrivileged(pa);
    }
 else {
      Thread.currentThread().setContextClassLoader(oldCL);
    }
  }
}
Program: 28577
Project: 28577
Buggy source:
@Override public void close() throws Exception {
  if (isClosed.compareAndSet(false,true)) {
    if ((request != null) && (request.isUpgrade())) {
      HttpUpgradeHandler httpUpgradeHandler=request.getHttpUpgradeHandler();
      try {
        httpUpgradeHandler.destroy();
        request.setUpgrade(false);
        if (response != null) {
          response.setUpgrade(false);
        }
      }
  finally {
        (request.getContext()).fireContainerEvent(ContainerEvent.PRE_DESTROY,httpUpgradeHandler);
        if (request.getCoyoteRequest().getResponse().isSuspended()) {
          request.getCoyoteRequest().getResponse().resume();
        }
      }
      Exception exception=null;
      try {
        inputStream.close();
      }
 catch (      Exception ex) {
        exception=ex;
      }
      try {
        outputStream.close();
      }
 catch (      Exception ex) {
        exception=ex;
      }
      if (exception != null) {
        throw exception;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void close() throws Exception {
  if (isClosed.compareAndSet(false,true)) {
    if ((request != null) && (request.isUpgrade())) {
      HttpUpgradeHandler httpUpgradeHandler=request.getHttpUpgradeHandler();
      try {
        httpUpgradeHandler.destroy();
        request.setUpgrade(false);
        if (response != null) {
          response.setUpgrade(false);
        }
      }
  finally {
        (request.getContext()).fireContainerEvent(ContainerEvent.PRE_DESTROY,httpUpgradeHandler);
        request.getCoyoteRequest().getResponse().resume();
      }
      Exception exception=null;
      try {
        inputStream.close();
      }
 catch (      Exception ex) {
        exception=ex;
      }
      try {
        outputStream.close();
      }
 catch (      Exception ex) {
        exception=ex;
      }
      if (exception != null) {
        throw exception;
      }
    }
  }
}
Program: 28579
Project: 28579
Buggy source:
/** 
 * Determine if the specified annotation type is a CDI-enabling annotation
 * @param annotationType    The annotation type to check
 * @param excludedTypeNames The Set of annotation type names that should be excluded from the analysis
 * @return true, if the specified annotation type qualifies as a CDI enabler; Otherwise, false
 */
private static boolean isCDIEnablingAnnotation(AnnotationType annotationType,Set<String> excludedTypeNames){
  boolean result=false;
  Set<String> exclusions=new HashSet<String>();
  if (excludedTypeNames != null) {
    exclusions.addAll(excludedTypeNames);
  }
  String annotationTypeName=annotationType.getName();
  if (cdiEnablingAnnotations.contains(annotationTypeName) && !exclusions.contains(annotationTypeName)) {
    result=true;
  }
 else   if (!exclusions.contains(annotationTypeName)) {
    exclusions.add(annotationTypeName);
    for (    AnnotationModel parent : annotationType.getAnnotations()) {
      if (isCDIEnablingAnnotation(parent.getType())) {
        result=true;
        break;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Determine if the specified annotation type is a CDI-enabling annotation
 * @param annotationType    The annotation type to check
 * @param excludedTypeNames The Set of annotation type names that should be excluded from the analysis
 * @return true, if the specified annotation type qualifies as a CDI enabler; Otherwise, false
 */
private static boolean isCDIEnablingAnnotation(AnnotationType annotationType,Set<String> excludedTypeNames){
  boolean result=false;
  Set<String> exclusions=new HashSet<String>();
  if (excludedTypeNames != null) {
    exclusions.addAll(excludedTypeNames);
  }
  String annotationTypeName=annotationType.getName();
  if (cdiEnablingAnnotations.contains(annotationTypeName) && !exclusions.contains(annotationTypeName)) {
    result=true;
  }
 else   if (!exclusions.contains(annotationTypeName)) {
    exclusions.add(annotationTypeName);
    for (    AnnotationModel parent : annotationType.getAnnotations()) {
      if (isCDIEnablingAnnotation(parent.getType(),exclusions)) {
        result=true;
        break;
      }
    }
  }
  return result;
}
Program: 28581
Project: 28581
Buggy source:
/** 
 * Invokes preDestroy on the instance embedded in the given ContainerEvent.
 * @param event The ContainerEvent to process
 */
private void preDestroy(ContainerEvent event){
  try {
    injectionMgr.destroyManagedObject(event.getData());
  }
 catch (  Throwable t) {
    String msg=rb.getString(EXCEPTION_DURING_DESTROY_MANAGED_OBJECT);
    msg=MessageFormat.format(msg,new Object[]{event.getData(),event.getContainer()});
    _logger.log(Level.SEVERE,msg,t);
  }
}

Fixed version (ground truth):
/** 
 * Invokes preDestroy on the instance embedded in the given ContainerEvent.
 * @param event The ContainerEvent to process
 */
private void preDestroy(ContainerEvent event){
  try {
    injectionMgr.destroyManagedObject(event.getData(),false);
  }
 catch (  Throwable t) {
    String msg=rb.getString(EXCEPTION_DURING_DESTROY_MANAGED_OBJECT);
    msg=MessageFormat.format(msg,new Object[]{event.getData(),event.getContainer()});
    _logger.log(Level.SEVERE,msg,t);
  }
}
Program: 28584
Project: 28584
Buggy source:
@Override public Principal run(){
  return realm.authenticate(username,password);
}

Fixed version (ground truth):
@Override public Boolean run(){
  try {
    return Boolean.valueOf(realm.invokeAuthenticateDelegate(req,(HttpResponse)getResponse(),context,(AuthenticatorBase)authBase,true));
  }
 catch (  IOException ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
}
Program: 28585
Project: 28585
Buggy source:
public void login(final String username,final char[] password) throws ServletException {
  if (getUserPrincipal() != null) {
    log.log(Level.SEVERE,ATTEMPT_RELOGIN_EXCEPTION);
    throw new ServletException("String_Node_Str" + "String_Node_Str");
  }
  if (context == null) {
    return;
  }
  LoginConfig loginConfig=context.getLoginConfig();
  String authMethod=loginConfig != null ? loginConfig.getAuthMethod() : "String_Node_Str";
  final Realm realm=context.getRealm();
  if (realm == null) {
    return;
  }
  try {
    if ("String_Node_Str".equals(authMethod) || "String_Node_Str".equals(authMethod)) {
      throw new ServletException("String_Node_Str" + "String_Node_Str" + authMethod);
    }
    Principal webPrincipal=null;
    if (Globals.IS_SECURITY_ENABLED) {
      webPrincipal=AccessController.doPrivileged(new PrivilegedAction<Principal>(){
        @Override public Principal run(){
          return realm.authenticate(username,password);
        }
      }
);
    }
 else {
      webPrincipal=realm.authenticate(username,password);
    }
    if (webPrincipal == null) {
      throw new ServletException("String_Node_Str" + "String_Node_Str" + username);
    }
    setUserPrincipal(webPrincipal);
    setAuthType("String_Node_Str");
    Session session=getSessionInternal(true);
    session.setAuthType(authType);
    session.setPrincipal(webPrincipal);
    AuthenticatorBase authenticator=(AuthenticatorBase)context.getAuthenticator();
    boolean noCache=(authenticator != null && !authenticator.getCache());
    if (noCache) {
      if (username != null) {
        session.setNote(SESS_USERNAME_NOTE,username);
      }
 else {
        session.removeNote(SESS_USERNAME_NOTE);
      }
      if (password != null) {
        session.setNote(SESS_PASSWORD_NOTE,password);
      }
 else {
        session.removeNote(SESS_PASSWORD_NOTE);
      }
    }
  }
 catch (  Exception ex) {
    throw new ServletException("String_Node_Str" + "String_Node_Str" + username,ex);
  }
}

Fixed version (ground truth):
public void login(final String username,final char[] password) throws ServletException {
  if (getAuthType() != null || getRemoteUser() != null || getUserPrincipal() != null) {
    throw new ServletException(rb.getString(ALREADY_AUTHENTICATED));
  }
  if (context.getAuthenticator() == null) {
    throw new ServletException(rb.getString(NO_AUTHENTICATOR));
  }
  context.getAuthenticator().login(username,password,this);
}
Program: 28586
Project: 28586
Buggy source:
@Override public Set<Annotation> getQualifiers(){
  Set<Annotation> qualifiers=new HashSet<Annotation>();
  qualifiers.add(new AnnotationLiteral<Default>(){
  }
);
  qualifiers.add(new AnnotationLiteral<Any>(){
  }
);
  return qualifiers;
}

Fixed version (ground truth):
@Override public Set<Annotation> getQualifiers(){
  Set<Annotation> qualifiers=new HashSet<Annotation>();
  qualifiers.add(JMSCDIExtension.getDefaultAnnotationLiteral());
  qualifiers.add(JMSCDIExtension.getAnyAnnotationLiteral());
  return qualifiers;
}
Program: 28588
Project: 28588
Buggy source:
public void handleNotification(final Notification notif,final Object ignore){
  final String notifType=notif.getType();
}

Fixed version (ground truth):
public void handleNotification(final Notification notif,final Object ignore){
}
Program: 28589
Project: 28589
Buggy source:
@Override protected void registerChildren(){
  final ObjectNameBuilder builder=getObjectNames();
  final MetadataImpl meta=defaultChildMetadata();
  List<Server> servers=getDomain().getServers().getServer();
  for (  Server server : servers) {
    meta.setCorrespondingConfig(ConfigBeanRegistry.getInstance().getObjectNameForProxy(server));
    final DASJ2EEServerImpl impl=new DASJ2EEServerImpl(getObjectName(),meta);
    ObjectName serverObjectName=getObjectNames().buildChildObjectName(J2EETypes.J2EE_SERVER,server.getName());
    registerChild(impl,serverObjectName);
  }
}

Fixed version (ground truth):
@Override protected void registerChildren(){
  final ObjectNameBuilder builder=getObjectNames();
  final MetadataImpl meta=defaultChildMetadata();
  List<Server> servers=getDomain().getServers().getServer();
  for (  Server server : servers) {
    meta.setCorrespondingConfig(ConfigBeanRegistry.getInstance().getObjectNameForProxy(server));
    final DASJ2EEServerImpl impl=new DASJ2EEServerImpl(getObjectName(),meta);
    ObjectName serverObjectName=builder.buildChildObjectName(J2EETypes.J2EE_SERVER,server.getName());
    registerChild(impl,serverObjectName);
  }
}
Program: 28590
Project: 28590
Buggy source:
@Override protected void unregisterChildren(){
  mRegistrationSupport.cleanup();
  super.unregisterChildren();
}

Fixed version (ground truth):
@Override protected void unregisterChildren(){
  if (mRegistrationSupport != null) {
    mRegistrationSupport.cleanup();
  }
  super.unregisterChildren();
}
Program: 28591
Project: 28591
Buggy source:
@Override protected void registerChildren(){
  super.registerChildren();
  final JDBCDriverImpl driverImpl=new JDBCDriverImpl(getObjectName(),defaultChildMetadata());
  ObjectName driverON=new ObjectNameBuilder(getMBeanServer(),getObjectName()).buildChildObjectName(J2EETypes.JDBC_DRIVER,getName());
  driverON=registerChild(driverImpl,driverON);
}

Fixed version (ground truth):
@Override protected void registerChildren(){
  super.registerChildren();
  final JDBCDriverImpl driverImpl=new JDBCDriverImpl(getObjectName(),defaultChildMetadata());
  ObjectName driverON=new ObjectNameBuilder(getMBeanServer(),getObjectName()).buildChildObjectName(J2EETypes.JDBC_DRIVER,getName());
  registerChild(driverImpl,driverON);
}
Program: 28592
Project: 28592
Buggy source:
@Override protected void registerChildren(){
  super.registerChildren();
  final JDBCDataSourceImpl dataSourceImpl=new JDBCDataSourceImpl(getObjectName(),defaultChildMetadata());
  ObjectName dataSourceON=new ObjectNameBuilder(getMBeanServer(),getObjectName()).buildChildObjectName(J2EETypes.JDBC_DATA_SOURCE,getName());
  dataSourceON=registerChild(dataSourceImpl,dataSourceON);
}

Fixed version (ground truth):
@Override protected void registerChildren(){
  super.registerChildren();
  final JDBCDataSourceImpl dataSourceImpl=new JDBCDataSourceImpl(getObjectName(),defaultChildMetadata());
  ObjectName dataSourceON=new ObjectNameBuilder(getMBeanServer(),getObjectName()).buildChildObjectName(J2EETypes.JDBC_DATA_SOURCE,getName());
  registerChild(dataSourceImpl,dataSourceON);
}
Program: 28593
Project: 28593
Buggy source:
public RegistrationSupport(final J2EEServer server){
  mJ2EEServer=server;
  mMBeanServer=(MBeanServer)server.extra().mbeanServerConnection();
  mResourceRefType=Util.deduceType(ResourceRef.class);
  mApplicationRefType=Util.deduceType(ApplicationRef.class);
  mServer=getDomain().getServers().getServer(mJ2EEServer.getName());
  final ObjectName test=mJ2EEServer.objectName();
  mResourceRefListener=new RefListener();
  registerApplications();
}

Fixed version (ground truth):
public RegistrationSupport(final J2EEServer server){
  mJ2EEServer=server;
  mMBeanServer=(MBeanServer)server.extra().mbeanServerConnection();
  mResourceRefType=Util.deduceType(ResourceRef.class);
  mApplicationRefType=Util.deduceType(ApplicationRef.class);
  mServer=getDomain().getServers().getServer(mJ2EEServer.getName());
  mResourceRefListener=new RefListener();
  registerApplications();
}
Program: 28595
Project: 28595
Buggy source:
private ObjectName registerEjbModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final EjbBundleDescriptor ejbBundleDescriptor){
  final String xmlDesc=getDeploymentDescriptor(ejbBundleDescriptor);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=ejbBundleDescriptor.getModuleName();
  final String appLocation=appConfig.getLocation();
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,moduleName);
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  final ObjectName ejbModuleObjectName=registerJ2EEChild(parentMBean,meta,EJBModule.class,EJBModuleImpl.class,moduleName);
  meta.remove(Metadata.CORRESPONDING_CONFIG);
  meta.remove(Metadata.DEPLOYMENT_DESCRIPTOR);
  for (  final EjbDescriptor desc : ejbBundleDescriptor.getEjbs()) {
    final ObjectName ejbObjectName=createEJBMBean(ejbModuleObjectName,meta,desc);
  }
  return ejbModuleObjectName;
}

Fixed version (ground truth):
private ObjectName registerEjbModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final EjbBundleDescriptor ejbBundleDescriptor){
  final String xmlDesc=getDeploymentDescriptor(ejbBundleDescriptor);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=ejbBundleDescriptor.getModuleName();
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,moduleName);
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  final ObjectName ejbModuleObjectName=registerJ2EEChild(parentMBean,meta,EJBModule.class,EJBModuleImpl.class,moduleName);
  meta.remove(Metadata.CORRESPONDING_CONFIG);
  meta.remove(Metadata.DEPLOYMENT_DESCRIPTOR);
  for (  final EjbDescriptor desc : ejbBundleDescriptor.getEjbs()) {
    createEJBMBean(ejbModuleObjectName,meta,desc);
  }
  return ejbModuleObjectName;
}
Program: 28596
Project: 28596
Buggy source:
private ObjectName createRARModuleMBean(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ConnectorDescriptor bundleDesc){
  final String appLocation=appConfig.getLocation();
  final String xmlDesc=getDeploymentDescriptor(bundleDesc);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String resAdName=bundleDesc.getModuleName();
  final ObjectName objectName=registerJ2EEChild(parentMBean,meta,ResourceAdapterModule.class,ResourceAdapterModuleImpl.class,resAdName);
  return objectName;
}

Fixed version (ground truth):
private ObjectName createRARModuleMBean(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ConnectorDescriptor bundleDesc){
  final String xmlDesc=getDeploymentDescriptor(bundleDesc);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String resAdName=bundleDesc.getModuleName();
  final ObjectName objectName=registerJ2EEChild(parentMBean,meta,ResourceAdapterModule.class,ResourceAdapterModuleImpl.class,resAdName);
  return objectName;
}
Program: 28597
Project: 28597
Buggy source:
public ObjectName registerAppClient(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ApplicationClientDescriptor bundleDesc){
  final String appLocation=appConfig.getLocation();
  final String xmlDesc=getDeploymentDescriptor(bundleDesc);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=bundleDesc.getModuleDescriptor().getModuleName();
  return registerJ2EEChild(parentMBean,meta,AppClientModule.class,AppClientModuleImpl.class,moduleName);
}

Fixed version (ground truth):
public ObjectName registerAppClient(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ApplicationClientDescriptor bundleDesc){
  final String xmlDesc=getDeploymentDescriptor(bundleDesc);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=bundleDesc.getModuleDescriptor().getModuleName();
  return registerJ2EEChild(parentMBean,meta,AppClientModule.class,AppClientModuleImpl.class,moduleName);
}
Program: 28598
Project: 28598
Buggy source:
protected void registerApplications(){
  final List<ApplicationRef> appRefs=mServer.getApplicationRef();
  for (  final ApplicationRef ref : appRefs) {
    try {
      final ObjectName objectName=processApplicationRef(ref);
    }
 catch (    final Exception e) {
      mLogger.log(Level.INFO,AMXEELoggerInfo.registeringApplicationException,new Object[]{ref.getRef(),e});
    }
  }
}

Fixed version (ground truth):
protected void registerApplications(){
  final List<ApplicationRef> appRefs=mServer.getApplicationRef();
  for (  final ApplicationRef ref : appRefs) {
    try {
      processApplicationRef(ref);
    }
 catch (    final Exception e) {
      mLogger.log(Level.INFO,AMXEELoggerInfo.registeringApplicationException,new Object[]{ref.getRef(),e});
    }
  }
}
Program: 28599
Project: 28599
Buggy source:
public ObjectName registerResourceAdapterModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ConnectorDescriptor bundleDesc,final String appLocation){
  meta.setCorrespondingConfig(getObjectName(appConfig));
  final ObjectName objectName=createRARModuleMBean(parentMBean,meta,appConfig,bundleDesc);
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,bundleDesc.getModuleName());
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  final ObjectName rarObjectName=registerJ2EEChild(objectName,meta,ResourceAdapter.class,ResourceAdapterImpl.class,bundleDesc.getName());
  return objectName;
}

Fixed version (ground truth):
public ObjectName registerResourceAdapterModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final ConnectorDescriptor bundleDesc,final String appLocation){
  meta.setCorrespondingConfig(getObjectName(appConfig));
  final ObjectName objectName=createRARModuleMBean(parentMBean,meta,appConfig,bundleDesc);
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,bundleDesc.getModuleName());
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  registerJ2EEChild(objectName,meta,ResourceAdapter.class,ResourceAdapterImpl.class,bundleDesc.getName());
  return objectName;
}
Program: 28600
Project: 28600
Buggy source:
private ObjectName registerWebModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final WebBundleDescriptor webBundleDescriptor){
  final String xmlDesc=getDeploymentDescriptor(webBundleDescriptor);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=webBundleDescriptor.getModuleName();
  final String appLocation=appConfig.getLocation();
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,moduleName);
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  final ObjectName webModuleObjectName=registerJ2EEChild(parentMBean,meta,WebModule.class,WebModuleImpl.class,moduleName);
  meta.remove(Metadata.CORRESPONDING_CONFIG);
  meta.remove(Metadata.DEPLOYMENT_DESCRIPTOR);
  for (  final WebComponentDescriptor desc : webBundleDescriptor.getWebComponentDescriptors()) {
    final String servletName=desc.getCanonicalName();
    final ObjectName on=registerJ2EEChild(webModuleObjectName,meta,Servlet.class,ServletImpl.class,servletName);
  }
  return webModuleObjectName;
}

Fixed version (ground truth):
private ObjectName registerWebModuleAndItsComponents(final ObjectName parentMBean,final MetadataImpl meta,final com.sun.enterprise.config.serverbeans.Application appConfig,final WebBundleDescriptor webBundleDescriptor){
  final String xmlDesc=getDeploymentDescriptor(webBundleDescriptor);
  if (xmlDesc != null) {
    meta.setDeploymentDescriptor(xmlDesc);
  }
  final String moduleName=webBundleDescriptor.getModuleName();
  final com.sun.enterprise.config.serverbeans.Module moduleConfig=getModuleConfig(appConfig,moduleName);
  meta.setCorrespondingConfig(getObjectName(moduleConfig));
  final ObjectName webModuleObjectName=registerJ2EEChild(parentMBean,meta,WebModule.class,WebModuleImpl.class,moduleName);
  meta.remove(Metadata.CORRESPONDING_CONFIG);
  meta.remove(Metadata.DEPLOYMENT_DESCRIPTOR);
  for (  final WebComponentDescriptor desc : webBundleDescriptor.getWebComponentDescriptors()) {
    final String servletName=desc.getCanonicalName();
    registerJ2EEChild(webModuleObjectName,meta,Servlet.class,ServletImpl.class,servletName);
  }
  return webModuleObjectName;
}
Program: 28601
Project: 28601
Buggy source:
public synchronized ObjectName loadAMXMBeans(){
  FeatureAvailability.getInstance().waitForFeature(FeatureAvailability.AMX_CORE_READY_FEATURE,"String_Node_Str" + this);
  FeatureAvailability.getInstance().waitForFeature(AMXConfigConstants.AMX_CONFIG_READY_FEATURE,"String_Node_Str" + this);
  final DomainRoot domainRootProxy=ProxyFactory.getInstance(mMBeanServer).getDomainRootProxy(false);
  final ObjectName domainRoot=domainRootProxy.objectName();
  final ObjectNameBuilder objectNames=new ObjectNameBuilder(mMBeanServer,domainRoot);
  final String domainName=Util.getNameProp(domainRoot);
  final Metadata metadata=new MetadataImpl();
  metadata.add(Metadata.CORRESPONDING_CONFIG,ConfigBeanRegistry.getInstance().getObjectNameForProxy(domain));
  String serverName=mHabitat.<Server>getService(Server.class).getName();
  final J2EEDomainImpl impl=new J2EEDomainImpl(domainRoot,metadata);
  impl.setServerName(serverName);
  ObjectName objectName=objectNames.buildChildObjectName(J2EEDomain.class);
  try {
    objectName=mMBeanServer.registerMBean(impl,objectName).getObjectName();
  }
 catch (  JMException e) {
    throw new Error(e);
  }
  logger.log(Level.INFO,AMXEELoggerInfo.domainRegistered,objectName);
  return objectName;
}

Fixed version (ground truth):
public synchronized ObjectName loadAMXMBeans(){
  FeatureAvailability.getInstance().waitForFeature(FeatureAvailability.AMX_CORE_READY_FEATURE,"String_Node_Str" + this);
  FeatureAvailability.getInstance().waitForFeature(AMXConfigConstants.AMX_CONFIG_READY_FEATURE,"String_Node_Str" + this);
  final DomainRoot domainRootProxy=ProxyFactory.getInstance(mMBeanServer).getDomainRootProxy(false);
  final ObjectName domainRoot=domainRootProxy.objectName();
  final ObjectNameBuilder objectNames=new ObjectNameBuilder(mMBeanServer,domainRoot);
  final Metadata metadata=new MetadataImpl();
  metadata.add(Metadata.CORRESPONDING_CONFIG,ConfigBeanRegistry.getInstance().getObjectNameForProxy(domain));
  String serverName=mHabitat.<Server>getService(Server.class).getName();
  final J2EEDomainImpl impl=new J2EEDomainImpl(domainRoot,metadata);
  impl.setServerName(serverName);
  ObjectName objectName=objectNames.buildChildObjectName(J2EEDomain.class);
  try {
    objectName=mMBeanServer.registerMBean(impl,objectName).getObjectName();
  }
 catch (  JMException e) {
    throw new Error(e);
  }
  logger.log(Level.INFO,AMXEELoggerInfo.domainRegistered,objectName);
  return objectName;
}
Program: 28603
Project: 28603
Buggy source:
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  if (errorMessage != null && errorMessage.length() > 0) {
    errorMessage=HtmlEntityEncoder.encodeXSS(errorMessage);
  }
  return errorMessage;
}

Fixed version (ground truth):
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  return HtmlEntityEncoder.encodeXSS(errorMessage);
}
Program: 28604
Project: 28604
Buggy source:
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String configErrMsg=ssiMediator.getConfigErrMsg();
  if (configErrMsg != null && configErrMsg.length() > 0) {
    configErrMsg=HtmlEntityEncoder.encodeXSS(configErrMsg);
  }
  return configErrMsg;
}

Fixed version (ground truth):
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String configErrMsg=ssiMediator.getConfigErrMsg();
  return HtmlEntityEncoder.encodeXSS(configErrMsg);
}
Program: 28605
Project: 28605
Buggy source:
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  if (errorMessage != null && errorMessage.length() > 0) {
    errorMessage=HtmlEntityEncoder.encodeXSS(errorMessage);
  }
  return errorMessage;
}

Fixed version (ground truth):
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  return HtmlEntityEncoder.encodeXSS(errorMessage);
}
Program: 28606
Project: 28606
Buggy source:
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  if (errorMessage != null && errorMessage.length() > 0) {
    errorMessage=HtmlEntityEncoder.encodeXSS(errorMessage);
  }
  return errorMessage;
}

Fixed version (ground truth):
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  return HtmlEntityEncoder.encodeXSS(errorMessage);
}
Program: 28607
Project: 28607
Buggy source:
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  long lastModified=0;
  if (paramNames.length > 0) {
    String errorMessage=ssiMediator.getConfigErrMsg();
    if (errorMessage != null && errorMessage.length() > 0) {
      errorMessage=HtmlEntityEncoder.encodeXSS(errorMessage);
    }
    writer.write(errorMessage);
  }
 else {
    Collection<String> variableNames=ssiMediator.getVariableNames();
    Iterator<String> iter=variableNames.iterator();
    while (iter.hasNext()) {
      String variableName=iter.next();
      String variableValue=ssiMediator.getVariableValue(variableName);
      if (variableValue == null) {
        variableValue="String_Node_Str";
      }
      writer.write(variableName);
      writer.write('=');
      writer.write(variableValue);
      writer.write('\n');
      lastModified=System.currentTimeMillis();
    }
  }
  return lastModified;
}

Fixed version (ground truth):
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  long lastModified=0;
  if (paramNames.length > 0) {
    String errorMessage=ssiMediator.getConfigErrMsg();
    writer.write(HtmlEntityEncoder.encodeXSS(errorMessage));
  }
 else {
    Collection<String> variableNames=ssiMediator.getVariableNames();
    Iterator<String> iter=variableNames.iterator();
    while (iter.hasNext()) {
      String variableName=iter.next();
      String variableValue=ssiMediator.getVariableValue(variableName);
      if (variableValue == null) {
        variableValue="String_Node_Str";
      }
      writer.write(variableName);
      writer.write('=');
      writer.write(variableValue);
      writer.write('\n');
      lastModified=System.currentTimeMillis();
    }
  }
  return lastModified;
}
Program: 28608
Project: 28608
Buggy source:
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer) throws SSIStopProcessingException {
  long lastModified=0;
  String errorMessage=null;
  String variableName=null;
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      variableName=paramValue;
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      if (variableName != null) {
        String substitutedValue=ssiMediator.substituteVariables(paramValue);
        ssiMediator.setVariableValue(variableName,substitutedValue);
        lastModified=System.currentTimeMillis();
      }
 else {
        ssiMediator.log("String_Node_Str");
        if (errorMessage == null) {
          errorMessage=getEncodedConfigErrorMessage(ssiMediator);
        }
        writer.write(errorMessage);
        throw new SSIStopProcessingException();
      }
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      if (errorMessage == null) {
        errorMessage=getEncodedConfigErrorMessage(ssiMediator);
      }
      writer.write(errorMessage);
      throw new SSIStopProcessingException();
    }
  }
  return lastModified;
}

Fixed version (ground truth):
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer) throws SSIStopProcessingException {
  long lastModified=0;
  String variableName=null;
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      variableName=paramValue;
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      if (variableName != null) {
        String substitutedValue=ssiMediator.substituteVariables(paramValue);
        ssiMediator.setVariableValue(variableName,substitutedValue);
        lastModified=System.currentTimeMillis();
      }
 else {
        ssiMediator.log("String_Node_Str");
        String errorMessage=getEncodedConfigErrorMessage(ssiMediator);
        writer.write(errorMessage);
        throw new SSIStopProcessingException();
      }
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      String errorMessage=getEncodedConfigErrorMessage(ssiMediator);
      writer.write(errorMessage);
      throw new SSIStopProcessingException();
    }
  }
  return lastModified;
}
Program: 28609
Project: 28609
Buggy source:
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  if (errorMessage != null && errorMessage.length() > 0) {
    errorMessage=HtmlEntityEncoder.encodeXSS(errorMessage);
  }
  return errorMessage;
}

Fixed version (ground truth):
private String getEncodedConfigErrorMessage(SSIMediator ssiMediator){
  String errorMessage=ssiMediator.getConfigErrMsg();
  return HtmlEntityEncoder.encodeXSS(errorMessage);
}
Program: 28612
Project: 28612
Buggy source:
/** 
 * Renders the default error page.
 */
private static void serveDefaultErrorPage(HttpServletRequest request,HttpServletResponse response,int statusCode) throws IOException, ServletException {
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (response.isCommitted() || statusCode < 400 || (reqFacHelper != null && reqFacHelper.getResponseContentCount() > 0) || Boolean.TRUE.equals(request.getAttribute("String_Node_Str"))) {
    return;
  }
  String message=null;
  if (reqFacHelper != null) {
    message=reqFacHelper.getResponseMessage();
  }
  if (message == null) {
    message="String_Node_Str";
  }
 else {
    HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
    message=htmlEntityEncoder.encode(message);
  }
  String report=null;
  try {
    report=sm.getString("String_Node_Str" + statusCode,message);
  }
 catch (  Throwable t) {
    ;
  }
  if (report == null) {
    return;
  }
  String responseContents=ErrorReportValve.makeErrorPage(statusCode,message,null,null,report,response);
  response.setLocale(sm.getResourceBundleLocale(response.getLocale()));
  try {
    response.setContentType("String_Node_Str");
    response.getWriter().write(responseContents);
  }
 catch (  Throwable t) {
    log.log(Level.WARNING,EXCEPTION_SENDING_DEFAULT_ERROR_PAGE,t);
  }
}

Fixed version (ground truth):
/** 
 * Renders the default error page.
 */
private static void serveDefaultErrorPage(HttpServletRequest request,HttpServletResponse response,int statusCode) throws IOException, ServletException {
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (response.isCommitted() || statusCode < 400 || (reqFacHelper != null && reqFacHelper.getResponseContentCount() > 0) || Boolean.TRUE.equals(request.getAttribute("String_Node_Str"))) {
    return;
  }
  String message=null;
  if (reqFacHelper != null) {
    message=reqFacHelper.getResponseMessage();
  }
  if (message == null) {
    message="String_Node_Str";
  }
 else {
    message=HtmlEntityEncoder.encodeXSS(message);
  }
  String report=null;
  try {
    report=sm.getString("String_Node_Str" + statusCode,message);
  }
 catch (  Throwable t) {
    ;
  }
  if (report == null) {
    return;
  }
  String responseContents=ErrorReportValve.makeErrorPage(statusCode,message,null,null,report,response);
  response.setLocale(sm.getResourceBundleLocale(response.getLocale()));
  try {
    response.setContentType("String_Node_Str");
    response.getWriter().write(responseContents);
  }
 catch (  Throwable t) {
    log.log(Level.WARNING,EXCEPTION_SENDING_DEFAULT_ERROR_PAGE,t);
  }
}
Program: 28613
Project: 28613
Buggy source:
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (reqFacHelper == null || !reqFacHelper.isResponseError()) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=reqFacHelper.getResponseMessage();
      if (message == null) {
        message="String_Node_Str";
      }
 else {
        HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
        message=htmlEntityEncoder.encode(message);
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        String msg=MessageFormat.format(rb.getString(EXCEPTION_PROCESSING),errorPage);
        log.log(Level.WARNING,msg,e);
      }
    }
  }
  return matchFound;
}

Fixed version (ground truth):
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (reqFacHelper == null || !reqFacHelper.isResponseError()) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=reqFacHelper.getResponseMessage();
      if (message == null) {
        message="String_Node_Str";
      }
 else {
        message=HtmlEntityEncoder.encodeXSS(message);
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        String msg=MessageFormat.format(rb.getString(EXCEPTION_PROCESSING),errorPage);
        log.log(Level.WARNING,msg,e);
      }
    }
  }
  return matchFound;
}
Program: 28614
Project: 28614
Buggy source:
private void dispatchToErrorPage(Request request,Response response,ErrorPage errorPage,Throwable throwable,Throwable realError,int statusCode){
  response.setAppCommitted(false);
  ServletRequest sreq=request.getRequest();
  ServletResponse sresp=response.getResponse();
  sreq.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,errorPage.getLocation());
  sreq.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,((HttpServletRequest)sreq).getRequestURI());
  Wrapper wrapper=request.getWrapper();
  if (wrapper != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,wrapper.getName());
  }
  if (throwable != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,throwable.getMessage());
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION,realError);
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,realError.getClass());
  }
 else {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(statusCode));
    String message=((HttpResponse)response).getMessage();
    if (message == null) {
      message="String_Node_Str";
    }
 else {
      HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
      message=htmlEntityEncoder.encode(message);
    }
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,message);
  }
  if (custom(request,response,errorPage)) {
    try {
      sresp.flushBuffer();
    }
 catch (    IOException e) {
      log("String_Node_Str" + errorPage,e);
    }
  }
}

Fixed version (ground truth):
private void dispatchToErrorPage(Request request,Response response,ErrorPage errorPage,Throwable throwable,Throwable realError,int statusCode){
  response.setAppCommitted(false);
  ServletRequest sreq=request.getRequest();
  ServletResponse sresp=response.getResponse();
  sreq.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,errorPage.getLocation());
  sreq.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,((HttpServletRequest)sreq).getRequestURI());
  Wrapper wrapper=request.getWrapper();
  if (wrapper != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,wrapper.getName());
  }
  if (throwable != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,throwable.getMessage());
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION,realError);
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,realError.getClass());
  }
 else {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(statusCode));
    String message=((HttpResponse)response).getMessage();
    if (message == null) {
      message="String_Node_Str";
    }
 else {
      message=HtmlEntityEncoder.encodeXSS(message);
    }
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,message);
  }
  if (custom(request,response,errorPage)) {
    try {
      sresp.flushBuffer();
    }
 catch (    IOException e) {
      log("String_Node_Str" + errorPage,e);
    }
  }
}
Program: 28615
Project: 28615
Buggy source:
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the parameter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  try {
    Collection<ManagedExecutorService> managedExecutorServices=domain.getResources().getResources(ManagedExecutorService.class);
    for (    ManagedExecutorService managedExecutorService : managedExecutorServices) {
      String jndiName=managedExecutorService.getJndiName();
      if (bindableResourcesHelper.resourceExists(jndiName,target)) {
        ActionReport.MessagePart part=report.getTopMessagePart().addChild();
        part.setMessage(jndiName);
      }
    }
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}

Fixed version (ground truth):
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the parameter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  try {
    Collection<ManagedExecutorService> managedExecutorServices=domain.getResources().getResources(ManagedExecutorService.class);
    for (    ManagedExecutorService managedExecutorService : managedExecutorServices) {
      if (!(managedExecutorService instanceof ManagedScheduledExecutorService)) {
        String jndiName=managedExecutorService.getJndiName();
        if (bindableResourcesHelper.resourceExists(jndiName,target)) {
          ActionReport.MessagePart part=report.getTopMessagePart().addChild();
          part.setMessage(jndiName);
        }
      }
    }
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Program: 28616
Project: 28616
Buggy source:
public HtmlEntityEncoder(){
  for (char i='a'; i <= 'z'; i++) {
    addSafeCharacter(i);
  }
  for (char i='A'; i <= 'Z'; i++) {
    addSafeCharacter(i);
  }
  for (char i='0'; i <= '9'; i++) {
    addSafeCharacter(i);
  }
  addSafeCharacter('$');
  addSafeCharacter('_');
  addSafeCharacter('.');
  addSafeCharacter('!');
  addSafeCharacter('*');
  addSafeCharacter('\\');
  addSafeCharacter(',');
}

Fixed version (ground truth):
public HtmlEntityEncoder(){
  for (char i='a'; i <= 'z'; i++) {
    addSafeCharacter(i);
  }
  for (char i='A'; i <= 'Z'; i++) {
    addSafeCharacter(i);
  }
  for (char i='0'; i <= '9'; i++) {
    addSafeCharacter(i);
  }
  addSafeCharacter('$');
  addSafeCharacter('_');
  addSafeCharacter('.');
  addSafeCharacter('!');
  addSafeCharacter('*');
  addSafeCharacter('\\');
  addSafeCharacter(',');
  addSafeCharacter(' ');
}