nus-yam/ex-repair huggingface dataset:
Program: 9217
Project: 9217
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: 9218
Project: 9218
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: 9219
Project: 9219
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: 9220
Project: 9220
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: 9221
Project: 9221
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: 9222
Project: 9222
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: 9223
Project: 9223
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: 9224
Project: 9224
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: 9225
Project: 9225
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: 9226
Project: 9226
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: 9227
Project: 9227
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: 9228
Project: 9228
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: 9229
Project: 9229
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: 9230
Project: 9230
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: 9231
Project: 9231
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: 9232
Project: 9232
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: 9233
Project: 9233
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: 9234
Project: 9234
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: 9235
Project: 9235
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: 9237
Project: 9237
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: 9238
Project: 9238
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: 9239
Project: 9239
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: 9240
Project: 9240
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: 9241
Project: 9241
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: 9242
Project: 9242
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: 9243
Project: 9243
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);
  }
}
Program: 9244
Project: 9244
Buggy source:
@Override public BearerToken verify(BearerToken token) throws OAuthProblemException {
  Reference reference=new Reference(validationServerRef);
  reference.addQueryParameter(OAuth2Constants.Params.ACCESS_TOKEN,token.getTokenID());
  Client client=new Client(new Context(),Protocol.HTTP);
  ClientResource clientResource=new ClientResource(reference.toUri());
  clientResource.setNext(client);
  clientResource.get();
  try {
    Response response=clientResource.getResponse();
    Map remoteToken=BearerTokenExtractor.extractToken(response);
    Object o=remoteToken.get(OAuth2Constants.Token.OAUTH_ACCESS_TOKEN);
    if (o != null) {
      return (BearerToken)tokenStore.readAccessToken(o.toString());
    }
    return null;
  }
 catch (  OAuthProblemException e) {
    OAuth2Utils.DEBUG.error("String_Node_Str",e);
    throw e;
  }
catch (  ResourceException e) {
    OAuth2Utils.DEBUG.error("String_Node_Str",e);
    throw OAuthProblemException.OAuthError.ACCESS_DENIED.handle(null,e.getMessage());
  }
}

Fixed version (ground truth):
@Override public BearerToken verify(BearerToken token) throws OAuthProblemException {
  Reference reference=new Reference(validationServerRef);
  reference.addQueryParameter(OAuth2Constants.Params.ACCESS_TOKEN,token.getTokenID());
  Client client=new Client(new Context(),Protocol.HTTP);
  ClientResource clientResource=new ClientResource(reference.toUri());
  clientResource.setNext(client);
  clientResource.get();
  try {
    Response response=clientResource.getResponse();
    Map remoteToken=BearerTokenExtractor.extractToken(response);
    Object o=remoteToken.get(OAuth2Constants.Token.OAUTH_ACCESS_TOKEN);
    if (o != null) {
      return (BearerToken)tokenStore.readAccessToken(o.toString());
    }
    return null;
  }
 catch (  OAuthProblemException e) {
    OAuth2Utils.DEBUG.error("String_Node_Str",e);
    throw e;
  }
catch (  ResourceException e) {
    OAuth2Utils.DEBUG.error("String_Node_Str",e);
    throw OAuthProblemException.OAuthError.ACCESS_DENIED.handle(null,e.getMessage());
  }
 finally {
    if (client != null) {
      try {
        client.stop();
      }
 catch (      Exception e) {
        OAuth2Utils.DEBUG.error("String_Node_Str" + "String_Node_Str",e);
      }
    }
  }
}
Program: 9246
Project: 9246
Buggy source:
public OpenSSOPrivilege(){
  super();
  policyMonitor=InjectorHolder.getInstance(PolicyMonitor.class);
}

Fixed version (ground truth):
public OpenSSOPrivilege(){
  super();
  if (isServerMode()) {
    policyMonitor=InjectorHolder.getInstance(PolicyMonitor.class);
  }
 else {
    policyMonitor=null;
  }
}
Program: 9247
Project: 9247
Buggy source:
/** 
 * Constructor to create an evaluator the default service type.
 * @param subject Subject who credential is used for performing the evaluation.
 * @throws EntitlementException if any other abnormal condition occured.
 */
public Evaluator(Subject subject) throws EntitlementException {
  adminSubject=subject;
  policyMonitor=InjectorHolder.getInstance(PolicyMonitor.class);
  configWrapper=new EntitlementConfigurationWrapper();
}

Fixed version (ground truth):
/** 
 * Constructor to create an evaluator the default service type.
 * @param subject Subject who credential is used for performing the evaluation.
 * @throws EntitlementException if any other abnormal condition occured.
 */
