nus-yam/ex-repair huggingface dataset:
Program: 9171
Project: 9171
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: 9172
Project: 9172
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: 9173
Project: 9173
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: 9174
Project: 9174
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: 9175
Project: 9175
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 9176
Project: 9176
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 9178
Project: 9178
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 9179
Project: 9179
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 9181
Project: 9181
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 9182
Project: 9182
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 9184
Project: 9184
Buggy source:
/** 
 * Convert from a Token using the serialised JSON blob to generate the JsonValue.
 * @param token Token to be converted back to its original format.
 * @return Non null JsonValue.
 * @throws IllegalArgumentException If the object wrapped inside the Tokenwas not an instance of a Map.
 */
public JsonValue fromToken(Token token){
  if (token == null) {
    return null;
  }
  String data=blobUtils.getBlobAsString(token);
  JsonValue r;
  try {
    r=new JsonValue(serialisation.deserialise(data,Map.class));
    Set<String> keys=new HashSet<String>(r.keys());
    for (    String key : keys) {
      List<String> x=r.get(key).asList(String.class);
      Set<String> set=new HashSet<String>(x);
      r.remove(key);
      r.add(key,set);
    }
  }
 catch (  RuntimeException e) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  return r;
}

Fixed version (ground truth):
/** 
 * Convert from a Token using the serialised JSON blob to generate the JsonValue.
 * @param token Token to be converted back to its original format.
 * @return Non null JsonValue.
 * @throws IllegalArgumentException If the object wrapped inside the Tokenwas not an instance of a Map.
 */
public JsonValue fromToken(Token token){
  if (token == null) {
    return null;
  }
  String data=blobUtils.getBlobAsString(token);
  if (data == null) {
    return null;
  }
  JsonValue r;
  try {
    r=new JsonValue(serialisation.deserialise(data,Map.class));
    Set<String> keys=new HashSet<String>(r.keys());
    for (    String key : keys) {
      List<String> x=r.get(key).asList(String.class);
      Set<String> set=new HashSet<String>(x);
      r.remove(key);
      r.add(key,set);
    }
  }
 catch (  IllegalStateException e) {
    return null;
  }
  return r;
}
Program: 9185
Project: 9185
Buggy source:
/** 
 * Get the BaseURLProvider for a realm.
 * @param realm The realm.
 * @return The BaseURLProvider.
 */
public BaseURLProvider get(String realm){
  String realmDN=DNMapper.orgNameToDN(realm);
  BaseURLProvider cached=providers.get(realmDN);
  if (cached != null) {
    return cached;
  }
  return create(realmDN);
}

Fixed version (ground truth):
/** 
 * Get the BaseURLProvider for a realm.
 * @param request The Http Servlet Request.
 * @param realm The realm.
 * @return The BaseURLProvider.
 */
