nus-yam/ex-repair huggingface dataset:
Program: 34570
Project: 34570
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.authentication.jaas.modules.modules.CertificateLoginModule#login()}.
 */
@Test public void loginFailsUnexpectedException() throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      one(userRegistry).mapCertificate(cert);
      will(throwException(new RegistryException("String_Node_Str")));
      one(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
    }
  }
);
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(null,callbackHandler,null,null);
  try {
    module.login();
  }
 catch (  AuthenticationException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.authentication.jaas.modules.modules.CertificateLoginModule#login()}.
 */
@Test public void loginFailsUnexpectedException() throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      one(userRegistry).mapCertificate(certChain);
      will(throwException(new RegistryException("String_Node_Str")));
      one(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
    }
  }
);
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(null,callbackHandler,null,null);
  try {
    module.login();
  }
 catch (  AuthenticationException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}
Program: 34571
Project: 34571
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.authentication.jaas.modules.modules.CertificateLoginModule#login()}.
 */
@Test public void loginFailsCertificateMapFailedException() throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      one(userRegistry).mapCertificate(cert);
      will(throwException(new CertificateMapFailedException("String_Node_Str")));
      one(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
    }
  }
);
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(null,callbackHandler,null,null);
  try {
    module.login();
  }
 catch (  AuthenticationException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.authentication.jaas.modules.modules.CertificateLoginModule#login()}.
 */
@Test public void loginFailsCertificateMapFailedException() throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      one(userRegistry).mapCertificate(certChain);
      will(throwException(new CertificateMapFailedException("String_Node_Str")));
      one(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
    }
  }
);
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(null,callbackHandler,null,null);
  try {
    module.login();
  }
 catch (  AuthenticationException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}
Program: 34572
Project: 34572
Buggy source:
@Test public void loginTrustedWithCertificateChainPasses() throws Exception {
  final String methodName="String_Node_Str";
  try {
    mockery.checking(new Expectations(){
{
        one(userRegistry).mapCertificate(certificateChain[0]);
        will(returnValue(CERTIFICATE_USER_NAME));
      }
    }
);
    IdentityAssertionLoginModule module=new IdentityAssertionLoginModule();
    Subject subject=new Subject();
    CallbackHandler callbackHandler=null;
    Map sharedState=createSharedState(true,null,certificateChain);
    Map options=null;
    module.initialize(subject,callbackHandler,sharedState,options);
    assertTrue(module.login());
  }
 catch (  Throwable t) {
    outputMgr.failWithThrowable(methodName,t);
  }
}

