nus-yam/ex-repair huggingface dataset:
Program: 79793
Project: 79793
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: 79794
Project: 79794
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: 79795
Project: 79795
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: 79796
Project: 79796
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: 79798
Project: 79798
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: 79799
Project: 79799
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: 79800
Project: 79800
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: 79801
Project: 79801
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: 79802
Project: 79802
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: 79803
Project: 79803
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: 79804
Project: 79804
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: 79805
Project: 79805
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: 79806
Project: 79806
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: 79807
Project: 79807
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: 79808
Project: 79808
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();
}
Program: 79809
Project: 79809
Buggy source:
/** 
 * Validates the Relay State URL against a list of valid Relay State   URLs created on the hosted service provider.
 * @param orgName realm or organization name the provider resides in.
 * @param hostEntityId Entity ID of the hosted provider.
 * @param relayState Relay State URL.
 * @param role IDP/SP Role.
 * @throws SAML2Exception if the processing failed. 
 */
public static void validateRelayStateURL(String orgName,String hostEntityId,String relayState,String role) throws SAML2Exception {
  if (relayState != null) {
    if (!RELAY_STATE_VALIDATOR.isRedirectUrlValid(relayState,SAMLEntityInfo.from(orgName,hostEntityId,role))) {
      throw new SAML2Exception(SAML2Utils.bundle.getString("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
/** 
 * Validates the Relay State URL against a list of valid Relay State   URLs created on the hosted service provider.
 * @param orgName realm or organization name the provider resides in.
 * @param hostEntityId Entity ID of the hosted provider.
 * @param relayState Relay State URL.
 * @param role IDP/SP Role.
 * @throws SAML2Exception if the processing failed. 
 */
public static void validateRelayStateURL(String orgName,String hostEntityId,String relayState,String role) throws SAML2Exception {
  if (relayState != null && !relayState.isEmpty()) {
    if (!RELAY_STATE_VALIDATOR.isRedirectUrlValid(relayState,SAMLEntityInfo.from(orgName,hostEntityId,role))) {
      throw new SAML2Exception(SAML2Utils.bundle.getString("String_Node_Str"));
    }
  }
}
Program: 79810
Project: 79810
Buggy source:
/** 
 * Checks if a privilege with the specified name can be found.
 * @param name name of the privilege.
 * @throws com.sun.identity.entitlement.EntitlementException if search failed.
 */
@Override public boolean canFindByName(String name) throws EntitlementException {
  SearchFilter filter=new SearchFilter("String_Node_Str",name);
  return searchNames(asSet(filter)).isEmpty();
}

Fixed version (ground truth):
/** 
 * Checks if a privilege with the specified name can be found.
 * @param name name of the privilege.
 * @throws com.sun.identity.entitlement.EntitlementException if search failed.
 */
@Override public boolean canFindByName(String name) throws EntitlementException {
  SearchFilter filter=new SearchFilter("String_Node_Str",name);
  return !searchNames(asSet(filter)).isEmpty();
}
Program: 79811
Project: 79811
Buggy source:
/** 
 * Checks if a privilege with the specified name can be found.
 * @param name name of the privilege.
 * @throws com.sun.identity.entitlement.EntitlementException if search failed.
 */
@Override public boolean canFindByName(String name) throws EntitlementException {
  SearchFilter filter=new SearchFilter("String_Node_Str",name);
  return searchNames(asSet(filter)).isEmpty();
}

Fixed version (ground truth):
/** 
 * Checks if a privilege with the specified name can be found.
 * @param name name of the privilege.
 * @throws com.sun.identity.entitlement.EntitlementException if search failed.
 */
@Override public boolean canFindByName(String name) throws EntitlementException {
  SearchFilter filter=new SearchFilter("String_Node_Str",name);
  return !searchNames(asSet(filter)).isEmpty();
}
Program: 79812
Project: 79812
Buggy source:
/** 
 * Audits an attempted REST request, indicating which resource was accessed using which method linked to the SSOToken of the accessing user.
 * @param resource The accessed resource.
 * @param action The CREST action-type requested.
 * @param token The SSO token of the accessing user.
 */
public void auditAccessMessage(String resource,String action,SSOToken token){
  if (accessLogger != null && msgProvider != null) {
    final LogRecord record=msgProvider.createLogRecord("String_Node_Str",new String[]{resource,action},token);
    if (record != null) {
      accessLogger.log(record,AccessController.doPrivileged(AdminTokenAction.getInstance()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Audits an attempted REST request, indicating which resource was accessed using which method linked to the SSOToken of the accessing user.
 * @param resource The accessed resource.
 * @param action The CREST action-type requested.
 * @param token The SSO token of the accessing user (null if XUI)
 */
public void auditAccessMessage(String resource,String action,SSOToken token){
  if (accessLogger != null && msgProvider != null) {
    final LogRecord record=msgProvider.createLogRecord("String_Node_Str",new String[]{resource,action},token);
    if (record != null) {
      accessLogger.log(record,AccessController.doPrivileged(AdminTokenAction.getInstance()));
    }
  }
}
Program: 79813
Project: 79813
Buggy source:
/** 
 * Retrieves a link to the user's SSO Token, if it exists in the context.
 * @param context from which to pull the SSO Token
 */
public static SSOToken getTokenFromContext(ServerContext context){
  SSOToken userToken=null;
  if (!context.containsContext(SSOTokenContext.class)) {
    context=new SSOTokenContext(context);
  }
  SSOTokenContext ssoTokenContext=context.asContext(SSOTokenContext.class);
  try {
    userToken=ssoTokenContext.getCallerSSOToken();
  }
 catch (  SSOException e) {
  }
  return userToken;
}

Fixed version (ground truth):
/** 
 * Retrieves a link to the user's SSO Token, if it exists in the context.
 * @param context from which to pull the SSO Token
 */
public static SSOToken getTokenFromContext(ServerContext context,Debug debug){
  SSOToken userToken=null;
  if (!context.containsContext(SSOTokenContext.class)) {
    context=new SSOTokenContext(context);
  }
  SSOTokenContext ssoTokenContext=context.asContext(SSOTokenContext.class);
  try {
    userToken=ssoTokenContext.getCallerSSOToken();
  }
 catch (  SSOException e) {
    debug.message("String_Node_Str",e);
  }
  return userToken;
}
Program: 79814
Project: 79814
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeUpdate(ServerContext serverContext,UpdateRequest updateRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getUpdateString(updateRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeUpdate(serverContext,updateRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeUpdate(ServerContext serverContext,UpdateRequest updateRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getUpdateString(updateRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeUpdate(serverContext,updateRequest),moduleName);
}
Program: 79815
Project: 79815
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeQuery(ServerContext serverContext,QueryRequest queryRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getQueryString(queryRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeQuery(serverContext,queryRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeQuery(ServerContext serverContext,QueryRequest queryRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getQueryString(queryRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeQuery(serverContext,queryRequest),moduleName);
}
Program: 79816
Project: 79816
Buggy source:
Promise<AuthorizationResult,ResourceException> log(String resource,String action,SSOToken token,Promise<AuthorizationResult,ResourceException> result,String authZModule){
  try {
    if (!result.get().isAuthorized()) {
      restLog.auditAccessDenied(resource,action,authZModule,token);
    }
 else {
      restLog.auditAccessGranted(resource,action,authZModule,token);
    }
  }
 catch (  ExecutionException e) {
    debug.error("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    debug.error("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
Promise<AuthorizationResult,ResourceException> log(String resource,String action,SSOToken token,Promise<AuthorizationResult,ResourceException> result,String authZModule){
  try {
    if (!result.get().isAuthorized()) {
      restLog.auditAccessDenied(resource,action,authZModule,token);
    }
 else {
      restLog.auditAccessGranted(resource,action,authZModule,token);
    }
  }
 catch (  ExecutionException e) {
    debug.message(e.getMessage());
  }
catch (  InterruptedException e) {
    debug.message(e.getMessage());
  }
  return result;
}
Program: 79817
Project: 79817
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizePatch(ServerContext serverContext,PatchRequest patchRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getPatchString(patchRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizePatch(serverContext,patchRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizePatch(ServerContext serverContext,PatchRequest patchRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getPatchString(patchRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizePatch(serverContext,patchRequest),moduleName);
}
Program: 79818
Project: 79818
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeCreate(ServerContext serverContext,CreateRequest createRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getCreateString(createRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeCreate(serverContext,createRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeCreate(ServerContext serverContext,CreateRequest createRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getCreateString(createRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeCreate(serverContext,createRequest),moduleName);
}
Program: 79819
Project: 79819
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeAction(ServerContext serverContext,ActionRequest actionRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getActionString(actionRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeAction(serverContext,actionRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeAction(ServerContext serverContext,ActionRequest actionRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getActionString(actionRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeAction(serverContext,actionRequest),moduleName);
}
Program: 79820
Project: 79820
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeRead(ServerContext serverContext,ReadRequest readRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getReadString(readRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeRead(serverContext,readRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeRead(ServerContext serverContext,ReadRequest readRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getReadString(readRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeRead(serverContext,readRequest),moduleName);
}
Program: 79821
Project: 79821
Buggy source:
@Override public Promise<AuthorizationResult,ResourceException> authorizeDelete(ServerContext serverContext,DeleteRequest deleteRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getDeleteString(deleteRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext),module.authorizeDelete(serverContext,deleteRequest),moduleName);
}

Fixed version (ground truth):
@Override public Promise<AuthorizationResult,ResourceException> authorizeDelete(ServerContext serverContext,DeleteRequest deleteRequest){
  final String resource=ServerContextUtils.getMatchedUri(serverContext);
  final String action=ServerContextUtils.getDeleteString(deleteRequest);
  return log(resource,action,ServerContextUtils.getTokenFromContext(serverContext,debug),module.authorizeDelete(serverContext,deleteRequest),moduleName);
}
Program: 79822
Project: 79822
Buggy source:
/** 
 * Pushes off to our logging subsystem.
 */
private void logAccess(String resource,String operation,ServerContext context){
  if (!context.containsContext(SSOTokenContext.class)) {
    context=new SSOTokenContext(context);
  }
  SSOTokenContext ssoTokenContext=context.asContext(SSOTokenContext.class);
  try {
    restLog.auditAccessMessage(resource,operation,ssoTokenContext.getCallerSSOToken());
  }
 catch (  SSOException e) {
    if (debug.errorEnabled()) {
      debug.error("String_Node_Str" + "String_Node_Str");
    }
  }
  restLog.debugOperationAttemptAsPrincipal(resource,operation,context,null,debug);
}

Fixed version (ground truth):
/** 
 * Pushes off to our logging subsystem.
 */
private void logAccess(String resource,String operation,ServerContext context){
  if (!context.containsContext(SSOTokenContext.class)) {
    context=new SSOTokenContext(context);
  }
  SSOTokenContext ssoTokenContext=context.asContext(SSOTokenContext.class);
  try {
    restLog.auditAccessMessage(resource,operation,ssoTokenContext.getCallerSSOToken());
  }
 catch (  SSOException e) {
    if (debug.warningEnabled()) {
      debug.warning("String_Node_Str" + "String_Node_Str",e);
      restLog.auditAccessMessage(resource,operation,null);
    }
  }
  restLog.debugOperationAttemptAsPrincipal(resource,operation,context,null,debug);
}
Program: 79823
Project: 79823
Buggy source:
@Test public void shouldNotStoreSecondaryKeyIfNull(){
  SAMLToken samlToken=new SAMLToken("String_Node_Str",null,12345,"String_Node_Str");
  given(tokenIdFactory.toSAMLPrimaryTokenId(anyString())).willReturn("String_Node_Str");
  given(serialisation.serialise(anyObject())).willReturn("String_Node_Str");
  Token token=adapter.toToken(samlToken);
  assertThat(token.getValue(SAMLTokenField.SECONDARY_KEY.getField())).isNull();
}

Fixed version (ground truth):
@Test public void shouldNotStoreSecondaryKeyIfNull(){
  SAMLToken samlToken=new SAMLToken("String_Node_Str",null,12345,"String_Node_Str");
  given(tokenIdFactory.toSAMLPrimaryTokenId(anyString())).willReturn("String_Node_Str");
  given(serialisation.serialise(anyObject())).willReturn("String_Node_Str");
  Token token=adapter.toToken(samlToken);
  assertThat(token.<String>getValue(SAMLTokenField.SECONDARY_KEY.getField())).isNull();
}
Program: 79824
Project: 79824
Buggy source:
public void shouldAssignSessionHandle(){
  long timestamp=12345l;
  InternalSession mockSession=mock(InternalSession.class);
  SessionID mockSessionID=mock(SessionID.class);
  String sessionId="String_Node_Str";
  String sessionHandle=SessionService.SHANDLE_SCHEME_PREFIX + "String_Node_Str";
  given(mockSessionID.toString()).willReturn(sessionId);
  given(jsonSerialisation.deserialise(anyString(),any(Class.class))).willReturn(mockSession);
  given(mockSession.getExpirationTime()).willReturn(timestamp);
  given(mockSession.getID()).willReturn(mockSessionID);
  given(mockSession.getSessionHandle()).willReturn(sessionHandle);
  given(tokenIdFactory.toSessionTokenId(eq(mockSession))).willReturn(sessionId);
  given(jsonSerialisation.serialise(any())).willReturn("String_Node_Str");
  Token token=adapter.toToken(mockSession);
  assertThat(token.getValue(SessionTokenField.SESSION_HANDLE.getField())).isEqualTo(sessionHandle);
}

Fixed version (ground truth):
public void shouldAssignSessionHandle(){
  long timestamp=12345l;
  InternalSession mockSession=mock(InternalSession.class);
  SessionID mockSessionID=mock(SessionID.class);
  String sessionId="String_Node_Str";
  String sessionHandle=SessionService.SHANDLE_SCHEME_PREFIX + "String_Node_Str";
  given(mockSessionID.toString()).willReturn(sessionId);
  given(jsonSerialisation.deserialise(anyString(),any(Class.class))).willReturn(mockSession);
  given(mockSession.getExpirationTime()).willReturn(timestamp);
  given(mockSession.getID()).willReturn(mockSessionID);
  given(mockSession.getSessionHandle()).willReturn(sessionHandle);
  given(tokenIdFactory.toSessionTokenId(eq(mockSession))).willReturn(sessionId);
  given(jsonSerialisation.serialise(any())).willReturn("String_Node_Str");
  Token token=adapter.toToken(mockSession);
  assertThat(token.<String>getValue(SessionTokenField.SESSION_HANDLE.getField())).isEqualTo(sessionHandle);
}
Program: 79825
Project: 79825
Buggy source:
@Test public void shouldAssignSessionID(){
  long timestamp=12345l;
  InternalSession mockSession=mock(InternalSession.class);
  SessionID mockSessionID=mock(SessionID.class);
  String sessionId="String_Node_Str";
  String sessionHandle=SessionService.SHANDLE_SCHEME_PREFIX + "String_Node_Str";
  given(mockSessionID.toString()).willReturn(sessionId);
  given(jsonSerialisation.deserialise(anyString(),any(Class.class))).willReturn(mockSession);
  given(mockSession.getExpirationTime()).willReturn(timestamp);
  given(mockSession.getID()).willReturn(mockSessionID);
  given(mockSession.getSessionHandle()).willReturn(sessionHandle);
  given(tokenIdFactory.toSessionTokenId(eq(mockSession))).willReturn(sessionId);
  given(jsonSerialisation.serialise(any())).willReturn("String_Node_Str");
  Token token=adapter.toToken(mockSession);
  assertThat(token.getValue(SessionTokenField.SESSION_ID.getField())).isEqualTo(sessionId);
}

Fixed version (ground truth):
@Test public void shouldAssignSessionID(){
  long timestamp=12345l;
  InternalSession mockSession=mock(InternalSession.class);
  SessionID mockSessionID=mock(SessionID.class);
  String sessionId="String_Node_Str";
  String sessionHandle=SessionService.SHANDLE_SCHEME_PREFIX + "String_Node_Str";
  given(mockSessionID.toString()).willReturn(sessionId);
  given(jsonSerialisation.deserialise(anyString(),any(Class.class))).willReturn(mockSession);
  given(mockSession.getExpirationTime()).willReturn(timestamp);
  given(mockSession.getID()).willReturn(mockSessionID);
  given(mockSession.getSessionHandle()).willReturn(sessionHandle);
  given(tokenIdFactory.toSessionTokenId(eq(mockSession))).willReturn(sessionId);
  given(jsonSerialisation.serialise(any())).willReturn("String_Node_Str");
  Token token=adapter.toToken(mockSession);
  assertThat(token.<String>getValue(SessionTokenField.SESSION_ID.getField())).isEqualTo(sessionId);
}
Program: 79826
Project: 79826
Buggy source:
@Test public void shouldContainNewFieldInCopyConstructor(){
  String id="String_Node_Str";
  CoreTokenField field=CoreTokenField.TOKEN_ID;
  PartialToken first=new PartialToken(Collections.<CoreTokenField,Object>emptyMap());
  PartialToken clone=new PartialToken(first,field,id);
  assertThat(clone.getValue(field)).isEqualTo(id);
}

Fixed version (ground truth):
@Test public void shouldContainNewFieldInCopyConstructor(){
  String id="String_Node_Str";
  CoreTokenField field=CoreTokenField.TOKEN_ID;
  PartialToken first=new PartialToken(Collections.<CoreTokenField,Object>emptyMap());
  PartialToken clone=new PartialToken(first,field,id);
  assertThat(clone.<String>getValue(field)).isEqualTo(id);
}
Program: 79827
Project: 79827
Buggy source:
/** 
 * {@inheritDoc}
 */
public Map<String,Object> extraDataToReturnForTokenEndpoint(Map<String,String> parameters,CoreToken token){
  final Map<String,Object> map=new HashMap<String,Object>();
  final Set<String> scope=token.getScope();
  if (scope != null && scope.contains("String_Node_Str")) {
    final Map.Entry<String,String> tokenEntry;
    try {
      tokenEntry=openIDTokenIssuer.issueToken(new AccessTokenToLegacyAdapter(token),requestFactory.create(Request.getCurrent()));
    }
 catch (    ServerException e) {
      throw OAuthProblemException.OAuthError.SERVER_ERROR.handle(null,e.getMessage());
    }
catch (    InvalidClientException e) {
      throw OAuthProblemException.OAuthError.INVALID_CLIENT.handle(null,e.getMessage());
    }
catch (    InvalidGrantException e) {
      throw OAuthProblemException.OAuthError.INVALID_GRANT.handle(null,e.getMessage());
    }
    if (tokenEntry != null) {
      map.put(tokenEntry.getKey(),tokenEntry.getValue());
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Map<String,Object> extraDataToReturnForTokenEndpoint(Map<String,String> parameters,CoreToken token){
  final Map<String,Object> map=new HashMap<String,Object>();
  final Set<String> scope=token.getScope();
  if (scope != null && scope.contains(OPENID_SCOPE)) {
    final Map.Entry<String,String> tokenEntry;
    try {
      tokenEntry=openIDTokenIssuer.issueToken(new AccessTokenToLegacyAdapter(token),requestFactory.create(Request.getCurrent()));
    }
 catch (    ServerException e) {
      throw OAuthProblemException.OAuthError.SERVER_ERROR.handle(null,e.getMessage());
    }
catch (    InvalidClientException e) {
      throw OAuthProblemException.OAuthError.INVALID_CLIENT.handle(null,e.getMessage());
    }
catch (    InvalidGrantException e) {
      throw OAuthProblemException.OAuthError.INVALID_GRANT.handle(null,e.getMessage());
    }
    if (tokenEntry != null) {
      map.put(tokenEntry.getKey(),tokenEntry.getValue());
    }
  }
  return map;
}
Program: 79829
Project: 79829
Buggy source:
/** 
 * Perform any necessary session cleanup after authentication has completed. In the case of successful session upgrade, this will destroy the original session in favour of the new (upgraded) session. In the case of force-auth mode, this will destroy the new session in favour of the old (now upgraded) session. In the case of authentication failure the new session will always be destroyed. For failed session upgrade, the original session is restored. Otherwise, any existing session is also destroyed on authentication failure.
 */
public void cleanup(){
  if (isFailed()) {
    DEBUG.message("String_Node_Str");
    authContext.destroySession();
    if (authContext.isSessionUpgrade()) {
      DEBUG.message("String_Node_Str");
      authContext.restoreOldSession();
    }
 else {
      authContext.destroyOldSession();
    }
  }
 else   if (isSuccessful()) {
    if (authContext.isForceAuth()) {
      DEBUG.message("String_Node_Str");
      authContext.destroySession();
      authContext.restoreOldSession();
    }
 else     if (authContext.isSessionUpgrade() && SystemProperties.getAsBoolean(Constants.DESTROY_SESSION_AFTER_UPGRADE)) {
      DEBUG.message("String_Node_Str");
      authContext.destroyOldSession();
    }
  }
}

Fixed version (ground truth):
/** 
 * Perform any necessary session cleanup after authentication has completed. In the case of successful session upgrade, this will destroy the original session in favour of the new (upgraded) session. In the case of force-auth mode, this will destroy the new session in favour of the old (now upgraded) session. In the case of authentication failure the new session will always be destroyed. For failed session upgrade, the original session is restored. Otherwise, any existing session is also destroyed on authentication failure.
 */
public void cleanup(){
  if (isFailed()) {
    DEBUG.message("String_Node_Str");
    authContext.destroySession();
    if (authContext.isSessionUpgrade()) {
      DEBUG.message("String_Node_Str");
      authContext.restoreOldSession();
    }
 else {
      authContext.destroyOldSession();
    }
  }
 else   if (isSuccessful()) {
    if (authContext.isForceAuth()) {
      DEBUG.message("String_Node_Str");
      authContext.destroySession();
      authContext.restoreOldSession();
    }
 else     if (authContext.hasOldSession() && SystemProperties.getAsBoolean(Constants.DESTROY_SESSION_AFTER_UPGRADE)) {
      DEBUG.message("String_Node_Str");
      authContext.destroyOldSession();
    }
  }
}
Program: 79830
Project: 79830
Buggy source:
@Test public void shouldDestroyOldSessionAfterSessionUpgrade(){
  System.setProperty(Constants.DESTROY_SESSION_AFTER_UPGRADE,"String_Node_Str");
  given(authContext.getStatus()).willReturn(AuthContext.Status.SUCCESS);
  given(authContext.isSessionUpgrade()).willReturn(true);
  loginProcess.cleanup();
  verify(authContext).destroyOldSession();
}

Fixed version (ground truth):
@Test public void shouldDestroyOldSessionAfterSessionUpgrade(){
  System.setProperty(Constants.DESTROY_SESSION_AFTER_UPGRADE,"String_Node_Str");
  given(authContext.getStatus()).willReturn(AuthContext.Status.SUCCESS);
  given(authContext.hasOldSession()).willReturn(true);
  loginProcess.cleanup();
  verify(authContext).destroyOldSession();
}
Program: 79831
Project: 79831
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int process(Callback[] callbacks,int state) throws LoginException {
switch (state) {
case STATE_BEGIN:
    if (!clientSideScriptEnabled) {
      clientSideScript="String_Node_Str";
    }
  substituteUIStrings();
return STATE_RUN_SCRIPT;
case STATE_RUN_SCRIPT:
Bindings scriptVariables=new SimpleBindings();
scriptVariables.put("String_Node_Str",getScriptHttpRequestWrapper());
scriptVariables.put(LOGGER_VARIABLE_NAME,DEBUG);
scriptVariables.put(STATE_VARIABLE_NAME,state);
scriptVariables.put(USERNAME_VARIABLE_NAME,userName);
scriptVariables.put(SUCCESS_ATTR_NAME,SUCCESS_VALUE);
scriptVariables.put(FAILED_ATTR_NAME,FAILURE_VALUE);
scriptVariables.put(HTTP_CLIENT_VARIABLE_NAME,httpClient);
scriptVariables.put(HTTP_CLIENT_REQUEST_VARIABLE_NAME,httpClientRequest);
scriptVariables.put(IDENTITY_REPOSITORY,identityRepository);
try {
scriptEvaluator.evaluateScript(serverSideScript,scriptVariables);
}
 catch (ScriptException e) {
DEBUG.message("String_Node_Str",e);
throw new AuthLoginException("String_Node_Str");
}
state=((Number)scriptVariables.get(STATE_VARIABLE_NAME)).intValue();
userName=(String)scriptVariables.get(USERNAME_VARIABLE_NAME);
if (state != SUCCESS_VALUE) {
throw new AuthLoginException("String_Node_Str");
}
return state;
default :
throw new AuthLoginException("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int process(Callback[] callbacks,int state) throws LoginException {
switch (state) {
case STATE_BEGIN:
    if (!clientSideScriptEnabled || clientSideScript.isEmpty()) {
      clientSideScript="String_Node_Str";
    }
  substituteUIStrings();
return STATE_RUN_SCRIPT;
case STATE_RUN_SCRIPT:
Bindings scriptVariables=new SimpleBindings();
scriptVariables.put("String_Node_Str",getScriptHttpRequestWrapper());
scriptVariables.put(LOGGER_VARIABLE_NAME,DEBUG);
scriptVariables.put(STATE_VARIABLE_NAME,state);
scriptVariables.put(USERNAME_VARIABLE_NAME,userName);
scriptVariables.put(SUCCESS_ATTR_NAME,SUCCESS_VALUE);
scriptVariables.put(FAILED_ATTR_NAME,FAILURE_VALUE);
scriptVariables.put(HTTP_CLIENT_VARIABLE_NAME,httpClient);
scriptVariables.put(HTTP_CLIENT_REQUEST_VARIABLE_NAME,httpClientRequest);
scriptVariables.put(IDENTITY_REPOSITORY,identityRepository);
try {
scriptEvaluator.evaluateScript(serverSideScript,scriptVariables);
}
 catch (ScriptException e) {
DEBUG.message("String_Node_Str",e);
throw new AuthLoginException("String_Node_Str");
}
state=((Number)scriptVariables.get(STATE_VARIABLE_NAME)).intValue();
userName=(String)scriptVariables.get(USERNAME_VARIABLE_NAME);
if (state != SUCCESS_VALUE) {
throw new AuthLoginException("String_Node_Str");
}
return state;
default :
throw new AuthLoginException("String_Node_Str");
}
}
Program: 79832
Project: 79832
Buggy source:
/** 
 * Sets mime headers in HTTP servlet response.
 * @param headers mime headers to be set.
 * @param res HTTP servlet response.
 */
public static void putHeaders(MimeHeaders headers,HttpServletResponse res){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + headers.toString());
  }
  Iterator it=headers.getAllHeaders();
  while (it.hasNext()) {
    MimeHeader header=(MimeHeader)it.next();
    String[] values=headers.getHeader(header.getName());
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str" + header.getName() + "String_Node_Str"+ values);
    }
    if (values.length == 1) {
      res.setHeader(header.getName(),header.getValue());
    }
 else {
      StringBuffer concat=new StringBuffer();
      int i=0;
      while (i < values.length) {
        if (i != 0) {
          concat.append(',');
        }
        concat.append(values[i++]);
      }
      res.setHeader(header.getName(),concat.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets mime headers in HTTP servlet response.
 * @param headers mime headers to be set.
 * @param res HTTP servlet response.
 */
public static void putHeaders(MimeHeaders headers,HttpServletResponse res){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + headers.toString());
  }
  Iterator it=headers.getAllHeaders();
  while (it.hasNext()) {
    MimeHeader header=(MimeHeader)it.next();
    String[] values=headers.getHeader(header.getName());
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str" + header.getName() + "String_Node_Str"+ Arrays.toString(values));
    }
    if (values.length == 1) {
      res.setHeader(header.getName(),header.getValue());
    }
 else {
      StringBuffer concat=new StringBuffer();
      int i=0;
      while (i < values.length) {
        if (i != 0) {
          concat.append(',');
        }
        concat.append(values[i++]);
      }
      res.setHeader(header.getName(),concat.toString());
    }
  }
}
Program: 79833
Project: 79833
Buggy source:
/** 
 * Checks certificate validity with configured CRL 
 * @param cert x509 certificate 
 * @return <code>true</code> if the certificate is not in CRL, otherwise, return <code>false</code> 
 */
public static boolean validateCertificate(X509Certificate cert){
  String method="String_Node_Str";
  boolean certgood=true;
  if (checkCertStatus == false) {
    if (debug.messageEnabled()) {
      debug.message(method + "String_Node_Str");
    }
    return certgood=true;
  }
  certgood=CRLValidator.validateCertificate(cert,checkCAStatus);
  if (debug.messageEnabled()) {
    debug.message(method + "String_Node_Str" + certgood);
  }
  return certgood;
}

Fixed version (ground truth):
/** 
 * Checks certificate validity with configured CRL 
 * @param cert x509 certificate 
 * @return <code>true</code> if the certificate is not in CRL, otherwise, return <code>false</code> 
 */
public static boolean validateCertificate(X509Certificate cert){
  String method="String_Node_Str";
  boolean certgood=true;
  if (checkCertStatus == false) {
    if (debug.messageEnabled()) {
      debug.message(method + "String_Node_Str");
    }
    return certgood;
  }
  certgood=CRLValidator.validateCertificate(cert,checkCAStatus);
  if (debug.messageEnabled()) {
    debug.message(method + "String_Node_Str" + certgood);
  }
  return certgood;
}
Program: 79834
Project: 79834
Buggy source:
/** 
 * Returns the authentication level of the authentication method used for for authentication.
 * @return The authentication level.
 * @throws SSOException if the SSOToken is not VALID or ifthere are errors in getting the authentication level.
 */
public int getAuthLevel() throws SSOException {
  checkTokenType("String_Node_Str");
  try {
    String authLevelFull=SSOSession.getProperty("String_Node_Str");
    int indexOfStartOfIntegerPart=0;
    if (authLevelFull.contains("String_Node_Str")) {
      indexOfStartOfIntegerPart=authLevelFull.lastIndexOf("String_Node_Str") + 1;
    }
    String authLevelInteger=authLevelFull.substring(indexOfStartOfIntegerPart);
    return (new Integer(authLevelInteger)).intValue();
  }
 catch (  Exception e) {
    SSOProviderImpl.debug.error("String_Node_Str");
    throw new SSOException(e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the authentication level of the authentication method used for for authentication.
 * @return The authentication level.
 * @throws SSOException if the SSOToken is not VALID or ifthere are errors in getting the authentication level.
 */
public int getAuthLevel() throws SSOException {
  checkTokenType("String_Node_Str");
  try {
    String authLevelFull=SSOSession.getProperty("String_Node_Str");
    int indexOfStartOfIntegerPart=authLevelFull.lastIndexOf("String_Node_Str") + 1;
    String authLevelInteger=authLevelFull.substring(indexOfStartOfIntegerPart);
    return Integer.valueOf(authLevelInteger);
  }
 catch (  Exception e) {
    SSOProviderImpl.debug.error("String_Node_Str");
    throw new SSOException(e);
  }
}
Program: 79835
Project: 79835
Buggy source:
/** 
 * Returns the authentication level of the authentication method used for for authentication.
 * @return The authentication level.
 * @throws SSOException if the SSOToken is not VALID or ifthere are errors in getting the authentication level.
 */
public int getAuthLevel() throws SSOException {
  checkTokenType("String_Node_Str");
  try {
    return ((new Integer(SSOSession.getProperty("String_Node_Str"))).intValue());
  }
 catch (  Exception e) {
    SSOProviderImpl.debug.error("String_Node_Str");
    throw new SSOException(e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the authentication level of the authentication method used for for authentication.
 * @return The authentication level.
 * @throws SSOException if the SSOToken is not VALID or ifthere are errors in getting the authentication level.
 */
public int getAuthLevel() throws SSOException {
  checkTokenType("String_Node_Str");
  try {
    String authLevelFull=SSOSession.getProperty("String_Node_Str");
    int indexOfStartOfIntegerPart=0;
    if (authLevelFull.contains("String_Node_Str")) {
      indexOfStartOfIntegerPart=authLevelFull.lastIndexOf("String_Node_Str") + 1;
    }
    String authLevelInteger=authLevelFull.substring(indexOfStartOfIntegerPart);
    return (new Integer(authLevelInteger)).intValue();
  }
 catch (  Exception e) {
    SSOProviderImpl.debug.error("String_Node_Str");
    throw new SSOException(e);
  }
}