public BaseURLProvider get(HttpServletRequest request,String realm){
  String realmDN=DNMapper.orgNameToDN(realm);
  BaseURLProvider cached=providers.get(realmDN);
  if (cached != null) {
    return cached;
  }
  return create(request,realmDN);
}
Program: 9186
Project: 9186
Buggy source:
private synchronized BaseURLProvider create(String realmDN){
  if (!providers.containsKey(realmDN)) {
    debug.message("String_Node_Str",realmDN);
    OpenAMSettingsImpl settings=new OpenAMSettingsImpl(SERVICE_NAME,SERVICE_VERSION);
    try {
      BaseURLProvider provider;
      if (settings.hasConfig(realmDN)) {
        ProviderType providerType=ProviderType.valueOf(settings.getStringSetting(realmDN,PROVIDER_TYPE));
        provider=providerType.getProvider();
        provider.init(settings,realmDN);
        provider.setContextPath(settings.getStringSetting(realmDN,CONTEXT_PATH));
      }
 else {
        provider=new RequestValuesBaseURLProvider();
      }
      providers.put(realmDN,provider);
    }
 catch (    SMSException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
catch (    SSOException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
  }
  return providers.get(realmDN);
}

Fixed version (ground truth):
private synchronized BaseURLProvider create(HttpServletRequest request,String realmDN){
  if (!providers.containsKey(realmDN)) {
    debug.message("String_Node_Str",realmDN);
    OpenAMSettingsImpl settings=new OpenAMSettingsImpl(SERVICE_NAME,SERVICE_VERSION);
    try {
      BaseURLProvider provider;
      if (settings.hasConfig(realmDN)) {
        ProviderType providerType=ProviderType.valueOf(settings.getStringSetting(realmDN,PROVIDER_TYPE));
        provider=providerType.getProvider();
        provider.init(settings,realmDN);
        provider.setContextPath(settings.getStringSetting(realmDN,CONTEXT_PATH));
      }
 else {
        provider=new RequestValuesBaseURLProvider();
        provider.setContextPath(request.getContextPath());
      }
      providers.put(realmDN,provider);
    }
 catch (    SMSException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
catch (    SSOException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
  }
  return providers.get(realmDN);
}
Program: 9187
Project: 9187
Buggy source:
/** 
 * <p>Creates or updates a resource set description.</p> <p>If the request contains a If-Match header an update is performed, otherwise a create is performed.</p> <p>An update will replace the current description of the resource set with the contents of the request body.</p>
 * @param entity The new resource set description.
 * @return A JSON object containing the authorization server's unique id for the resource set and, optionally,a policy uri.
 * @throws NotFoundException If the requested resource set description does not exist.
 * @throws ServerException When an error occurs during creating or updating.
 * @throws BadRequestException If the request JSON is invalid.
 */
@Post public Representation createResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  ResourceSetDescription resourceSetDescription=new ResourceSetDescription(null,getClientId(),getResourceOwnerId(),validator.validate(toMap(entity)));
  OAuth2Request oAuth2Request=requestFactory.create(getRequest());
  ResourceSetStore store=providerSettingsFactory.get(oAuth2Request).getResourceSetStore();
  try {
    store.create(oAuth2Request,resourceSetDescription);
    for (    ResourceSetRegistrationListener listener : listeners) {
      listener.resourceSetCreated(oAuth2Request.<String>getParameter("String_Node_Str"),resourceSetDescription);
    }
  }
 catch (  ServerException e) {
    throw e;
  }
catch (  BadRequestException e) {
    throw e;
  }
catch (  NotFoundException e) {
    throw e;
  }
  getResponse().setStatus(new Status(201));
  return createJsonResponse(resourceSetDescription,false,true);
}

Fixed version (ground truth):
/** 
 * <p>Creates or updates a resource set description.</p> <p>If the request contains a If-Match header an update is performed, otherwise a create is performed.</p> <p>An update will replace the current description of the resource set with the contents of the request body.</p>
 * @param entity The new resource set description.
 * @return A JSON object containing the authorization server's unique id for the resource set and, optionally,a policy uri.
 * @throws NotFoundException If the requested resource set description does not exist.
 * @throws ServerException When an error occurs during creating or updating.
 * @throws BadRequestException If the request JSON is invalid.
 */
@Post public Representation createResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  ResourceSetDescription resourceSetDescription=new ResourceSetDescription(null,getClientId(),getResourceOwnerId(),validator.validate(toMap(entity)));
  OAuth2Request oAuth2Request=requestFactory.create(getRequest());
  ResourceSetStore store=providerSettingsFactory.get(oAuth2Request).getResourceSetStore();
  store.create(oAuth2Request,resourceSetDescription);
  for (  ResourceSetRegistrationListener listener : listeners) {
    listener.resourceSetCreated(oAuth2Request.<String>getParameter("String_Node_Str"),resourceSetDescription);
  }
  getResponse().setStatus(new Status(201));
  return createJsonResponse(resourceSetDescription,false,true);
}
Program: 9189
Project: 9189
Buggy source:
boolean isSuperUser(String userId){
  return sessionService.get().isSuperUser(userId);
}

Fixed version (ground truth):
protected boolean isSuperUser(String userId){
  return sessionService.get().isSuperUser(userId);
}
Program: 9190
Project: 9190
Buggy source:
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}

Fixed version (ground truth):
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}
Program: 9191
Project: 9191
Buggy source:
String getUserId(ServerContext context) throws ResourceException {
  SSOTokenContext tokenContext=context.asContext(SSOTokenContext.class);
  try {
    SSOToken token=tokenContext.getCallerSSOToken();
    return token.getProperty(Constants.UNIVERSAL_IDENTIFIER);
  }
 catch (  SSOException e) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str",e);
    }
    throw new ForbiddenException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected String getUserId(ServerContext context) throws ResourceException {
  SSOTokenContext tokenContext=context.asContext(SSOTokenContext.class);
  try {
    SSOToken token=tokenContext.getCallerSSOToken();
    return token.getProperty(Constants.UNIVERSAL_IDENTIFIER);
  }
 catch (  SSOException e) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str",e);
    }
    throw new ForbiddenException(e.getMessage(),e);
  }
}
Program: 9192
Project: 9192
Buggy source:
/** 
 * Prevents access to   {@link org.forgerock.openam.forgerockrest.cts.CoreTokenResource} unless thisREST endpoint has been explicitly enabled. If the endpoint has been explicitly enabled, it defers to {@link org.forgerock.openam.rest.authz.AdminOnlyAuthzModule} to ensure that the SSO Token belongs toa user with Administrator-level access.
 */