Fixed version (ground truth):
@Test public void loginTrustedWithCertificateChainPasses() throws Exception {
  final String methodName="String_Node_Str";
  try {
    mockery.checking(new Expectations(){
{
        one(userRegistry).mapCertificate(certificateChain);
        will(returnValue(CERTIFICATE_USER_NAME));
      }
    }
);
    IdentityAssertionLoginModule module=new IdentityAssertionLoginModule();
    Subject subject=new Subject();
    CallbackHandler callbackHandler=null;
    Map sharedState=createSharedState(true,null,certificateChain);
    Map options=null;
    module.initialize(subject,callbackHandler,sharedState,options);
    assertTrue(module.login());
  }
 catch (  Throwable t) {
    outputMgr.failWithThrowable(methodName,t);
  }
}
Program: 34573
Project: 34573
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void mapCertificate() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str" + DEFAULT_ADMIN_USER);
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  assertEquals(DEFAULT_ADMIN_USER,reg.mapCertificate(cert));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void mapCertificate() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str" + DEFAULT_ADMIN_USER);
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  assertEquals(DEFAULT_ADMIN_USER,reg.mapCertificate(new X509Certificate[]{cert}));
}
Program: 34574
Project: 34574
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_noCN() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  reg.mapCertificate(cert);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_noCN() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  reg.mapCertificate(new X509Certificate[]{cert});
}
Program: 34575
Project: 34575
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_userDoesntExist() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  reg.mapCertificate(cert);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.management.security.internal.QuickStartSecurityRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_userDoesntExist() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  reg.mapCertificate(new X509Certificate[]{cert});
}
Program: 34576
Project: 34576
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void mapCertificate() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  assertEquals("String_Node_Str",fullBasicRegistry().mapCertificate(cert));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void mapCertificate() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  assertEquals("String_Node_Str",fullBasicRegistry().mapCertificate(new X509Certificate[]{cert}));
}
Program: 34577
Project: 34577
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_noCN() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  fullBasicRegistry().mapCertificate(cert);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_noCN() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  fullBasicRegistry().mapCertificate(new X509Certificate[]{cert});
}
Program: 34578
Project: 34578
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_userDoesntExist() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  fullBasicRegistry().mapCertificate(cert);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.basic.internal.BasicRegistry#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_userDoesntExist() throws Exception {
  final X509Certificate cert=mock.mock(X509Certificate.class);
  final X500Principal principal=new X500Principal("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(cert).getSubjectX500Principal();
      will(returnValue(principal));
    }
  }
);
  fullBasicRegistry().mapCertificate(new X509Certificate[]{cert});
}
Program: 34579
Project: 34579
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void testMapCertificate_CertificateMapFailedException() throws Exception {
  final com.ibm.websphere.security.CertificateMapFailedException certMapFailedException=new com.ibm.websphere.security.CertificateMapFailedException(EXPECTED_EXCEPTION_MESSAGE);
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(certMapFailedException));
    }
  }
);
  try {
    wrapper.mapCertificate(cert);
  }
 catch (  Exception e) {
    assertExceptionContentsAndRethrow(certMapFailedException,e);
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapFailedException.class) public void testMapCertificate_CertificateMapFailedException() throws Exception {
  final com.ibm.websphere.security.CertificateMapFailedException certMapFailedException=new com.ibm.websphere.security.CertificateMapFailedException(EXPECTED_EXCEPTION_MESSAGE);
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(certMapFailedException));
    }
  }
);
  try {
    wrapper.mapCertificate(certChain);
  }
 catch (  Exception e) {
    assertExceptionContentsAndRethrow(certMapFailedException,e);
  }
}
Program: 34580
Project: 34580
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapNotSupportedException.class) public void testMapCertificate_CertificateMapNotSupportedException() throws Exception {
  final com.ibm.websphere.security.CertificateMapNotSupportedException certMapNotSupportedException=new com.ibm.websphere.security.CertificateMapNotSupportedException(EXPECTED_EXCEPTION_MESSAGE);
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(certMapNotSupportedException));
    }
  }
);
  try {
    wrapper.mapCertificate(cert);
  }
 catch (  Exception e) {
    assertExceptionMessage(e);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=CertificateMapNotSupportedException.class) public void testMapCertificate_CertificateMapNotSupportedException() throws Exception {
  final com.ibm.websphere.security.CertificateMapNotSupportedException certMapNotSupportedException=new com.ibm.websphere.security.CertificateMapNotSupportedException(EXPECTED_EXCEPTION_MESSAGE);
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(certMapNotSupportedException));
    }
  }
);
  try {
    wrapper.mapCertificate(certChain);
  }
 catch (  Exception e) {
    assertExceptionMessage(e);
    throw e;
  }
}
Program: 34581
Project: 34581
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void testMapCertificate() throws Exception {
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(returnValue(NAME));
    }
  }
);
  assertEquals("String_Node_Str",NAME,wrapper.mapCertificate(cert));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test public void testMapCertificate() throws Exception {
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(returnValue(NAME));
    }
  }
);
  assertEquals("String_Node_Str",NAME,wrapper.mapCertificate(certChain));
}
Program: 34582
Project: 34582
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=RegistryException.class) public void testMapCertificate_CustomRegistryException() throws Exception {
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(customRegistryException));
    }
  }
);
  try {
    wrapper.mapCertificate(cert);
  }
 catch (  Exception e) {
    assertExceptionContentsAndRethrow(customRegistryException,e);
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.registry.internal.CustomUserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate)}.
 */
