nus-yam/ex-repair huggingface dataset:
Program: 79597
Project: 79597
Buggy source:
public PrimitiveIterator.OfInt chars(){
class CodePointIterator implements PrimitiveIterator.OfInt {
    int cur=0;
    @Override public void forEachRemaining(    IntConsumer block){
      final int length=length();
      int i=cur;
      try {
        while (i < length) {
          char c1=data.charAt(i++);
          if (!Character.isHighSurrogate(c1) || i >= length) {
            block.accept(c1);
          }
 else {
            char c2=data.charAt(i);
            if (Character.isLowSurrogate(c2)) {
              i++;
              block.accept(Character.toCodePoint(c1,c2));
            }
 else {
              block.accept(c1);
            }
          }
        }
      }
  finally {
        cur=i;
      }
    }
    public boolean hasNext(){
      return cur < data.length();
    }
    public int nextInt(){
      final int length=data.length();
      if (cur >= length) {
        throw new NoSuchElementException();
      }
      char c1=data.charAt(cur++);
      if (Character.isHighSurrogate(c1) && cur < length) {
        char c2=data.charAt(cur);
        if (Character.isLowSurrogate(c2)) {
          cur++;
          return Character.toCodePoint(c1,c2);
        }
      }
      return c1;
    }
  }
  return new CodePointIterator();
}

Fixed version (ground truth):
public PrimitiveIterator.OfInt chars(){
class CodePointIterator implements PrimitiveIterator.OfInt {
    private int cur=0;
    @Override public void forEachRemaining(    IntConsumer block){
      final int length=length();
      int i=cur;
      try {
        while (i < length) {
          char c1=data.charAt(i++);
          if (!Character.isHighSurrogate(c1) || i >= length) {
            block.accept(c1);
          }
 else {
            char c2=data.charAt(i);
            if (Character.isLowSurrogate(c2)) {
              i++;
              block.accept(Character.toCodePoint(c1,c2));
            }
 else {
              block.accept(c1);
            }
          }
        }
      }
  finally {
        cur=i;
      }
    }
    public boolean hasNext(){
      return cur < data.length();
    }
    public int nextInt(){
      final int length=data.length();
      if (cur >= length) {
        throw new NoSuchElementException();
      }
      char c1=data.charAt(cur++);
      if (Character.isHighSurrogate(c1) && cur < length) {
        char c2=data.charAt(cur);
        if (Character.isLowSurrogate(c2)) {
          cur++;
          return Character.toCodePoint(c1,c2);
        }
      }
      return c1;
    }
  }
  return new CodePointIterator();
}
Program: 79598
Project: 79598
Buggy source:
@Provides @Named(AuthenticatorOathServiceFactory.FACTORY_NAME) @Inject AuthenticatorDeviceServiceFactory<AuthenticatorOathService> getAuthenticatorOathServiceFactory(@Named("String_Node_Str") Debug debug,@Named(AuthenticatorOathService.SERVICE_NAME) ServiceConfigManager serviceConfigManager){
  return new AuthenticatorDeviceServiceFactory<>(debug,serviceConfigManager,new AuthenticatorOathServiceFactory());
}

Fixed version (ground truth):
@Provides @Named(AuthenticatorOathServiceFactory.FACTORY_NAME) @Inject @Singleton AuthenticatorDeviceServiceFactory<AuthenticatorOathService> getAuthenticatorOathServiceFactory(@Named("String_Node_Str") Debug debug,@Named(AuthenticatorOathService.SERVICE_NAME) ServiceConfigManager serviceConfigManager){
  return new AuthenticatorDeviceServiceFactory<>(debug,serviceConfigManager,new AuthenticatorOathServiceFactory());
}
Program: 79599
Project: 79599
Buggy source:
@Provides @Named(AuthenticatorPushServiceFactory.FACTORY_NAME) @Inject AuthenticatorDeviceServiceFactory<AuthenticatorPushService> getAuthenticatorPushServiceFactory(@Named("String_Node_Str") Debug debug,@Named(AuthenticatorPushService.SERVICE_NAME) ServiceConfigManager serviceConfigManager){
  return new AuthenticatorDeviceServiceFactory<>(debug,serviceConfigManager,new AuthenticatorPushServiceFactory());
}

Fixed version (ground truth):
@Provides @Named(AuthenticatorPushServiceFactory.FACTORY_NAME) @Inject @Singleton AuthenticatorDeviceServiceFactory<AuthenticatorPushService> getAuthenticatorPushServiceFactory(@Named("String_Node_Str") Debug debug,@Named(AuthenticatorPushService.SERVICE_NAME) ServiceConfigManager serviceConfigManager){
  return new AuthenticatorDeviceServiceFactory<>(debug,serviceConfigManager,new AuthenticatorPushServiceFactory());
}
Program: 79600
Project: 79600
Buggy source:
/** 
 * Converts a serialised string back into a JSON device profile.
 * @param value the value to parse back into a JSON device profile.
 * @return the JSON device profile.
 * @throws IllegalArgumentException if the value cannot be parsed as a string.
 */
JsonValue stringToDeviceProfile(String value);

Fixed version (ground truth):
/** 
 * Converts a serialised string back into a JSON device profile.
 * @param value the value to parse back into a JSON device profile.
 * @return the JSON device profile.
 * @throws IllegalArgumentException if the value cannot be parsed as a string.
 * @throws JsonException if the value cannot be parsed as Json.
 */