@Override Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  if (!enabled) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str");
    }
    return Promises.newSuccessfulPromise(AuthorizationResult.failure("String_Node_Str"));
  }
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str");
  }
  return super.authorize(context);
}

Fixed version (ground truth):
/** 
 * Prevents access to   {@link org.forgerock.openam.forgerockrest.cts.CoreTokenResource} unless thisREST endpoint has been explicitly enabled. If the endpoint has been explicitly enabled, it defers to {@link org.forgerock.openam.rest.authz.AdminOnlyAuthzModule} to ensure that the SSO Token belongs toa user with Administrator-level access.
 */
@Override protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  if (!enabled) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str");
    }
    return Promises.newSuccessfulPromise(AuthorizationResult.failure("String_Node_Str"));
  }
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str");
  }
  return super.authorize(context);
}
Program: 9193
Project: 9193
Buggy source:
private String getUserIdFromUri(ServerContext context) throws InternalServerErrorException {
  String username=context.asContext(RouterContext.class).getUriTemplateVariables().get("String_Node_Str");
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  return IdUtils.getIdentity(username,realm).getUniversalId();
}

Fixed version (ground truth):
protected String getUserIdFromUri(ServerContext context) throws InternalServerErrorException {
  String username=context.asContext(RouterContext.class).getUriTemplateVariables().get("String_Node_Str");
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  return IdUtils.getIdentity(username,realm).getUniversalId();
}
Program: 9194
Project: 9194
Buggy source:
/** 
 * Authorizes caller if they are either a super user or they are making a request to a resource they "own", i.e. demo making a call to /json/users/demo/uma/resourceset.
 * @param context The request context.
 * @return The authorization result.
 */
@Override Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String loggedInUserId=getUserId(context);
    if (isSuperUser(loggedInUserId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else     if (loggedInUserId.equalsIgnoreCase(getUserIdFromUri(context))) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.warningEnabled()) {
        debug.warning("String_Node_Str" + loggedInUserId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str" + loggedInUserId + "String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}

Fixed version (ground truth):
/** 
 * Authorizes caller if they are either a super user or they are making a request to a resource they "own", i.e. demo making a call to /json/users/demo/uma/resourceset.
 * @param context The request context.
 * @return The authorization result.
 */
@Override protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String loggedInUserId=getUserId(context);
    if (isSuperUser(loggedInUserId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else     if (loggedInUserId.equalsIgnoreCase(getUserIdFromUri(context))) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.warningEnabled()) {
        debug.warning("String_Node_Str" + loggedInUserId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str" + loggedInUserId + "String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}
Program: 9195
Project: 9195
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 9197
Project: 9197
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 9198
Project: 9198
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 9200
Project: 9200
Buggy source:
/** 
 * Compute the final log file name (prefix and suffix)
 * @param fileName the log file name base
 * @return the complete log file name
 */
private String wrapFilename(String fileName){
  StringBuilder newFileName=new StringBuilder();
  if (debugPrefix != null) {
    newFileName.append(debugPrefix);
  }
  newFileName.append(fileName);
synchronized (suffixDateFormat) {
    if (suffixDateFormat != null && rotationInterval > 0) {
      newFileName.append(suffixDateFormat.format(new Date(clock.now())));
    }
  }
  return newFileName.toString();
}

Fixed version (ground truth):
/** 
 * Compute the final log file name (prefix and suffix)
 * @param fileName the log file name base
 * @return the complete log file name
 */
private String wrapFilename(String fileName){
  StringBuilder newFileName=new StringBuilder();
  if (debugPrefix != null) {
    newFileName.append(debugPrefix);
  }
  newFileName.append(fileName);
  if (suffixDateFormat != null && rotationInterval > 0) {
synchronized (suffixDateFormat) {
      newFileName.append(suffixDateFormat.format(new Date(clock.now())));
    }
  }
  return newFileName.toString();
}
Program: 9201
Project: 9201
Buggy source:
/** 
 * Creates an instance of <code>DebugImpl</code>.
 * @param debugName Name of the debug.
 */
public DebugImpl(String debugName,DebugFileProvider debugFileProvider){
  this.debugName=debugName;
  if (SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL) != null) {
    setDebug(SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL));
  }
 else {
    setDebug(DebugLevel.OFF);
  }
  this.debugFileProvider=debugFileProvider;
  stdoutDebugFile=debugFileProvider.getStdOutDebugFile();
  String mf=SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_MERGEALL);
  mergeAllMode="String_Node_Str".equals(mf);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <code>DebugImpl</code>.
 * @param debugName Name of the debug.
 */
public DebugImpl(String debugName,DebugFileProvider debugFileProvider){
  this.debugName=debugName;
  if (SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL) != null) {
    setDebug(SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL));
  }
 else {
    setDebug(DebugLevel.ON);
  }
  this.debugFileProvider=debugFileProvider;
  stdoutDebugFile=debugFileProvider.getStdOutDebugFile();
  String mf=SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_MERGEALL);
  mergeAllMode="String_Node_Str".equals(mf);
}
Program: 9202
Project: 9202
Buggy source:
/** 
 * Creates an instance of <code>DebugImpl</code>.
 * @param debugName Name of the debug.
 */