@Test(expected=RegistryException.class) public void testMapCertificate_CustomRegistryException() throws Exception {
  mockery.checking(new Expectations(){
{
      one(customUserRegistry).mapCertificate(certChain);
      will(throwException(customRegistryException));
    }
  }
);
  try {
    wrapper.mapCertificate(certChain);
  }
 catch (  Exception e) {
    assertExceptionContentsAndRethrow(customRegistryException,e);
  }
}
Program: 34583
Project: 34583
Buggy source:
public static void createJwtSSOToken(Subject subject){
  if (jwtSSOTokenProxyRef.getService() != null) {
    try {
      jwtSSOTokenProxyRef.getService().createJwtSSOToken(subject);
    }
 catch (    WSSecurityException e) {
      String msg=Tr.formatMessage(tc,"String_Node_Str");
      Tr.error(tc,msg);
    }
  }
}

Fixed version (ground truth):
public static void createJwtSSOToken(Subject subject){
  if (jwtSSOTokenProxyRef.getService() != null) {
    try {
      jwtSSOTokenProxyRef.getService().createJwtSSOToken(subject);
    }
 catch (    WSSecurityException e) {
      String msg=Tr.formatMessage(tc,"String_Node_Str");
      Tr.warning(tc,msg);
    }
  }
}
Program: 34584
Project: 34584
Buggy source:
/** 
 * @param subject
 * @param req
 * @param resp
 */
@Override public void addJwtSsoCookiesToResponse(Subject subject,HttpServletRequest req,HttpServletResponse resp){
  String cookieByteString=JwtSSOTokenHelper.getJwtSSOToken(subject);
  if (cookieByteString != null) {
    addJwtCookies(cookieByteString,req,resp);
    isJwtCookie=true;
  }
}

Fixed version (ground truth):
/** 
 * @param subject
 * @param req
 * @param resp
 */