JsonValue stringToDeviceProfile(String value);
Program: 79601
Project: 79601
Buggy source:
/** 
 * Gets a user's device profiles. The returned profiles must be stored in JSON format.
 * @param username User whose profiles to return.
 * @param realm Realm in which we are operating.
 * @return A list of device profiles.
 * @throws InternalServerErrorException If there is a problem retrieving the device profiles.
 */
public List<JsonValue> getDeviceProfiles(String username,String realm) throws InternalServerErrorException {
  List<JsonValue> devices=new ArrayList<>();
  final AMIdentity identity=getIdentity(username,realm);
  try {
    final DeviceService deviceService=serviceFactory.create(realm);
    final String attrName=deviceService.getConfigStorageAttributeName();
    final DeviceSerialisation deviceSerialisation=deviceService.getDeviceSerialisationStrategy();
    Set<String> set=(Set<String>)identity.getAttribute(attrName);
    for (    String profile : set) {
      devices.add(deviceSerialisation.stringToDeviceProfile(profile));
    }
    return devices;
  }
 catch (  SSOException|IdRepoException|SMSException e) {
    throw new InternalServerErrorException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Gets a user's device profiles. The returned profiles must be stored in JSON format.
 * @param username User whose profiles to return.
 * @param realm Realm in which we are operating.
 * @return A list of device profiles.
 * @throws InternalServerErrorException If there is a problem retrieving the device profiles.
 */
public List<JsonValue> getDeviceProfiles(String username,String realm) throws InternalServerErrorException {
  List<JsonValue> devices=new ArrayList<>();
  final AMIdentity identity=getIdentity(username,realm);
  try {
    final DeviceService deviceService=serviceFactory.create(realm);
    final String attrName=deviceService.getConfigStorageAttributeName();
    final DeviceSerialisation deviceSerialisation=deviceService.getDeviceSerialisationStrategy();
    Set<String> set=(Set<String>)identity.getAttribute(attrName);
    for (    String profile : set) {
      try {
        devices.add(deviceSerialisation.stringToDeviceProfile(profile));
      }
 catch (      JsonException jve) {
      }
    }
    return devices;
  }
 catch (  SSOException|IdRepoException|SMSException e) {
    throw new InternalServerErrorException(e.getMessage(),e);
  }
}
Program: 79602
Project: 79602
Buggy source:
/** 
 * Construct a new OathDevicesDao.
 * @param serviceFactory Factory used to retrieve the Push Service for this dao.
 */
public OathDevicesDao(AuthenticatorDeviceServiceFactory<AuthenticatorOathService> serviceFactory){
  super(serviceFactory);
}

Fixed version (ground truth):
/** 
 * Construct a new OathDevicesDao.
 * @param serviceFactory Factory used to retrieve the Push Service for this dao.
 */
@Inject public OathDevicesDao(@Named(FACTORY_NAME) AuthenticatorDeviceServiceFactory<AuthenticatorOathService> serviceFactory){
  super(serviceFactory);
}
Program: 79603
Project: 79603
Buggy source:
/** 
 * Construct a new PushDevicesDao.
 * @param serviceFactory Factory used to retrieve the Push Service for this dao.
 */
public PushDevicesDao(AuthenticatorDeviceServiceFactory<AuthenticatorPushService> serviceFactory){
  super(serviceFactory);
}

Fixed version (ground truth):
/** 
 * Construct a new PushDevicesDao.
 * @param serviceFactory Factory used to retrieve the Push Service for this dao.
 */
@Inject public PushDevicesDao(@Named(AuthenticatorPushServiceFactory.FACTORY_NAME) AuthenticatorDeviceServiceFactory<AuthenticatorPushService> serviceFactory){
  super(serviceFactory);
}
Program: 79604
Project: 79604
Buggy source:
/** 
 * Generates a new AuthenticatorDeviceServiceFactory, configuring a listener on the provided ServiceConfigManager to listen to changes in its settings.
 * @param debug For writing debug messages.
 * @param serviceConfigManager To communicate with the data store.
 */
public AuthenticatorDeviceServiceFactory(Debug debug,ServiceConfigManager serviceConfigManager,DeviceServiceFactory<T> factory){
  this.debug=debug;
  this.factory=factory;
  this.serviceConfigManager=serviceConfigManager;
  if (serviceConfigManager != null) {
    serviceConfigManager.addListener(new AuthenticatorDeviceServiceFactoryServiceListener());
  }
}

Fixed version (ground truth):
/** 
 * Generates a new AuthenticatorDeviceServiceFactory, configuring a listener on the provided ServiceConfigManager to listen to changes in its settings.
 * @param debug For writing debug messages.
 * @param serviceConfigManager To communicate with the data store.
 * @param factory For producing DeviceServices.
 */
public AuthenticatorDeviceServiceFactory(Debug debug,ServiceConfigManager serviceConfigManager,DeviceServiceFactory<T> factory){
  this.debug=debug;
  this.factory=factory;
  this.serviceConfigManager=serviceConfigManager;
  if (serviceConfigManager != null) {
    serviceConfigManager.addListener(new AuthenticatorDeviceServiceFactoryServiceListener());
  }
}
Program: 79605
Project: 79605
Buggy source:
private int waitingChecks() throws AuthLoginException {
  try {
    Boolean ctsValue=checkCTS(messageId);
    if (ctsValue != null) {
      pushService.getMessageDispatcher(realm).forget(messageId);
      coreTokenService.deleteAsync(messageId);
      if (ctsValue) {
        storeUsername(amIdentityPrincipal.getName());
        return ISAuthConstants.LOGIN_SUCCEED;
      }
 else {
        throw failedAsLoginException();
      }
    }
  }
 catch (  CoreTokenException e) {
    DEBUG.warning("String_Node_Str",e);
  }
catch (  PushNotificationException e) {
    DEBUG.error("String_Node_Str",e);
    throw failedAsLoginException();
  }
  setPollbackTimePeriod(pollingWaitAssistant.getWaitPeriod());
  pollingWaitAssistant.resetWait();
  return STATE_WAIT_FOR_RESPONSE_FROM_QR_SCAN;
}

Fixed version (ground truth):
private int waitingChecks() throws AuthLoginException {
  try {
    Boolean ctsValue=checkCTS(messageId);
    if (ctsValue != null) {
      pushService.getMessageDispatcher(realm).forget(messageId);
      coreTokenService.deleteAsync(messageId);
      if (ctsValue) {
        return finaliseSuccess();
      }
 else {
        throw failedAsLoginException();
      }
    }
  }
 catch (  CoreTokenException e) {
    DEBUG.warning("String_Node_Str",e);
  }
catch (  PushNotificationException e) {
    DEBUG.error("String_Node_Str",e);
    throw failedAsLoginException();
  }
  setPollbackTimePeriod(pollingWaitAssistant.getWaitPeriod());
  pollingWaitAssistant.resetWait();
  return STATE_WAIT_FOR_RESPONSE_FROM_QR_SCAN;
}
Program: 79606
Project: 79606
Buggy source:
private int completeChecks() throws AuthLoginException {
  try {
    coreTokenService.deleteAsync(messageId);
  }
 catch (  CoreTokenException e) {
    DEBUG.warning("String_Node_Str",e);
  }
  saveDeviceDetailsUnderUserAccount();
  return STATE_CONFIRMATION;
}

Fixed version (ground truth):
private int completeChecks() throws AuthLoginException {
  try {
    coreTokenService.deleteAsync(messageId);
  }
 catch (  CoreTokenException e) {
    DEBUG.warning("String_Node_Str",e);
  }
  return finaliseSuccess();
}
Program: 79607
Project: 79607
Buggy source:
@Override public String getRegServiceLocation(){
  return ROUTE + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getRegServiceLocation(){
  return (realm.endsWith("String_Node_Str") ? realm : realm + "String_Node_Str") + ROUTE + "String_Node_Str";
}
Program: 79608
Project: 79608
Buggy source:
@Override public String getAuthServiceLocation(){
  return ROUTE + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getAuthServiceLocation(){
  return (realm.endsWith("String_Node_Str") ? realm : realm + "String_Node_Str") + ROUTE + "String_Node_Str";
}
Program: 79609
Project: 79609
Buggy source:
/** 
 * Default constructor sets the debug for passing into produced delegates.
 */
public SnsHttpDelegateFactory(){
  messageResourceFactory=InjectorHolder.getInstance(SnsMessageResourceFactory.class);
  pushMessageConverter=InjectorHolder.getInstance(SnsPushMessageConverter.class);
  router=InjectorHolder.getInstance(KEY);
}

Fixed version (ground truth):
/** 
 * Default constructor sets the debug for passing into produced delegates.
 */
public SnsHttpDelegateFactory(){
  pushMessageConverter=InjectorHolder.getInstance(SnsPushMessageConverter.class);
  snsMessageResource=InjectorHolder.getInstance(SnsMessageResource.class);
  router=InjectorHolder.getInstance(KEY);
}
Program: 79610
Project: 79610
Buggy source:
@Override public SnsHttpDelegate produceDelegateFor(PushNotificationServiceConfig config,String realm,MessageDispatcher messageDispatcher) throws PushNotificationException {
  AmazonSNSClient service=new SnsClientFactory().produce(config);
  SnsMessageResource messageResource=messageResourceFactory.produce(messageDispatcher);
  return new SnsHttpDelegate(service,config,router,messageResource,pushMessageConverter,realm,messageDispatcher);
}

Fixed version (ground truth):
@Override public SnsHttpDelegate produceDelegateFor(PushNotificationServiceConfig config,String realm,MessageDispatcher messageDispatcher) throws PushNotificationException {
  AmazonSNSClient service=new SnsClientFactory().produce(config);
  return new SnsHttpDelegate(service,config,router,snsMessageResource,pushMessageConverter,realm,messageDispatcher);
}
Program: 79611
Project: 79611
Buggy source:
private Promise<ActionResponse,ResourceException> handle(Context context,ActionRequest actionRequest){
  Reject.ifFalse(context.containsContext(RealmContext.class));
  final JsonValue actionContent=actionRequest.getContent();
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  JsonValue messageIdLoc=actionContent.get(MESSAGE_ID_JSON_POINTER);
  String messageId;
  if (messageIdLoc == null) {
    debug.warning("String_Node_Str",realm);
    return RestUtils.generateBadRequestException();
  }
 else {
    messageId=messageIdLoc.asString();
  }
  try {
    messageDispatcher.handle(messageId,actionContent);
  }
 catch (  NotFoundException e) {
    debug.warning("String_Node_Str",messageId,realm,e);
    try {
      attemptFromCTS(messageId,actionContent);
    }
 catch (    IllegalAccessException|InstantiationException|ClassNotFoundException|CoreTokenException|NotFoundException ex) {
      debug.warning("String_Node_Str",messageId,ex);
      return RestUtils.generateBadRequestException();
    }
  }
catch (  PredicateNotMetException e) {
    debug.warning("String_Node_Str",messageId,realm,e);
    return RestUtils.generateBadRequestException();
  }
  return newResultPromise(newActionResponse(json(object())));
}

Fixed version (ground truth):
private Promise<ActionResponse,ResourceException> handle(Context context,ActionRequest actionRequest){
  Reject.ifFalse(context.containsContext(RealmContext.class));
  final JsonValue actionContent=actionRequest.getContent();
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  JsonValue messageIdLoc=actionContent.get(MESSAGE_ID_JSON_POINTER);
  String messageId;
  if (messageIdLoc == null) {
    debug.warning("String_Node_Str",realm);
    return RestUtils.generateBadRequestException();
  }
 else {
    messageId=messageIdLoc.asString();
  }
  try {
    pushNotificationService.getMessageDispatcher(realm).handle(messageId,actionContent);
  }
 catch (  NotFoundException|PushNotificationException e) {
    debug.warning("String_Node_Str",messageId,realm,e);
    try {
      attemptFromCTS(messageId,actionContent);
    }
 catch (    IllegalAccessException|InstantiationException|ClassNotFoundException|CoreTokenException|NotFoundException ex) {
      debug.warning("String_Node_Str",messageId,ex);
      return RestUtils.generateBadRequestException();
    }
  }
catch (  PredicateNotMetException e) {
    debug.warning("String_Node_Str",messageId,realm,e);
    return RestUtils.generateBadRequestException();
  }
  return newResultPromise(newActionResponse(json(object())));
}
Program: 79612
Project: 79612
Buggy source:
/** 
 * Generate a new SnsMessageResource using the provided MessageDispatcher.
 * @param coreTokenService A copy of the core token services - messages are dropped on to this for use in clusteredenvironments.
 * @param messageDispatcher Used to deliver messages received at this endpoint to their appropriate locationswithin OpenAM.
 * @param jsonSerialisation Used to perform the serialisation necessary for inserting tokens into the CTS.
 * @param debug For writing out debug messages.
 */
public SnsMessageResource(CTSPersistentStore coreTokenService,MessageDispatcher messageDispatcher,JSONSerialisation jsonSerialisation,@Named("String_Node_Str") Debug debug){
  this.messageDispatcher=messageDispatcher;
  this.jsonSerialisation=jsonSerialisation;
  this.debug=debug;
  this.coreTokenService=coreTokenService;
}

Fixed version (ground truth):
/** 
 * Generate a new SnsMessageResource using the provided MessageDispatcher.
 * @param coreTokenService A copy of the core token services - messages are dropped on to this for use in clusteredenvironments.
 * @param pushNotificationService Used to get the message dispatcher, usde to deliver messages received at thisendpoint to their appropriate locations within OpenAM.
 * @param jsonSerialisation Used to perform the serialisation necessary for inserting tokens into the CTS.
 * @param debug For writing out debug messages.
 */
@Inject public SnsMessageResource(CTSPersistentStore coreTokenService,PushNotificationService pushNotificationService,JSONSerialisation jsonSerialisation,@Named("String_Node_Str") Debug debug){
  this.pushNotificationService=pushNotificationService;
  this.jsonSerialisation=jsonSerialisation;
  this.debug=debug;
  this.coreTokenService=coreTokenService;
}
Program: 79613
Project: 79613
Buggy source:
/** 
 * SnsMessageResourceFactory to provude SnsMessageResources with the appropriate resources.
 * @param coreTokenService The CTS instance to utilise.
 * @param jsonSerialisation For serializing down to the CTS.
 * @param debug For logging purposes.
 */
@Inject public SnsMessageResourceFactory(CTSPersistentStore coreTokenService,JSONSerialisation jsonSerialisation,@Named("String_Node_Str") Debug debug){
  this.coreTokenService=coreTokenService;
  this.jsonSerialisation=jsonSerialisation;
  this.debug=debug;
}

Fixed version (ground truth):
/** 
 * SnsMessageResourceFactory to provude SnsMessageResources with the appropriate resources.
 * @param coreTokenService The CTS instance to utilise.
 * @param jsonSerialisation For serializing down to the CTS.
 * @param debug For logging purposes.
 * @param pushNotificationService for retrieving the appropriate message dispatcher for this realm.
 */
@Inject public SnsMessageResourceFactory(CTSPersistentStore coreTokenService,JSONSerialisation jsonSerialisation,@Named("String_Node_Str") Debug debug,PushNotificationService pushNotificationService){
  this.coreTokenService=coreTokenService;
  this.jsonSerialisation=jsonSerialisation;
  this.pushNotificationService=pushNotificationService;
  this.debug=debug;
}
Program: 79614
Project: 79614
Buggy source:
/** 
 * Generates a new SnsMessageResource.
 * @param messageDispatcher The MessageDispatcher which backs this message resource.
 * @return a new SnsMessageResource.
 */
public SnsMessageResource produce(MessageDispatcher messageDispatcher){
  return new SnsMessageResource(coreTokenService,messageDispatcher,jsonSerialisation,debug);
}

Fixed version (ground truth):
/** 
 * Generates a new SnsMessageResource.
 * @return a new SnsMessageResource.
 */
public SnsMessageResource produce(){
  return new SnsMessageResource(coreTokenService,pushNotificationService,jsonSerialisation,debug);
}
Program: 79615
Project: 79615
Buggy source:
@BeforeMethod public void theSetUp(){
  mockDispatcher=mock(MessageDispatcher.class);
  Debug mockDebug=mock(Debug.class);
  mockCTS=mock(CTSPersistentStore.class);
  JSONSerialisation mockSerialisation=mock(JSONSerialisation.class);
  messageResource=new SnsMessageResource(mockCTS,mockDispatcher,mockSerialisation,mockDebug);
}

Fixed version (ground truth):
@BeforeMethod public void theSetUp(){
  mockService=mock(PushNotificationService.class);
  Debug mockDebug=mock(Debug.class);
  mockCTS=mock(CTSPersistentStore.class);
  mockDispatcher=mock(MessageDispatcher.class);
  try {
    given(mockService.getMessageDispatcher(anyString())).willReturn(mockDispatcher);
  }
 catch (  PushNotificationException e) {
  }
  JSONSerialisation mockSerialisation=mock(JSONSerialisation.class);
  messageResource=new SnsMessageResource(mockCTS,mockService,mockSerialisation,mockDebug);
}
Program: 79618
Project: 79618
Buggy source:
/** 
 * Returns tokens from Principals of a subject returns a Set of tokens TODO - DN to Universal ID?
 * @param subject Principals of a subject associated with<code>SSOToken</code>
 * @return set of  <code>SSOToken</code> associated with subject
 */
Set<String> getTokenFromPrincipal(Subject subject){
  Set<Principal> principal=subject.getPrincipals();
  Set<String> tokenSet=new HashSet<String>();
  StringBuilder pList=new StringBuilder();
  Iterator<Principal> p=principal.iterator();
  while (p.hasNext()) {
    this.token=(p.next()).getName();
    if (this.token != null && !containsToken(pList,token)) {
      pList.append(this.token).append("String_Node_Str");
      String tmpDN=DNUtils.normalizeDN(this.token);
      if (tmpDN != null) {
        this.userDN=tmpDN;
        this.token=DNUtils.DNtoName(this.token);
      }
 else       if (tmpDN == null && this.userDN == null) {
        this.userDN=this.token;
      }
    }
    if (!tokenSet.contains(this.token)) {
      tokenSet.add(this.token);
    }
    if (DEBUG.messageEnabled()) {
      DEBUG.message("String_Node_Str" + this.token);
    }
  }
  principalList=pList.toString();
  if (principalList != null) {
    principalList=principalList.substring(0,principalList.length() - 1);
  }
  if (DEBUG.messageEnabled()) {
    DEBUG.message("String_Node_Str" + principalList);
  }
  return tokenSet;
}

Fixed version (ground truth):
/** 
 * Returns tokens from Principals of a subject returns a Set of tokens TODO - DN to Universal ID?
 * @param subject Principals of a subject associated with<code>SSOToken</code>
 * @return set of  <code>SSOToken</code> associated with subject
 */
Set<String> getTokenFromPrincipal(Subject subject){
  Set<String> tokenSet=new HashSet<>();
  List<String> principalNames=new ArrayList<>(subject.getPrincipals().size());
  for (  Principal p : subject.getPrincipals()) {
    token=p.getName();
    if (token != null && !principalNames.contains(token)) {
      principalNames.add(token);
      if (LDAPUtils.isDN(token)) {
        userDN=token;
        token=DNUtils.DNtoName(token);
      }
 else       if (!LDAPUtils.isDN(token) && userDN == null) {
        userDN=token;
      }
    }
    if (!tokenSet.contains(token)) {
      tokenSet.add(token);
    }
    if (DEBUG.messageEnabled()) {
      DEBUG.message("String_Node_Str" + this.token);
    }
  }
  principalList=Joiner.on('|').join(principalNames);
  if (DEBUG.messageEnabled()) {
    DEBUG.message("String_Node_Str" + principalList);
  }
  return tokenSet;
}
Program: 79619
Project: 79619
Buggy source:
@Override public String getSessionId(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String getSessionId(){
  return null;
}
Program: 79620
Project: 79620
Buggy source:
public Map<String,Object> getTokenInfo(){
  JwtClaimsSet claimsSet=jwt.getClaimsSet();
  Map<String,Object> tokenInfo=new HashMap<>();
  for (  String key : claimsSet.keys()) {
    tokenInfo.put(key,claimsSet.get(key).getObject());
  }
  return tokenInfo;
}

Fixed version (ground truth):
public Map<String,Object> getTokenInfo(){
  JwtClaimsSet claimsSet=jwt.getClaimsSet();
  Map<String,Object> tokenInfo=new HashMap<>();
  for (  String key : claimsSet.keys()) {
    tokenInfo.put(key,claimsSet.get(key).getObject());
  }
  tokenInfo.put(getTokenName(),jwtString);
  return tokenInfo;
}
Program: 79621
Project: 79621
Buggy source:
/** 
 * Gets the name of the parameters in the current request
 * @return    The parameter names in the request
 */
public abstract Set<String> getParameterNames();

Fixed version (ground truth):
/** 
 * Gets the name of the parameters in the current request
 * @return The parameter names in the request
 */
public abstract Set<String> getParameterNames();
Program: 79622
Project: 79622
Buggy source:
/** 
 * Gets the name of the parameters in the current request
 * @return The parameter names in the request
 */
@Override public Set<String> getParameterNames(){
  if (request.getMethod().equals(Method.GET)) {
    return request.getResourceRef().getQueryAsForm().getNames();
  }
 else   if (request.getMethod().equals(Method.POST)) {
    if (request.getEntity() != null) {
      if (MediaType.APPLICATION_WWW_FORM.equals(request.getEntity().getMediaType())) {
        Form form=new Form(request.getEntity());
        request.setEntity(form.getWebRepresentation());
        return form.getNames();
      }
 else       if (MediaType.APPLICATION_JSON.equals(request.getEntity().getMediaType())) {
        return getBody().keys();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the name of the parameters in the current request
 * @return The parameter names in the request
 */
@Override public Set<String> getParameterNames(){
  if (request.getMethod().equals(Method.GET)) {
    return request.getResourceRef().getQueryAsForm().getNames();
  }
 else   if (request.getMethod().equals(Method.POST)) {
    if (request.getEntity() != null) {
      if (MediaType.APPLICATION_WWW_FORM.equals(request.getEntity().getMediaType())) {
        Form form=new Form(request.getEntity());
        request.setEntity(form.getWebRepresentation());
        return form.getNames();
      }
 else       if (MediaType.APPLICATION_JSON.equals(request.getEntity().getMediaType())) {
        return getBody().keys();
      }
    }
  }
  return Collections.emptySet();
}
Program: 79623
Project: 79623
Buggy source:
@Test public void shouldReturnParameterNamesWithGET(){
  setQueryParam(request);
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  Set<String> parameterNames=requestUnderTest.getParameterNames();
  assertEquals(parameterNames,new HashSet<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})));
}

Fixed version (ground truth):
@Test public void shouldReturnParameterNamesWithGET(){
  setQueryParam(request);
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  Set<String> parameterNames=requestUnderTest.getParameterNames();
  assertThat(parameterNames).containsOnly("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 79624
Project: 79624
Buggy source:
@Test public void shouldReturnZeroAsQueryParamCountWhenParamNotPresent(){
  setQueryParam(request);
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertEquals(result,0);
}

Fixed version (ground truth):
@Test public void shouldReturnZeroAsQueryParamCountWhenParamNotPresent(){
  setQueryParam(request);
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertThat(result).isEqualTo(0);
}
Program: 79625
Project: 79625
Buggy source:
@Test public void shouldReturnParameterNamesWithPOST(){
  Map<String,String> bodyParams=new HashMap<String,String>();
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  final JacksonRepresentation<Map> representation=new JacksonRepresentation<Map>(bodyParams);
  request.setEntity(representation);
  Set<String> parameterNames=requestUnderTest.getParameterNames();
  assertEquals(parameterNames,new HashSet<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})));
}

Fixed version (ground truth):
@Test public void shouldReturnParameterNamesWithPOST(){
  Map<String,String> bodyParams=new HashMap<String,String>();
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  bodyParams.put("String_Node_Str","String_Node_Str");
  final JacksonRepresentation<Map> representation=new JacksonRepresentation<Map>(bodyParams);
  request.setEntity(representation);
  Set<String> parameterNames=requestUnderTest.getParameterNames();
  assertThat(parameterNames).containsOnly("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 79626
Project: 79626
Buggy source:
@Test public void shouldReturnOneAsQueryParamCount(){
  setQueryParam(request);
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertEquals(result,1);
}

Fixed version (ground truth):
@Test public void shouldReturnOneAsQueryParamCount(){
  setQueryParam(request);
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertThat(result).isEqualTo(1);
}
Program: 79627
Project: 79627
Buggy source:
@Test public void shouldReturnTwoAsQueryParamCountWhenParamSetTwice(){
  setQueryParam(request);
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertEquals(result,2);
}

Fixed version (ground truth):
@Test public void shouldReturnTwoAsQueryParamCountWhenParamSetTwice(){
  setQueryParam(request);
  request.getResourceRef().addQueryParameter("String_Node_Str","String_Node_Str");
  int result=requestUnderTest.getParameterCount("String_Node_Str");
  assertThat(result).isEqualTo(2);
}
Program: 79630
Project: 79630
Buggy source:
private Object getValue(Properties attributes,String attributeName){
  final String type=getType(attributeName);
  if (type != null && type.equals("String_Node_Str")) {
    return new Integer((String)attributes.get(attributeName));
  }
 else {
    return attributes.get(attributeName);
  }
}

Fixed version (ground truth):
private Object getValue(Properties attributes,String attributeName){
  final String type=getType(attributeName);
  final String value=(String)attributes.get(attributeName);
  if (type != null && type.equals("String_Node_Str") && !value.isEmpty()) {
    return new Integer(value);
  }
 else {
    return value;
  }
}
Program: 79631
Project: 79631
Buggy source:
@Override public void addResourceRoutes(ResourceRouter rootRouter,ResourceRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(REALMS).authorizeWith(PrivilegeAuthzModule.class).toCollection(RealmResource.class);
  realmRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.ORGANIZATION));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).through(RealmContextFilter.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.GLOBAL));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toSingleton(SmsServerPropertiesResource.class);
}

Fixed version (ground truth):
@Override public void addResourceRoutes(ResourceRouter rootRouter,ResourceRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(REALMS).authorizeWith(PrivilegeAuthzModule.class).toCollection(RealmResource.class);
  realmRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.ORGANIZATION));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.GLOBAL));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toSingleton(SmsServerPropertiesResource.class);
}
Program: 79632
Project: 79632
Buggy source:
@Override public void addResourceRoutes(ResourceRouter rootRouter,ResourceRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(REALMS).authorizeWith(PrivilegeAuthzModule.class).toCollection(RealmResource.class);
  realmRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.ORGANIZATION));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).through(RealmContextFilter.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.GLOBAL));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toSingleton(SmsServerPropertiesResource.class);
}