public DebugImpl(String debugName,DebugFileProvider debugFileProvider){
  this.debugName=debugName;
  if (SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL) != null) {
    setDebug(SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL));
  }
 else {
    setDebug(DebugLevel.OFF);
  }
  this.debugFileProvider=debugFileProvider;
  stdoutDebugFile=debugFileProvider.getStdOutDebugFile();
  String mf=SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_MERGEALL);
  mergeAllMode="String_Node_Str".equals(mf);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <code>DebugImpl</code>.
 * @param debugName Name of the debug.
 */
public DebugImpl(String debugName,DebugFileProvider debugFileProvider){
  this.debugName=debugName;
  if (SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL) != null) {
    setDebug(SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_LEVEL));
  }
 else {
    setDebug(DebugLevel.ON);
  }
  this.debugFileProvider=debugFileProvider;
  stdoutDebugFile=debugFileProvider.getStdOutDebugFile();
  String mf=SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_MERGEALL);
  mergeAllMode="String_Node_Str".equals(mf);
}
Program: 9204
Project: 9204
Buggy source:
@Inject public LDAPConfig(String rootSuffix){
  defaultCTSRootSuffix=DN.valueOf(rootSuffix).child("String_Node_Str").child("String_Node_Str").child("String_Node_Str");
}

Fixed version (ground truth):
@Inject public LDAPConfig(String rootSuffix){
  defaultCTSRootSuffix=DN.valueOf(rootSuffix).child("String_Node_Str").child("String_Node_Str").child("String_Node_Str");
  update();
}
Program: 9205
Project: 9205
Buggy source:
@Test public void shouldIndicateHasChanged(){
  PowerMockito.mockStatic(SystemProperties.class);
  given(SystemProperties.get(anyString())).willReturn("String_Node_Str");
  LDAPConfig config=new LDAPConfig("String_Node_Str");
  config.update();
  assertThat(config.hasChanged()).isTrue();
}

Fixed version (ground truth):
@Test public void shouldIndicateHasChanged(){
  PowerMockito.mockStatic(SystemProperties.class);
  given(SystemProperties.get(anyString())).willReturn("String_Node_Str");
  LDAPConfig config=new LDAPConfig("String_Node_Str");
  assertThat(config.hasChanged()).isTrue();
}
Program: 9206
Project: 9206
Buggy source:
@Inject public LDAPConfig(String rootSuffix){
  defaultCTSRootSuffix=DN.valueOf(rootSuffix).child("String_Node_Str").child("String_Node_Str").child("String_Node_Str");
}

