nus-yam/ex-repair huggingface dataset:
Program: 9112
Project: 9112
Buggy source:
private void auditAccessFailure(Request request,Response response){
  if (auditEventPublisher.isAuditing(ACCESS_TOPIC)) {
    long endTime=System.currentTimeMillis();
    AMAccessAuditEventBuilder builder=auditEventFactory.accessEvent().timestamp(endTime).transactionId(AuditRequestContext.getTransactionIdValue()).eventName(EventName.AM_ACCESS_OUTCOME).component(component).authentication(getUserIdForAccessOutcome(response)).contextId(getContextIdForAccessOutcome(response)).responseWithMessage("String_Node_Str" + response.getStatus().getCode(),endTime - request.getDate().getTime(),response.getStatus().getDescription());
    addHttpData(request,builder);
    auditEventPublisher.tryPublish(ACCESS_TOPIC,builder.toEvent());
  }
}

Fixed version (ground truth):
private void auditAccessFailure(Request request,Response response){
}
Program: 9113
Project: 9113
Buggy source:
/** 
 * Retrieve the user ID for an access attempt.
 * @param request the restlet request
 * @return the user ID
 */
protected String getUserIdForAccessAttempt(Request request){
  String userId=AuditRequestContext.getProperty(USER_ID);
  return userId == null ? "String_Node_Str" : userId;
}

Fixed version (ground truth):
/** 
 * Retrieve the user ID for an access attempt.
 * @param request the restlet request
 * @return the user ID
 */
protected String getUserIdForAccessAttempt(Request request){
  return null;
}
Program: 9114
Project: 9114
Buggy source:
@Override protected int beforeHandle(Request request,Response response){
  try {
    Representation representation=request.getEntity();
    if (representation.isTransient()) {
      request.setEntity(new BufferingRepresentation(request.getEntity()));
    }
    auditAccessAttempt(request);
  }
 catch (  AuditException e) {
    response.setStatus(Status.SERVER_ERROR_INTERNAL,e);
    return STOP;
  }
  return CONTINUE;
}

Fixed version (ground truth):
@Override protected int beforeHandle(Request request,Response response){
  return 0;
}
Program: 9115
Project: 9115
Buggy source:
private void auditAccessAttempt(Request request) throws AuditException {
  if (auditEventPublisher.isAuditing(ACCESS_TOPIC)) {
    AMAccessAuditEventBuilder builder=auditEventFactory.accessEvent().timestamp(request.getDate().getTime()).transactionId(AuditRequestContext.getTransactionIdValue()).eventName(EventName.AM_ACCESS_ATTEMPT).component(component).authentication(getUserIdForAccessAttempt(request)).contextId(getContextIdForAccessAttempt(request));
    addHttpData(request,builder);
    auditEventPublisher.publish(ACCESS_TOPIC,builder.toEvent());
  }
}