Fixed version (ground truth):
@Override public void addResourceRoutes(ResourceRouter rootRouter,ResourceRouter realmRouter){
  realmRouter.route("String_Node_Str").auditAs(REALMS).authorizeWith(PrivilegeAuthzModule.class).toCollection(RealmResource.class);
  realmRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.ORGANIZATION));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).toRequestHandler(STARTS_WITH,smsRequestHandlerFactory.create(SchemaType.GLOBAL));
  rootRouter.route("String_Node_Str").auditAs(CONFIG).authorizeWith(PrivilegeAuthzModule.class).toSingleton(SmsServerPropertiesResource.class);
}
Program: 79633
Project: 79633
Buggy source:
public boolean handleResource(ResourceResponse resource){
  response.add(resource.getContent());
  return true;
}

Fixed version (ground truth):
public boolean handleResource(ResourceResponse resource){
  response.add(resource.getContent().getObject());
  return true;
}
Program: 79634
Project: 79634
Buggy source:
@Override public Set<HttpRoute> get(){
  rootRouter.route("String_Node_Str").authenticateWith(ssoToken().exceptActions("String_Node_Str")).auditAs(OAUTH).toCollection(TokenResource.class);
  rootRouter.route("String_Node_Str").authenticateWith(ssoToken()).auditAs(OAUTH).authorizeWith(AdminOnlyAuthzModule.class).toCollection(ClientResource.class);
  return Collections.singleton(HttpRoute.newHttpRoute(STARTS_WITH,"String_Node_Str",newHttpHandler(rootRouter.getRouter())));
}