Fixed version (ground truth):
@Inject public LDAPConfig(String rootSuffix){
  defaultCTSRootSuffix=DN.valueOf(rootSuffix).child("String_Node_Str").child("String_Node_Str").child("String_Node_Str");
  update();
}
Program: 9207
Project: 9207
Buggy source:
@Test public void shouldIndicateHasChanged(){
  PowerMockito.mockStatic(SystemProperties.class);
  given(SystemProperties.get(anyString())).willReturn("String_Node_Str");
  LDAPConfig config=new LDAPConfig("String_Node_Str");
  config.update();
  assertThat(config.hasChanged()).isTrue();
}

Fixed version (ground truth):
@Test public void shouldIndicateHasChanged(){
  PowerMockito.mockStatic(SystemProperties.class);
  given(SystemProperties.get(anyString())).willReturn("String_Node_Str");
  LDAPConfig config=new LDAPConfig("String_Node_Str");
  assertThat(config.hasChanged()).isTrue();
}
Program: 9208
Project: 9208
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void createInstance(ServerContext context,CreateRequest request,ResultHandler<Resource> handler){
  String providedName=null;
  try {
    providedName=request.getNewResourceId();
    if (!providedName.equals(DN.escapeAttributeValue(providedName))) {
      throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{"String_Node_Str" + providedName + "String_Node_Str"});
    }
    Privilege policy=policyParser.parsePolicy(providedName,request.getContent());
    if (isNotBlank(providedName) && !providedName.equals(policy.getName())) {
      DEBUG.error("String_Node_Str");
      throw new EntitlementException(EntitlementException.POLICY_NAME_MISMATCH);
    }
    policyStoreProvider.getPolicyStore(context).create(policy);
    handler.handleResult(policyResource(policy));
  }
 catch (  EntitlementException ex) {
    DEBUG.error("String_Node_Str" + providedName,ex);
    handler.handleError(resourceErrorHandler.handleError(request,ex));
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void createInstance(ServerContext context,CreateRequest request,ResultHandler<Resource> handler){
  String providedName=null;
  try {
    providedName=request.getNewResourceId();
    Privilege policy=policyParser.parsePolicy(providedName,request.getContent());
    if (isNotBlank(providedName) && !providedName.equals(policy.getName())) {
      DEBUG.error("String_Node_Str");
      throw new EntitlementException(EntitlementException.POLICY_NAME_MISMATCH);
    }
    if (isBlank(providedName)) {
      providedName=policy.getName();
    }
    if (!providedName.equals(DN.escapeAttributeValue(providedName))) {
      throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{"String_Node_Str" + providedName + "String_Node_Str"});
    }
    policyStoreProvider.getPolicyStore(context).create(policy);
    handler.handleResult(policyResource(policy));
  }
 catch (  EntitlementException ex) {
    DEBUG.error("String_Node_Str" + providedName,ex);
    handler.handleError(resourceErrorHandler.handleError(request,ex));
  }
}
Program: 9209
Project: 9209
Buggy source:
/** 
 * Notifies the monitoring system that a rate tracker must be incremented, and the rate information recalculated.
 */
public void add(){
synchronized (this) {
    count.incrementAndGet();
  }
  rateWindow.recalculate(timer.now());
}

Fixed version (ground truth):
/** 
 * Notifies the monitoring system that a rate tracker must be incremented, and the rate information recalculated.
 */
public void add(){
  count.incrementAndGet();
  rateWindow.incrementForTimestamp(timer.now());
}
Program: 9210
Project: 9210
Buggy source:
/** 
 * Increments the cumulative count for an operation and recalculates the rate at which the operation has been made. <br/> Only synchronizes the count increment, NOT the whole method.
 */
void increment(){
  count.incrementAndGet();
  rateWindow.recalculate(timerGetter.now());
}

Fixed version (ground truth):
/** 
 * Increments the cumulative count for an operation and recalculates the rate at which the operation has been made. <br/> Only synchronizes the count increment, NOT the whole method.
 */
void increment(){
  count.incrementAndGet();
  rateWindow.incrementForTimestamp(timerGetter.now());
}
Program: 9211
Project: 9211
Buggy source:
/** 
 * Increments the cumulative count of evaluations and recalculates the rate. <br/> Only synchronizes the count increment, NOT the whole method.
 */
public void increment(){
  count.incrementAndGet();
  rateWindow.recalculate(timerGetter.now());
}

Fixed version (ground truth):
/** 
 * Increments the cumulative count of evaluations and recalculates the rate. <br/> Only synchronizes the count increment, NOT the whole method.
 */