public Evaluator(Subject subject) throws EntitlementException {
  adminSubject=subject;
  policyMonitor=getPolicyMonitor();
  configWrapper=new EntitlementConfigurationWrapper();
}
Program: 9248
Project: 9248
Buggy source:
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  if (preceedingDelimiter) {
    j--;
  }
  return String.valueOf(newchars,0,j);
}

Fixed version (ground truth):
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  return String.valueOf(newchars,0,j);
}
Program: 9249
Project: 9249
Buggy source:
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  if (preceedingDelimiter) {
    j--;
  }
  return String.valueOf(newchars,0,j);
}

Fixed version (ground truth):
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  return String.valueOf(newchars,0,j);
}
Program: 9250
Project: 9250
Buggy source:
/** 
 * Returns an asynchronous connection from the underlying connection factory.
 * @param resultHandler the result handler
 * @return the FutureResult from the underlying factory.
 */
public FutureResult<Connection> getConnectionAsync(ResultHandler<? super Connection> resultHandler){
  return getConnectionAsync(resultHandler);
}

Fixed version (ground truth):
/** 
 * Returns an asynchronous connection from the underlying connection factory.
 * @param resultHandler the result handler
 * @return the FutureResult from the underlying factory.
 */
public FutureResult<Connection> getConnectionAsync(ResultHandler<? super Connection> resultHandler){
  return factory.getConnectionAsync(resultHandler);
}
Program: 9251
Project: 9251
Buggy source:
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  if (preceedingDelimiter) {
    j--;
  }
  return String.valueOf(newchars,0,j);
}

Fixed version (ground truth):
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  return String.valueOf(newchars,0,j);
}
Program: 9252
Project: 9252
Buggy source:
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  if (preceedingDelimiter) {
    j--;
  }
  return String.valueOf(newchars,0,j);
}

Fixed version (ground truth):
/** 
 * eliminates the null path (consecutive delimiters) from the resource 
 */
private String purgeNullPath(String res){
  if ((res == null) || (res.length() == 0)) {
    return "String_Node_Str";
  }
  boolean preceedingDelimiter=false;
  int len=res.length();
  char[] oldchars=res.toCharArray();
  char[] newchars=new char[len];
  int i=0;
  int j=0;
  while (i < len) {
    if (oldchars[i] == delimiter.charAt(0)) {
      if (!preceedingDelimiter) {
        newchars[j++]=oldchars[i++];
        preceedingDelimiter=true;
      }
 else {
        i++;
      }
    }
 else {
      newchars[j++]=oldchars[i++];
      preceedingDelimiter=false;
    }
  }
  return String.valueOf(newchars,0,j);
}
Program: 9253
Project: 9253
Buggy source:
protected Map<String,Object> getDataModel(Set<String> scopes){
  Map<String,Object> data=new HashMap<String,Object>(getRequest().getAttributes());
  data.put("String_Node_Str",getRequest().getResourceRef().toString());
  Set<String> displayNames=client.getClient().getDisplayName();
  Set<String> displayDescriptions=client.getClient().getDisplayDescription();
  Set<String> allScopes=client.getClient().getAllowedGrantScopes();
  String locale=OAuth2Utils.getLocale(getRequest());
  String displayName="String_Node_Str";
  String displayDescription="String_Node_Str";
  List<String> displayScope=new ArrayList<String>();
  displayName=getDisplayParameter(locale,displayNames);
  displayDescription=getDisplayParameter(locale,displayDescriptions);
  displayScope=getScopeDescriptionsForLocale(scopes,allScopes,locale);
  data.put("String_Node_Str",displayName);
  data.put("String_Node_Str",displayDescription);
  data.put("String_Node_Str",displayScope);
  return data;
}

Fixed version (ground truth):
protected Map<String,Object> getDataModel(Set<String> scopes){
  Map<String,Object> data=new HashMap<String,Object>(getRequest().getAttributes());
  data.put("String_Node_Str",getRequest().getResourceRef().toString());
  Set<String> displayNames=client.getClient().getDisplayName();
  Set<String> displayDescriptions=client.getClient().getDisplayDescription();
  Set<String> allScopes=client.getClient().getAllowedGrantScopes();
  String locale=OAuth2Utils.getLocale(getRequest());
  String displayName="String_Node_Str";
  String displayDescription="String_Node_Str";
  List<String> displayScope=null;
  displayName=getDisplayParameter(locale,displayNames);
  displayDescription=getDisplayParameter(locale,displayDescriptions);
  displayScope=getScopeDescriptionsForLocale(scopes,allScopes,locale);
  data.put("String_Node_Str",ESAPI.encoder().encodeForHTML(displayName));
  data.put("String_Node_Str",ESAPI.encoder().encodeForHTML(displayDescription));
  data.put("String_Node_Str",encodeListForHTML(displayScope));
  return data;
}