@Override public void addJwtSsoCookiesToResponse(Subject subject,HttpServletRequest req,HttpServletResponse resp){
  String cookieByteString=JwtSSOTokenHelper.getJwtSSOToken(subject);
  if (cookieByteString != null) {
    String testString=getJwtSsoTokenFromCookies(req,getJwtCookieName());
    boolean cookieAlreadySent=testString != null && testString.equals(cookieByteString);
    if (!cookieAlreadySent) {
      addJwtCookies(cookieByteString,req,resp);
    }
    isJwtCookie=true;
  }
}
Program: 34585
Project: 34585
Buggy source:
@Test public void testScheduleInvalidation() throws Exception {
  int hour=ZonedDateTime.now().getHour();
  int hour1=(hour + 8) % 24;
  int hour2=(hour + 16) % 24;
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setScheduleInvalidationFirstHour(Integer.toString(hour1));
  httpSessionCache.setScheduleInvalidationSecondHour(Integer.toString(hour2));
  httpSessionCache.setWriteFrequency("String_Node_Str");
  httpSessionCache.setWriteInterval("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  ArrayList<String> session=new ArrayList<>();
  String response=FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  int start=response.indexOf("String_Node_Str") + 13;
  String sessionId=response.substring(start,response.indexOf(']',start));
  TimeUnit.SECONDS.sleep(35);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str" + sessionId,null);
  response=FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  start=response.indexOf("String_Node_Str") + 13;
  sessionId=response.substring(start,response.indexOf(']',start));
}

Fixed version (ground truth):
@Test public void testScheduleInvalidation() throws Exception {
  int hour=ZonedDateTime.now().getHour();
  int hour1=(hour + 8) % 24;
  int hour2=(hour + 16) % 24;
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setScheduleInvalidationFirstHour(Integer.toString(hour1));
  httpSessionCache.setScheduleInvalidationSecondHour(Integer.toString(hour2));
  httpSessionCache.setWriteFrequency("String_Node_Str");
  httpSessionCache.setWriteInterval("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  ArrayList<String> session=new ArrayList<>();
  String response=run("String_Node_Str",session);
  int start=response.indexOf("String_Node_Str") + 13;
  String sessionId=response.substring(start,response.indexOf(']',start));
  TimeUnit.SECONDS.sleep(35);
  run("String_Node_Str" + sessionId,null);
  response=run("String_Node_Str",session);
  start=response.indexOf("String_Node_Str") + 13;
  sessionId=response.substring(start,response.indexOf(']',start));
}
Program: 34586
Project: 34586
Buggy source:
/** 
 * Update the configured value of the writeContents attribute while the server is running. Confirm the configured behavior.
 */
@Test public void testWriteContents() throws Exception {
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setWriteContents("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  httpSessionCache.setWriteContents("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
}

Fixed version (ground truth):
/** 
 * Update the configured value of the writeContents attribute while the server is running. Confirm the configured behavior.
 */
@Test public void testWriteContents() throws Exception {
  run("String_Node_Str",new ArrayList<>());
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setWriteContents("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
  httpSessionCache.setWriteContents("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
}
Program: 34587
Project: 34587
Buggy source:
/** 
 * Verify that application usage of a caching provider does not interfere with the sessionCache feature.
 */
@Test public void testApplicationClosesCachingProvider() throws Exception {
  ServerConfiguration config=server.getServerConfiguration();
  Application jcacheApp=new Application();
  ClassloaderElement jcacheApp_classloader=new ClassloaderElement();
  jcacheApp_classloader.getCommonLibraryRefs().add("String_Node_Str");
  jcacheApp.getClassloaders().add(jcacheApp_classloader);
  jcacheApp.setLocation("String_Node_Str");
  config.getApplications().add(jcacheApp);
  Set<String> appNames=new TreeSet<String>(APP_NAMES);
  appNames.add("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(appNames,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,"String_Node_Str","String_Node_Str",null);
  List<String> session=new ArrayList<>();
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
}

Fixed version (ground truth):
/** 
 * Verify that application usage of a caching provider does not interfere with the sessionCache feature.
 */
@Test public void testApplicationClosesCachingProvider() throws Exception {
  ServerConfiguration config=server.getServerConfiguration();
  Application jcacheApp=new Application();
  ClassloaderElement jcacheApp_classloader=new ClassloaderElement();
  jcacheApp_classloader.getCommonLibraryRefs().add("String_Node_Str");
  jcacheApp.getClassloaders().add(jcacheApp_classloader);
  jcacheApp.setLocation(APP_JCACHE + "String_Node_Str");
  config.getApplications().add(jcacheApp);
  Set<String> appNames=new TreeSet<String>(APP_NAMES);
  appNames.add(APP_JCACHE);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(appNames,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_JCACHE + "String_Node_Str","String_Node_Str",null);
  List<String> session=new ArrayList<>();
  run("String_Node_Str",session);
  run("String_Node_Str",session);
}
Program: 34589
Project: 34589
Buggy source:
/** 
 * Update the configured value of the writeFrequency attribute from default (END_OF_SERVLET_SERVICE) to MANUAL_UPDATE while the server is running. The session must remain valid, and must exhibit the new behavior (MANUAL_UPDATE) after the configuration change.
 */
@Test public void testWriteFrequency() throws Exception {
  List<String> session=new ArrayList<>();
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setWriteFrequency("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",session);
}

Fixed version (ground truth):
/** 
 * Update the configured value of the writeFrequency attribute from default (END_OF_SERVLET_SERVICE) to MANUAL_UPDATE while the server is running. The session must remain valid, and must exhibit the new behavior (MANUAL_UPDATE) after the configuration change.
 */
@Test public void testWriteFrequency() throws Exception {
  List<String> session=new ArrayList<>();
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  ServerConfiguration config=server.getServerConfiguration();
  HttpSessionCache httpSessionCache=config.getHttpSessionCaches().get(0);
  httpSessionCache.setWriteFrequency("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
}
Program: 34590
Project: 34590
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  ShrinkHelper.defaultApp(server,APP_NAME,"String_Node_Str");
  ShrinkHelper.defaultApp(server,"String_Node_Str","String_Node_Str");
  server.removeInstalledAppForValidation("String_Node_Str");
  String configLocation=new File(server.getUserDir() + "String_Node_Str").getAbsolutePath();
  server.setJvmOptions(Arrays.asList("String_Node_Str" + configLocation,"String_Node_Str" + UUID.randomUUID()));
  savedConfig=server.getServerConfiguration().clone();
  server.startServer();
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  ShrinkHelper.defaultApp(server,APP_DEFAULT,"String_Node_Str");
  ShrinkHelper.defaultApp(server,APP_JCACHE,"String_Node_Str");
  server.removeInstalledAppForValidation(APP_JCACHE);
  String configLocation=new File(server.getUserDir() + "String_Node_Str").getAbsolutePath();
  server.setJvmOptions(Arrays.asList("String_Node_Str" + configLocation,"String_Node_Str" + UUID.randomUUID()));
  savedConfig=server.getServerConfiguration().clone();
  server.startServer();
}
Program: 34591
Project: 34591
Buggy source:
/** 
 * Enable and disable monitoring for sessions while the server is running.
 */
@Test public void testMonitoring() throws Exception {
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  ServerConfiguration config=server.getServerConfiguration();
  config.getFeatureManager().getFeatures().add("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  Monitor monitor=new Monitor();
  monitor.setFilter("String_Node_Str");
  config.getMonitors().add(monitor);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  monitor.setFilter("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(savedConfig);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  FATSuite.run(server,APP_NAME + '/' + SERVLET_NAME,"String_Node_Str",new ArrayList<>());
}

Fixed version (ground truth):
/** 
 * Enable and disable monitoring for sessions while the server is running.
 */
@Test public void testMonitoring() throws Exception {
  run("String_Node_Str",new ArrayList<>());
  ServerConfiguration config=server.getServerConfiguration();
  config.getFeatureManager().getFeatures().add("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
  Monitor monitor=new Monitor();
  monitor.setFilter("String_Node_Str");
  config.getMonitors().add(monitor);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
  monitor.setFilter("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(savedConfig);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",new ArrayList<>());
}
Program: 34592
Project: 34592
Buggy source:
/** 
 * Gets a Hashtable of values from the Subject.
 * @param subject {@code null} is not supported.
 * @param properties The properties to get.
 * @return
 */
public Hashtable<String,?> getHashtableFromSubject(final Subject subject,final String[] properties){
  return AccessController.doPrivileged(new PrivilegedAction<Hashtable<String,?>>(){
    @Override public Hashtable<String,?> run(){
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      Set<Object> list_public=subject.getPublicCredentials();
      Hashtable<String,?> hashtableFromPublic=getHashtable(list_public,properties);
      if (hashtableFromPublic != null) {
        return hashtableFromPublic;
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      Set<Object> list_private=subject.getPrivateCredentials();
      Hashtable<String,?> hashtableFromPrivate=getHashtable(list_private,properties);
      if (hashtableFromPrivate != null) {
        return hashtableFromPrivate;
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Trivial private Hashtable<String,?> getHashtableFromSubject(Subject subject){
  Set s=subject.getPrivateCredentials(Hashtable.class);
  if (s == null || s.isEmpty()) {
    if (tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    return null;
  }
 else {
    return (Hashtable<String,?>)s.iterator().next();
  }
}
Program: 34593
Project: 34593
Buggy source:
protected Hashtable<String,Object> getSubjectCustomData(final Subject clientSubject){
  Hashtable<String,Object> cred=jaspiService.getCustomCredentials(clientSubject);
  if (cred == null) {
    PrivilegedAction<Hashtable<String,Object>> action=new PrivilegedAction<Hashtable<String,Object>>(){
      @Override public Hashtable<String,Object> run(){
        Hashtable<String,Object> newCred=new Hashtable<String,Object>();
        clientSubject.getPrivateCredentials().add(newCred);
        return newCred;
      }
    }
;
    cred=AccessController.doPrivileged(action);
  }
  return cred;
}

Fixed version (ground truth):
protected Hashtable<String,Object> getSubjectCustomData(@Sensitive final Subject clientSubject){
  Hashtable<String,Object> cred=jaspiService.getCustomCredentials(clientSubject);
  if (cred == null) {
    SubjectHelper subjectHelper=new SubjectHelper();
    cred=subjectHelper.createNewHashtableInSubject(clientSubject);
  }
  return cred;
}
Program: 34595
Project: 34595
Buggy source:
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str" + this.getId() + "String_Node_Str");
  if (this.hostAliases != null)   for (  String hostAlias : hostAliases)   buf.append("String_Node_Str" + hostAlias + "String_Node_Str");
  if (this.allowFromEndpoint != null) {
    buf.append("String_Node_Str" + this.allowFromEndpoint + "String_Node_Str");
  }
  buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append("String_Node_Str" + this.getId() + "String_Node_Str");
  if (this.hostAliases != null)   for (  String hostAlias : hostAliases)   buf.append("String_Node_Str" + hostAlias + "String_Node_Str");
  if (this.allowFromEndpointRef != null) {
    buf.append("String_Node_Str" + this.allowFromEndpointRef + "String_Node_Str");
  }
  buf.append("String_Node_Str");
  return buf.toString();
}
Program: 34596
Project: 34596
Buggy source:
private static void configureVirtualHost(ServerConfiguration serverConfig,LibertyServletContainerFactory factory,String springBootConfigId){
  List<VirtualHost> virtualHosts=serverConfig.getVirtualHosts();
  virtualHosts.clear();
  VirtualHost virtualHost=new VirtualHost();
  virtualHost.setId(SPRING_VIRTUALHOST + springBootConfigId);
  HttpEndpoint httpEndpoint=serverConfig.getHttpEndpoints().iterator().next();
  virtualHost.setAllowFromEndpoint(httpEndpoint.getId());
  Set<String> aliases=virtualHost.getHostAliases();
  aliases.clear();
  aliases.add("String_Node_Str" + factory.getPort());
  virtualHosts.add(virtualHost);
}

Fixed version (ground truth):
private static void configureVirtualHost(ServerConfiguration serverConfig,LibertyServletContainerFactory factory,String springBootConfigId){
  List<VirtualHost> virtualHosts=serverConfig.getVirtualHosts();
  virtualHosts.clear();
  VirtualHost virtualHost=new VirtualHost();
  virtualHost.setId(SPRING_VIRTUALHOST + springBootConfigId);
  HttpEndpoint httpEndpoint=serverConfig.getHttpEndpoints().iterator().next();
  virtualHost.setAllowFromEndpointRef(httpEndpoint.getId());
  Set<String> aliases=virtualHost.getHostAliases();
  aliases.clear();
  aliases.add("String_Node_Str" + factory.getPort());
  virtualHosts.add(virtualHost);
}
Program: 34597
Project: 34597
Buggy source:
private static void configureVirtualHost(ServerConfiguration serverConfig,LibertyServletContainerFactory factory,String springBootConfigId){
  List<VirtualHost> virtualHosts=serverConfig.getVirtualHosts();
  virtualHosts.clear();
  VirtualHost virtualHost=new VirtualHost();
  virtualHost.setId(SPRING_VIRTUALHOST + springBootConfigId);
  HttpEndpoint httpEndpoint=serverConfig.getHttpEndpoints().iterator().next();
  virtualHost.setAllowFromEndpoint(httpEndpoint.getId());
  Set<String> aliases=virtualHost.getHostAliases();
  aliases.clear();
  aliases.add("String_Node_Str" + factory.getPort());
  virtualHosts.add(virtualHost);
}

Fixed version (ground truth):
private static void configureVirtualHost(ServerConfiguration serverConfig,LibertyServletContainerFactory factory,String springBootConfigId){
  List<VirtualHost> virtualHosts=serverConfig.getVirtualHosts();
  virtualHosts.clear();
  VirtualHost virtualHost=new VirtualHost();
  virtualHost.setId(SPRING_VIRTUALHOST + springBootConfigId);
  HttpEndpoint httpEndpoint=serverConfig.getHttpEndpoints().iterator().next();
  virtualHost.setAllowFromEndpointRef(httpEndpoint.getId());
  Set<String> aliases=virtualHost.getHostAliases();
  aliases.clear();
  aliases.add("String_Node_Str" + factory.getPort());
  virtualHosts.add(virtualHost);
}
Program: 34598
Project: 34598
Buggy source:
/** 
 * When the output file has reached it's maximum size, this code will rotate the current log to a backup and get ready to start logging with a new file.
 */
private void rotate(){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,getFileName() + "String_Node_Str");
  }
  bytesWritten=0;
  try {
    getChannel().close();
  }
 catch (  IOException ioe) {
    FFDCFilter.processException(ioe,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,getFileName() + "String_Node_Str" + ioe);
    }
  }
  try {
    if (0 < getMaximumBackupFiles()) {
      addBackup();
    }
    setChannel(createFileOutputStream().getChannel());
  }
 catch (  Throwable t) {
    FFDCFilter.processException(t,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
      Tr.event(tc,getFileName() + "String_Node_Str" + t);
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + getFileName());
  }
}

Fixed version (ground truth):
/** 
 * When the output file has reached it's maximum size, this code will rotate the current log to a backup and get ready to start logging with a new file.
 */
private void rotate(){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,getFileName() + "String_Node_Str");
  }
  bytesWritten=0;
  try {
    getChannel().close();
  }
 catch (  IOException ioe) {
    FFDCFilter.processException(ioe,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,getFileName() + "String_Node_Str" + ioe);
    }
  }
  try {
    if (0 <= getMaximumBackupFiles()) {
      addBackup();
    }
    setChannel(createFileOutputStream().getChannel());
  }
 catch (  Throwable t) {
    FFDCFilter.processException(t,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
      Tr.event(tc,getFileName() + "String_Node_Str" + t);
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + getFileName());
  }
}
Program: 34599
Project: 34599
Buggy source:
/** 
 * Start this worker thread accepting and handling new data.
 */
@Override public void start(){
  if (0 < getMaximumBackupFiles()) {
    this.myFormat=new SimpleDateFormat("String_Node_Str",Locale.US);
    int index=getFileName().lastIndexOf("String_Node_Str");
    if (-1 != index) {
      index+=(getFilePathName().length() - getFileName().length());
      this.fileinfo=getFilePathName().substring(0,index);
      this.extensioninfo=getFilePathName().substring(index);
    }
 else {
      this.fileinfo=getFilePathName();
      this.extensioninfo="String_Node_Str";
    }
    this.backups=new LinkedList<File>();
  }
  try {
    bytesWritten=myChannel.size();
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + bytesWritten);
    }
  }
 catch (  IOException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    bytesWritten=0;
  }
  super.start();
}

Fixed version (ground truth):
/** 
 * Start this worker thread accepting and handling new data.
 */
@Override public void start(){
  if (0 <= getMaximumBackupFiles()) {
    this.myFormat=new SimpleDateFormat("String_Node_Str",Locale.US);
    int index=getFileName().lastIndexOf("String_Node_Str");
    if (-1 != index) {
      index+=(getFilePathName().length() - getFileName().length());
      this.fileinfo=getFilePathName().substring(0,index);
      this.extensioninfo=getFilePathName().substring(index);
    }
 else {
      this.fileinfo=getFilePathName();
      this.extensioninfo="String_Node_Str";
    }
    this.backups=new LinkedList<File>();
  }
  try {
    bytesWritten=myChannel.size();
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + bytesWritten);
    }
  }
 catch (  IOException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    bytesWritten=0;
  }
  super.start();
}
Program: 34600
Project: 34600
Buggy source:
/** 
 * Move the current logfile to a backup name, taking care of any existing backup files according to the configured limit.
 */
private void addBackup(){
  String newname=this.fileinfo + this.myFormat.format(new Date(HttpDispatcher.getApproxTime())) + this.extensioninfo;
  File newFile=new File(newname);
  renameFile(getFile(),newFile);
  while (this.backups.size() >= getMaximumBackupFiles()) {
    File oldest=this.backups.removeLast();
    if (null != oldest && oldest.exists()) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,getFileName() + "String_Node_Str" + oldest.getName());
      }
      oldest.delete();
    }
  }
  this.backups.addFirst(newFile);
}

Fixed version (ground truth):
/** 
 * Move the current logfile to a backup name, taking care of any existing backup files according to the configured limit.
 */
private void addBackup(){
  String newname=this.fileinfo + this.myFormat.format(new Date(HttpDispatcher.getApproxTime())) + this.extensioninfo;
  File newFile=new File(newname);
  renameFile(getFile(),newFile);
  if (getMaximumBackupFiles() > 0) {
    while (this.backups.size() >= getMaximumBackupFiles()) {
      File oldest=this.backups.removeLast();
      if (null != oldest && oldest.exists()) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,getFileName() + "String_Node_Str" + oldest.getName());
        }
        oldest.delete();
      }
    }
  }
  this.backups.addFirst(newFile);
}
Program: 34601
Project: 34601
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void createLogoutCookies(HttpServletRequest req,HttpServletResponse res){
  Cookie[] cookies=req.getCookies();
  java.util.ArrayList<Cookie> logoutCookieList=new java.util.ArrayList<Cookie>();
  if (cookies != null) {
    String ssoCookieName=resolveCookieName(cookies);
    for (int i=0; i < cookies.length; i++) {
      if (cookies[i].getName().equalsIgnoreCase(ssoCookieName)) {
        cookies[i].setValue(null);
        addLogoutCookieToList(req,ssoCookieName,logoutCookieList);
      }
    }
    String jwtCookieName=getJwtCookieName();
    if (jwtCookieName != null) {
      for (int i=0; i < cookies.length; i++) {
        if (isJwtCookie(jwtCookieName,cookies[i].getName())) {
          cookies[i].setValue(null);
          addLogoutCookieToList(req,cookies[i].getName(),logoutCookieList);
        }
      }
      if (config.isTrackLoggedOutSSOCookiesEnabled()) {
        LoggedOutJwtSsoCookieCache.put(getJwtSsoTokenFromCookies(req,jwtCookieName));
      }
    }
    for (    Cookie cookie : logoutCookieList) {
      res.addCookie(cookie);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void createLogoutCookies(HttpServletRequest req,HttpServletResponse res){
  Cookie[] cookies=req.getCookies();
  java.util.ArrayList<Cookie> logoutCookieList=new java.util.ArrayList<Cookie>();
  if (cookies != null) {
    String ssoCookieName=resolveCookieName(cookies);
    for (int i=0; i < cookies.length; i++) {
      if (cookies[i].getName().equalsIgnoreCase(ssoCookieName)) {
        cookies[i].setValue(null);
        addLogoutCookieToList(req,ssoCookieName,logoutCookieList);
      }
    }
    String jwtCookieName=getJwtCookieName();
    if (jwtCookieName != null) {
      if (config.isTrackLoggedOutSSOCookiesEnabled()) {
        LoggedOutJwtSsoCookieCache.put(getJwtSsoTokenFromCookies(req,jwtCookieName));
      }
      for (int i=0; i < cookies.length; i++) {
        if (isJwtCookie(jwtCookieName,cookies[i].getName())) {
          cookies[i].setValue(null);
          addLogoutCookieToList(req,cookies[i].getName(),logoutCookieList);
        }
      }
    }
    for (    Cookie cookie : logoutCookieList) {
      res.addCookie(cookie);
    }
  }
}
Program: 34602
Project: 34602
Buggy source:
void unregisterSpringConfigFactory(){
  springBootConfigReg.updateAndGet((r) -> {
    if (r != null) {
      r.unregister();
    }
    return null;
  }
);
}

Fixed version (ground truth):
@FFDCIgnore(IllegalStateException.class) void unregisterSpringConfigFactory(){
  try {
    springBootConfigReg.updateAndGet((r) -> {
      if (r != null) {
        r.unregister();
      }
      return null;
    }
);
  }
 catch (  IllegalStateException e) {
  }
}