Fixed version (ground truth):
@Override public Set<HttpRoute> get(){
  rootRouter.route("String_Node_Str").authenticateWith(ssoToken().exceptActions("String_Node_Str")).auditAs(OAUTH).toCollection(TokenResource.class);
  rootRouter.route("String_Node_Str").authenticateWith(ssoToken()).auditAs(OAUTH).authorizeWith(AdminOnlyAuthzModule.class).toCollection(ClientResource.class);
  return Collections.singleton(HttpRoute.newHttpRoute(STARTS_WITH,"String_Node_Str",Handlers.chainOf(newHttpHandler(rootRouter.getRouter()),authenticationFilter)));
}
Program: 79635
Project: 79635
Buggy source:
/** 
 * Handles create site request.
 * @param event Request invocation event
 */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
  ServerSiteModel model=(ServerSiteModel)getModel();
  AMPropertySheet ps=(AMPropertySheet)getChild(PROPERTY_ATTRIBUTE);
  String name=(String)getDisplayFieldValue(TF_NAME);
  name=name.trim();
  String url=(String)getDisplayFieldValue(TF_URL);
  url=url.trim();
  if ((name.length() > 0) && (url.length() > 0)) {
    try {
      model.createSite(name,url);
      backTrail();
      ServerSiteViewBean vb=(ServerSiteViewBean)getViewBean(ServerSiteViewBean.class);
      passPgSessionMap(vb);
      vb.forwardTo(getRequestContext());
    }
 catch (    AMConsoleException e) {
      setInlineAlertMessage(CCAlert.TYPE_ERROR,"String_Node_Str",e.getMessage());
      forwardTo();
    }
  }
 else {
    setInlineAlertMessage(CCAlert.TYPE_ERROR,"String_Node_Str","String_Node_Str");
    forwardTo();
  }
}