public void increment(){
  count.incrementAndGet();
  rateWindow.incrementForTimestamp(timerGetter.now());
}
Program: 9212
Project: 9212
Buggy source:
public int compare(AtomicLong rate,AtomicLong rate2){
  return (int)(rate.get() - rate2.get());
}

Fixed version (ground truth):
@Override public int compare(AtomicLong rate,AtomicLong rate2){
  return Long.compare(rate.get(),rate2.get());
}
Program: 9213
Project: 9213
Buggy source:
/** 
 * Gets the minimum rate.
 * @return The minimum event rate.
 */
public synchronized long getMinRate(){
  if (minMaxRate.isEmpty()) {
    return 0L;
  }
  if (isAtCurrentIndex(toSampleRate(timer.now()))) {
    addNextSlot();
  }
  return new ArrayList<AtomicLong>(minMaxRate).get(0).get();
}

Fixed version (ground truth):
/** 
 * Gets the minimum rate.
 * @return The minimum event rate.
 */
public long getMinRate(){
  if (window.isEmpty()) {
    return 0L;
  }
  fillInWindow(getCurrentIndex());
  return Collections.min(window.values(),atomicLongComparator).get();
}
Program: 9214
Project: 9214
Buggy source:
/** 
 * Constructs a new instance of the RateWindow.
 * @param timer An instance of a Timer.
 * @param size The size of the window.
 * @param sampleRate The sample rate for the window.
 */
public RateWindow(final RateTimer timer,final int size,final long sampleRate){
  this.timer=timer;
  this.size=size;
  this.sampleRate=sampleRate;
  this.window=new LinkedHashMap<Long,AtomicLong>(size);
}

Fixed version (ground truth):
/** 
 * Constructs a new instance of the RateWindow.
 * @param timer An instance of a Timer.
 * @param size The size of the window.
 * @param sampleRate The sample rate for the window.
 */
public RateWindow(final RateTimer timer,final int size,final long sampleRate){
  this.timer=timer;
  this.size=size;
  this.sampleRate=sampleRate;
}
Program: 9215
Project: 9215
Buggy source:
/** 
 * Gets the maximum rate.
 * @return The maximum event rate.
 */
public synchronized long getMaxRate(){
  if (minMaxRate.isEmpty()) {
    return 0L;
  }
  if (isAtCurrentIndex(toSampleRate(timer.now()))) {
    addNextSlot();
  }
  List<AtomicLong> maxRate=new ArrayList<AtomicLong>(minMaxRate);
  return maxRate.get(maxRate.size() - 1).get();
}

Fixed version (ground truth):
/** 
 * Gets the maximum rate.
 * @return The maximum event rate.
 */
public long getMaxRate(){
  if (window.isEmpty()) {
    return 0L;
  }
  fillInWindow(getCurrentIndex());
  return Collections.max(window.values(),atomicLongComparator).get();
}
Program: 9216
Project: 9216
Buggy source:
/** 
 * Gets the average rate for the sample rate averaged across the whole window. <br/> Does not include the latest window slot if time has not passed beyond it yet as otherwise could skew the average as that time slot has not yet completed and may get more events made in it.
 * @return The average event rate.
 */
public synchronized double getAverageRate(){
  if (window.size() == 0) {
    return 0D;
  }
  double averageRate=0;
  final long now=toSampleRate(timer.now());
  for (  Map.Entry<Long,AtomicLong> entry : window.entrySet()) {
    if (isAtCurrentIndex(now) && entry.getKey().equals(currentIndex)) {
      continue;
    }
    averageRate+=entry.getValue().get();
  }
  return averageRate / window.size();
}

Fixed version (ground truth):
/** 
 * Gets the average rate for the sample rate averaged across the whole window. <br/> Does not include the latest window slot if time has not passed beyond it yet as otherwise could skew the average as that time slot has not yet completed and may get more events made in it.
 * @return The average event rate.
 */
public synchronized double getAverageRate(){
  if (window.isEmpty()) {
    return 0D;
  }
  fillInWindow(getCurrentIndex());
  double averageRate=0;
  for (  Map.Entry<Long,AtomicLong> entry : window.entrySet()) {
    if (entry.getKey().equals(getCurrentIndex())) {
      continue;
    }
    averageRate+=entry.getValue().get();
  }
  return averageRate / window.size();
}