Fixed version (ground truth):
private void auditAccessAttempt(Request request) throws AuditException {
}
Program: 9116
Project: 9116
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected String getContextIdForAccessAttempt(Request request){
  String contextId=super.getContextIdForAccessAttempt(request);
  if (contextId != null) {
    return contextId;
  }
  AccessToken accessToken=retrieveAccessToken(request);
  contextId=generateContextID(accessToken);
  AuditRequestContext.putProperty(CONTEXT_ID,contextId);
  return contextId;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected String getContextIdForAccessAttempt(Request request){
  return null;
}
Program: 9117
Project: 9117
Buggy source:
@Test public void shouldHandleAuditException() throws AuditException {
  Request request=mock(Request.class);
  Response response=new Response(request);
  Representation representation=mock(Representation.class);
  when(request.getEntity()).thenReturn(representation);
  when(request.getDate()).thenReturn(new Date());
  when(representation.isTransient()).thenReturn(false);
  AuditRequestContext.putProperty(USER_ID,"String_Node_Str");
  AuditRequestContext.putProperty(CONTEXT_ID,"String_Node_Str");
  when(eventPublisher.isAuditing(anyString())).thenReturn(true);
  when(eventPublisher.isSuppressExceptions()).thenReturn(false);
  doThrow(AuditException.class).when(eventPublisher).publish(anyString(),any(AuditEvent.class));
  auditFilter.handle(request,response);
  verify(restlet,never()).handle(any(Request.class),any(Response.class));
  assertThat(response.getStatus()).isEqualTo(Status.SERVER_ERROR_INTERNAL);
}

Fixed version (ground truth):
@Test public void shouldHandleAuditException() throws AuditException {
  Request request=mock(Request.class);
  Response response=new Response(request);
  Representation representation=mock(Representation.class);
  when(request.getEntity()).thenReturn(representation);
  when(request.getDate()).thenReturn(new Date());
  when(representation.isTransient()).thenReturn(false);
  AuditRequestContext.putProperty(USER_ID,"String_Node_Str");
  when(eventPublisher.isAuditing(anyString())).thenReturn(true);
  when(eventPublisher.isSuppressExceptions()).thenReturn(false);
  doThrow(AuditException.class).when(eventPublisher).publish(anyString(),any(AuditEvent.class));
  auditFilter.handle(request,response);
  verify(restlet,never()).handle(any(Request.class),any(Response.class));
  assertThat(response.getStatus()).isEqualTo(Status.SERVER_ERROR_INTERNAL);
}
Program: 9118
Project: 9118
Buggy source:
public void auditActivity(InternalSession session,EventName eventName){
  if (auditEventPublisher.isAuditing(ACTIVITY_TOPIC)) {
    String contextId=session.getProperty(Constants.AM_CTX_ID);
    AuditEvent auditEvent=auditEventFactory.activityEvent().transactionId(AuditRequestContext.getTransactionIdValue()).eventName(eventName).component(Component.SESSION).authentication(session.getProperty(Constants.UNIVERSAL_IDENTIFIER)).contextId(Context.SESSION,contextId).runAs(getUserId(getAdminToken())).resourceOperation(contextId,"String_Node_Str",getCrudType(eventName)).toEvent();
    auditEventPublisher.tryPublish(ACTIVITY_TOPIC,auditEvent);
  }
}

Fixed version (ground truth):
public void auditActivity(InternalSession session,EventName eventName){
  if (auditEventPublisher.isAuditing(ACTIVITY_TOPIC)) {
    String contextId=session.getProperty(Constants.AM_CTX_ID);
    AuditEvent auditEvent=auditEventFactory.activityEvent().transactionId(AuditRequestContext.getTransactionIdValue()).eventName(eventName).component(Component.SESSION).authentication(session.getProperty(Constants.UNIVERSAL_IDENTIFIER)).context(Context.SESSION,contextId).runAs(getUserId(getAdminToken())).resourceOperation(contextId,"String_Node_Str",getCrudType(eventName)).toEvent();
    auditEventPublisher.tryPublish(ACTIVITY_TOPIC,auditEvent);
  }
}
Program: 9119
Project: 9119
Buggy source:
/** 
 * @return
 */
public static Map<String,String> getAllAvailableContexts(){
  Map<String,String> map=new HashMap<>();
  for (  AuditConstants.Context context : AuditConstants.Context.values()) {
    String contextKey=context.toString();
    String contextValue=AuditRequestContext.getProperty(contextKey);
    if (StringUtils.isNotEmpty(contextValue)) {
      map.put(contextKey,contextValue);
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * Get all available   {@link AuditConstants.Context} values from the possible list of{@link AuditConstants.Context} values, from the {@link AuditRequestContext}.
 * @return All the available {@link AuditConstants.Context} values.
 */
public static Map<String,String> getAllAvailableContexts(){
  Map<String,String> map=new HashMap<>();
  for (  AuditConstants.Context context : AuditConstants.Context.values()) {
    String contextKey=context.toString();
    String contextValue=AuditRequestContext.getProperty(contextKey);
    if (StringUtils.isNotEmpty(contextValue)) {
      map.put(contextKey,contextValue);
    }
  }
  return map;
}
Program: 9121
Project: 9121
Buggy source:
/** 
 * Gets the instance of the OAuth2ProviderSettings.
 * @param realm The realm.
 * @param req The request that can be used to obtain the base deployment url.
 * @return The OAuth2ProviderSettings instance.
 */
OAuth2ProviderSettings get(String realm,HttpServletRequest req) throws NotFoundException ;

Fixed version (ground truth):
/** 
 * Gets the instance of the OAuth2ProviderSettings.
 * @param realm The realm.
 * @param context The context that can be used to obtain the base deployment url.
 * @return The OAuth2ProviderSettings instance.
 */
OAuth2ProviderSettings get(String realm,Context context) throws NotFoundException ;
Program: 9122
Project: 9122
Buggy source:
/** 
 * Cache each provider settings on the realm it was created for.  {@inheritDoc}
 */
public OAuth2ProviderSettings get(String realm,HttpServletRequest req) throws NotFoundException {
  String baseDeploymentUri=baseURLProviderFactory.get(realm).getURL(req);
synchronized (providerSettingsMap) {
    OAuth2ProviderSettings providerSettings=providerSettingsMap.get(realm);
    if (providerSettings == null) {
      ResourceSetStore resourceSetStore=resourceSetStoreFactory.create(realm);
      providerSettings=new OpenAMOAuth2ProviderSettings(realm,baseDeploymentUri,resourceSetStore,cookieExtractor);
      if (providerSettings.exists()) {
        providerSettingsMap.put(realm,providerSettings);
      }
 else {
        throw new NotFoundException("String_Node_Str" + realm);
      }
    }
    return providerSettings;
  }
}

Fixed version (ground truth):
@Override public OAuth2ProviderSettings get(String realm,Context context) throws NotFoundException {
  Reject.ifNull(realm,"String_Node_Str");
  Reject.ifNull(context,"String_Node_Str");
  String baseDeploymentUri=baseURLProviderFactory.get(realm).getURL(context.asContext(HttpContext.class));
  return getProviderSettings(realm,baseDeploymentUri);
}
Program: 9123
Project: 9123
Buggy source:
@Override public void addRoutes(RestRouter rootRouter,RestRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(OAUTH2).authorizeWith(ResourceOwnerOrSuperUserAuthzModule.class).through(UmaEnabledFilter.class).toCollection(ResourceSetResource.class);
  realmRouter.route("String_Node_Str").auditAs(OAUTH2).authorizeWith(ResourceOwnerOrSuperUserAuthzModule.class).toCollection(UmaLabelResource.class);
}

Fixed version (ground truth):
@Override public void addRoutes(RestRouter rootRouter,RestRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(OAUTH2).authorizeWith(ResourceOwnerOrSuperUserAuthzModule.class).through(UmaEnabledFilter.class).toCollection(ResourceSetResource.class);
  realmRouter.route("String_Node_Str").auditAs(OAUTH2).authorizeWith(ResourceOwnerOrSuperUserAuthzModule.class).through(UmaEnabledFilter.class).toCollection(UmaLabelResource.class);
}
Program: 9124
Project: 9124
Buggy source:
public void setResourceSetQuery(org.forgerock.util.query.QueryFilter<String> query){
  setFirstQuery(query);
}

Fixed version (ground truth):
/** 
 * Set the resource set query.
 * @param query The query.
 */
public void setResourceSetQuery(org.forgerock.util.query.QueryFilter<String> query){
  setFirstQuery(query);
}
Program: 9125
Project: 9125
Buggy source:
public QueryFilter getPolicyQuery(){
  return getSecondQuery();
}

Fixed version (ground truth):
/** 
 * Get the policy query.
 * @return The query.
 */
public QueryFilter<JsonPointer> getPolicyQuery(){
  return getSecondQuery();
}
Program: 9126
Project: 9126
Buggy source:
public org.forgerock.util.query.QueryFilter<String> getResourceSetQuery(){
  return getFirstQuery();
}

Fixed version (ground truth):
/** 
 * Get the resource set query.
 * @return The query.
 */
public org.forgerock.util.query.QueryFilter<String> getResourceSetQuery(){
  return getFirstQuery();
}
Program: 9127
Project: 9127
Buggy source:
public void setPolicyQuery(QueryFilter query){
  setSecondQuery(query);
}

Fixed version (ground truth):
/** 
 * Set the policy query.
 * @param query The query.
 */
public void setPolicyQuery(QueryFilter<JsonPointer> query){
  setSecondQuery(query);
}
Program: 9128
Project: 9128
Buggy source:
private Promise<Void,ResourceException> enabled(Context serverContext){
  try {
    final String realm=ServerContextUtils.getRealm(serverContext);
    UmaProviderSettings settings=umaProviderSettingsFactory.get(RequestHolder.get(),realm);
    if (settings.isEnabled()) {
      return newResultPromise(null);
    }
  }
 catch (  NotFoundException ignore) {
  }
  return newExceptionPromise(newNotSupportedException("String_Node_Str"));
}

Fixed version (ground truth):
private Promise<Void,ResourceException> enabled(Context serverContext){
  try {
    final String realm=ServerContextUtils.getRealm(serverContext);
    UmaProviderSettings settings=umaProviderSettingsFactory.get(serverContext,realm);
    if (settings.isEnabled()) {
      return newResultPromise(null);
    }
  }
 catch (  NotFoundException ignore) {
  }
  return newExceptionPromise(newNotSupportedException("String_Node_Str"));
}
Program: 9130
Project: 9130
Buggy source:
@Test public void getResourceSetsShouldReturnEmptySetWhenNoResourceSetsExist() throws Exception {
  String realm="String_Node_Str";
  Context context=mockContext(realm);
  ResourceSetWithPolicyQuery query=new ResourceSetWithPolicyQuery();
  String resourceOwnerId="String_Node_Str";
  boolean augmentWithPolicies=false;
  QueryFilter<String> resourceSetQuery=mock(QueryFilter.class);
  QueryFilter policyQuery=QueryFilter.alwaysFalse();
  Set<ResourceSetDescription> queriedResourceSets=new HashSet<>();
  Collection<UmaPolicy> queriedPolicies=new HashSet<>();
  Pair<QueryResponse,Collection<UmaPolicy>> queriedPoliciesPair=Pair.of(newQueryResponse(),queriedPolicies);
  Promise<Pair<QueryResponse,Collection<UmaPolicy>>,ResourceException> queriedPoliciesPromise=Promises.newResultPromise(queriedPoliciesPair);
  query.setResourceSetQuery(resourceSetQuery);
  query.setPolicyQuery(policyQuery);
  given(resourceSetStore.query(any(QueryFilter.class))).willReturn(queriedResourceSets);
  given(policyService.queryPolicies(eq(context),Matchers.<QueryRequest>anyObject())).willReturn(queriedPoliciesPromise);
  mockResourceOwnerIdentity(resourceOwnerId,realm);
  mockPolicyEvaluator("String_Node_Str");
  mockFilteredResourceSetsQueryVisitor(resourceSetQuery,queriedResourceSets);
  Collection<ResourceSetDescription> resourceSets=service.getResourceSets(context,realm,query,resourceOwnerId,augmentWithPolicies).getOrThrowUninterruptibly();
  assertThat(resourceSets).isEmpty();
}

Fixed version (ground truth):
@Test public void getResourceSetsShouldReturnEmptySetWhenNoResourceSetsExist() throws Exception {
  String realm="String_Node_Str";
  Context context=mockContext(realm);
  ResourceSetWithPolicyQuery query=new ResourceSetWithPolicyQuery();
  String resourceOwnerId="String_Node_Str";
  boolean augmentWithPolicies=false;
  QueryFilter<String> resourceSetQuery=mock(QueryFilter.class);
  QueryFilter<JsonPointer> policyQuery=QueryFilter.alwaysFalse();
  Set<ResourceSetDescription> queriedResourceSets=new HashSet<>();
  Collection<UmaPolicy> queriedPolicies=new HashSet<>();
  Pair<QueryResponse,Collection<UmaPolicy>> queriedPoliciesPair=Pair.of(newQueryResponse(),queriedPolicies);
  Promise<Pair<QueryResponse,Collection<UmaPolicy>>,ResourceException> queriedPoliciesPromise=Promises.newResultPromise(queriedPoliciesPair);
  query.setResourceSetQuery(resourceSetQuery);
  query.setPolicyQuery(policyQuery);
  given(resourceSetStore.query(any(QueryFilter.class))).willReturn(queriedResourceSets);
  given(policyService.queryPolicies(eq(context),Matchers.<QueryRequest>anyObject())).willReturn(queriedPoliciesPromise);
  mockResourceOwnerIdentity(resourceOwnerId,realm);
  mockPolicyEvaluator("String_Node_Str");
  mockFilteredResourceSetsQueryVisitor(resourceSetQuery,queriedResourceSets);
  Collection<ResourceSetDescription> resourceSets=service.getResourceSets(context,realm,query,resourceOwnerId,augmentWithPolicies).getOrThrowUninterruptibly();
  assertThat(resourceSets).isEmpty();
}
Program: 9131
Project: 9131
Buggy source:
@BeforeClass public static void setupFactories() throws Exception {
  notYetConfiguredFactory=mock(UmaProviderSettingsFactory.class);
  given(notYetConfiguredFactory.get(any(HttpServletRequest.class),anyString())).willThrow(NotFoundException.class);
  UmaProviderSettings notEnabled=mock(UmaProviderSettings.class);
  given(notEnabled.isEnabled()).willReturn(false);
  notEnabledFactory=mock(UmaProviderSettingsFactory.class);
  given(notEnabledFactory.get(any(HttpServletRequest.class),anyString())).willReturn(notEnabled);
  UmaProviderSettings enabled=mock(UmaProviderSettings.class);
  given(enabled.isEnabled()).willReturn(true);
  enabledFactory=mock(UmaProviderSettingsFactory.class);
  given(enabledFactory.get(any(HttpServletRequest.class),anyString())).willReturn(enabled);
}

Fixed version (ground truth):
@BeforeClass public static void setupFactories() throws Exception {
  notYetConfiguredFactory=mock(UmaProviderSettingsFactory.class);
  given(notYetConfiguredFactory.get(any(Context.class),anyString())).willThrow(NotFoundException.class);
  UmaProviderSettings notEnabled=mock(UmaProviderSettings.class);
  given(notEnabled.isEnabled()).willReturn(false);
  notEnabledFactory=mock(UmaProviderSettingsFactory.class);
  given(notEnabledFactory.get(any(Context.class),anyString())).willReturn(notEnabled);
  UmaProviderSettings enabled=mock(UmaProviderSettings.class);
  given(enabled.isEnabled()).willReturn(true);
  enabledFactory=mock(UmaProviderSettingsFactory.class);
  given(enabledFactory.get(any(Context.class),anyString())).willReturn(enabled);
}
Program: 9132
Project: 9132
Buggy source:
@BeforeMethod public void setup() throws Exception {
  MockitoAnnotations.initMocks(this);
  context=new InternalContext(new RealmContext(new RootContext()));
  requestHandler=mock(RequestHandler.class);
  when(requestHandler.handleAction(any(Context.class),any(ActionRequest.class))).thenReturn(promise(newActionResponse(null)));
  when(requestHandler.handleCreate(any(Context.class),any(CreateRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleDelete(any(Context.class),any(DeleteRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handlePatch(any(Context.class),any(PatchRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleQuery(any(Context.class),any(QueryRequest.class),any(QueryResourceHandler.class))).thenReturn(promise(newQueryResponse()));
  when(requestHandler.handleRead(any(Context.class),any(ReadRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleUpdate(any(Context.class),any(UpdateRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  RequestHolder.set(mock(HttpServletRequest.class));
}

Fixed version (ground truth):
@BeforeMethod public void setup() throws Exception {
  MockitoAnnotations.initMocks(this);
  context=new InternalContext(new RealmContext(new RootContext()));
  requestHandler=mock(RequestHandler.class);
  when(requestHandler.handleAction(any(Context.class),any(ActionRequest.class))).thenReturn(promise(newActionResponse(null)));
  when(requestHandler.handleCreate(any(Context.class),any(CreateRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleDelete(any(Context.class),any(DeleteRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handlePatch(any(Context.class),any(PatchRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleQuery(any(Context.class),any(QueryRequest.class),any(QueryResourceHandler.class))).thenReturn(promise(newQueryResponse()));
  when(requestHandler.handleRead(any(Context.class),any(ReadRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
  when(requestHandler.handleUpdate(any(Context.class),any(UpdateRequest.class))).thenReturn(promise(newResourceResponse(null,null,null)));
}
Program: 9133
Project: 9133
Buggy source:
/** 
 * <p>Gets the instance of the UmaProviderSettings.</p> <p>Cache each provider settings on the realm it was created for.</p>
 * @param request The request instance from which the base URL can be deduced.
 * @param realm The realm.
 * @return The OAuth2ProviderSettings instance.
 */
public UmaProviderSettings get(HttpServletRequest request,String realm) throws NotFoundException {
synchronized (providerSettingsMap) {
    UmaProviderSettingsImpl providerSettings=providerSettingsMap.get(realm);
    if (providerSettings == null) {
      OAuth2ProviderSettings oAuth2ProviderSettings=oAuth2ProviderSettingsFactory.get(realm,request);
      String baseUrlPattern=baseURLProviderFactory.get(realm).getURL(request);
      UmaTokenStore tokenStore=tokenStoreFactory.create(realm);
      providerSettings=new UmaProviderSettingsImpl(realm,baseUrlPattern,tokenStore,oAuth2ProviderSettings);
      providerSettingsMap.put(realm,providerSettings);
    }
    return providerSettings;
  }
}

Fixed version (ground truth):
/** 
 * <p>Gets the instance of the UmaProviderSettings.</p> <p>Cache each provider settings on the realm it was created for.</p>
 * @param context The context instance from which the base URL can be deduced.
 * @param realm The realm.
 * @return The OAuth2ProviderSettings instance.
 */
public UmaProviderSettings get(Context context,String realm) throws NotFoundException {
synchronized (providerSettingsMap) {
    UmaProviderSettingsImpl providerSettings=providerSettingsMap.get(realm);
    if (providerSettings == null) {
      OAuth2ProviderSettings oAuth2ProviderSettings=oAuth2ProviderSettingsFactory.get(realm,context);
      String baseUrlPattern=baseURLProviderFactory.get(realm).getURL(context.asContext(HttpContext.class));
      providerSettings=getUmaProviderSettings(realm,oAuth2ProviderSettings,baseUrlPattern);
    }
    return providerSettings;
  }
}
Program: 9134
Project: 9134
Buggy source:
@Provides @Singleton Iterator<HttpRouteProvider> getHttpRouteProviders(){
  return ServiceLoader.load(HttpRouteProvider.class).iterator();
}

Fixed version (ground truth):
@Provides @Singleton Iterable<HttpRouteProvider> getHttpRouteProviders(){
  return ServiceLoader.load(HttpRouteProvider.class);
}
Program: 9135
Project: 9135
Buggy source:
Handler getHandler(){
  return handler.get();
}

Fixed version (ground truth):
Handler getHandler(){
  return new Handler(){
    @Override public Promise<Response,NeverThrowsException> handle(    Context context,    Request request){
      return handler.get().handle(context,request);
    }
  }
;
}
Program: 9136
Project: 9136
Buggy source:
AuthenticationFilter(CrestAuthenticationFilter authenticationFilter,AuthenticationModule authenticationModule){
  this.authenticationFilter=authenticationFilter;
  this.authenticationModule=authenticationModule;
}

Fixed version (ground truth):
AuthenticationFilter(Filter authenticationFilter,AuthenticationModule authenticationModule){
  this.authenticationFilter=authenticationFilter;
  this.authenticationModule=authenticationModule;
}
Program: 9137
Project: 9137
Buggy source:
@BeforeClass public void setupMocks(){
  restletXACMLServiceServlet=mock(RestletServiceServlet.class);
  restletOAuth2ServiceServlet=mock(RestletServiceServlet.class);
  restletUMAServiceServlet=mock(RestletServiceServlet.class);
}

Fixed version (ground truth):
@BeforeClass public void setupMocks(){
  restletXACMLServiceServlet=mock(RestletServiceServlet.class);
  restletOAuth2ServiceServlet=mock(RestletServiceServlet.class);
  restletUMAServiceServlet=mock(RestletServiceServlet.class);
  restletXACMLHttpServlet=mock(HttpServlet.class);
  authenticationFilter=mock(Filter.class);
}
Program: 9138
Project: 9138
Buggy source:
@Test(dataProvider="String_Node_Str") public void shouldHandleRequestWithRestletServlet(String path,RestletServiceServlet servlet) throws Exception {
  HttpServletRequest request=mock(HttpServletRequest.class);
  HttpServletResponse response=mock(HttpServletResponse.class);
  given(request.getServletPath()).willReturn(path);
  restEndpointServlet.service(request,response);
  verify(servlet).service(Matchers.<HttpServletRequest>anyObject(),eq(response));
  for (  RestletServiceServlet s : Arrays.asList(restletXACMLServiceServlet,restletOAuth2ServiceServlet,restletUMAServiceServlet)) {
    if (s != servlet) {
      verifyZeroInteractions(s);
    }
  }
}

Fixed version (ground truth):
@Test(dataProvider="String_Node_Str",enabled=false) public void shouldHandleRequestWithRestletServlet(String path,HttpServlet servlet) throws Exception {
  HttpServletRequest request=mock(HttpServletRequest.class);
  HttpServletResponse response=mock(HttpServletResponse.class);
  given(request.getHeaderNames()).willReturn(Collections.enumeration(Collections.emptySet()));
  given(request.getAttributeNames()).willReturn(Collections.enumeration(Collections.emptySet()));
  given(request.getServletPath()).willReturn(path);
  restEndpointServlet.init();
  restEndpointServlet.service(request,response);
  verify(servlet).service(Matchers.<HttpServletRequest>anyObject(),eq(response));
  for (  HttpServlet s : Arrays.asList(restletXACMLHttpServlet,restletOAuth2ServiceServlet,restletUMAServiceServlet)) {
    if (s != servlet) {
      verifyZeroInteractions(s);
    }
  }
}
Program: 9139
Project: 9139
Buggy source:
@DataProvider(name="String_Node_Str") public Object[][] restletPathData(){
  return new Object[][]{{"String_Node_Str",restletXACMLServiceServlet},{"String_Node_Str",restletOAuth2ServiceServlet},{"String_Node_Str",restletUMAServiceServlet}};
}

Fixed version (ground truth):
@DataProvider(name="String_Node_Str") public Object[][] restletPathData(){
  return new Object[][]{{"String_Node_Str",restletXACMLHttpServlet},{"String_Node_Str",restletOAuth2ServiceServlet},{"String_Node_Str",restletUMAServiceServlet}};
}
Program: 9140
Project: 9140
Buggy source:
@BeforeMethod public void setUp(){
  reset(restletXACMLServiceServlet);
  reset(restletOAuth2ServiceServlet);
  reset(restletUMAServiceServlet);
  restEndpointServlet=new RestEndpointServlet(restletXACMLServiceServlet,restletOAuth2ServiceServlet,restletUMAServiceServlet);
}

Fixed version (ground truth):
@BeforeMethod public void setUp(){
  reset(restletXACMLServiceServlet,restletOAuth2ServiceServlet,restletUMAServiceServlet,restletXACMLHttpServlet,authenticationFilter);
  restEndpointServlet=new RestEndpointServlet(restletXACMLServiceServlet,restletOAuth2ServiceServlet,restletUMAServiceServlet,restletXACMLHttpServlet,authenticationFilter);
}
Program: 9142
Project: 9142
Buggy source:
/** 
 * @return the value of the default CTS root suffix
 */
@VisibleForTesting DN getDefaultRootSuffix(){
  return defaultRootSuffix;
}

Fixed version (ground truth):
/** 
 * @return the value of the default CTS root suffix
 */
public DN getDefaultRootSuffix(){
  return defaultRootSuffix;
}
Program: 9143
Project: 9143
Buggy source:
/** 
 * Performs the upgrade by traversing through the candidate LDIF files and tries to process them. If embedded configuration store is used the indexes are also rebuilt as part of the upgrade. That will make sure that the newly created indexes are all operational.
 * @throws UpgradeException If there was an error while processing the LDIF files.
 */
public void upgrade() throws UpgradeException {
  Connection conn=null;
  try {
    conn=connFactory.create();
    for (    Upgrader upgrader : upgraders) {
      processLDIF(conn,upgrader.getLDIFPath());
    }
  }
 catch (  DataLayerException ere) {
    DEBUG.error("String_Node_Str",ere);
    throw new UpgradeException(ere);
  }
 finally {
    IOUtils.closeIfNotNull(conn);
  }
  if (EmbeddedOpenDS.isStarted()) {
    if (DEBUG.messageEnabled()) {
      DEBUG.message("String_Node_Str");
    }
    Map<String,String> rebuildIndexData=new HashMap<String,String>(2);
    rebuildIndexData.put(SetupConstants.CONFIG_VAR_BASE_DIR,baseDir);
    rebuildIndexData.put(SetupConstants.CONFIG_VAR_ROOT_SUFFIX,baseDN);
    try {
      EmbeddedOpenDS.rebuildIndex(rebuildIndexData);
    }
 catch (    Exception ex) {
      throw new UpgradeException(ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * Performs the upgrade by traversing through the candidate LDIF files and tries to process them. If embedded configuration store is used the indexes are also rebuilt as part of the upgrade. That will make sure that the newly created indexes are all operational.
 * @throws UpgradeException If there was an error while processing the LDIF files.
 */
public void upgrade() throws UpgradeException {
  Connection conn=null;
  try {
    conn=connFactory.create();
    for (    Upgrader upgrader : upgraders) {
      processLDIF(conn,upgrader.getLDIFPath());
    }
  }
 catch (  DataLayerException ere) {
    DEBUG.error("String_Node_Str",ere);
    throw new UpgradeException(ere);
  }
 finally {
    IOUtils.closeIfNotNull(conn);
  }
  if (isEmbedded) {
    if (DEBUG.messageEnabled()) {
      DEBUG.message("String_Node_Str");
    }
    Map<String,String> rebuildIndexData=new HashMap<String,String>(2);
    rebuildIndexData.put(SetupConstants.CONFIG_VAR_BASE_DIR,baseDir);
    rebuildIndexData.put(SetupConstants.CONFIG_VAR_ROOT_SUFFIX,baseDN);
    try {
      EmbeddedOpenDS.rebuildIndex(rebuildIndexData);
    }
 catch (    Exception ex) {
      throw new UpgradeException(ex);
    }
  }
}
Program: 9145
Project: 9145
Buggy source:
private JsonValue parseOptions(String options){
  if (options == null) {
    return json("String_Node_Str");
  }
  if (KEY_VALUE_PAIR_REGEX.matcher(options).matches()) {
    JsonValue optionsValue=json(object());
    for (    String pair : options.split("String_Node_Str")) {
      String[] keyValue=pair.trim().split("String_Node_Str");
      if (keyValue.length != 2) {
        return json(options);
      }
      optionsValue.add(keyValue[0],keyValue[1]);
    }
    return optionsValue;
  }
 else {
    return json(options);
  }
}

Fixed version (ground truth):
private JsonValue parseOptions(String options){
  if (options == null || options.isEmpty()) {
    return json(object());
  }
  if (KEY_VALUE_PAIR_REGEX.matcher(options).matches()) {
    JsonValue optionsValue=json(object());
    for (    String pair : options.split("String_Node_Str")) {
      String[] keyValue=pair.trim().split("String_Node_Str");
      if (keyValue.length != 2) {
        return json(options);
      }
      optionsValue.add(keyValue[0],keyValue[1]);
    }
    return optionsValue;
  }
 else {
    return json(options);
  }
}
Program: 9146
Project: 9146
Buggy source:
private JsonValue transformRequestBody(JsonValue body) throws InternalServerErrorException {
  if (body.isDefined("String_Node_Str")) {
    try {
      List<AuthConfigurationEntry> entries=new ArrayList<>();
      for (      JsonValue entry : body.get("String_Node_Str")) {
        String module=entry.get("String_Node_Str").asString();
        String criteria=entry.get("String_Node_Str").asString();
        String options;
        if (entry.get("String_Node_Str").isString()) {
          options=entry.get("String_Node_Str").asString();
        }
 else {
          StringBuilder optionsBuilder=new StringBuilder();
          for (          Map.Entry<String,String> option : entry.get("String_Node_Str").asMap(String.class).entrySet()) {
            optionsBuilder.append(option.getKey()).append("String_Node_Str").append(option.getValue()).append("String_Node_Str");
          }
          options=optionsBuilder.substring(0,optionsBuilder.length() - 1);
        }
        entries.add(new AuthConfigurationEntry(module,criteria,options));
      }
      body.put("String_Node_Str",AMAuthConfigUtils.authConfigurationEntryToXMLString(entries));
    }
 catch (    AMConfigurationException e) {
      throw new InternalServerErrorException("String_Node_Str",e);
    }
  }
  return body;
}

Fixed version (ground truth):
private JsonValue transformRequestBody(JsonValue body) throws InternalServerErrorException {
  if (body.isDefined("String_Node_Str")) {
    try {
      List<AuthConfigurationEntry> entries=new ArrayList<>();
      for (      JsonValue entry : body.get("String_Node_Str")) {
        String module=entry.get("String_Node_Str").asString();
        String criteria=entry.get("String_Node_Str").asString();
        String options=getOptions(entry);
        entries.add(new AuthConfigurationEntry(module,criteria,options));
      }
      body.put("String_Node_Str",AMAuthConfigUtils.authConfigurationEntryToXMLString(entries));
    }
 catch (    AMConfigurationException e) {
      throw new InternalServerErrorException("String_Node_Str",e);
    }
  }
  return body;
}
Program: 9147
Project: 9147
Buggy source:
/** 
 * Populate the map containing the headers keys and values based on the   {@link FilterConfig}.   {@inheritDoc}
 */
@Override public void init(FilterConfig config) throws ServletException {
  if (config != null) {
    Enumeration<String> initParams=config.getInitParameterNames();
    while (initParams.hasMoreElements()) {
      String headerKey=initParams.nextElement();
      headerKeyValues.put(headerKey,config.getInitParameter(headerKey));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes the filter based on the   {@link FilterConfig}. The "excludes" init parameter is used to prevent the filter from setting the headers when accessing certain URIs. Any other init parameter specified in web.xml will be handled as a headername-headervalue pair that should be added to the HttpServletResponse.  {@inheritDoc}
 */
@Override public void init(FilterConfig config) throws ServletException {
  if (config != null) {
    contextPathLength=config.getServletContext().getContextPath().length();
    Enumeration<String> initParams=config.getInitParameterNames();
    while (initParams.hasMoreElements()) {
      String key=initParams.nextElement();
      String value=config.getInitParameter(key);
      if (EXCLUDES.equals(key)) {
        excludes.addAll(Arrays.asList(value.split("String_Node_Str")));
      }
 else {
        headerKeyValues.put(key,value);
      }
    }
  }
}
Program: 9148
Project: 9148
Buggy source:
/** 
 * Set HTTP Headers based on the values in the filterConfig init-parameters.  {@inheritDoc}
 */
@Override public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain filterChain) throws IOException, ServletException {
  HttpServletResponse httpServletResponse=(HttpServletResponse)servletResponse;
  HttpServletRequest httpServleRequest=(HttpServletRequest)servletRequest;
  for (  Map.Entry<String,String> entry : headerKeyValues.entrySet()) {
    httpServletResponse.addHeader(entry.getKey(),entry.getValue());
  }
  filterChain.doFilter(httpServleRequest,httpServletResponse);
}

Fixed version (ground truth):
/** 
 * Set HTTP Headers based on the values in the filterConfig init-parameters.  {@inheritDoc}
 */
@Override public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest httpServletRequest=(HttpServletRequest)servletRequest;
  HttpServletResponse httpServletResponse=(HttpServletResponse)servletResponse;
  if (!excludes.contains(httpServletRequest.getRequestURI().substring(contextPathLength))) {
    for (    Map.Entry<String,String> entry : headerKeyValues.entrySet()) {
      httpServletResponse.addHeader(entry.getKey(),entry.getValue());
    }
  }
  filterChain.doFilter(httpServletRequest,httpServletResponse);
}
Program: 9153
Project: 9153
Buggy source:
void updateSessionForFailover(){
  if (!isNoSession() || stateless) {
    return;
  }
  getSession().setIsISStored(true);
}

Fixed version (ground truth):
void updateSessionForFailover(){
  if (stateless || isNoSession()) {
    return;
  }
  getSession().setIsISStored(true);
}
Program: 9154
Project: 9154
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 9156
Project: 9156
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 9157
Project: 9157
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}
Program: 9158
Project: 9158
Buggy source:
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 * @param factor   acceleration factor
 */
public AccelerateTimeService(long initTime,int factor){
  this.initTime=initTime;
  this.factor=factor;
  this.systemTimeAtInitialization=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 */
public AccelerateTimeService(long initTime){
  this.clock=new AtomicLong(initTime);
}
Program: 9159
Project: 9159
Buggy source:
@Override public long now(){
  long deltaTimeFromInitTime=System.currentTimeMillis() - systemTimeAtInitialization;
  return deltaTimeFromInitTime * factor + initTime;
}

Fixed version (ground truth):
@Override public long now(){
  return incrementTime(INCR_TIME_MS);
}
Program: 9160
Project: 9160
Buggy source:
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (location == null) {
    location=endpoint.getLocation();
  }
  return location;
}

Fixed version (ground truth):
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (StringUtils.isBlank(location)) {
    location=endpoint.getLocation();
  }
  return location;
}
Program: 9161
Project: 9161
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 9163
Project: 9163
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 9164
Project: 9164
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}
Program: 9165
Project: 9165
Buggy source:
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 * @param factor   acceleration factor
 */
public AccelerateTimeService(long initTime,int factor){
  this.initTime=initTime;
  this.factor=factor;
  this.systemTimeAtInitialization=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 */
public AccelerateTimeService(long initTime){
  this.clock=new AtomicLong(initTime);
}
Program: 9166
Project: 9166
Buggy source:
@Override public long now(){
  long deltaTimeFromInitTime=System.currentTimeMillis() - systemTimeAtInitialization;
  return deltaTimeFromInitTime * factor + initTime;
}

Fixed version (ground truth):
@Override public long now(){
  return incrementTime(INCR_TIME_MS);
}
Program: 9167
Project: 9167
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 9169
Project: 9169
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 9170
Project: 9170
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}