Fixed version (ground truth):
/** 
 * Handles create site request.
 * @param event Request invocation event
 */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
  ServerSiteModel model=(ServerSiteModel)getModel();
  AMPropertySheet ps=(AMPropertySheet)getChild(PROPERTY_ATTRIBUTE);
  String name=(String)getDisplayFieldValue(TF_NAME);
  name=name.trim();
  String url=(String)getDisplayFieldValue(TF_URL);
  url=url.trim();
  if ((name.length() > 0) && (url.length() > 0)) {
    try {
      model.createSite(name,url);
      backTrail();
      ServerSiteViewBean vb=(ServerSiteViewBean)getViewBean(ServerSiteViewBean.class);
      passPgSessionMap(vb);
      vb.forwardTo(getRequestContext());
    }
 catch (    AMConsoleException e) {
      setInlineAlertMessage(CCAlert.TYPE_ERROR,"String_Node_Str",e.getMessage());
      forwardTo();
    }
  }
 else {
    setInlineAlertMessage(CCAlert.TYPE_ERROR,"String_Node_Str",model.getLocalizedString("String_Node_Str"));
    forwardTo();
  }
}
Program: 79636
Project: 79636
Buggy source:
@DataProvider(name="String_Node_Str") public Object[][] getRelativeCases(){
  return new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",false}};
}

Fixed version (ground truth):
@DataProvider(name="String_Node_Str") public Object[][] getRelativeCases(){
  return new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true},{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",false}};
}
Program: 79638
Project: 79638
Buggy source:
public static void changePassword(Context serverContext,String realm,String username,String oldPassword,String newPassword) throws ResourceException {
  try {
    SSOToken token=serverContext.asContext(SSOTokenContext.class).getCallerSSOToken();
    AMIdentity userIdentity=new AMIdentity(token,username,IdType.USER,realm,null);
    userIdentity.changePassword(oldPassword,newPassword);
  }
 catch (  SSOException ssoe) {
    debug.warning("String_Node_Str" + "String_Node_Str" + username,ssoe);
    throw new PermanentException(401,"String_Node_Str",ssoe);
  }
catch (  IdRepoException ire) {
    if (IdRepoBundle.ACCESS_DENIED.equals(ire.getErrorCode())) {
      throw new ForbiddenException("String_Node_Str");
    }
 else {
      debug.warning("String_Node_Str" + "String_Node_Str" + username,ire);
      throw new InternalServerErrorException("String_Node_Str",ire);
    }
  }
}

Fixed version (ground truth):
public static void changePassword(Context serverContext,String realm,String username,String oldPassword,String newPassword) throws ResourceException {
  try {
    SSOToken token=serverContext.asContext(SSOTokenContext.class).getCallerSSOToken();
    AMIdentity userIdentity=new AMIdentity(token,username,IdType.USER,realm,null);
    userIdentity.changePassword(oldPassword,newPassword);
  }
 catch (  SSOException ssoe) {
    debug.warning("String_Node_Str" + "String_Node_Str" + username,ssoe);
    throw new PermanentException(401,"String_Node_Str",ssoe);
  }
catch (  IdRepoException ire) {
    if (IdRepoBundle.ACCESS_DENIED.equals(ire.getErrorCode())) {
      throw new ForbiddenException("String_Node_Str");
    }
 else     if (LDAPConstants.LDAP_INVALID_CREDENTIALS.equals(ire.getLDAPErrorCode())) {
      throw ResourceException.newResourceException(401,"String_Node_Str");
    }
 else {
      debug.warning("String_Node_Str" + "String_Node_Str" + username,ire);
      throw new InternalServerErrorException("String_Node_Str",ire);
    }
  }
}
Program: 79639
Project: 79639
Buggy source:
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operaton which is ethier <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException ;

Fixed version (ground truth):
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operation which is either <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException ;
Program: 79640
Project: 79640
Buggy source:
/** 
 * Initialization paramters as configred for a given plugin.
 * @param configParams configuration parameters
 */
public void initialize(Map<String,Set<String>> configParams);

Fixed version (ground truth):
/** 
 * Initialization parameters as configured for a given plugin.
 * @param configParams configuration parameters
 */
void initialize(Map<String,Set<String>> configParams);
Program: 79641
Project: 79641
Buggy source:
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operaton which is ethier <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException {
  if (minPasswordLength == 0) {
    return;
  }
  attrMap=new CaseInsensitiveHashMap(attrMap);
  if (!attrMap.containsKey(ATTR_USER_PASSWORD)) {
    if (idOp.equals(IdOperation.CREATE)) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
  }
 else {
    Set<String> values=attrMap.get(ATTR_USER_PASSWORD);
    if ((values == null) || (values.isEmpty())) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
 else {
      String password=values.iterator().next();
      if (password.length() < minPasswordLength) {
        Object[] args={"String_Node_Str" + minPasswordLength};
        throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException {
  if (minPasswordLength == 0) {
    return;
  }
  attrMap=new CaseInsensitiveHashMap(attrMap);
  if (!attrMap.containsKey(ATTR_USER_PASSWORD)) {
    if (idOp.equals(IdOperation.CREATE)) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
  }
 else {
    Set<String> values=attrMap.get(ATTR_USER_PASSWORD);
    if ((values == null) || (values.isEmpty())) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
 else {
      String password=values.iterator().next();
      if (password.length() < minPasswordLength) {
        Object[] args={"String_Node_Str" + minPasswordLength};
        throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
      }
    }
  }
}
Program: 79642
Project: 79642
Buggy source:
/** 
 * Initialization paramters as configred for a given plugin.
 * @param configParams configuration parameters
 */
public void initialize(Map<String,Set<String>> configParams){
  if ((configParams == null) || configParams.isEmpty()) {
    return;
  }
  for (  String name : configParams.keySet()) {
    if (name.equals(PROP_MIN_PASSWORD_LENGTH)) {
      Set<String> values=configParams.get(name);
      if ((values != null) && (!values.isEmpty())) {
        String value=values.iterator().next();
        try {
          minPasswordLength=Integer.parseInt(value);
          if (minPasswordLength < 0) {
            minPasswordLength=0;
          }
        }
 catch (        NumberFormatException nfe) {
          if (debug.warningEnabled()) {
            debug.warning("String_Node_Str" + "String_Node_Str",nfe);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void initialize(Map<String,Set<String>> configParams){
  if ((configParams == null) || configParams.isEmpty()) {
    return;
  }
  for (  String name : configParams.keySet()) {
    if (name.equals(PROP_MIN_PASSWORD_LENGTH)) {
      Set<String> values=configParams.get(name);
      if ((values != null) && (!values.isEmpty())) {
        String value=values.iterator().next();
        try {
          minPasswordLength=Integer.parseInt(value);
          if (minPasswordLength < 0) {
            minPasswordLength=0;
          }
        }
 catch (        NumberFormatException nfe) {
          if (debug.warningEnabled()) {
            debug.warning("String_Node_Str" + "String_Node_Str",nfe);
          }
        }
      }
    }
  }
}
Program: 79646
Project: 79646
Buggy source:
/** 
 * Generates the redirect from SAML2 auth module to IDP as GET.
 */
private void configureGetRedirectCallback(final String redirectUrl,RedirectCallback redirectCallback) throws AuthLoginException {
  final RedirectCallback rcNew=new RedirectCallback(redirectUrl,null,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  Map<String,String> redirectData=rcNew.getRedirectData();
  if (null == redirectData) {
    redirectData=new HashMap<>();
  }
  rcNew.setRedirectData(redirectData);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}

Fixed version (ground truth):
/** 
 * Generates the redirect from SAML2 auth module to IDP as GET.
 */
private void configureGetRedirectCallback(final String redirectUrl,RedirectCallback redirectCallback) throws AuthLoginException {
  final RedirectCallback rcNew=new RedirectCallback(redirectUrl,null,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  Map<String,String> redirectData=rcNew.getRedirectData();
  rcNew.setRedirectData(redirectData);
  rcNew.setTrackingCookie(true);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}