nus-yam/ex-repair huggingface dataset:
Program: 79647
Project: 79647
Buggy source:
/** 
 * Generates the redirect from SAML2 auth module to IDP as POST.
 */
private void configurePostRedirectCallback(final String postMsg,final String ssoURL,final RedirectCallback redirectCallback) throws AuthLoginException {
  final Map<String,String> postData=new HashMap<>();
  postData.put(SAML2Constants.SAML_REQUEST,postMsg);
  final RedirectCallback rcNew=new RedirectCallback(ssoURL,postData,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}

Fixed version (ground truth):
/** 
 * Generates the redirect from SAML2 auth module to IDP as POST.
 */
private void configurePostRedirectCallback(final String postMsg,final String ssoURL,final RedirectCallback redirectCallback) throws AuthLoginException {
  final Map<String,String> postData=new HashMap<>();
  postData.put(SAML2Constants.SAML_REQUEST,postMsg);
  final RedirectCallback rcNew=new RedirectCallback(ssoURL,postData,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  rcNew.setTrackingCookie(true);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}
Program: 79648
Project: 79648
Buggy source:
/** 
 * Converts the   {@code RedirectCallback} into a JSON representation.{@inheritDoc}
 */
public JsonValue convertToJson(RedirectCallback callback,int index) throws RestAuthException {
  JsonValue callbacksJson=json(array(createOutputField("String_Node_Str",callback.getRedirectUrl()),createOutputField("String_Node_Str",callback.getMethod())));
  JsonValue jsonValue=json(object(field("String_Node_Str",CALLBACK_NAME),field("String_Node_Str",callbacksJson.getObject())));
  if (callback.getRedirectData() != null) {
    callbacksJson.add(createOutputField("String_Node_Str",callback.getRedirectData()));
  }
  return jsonValue;
}

Fixed version (ground truth):
/** 
 * Converts the   {@code RedirectCallback} into a JSON representation.{@inheritDoc}
 */
public JsonValue convertToJson(RedirectCallback callback,int index) throws RestAuthException {
  JsonValue callbacksJson=json(array(createOutputField("String_Node_Str",callback.getRedirectUrl()),createOutputField("String_Node_Str",callback.getMethod()),createOutputField("String_Node_Str",callback.getTrackingCookie())));
  JsonValue jsonValue=json(object(field("String_Node_Str",CALLBACK_NAME),field("String_Node_Str",callbacksJson.getObject())));
  if (callback.getRedirectData() != null) {
    callbacksJson.add(createOutputField("String_Node_Str",callback.getRedirectData()));
  }
  return jsonValue;
}
Program: 79649
Project: 79649
Buggy source:
@Test public void shouldSerialiseToJsonCorrectly() throws Exception {
  RedirectCallback redirectCallback=mock(RedirectCallback.class);
  final Map<String,String> redirectData=Collections.singletonMap("String_Node_Str","String_Node_Str");
  given(redirectCallback.getRedirectUrl()).willReturn("String_Node_Str");
  given(redirectCallback.getMethod()).willReturn("String_Node_Str");
  given(redirectCallback.getRedirectData()).willReturn(redirectData);
  String json=JsonValueBuilder.getObjectMapper().writeValueAsString(restAuthRedirectCallbackHandler.convertToJson(redirectCallback,1).getObject());
  JsonValue parsed=JsonValueBuilder.toJsonValue(json);
  assertThat(parsed).stringAt("String_Node_Str").isEqualTo("String_Node_Str");
  assertThat(parsed).hasArray("String_Node_Str").hasSize(3);
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str","String_Node_Str"));
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str","String_Node_Str"));
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str",redirectData));
}

Fixed version (ground truth):
@Test public void shouldSerialiseToJsonCorrectly() throws Exception {
  RedirectCallback redirectCallback=mock(RedirectCallback.class);
  final Map<String,String> redirectData=Collections.singletonMap("String_Node_Str","String_Node_Str");
  given(redirectCallback.getRedirectUrl()).willReturn("String_Node_Str");
  given(redirectCallback.getMethod()).willReturn("String_Node_Str");
  given(redirectCallback.getRedirectData()).willReturn(redirectData);
  String json=JsonValueBuilder.getObjectMapper().writeValueAsString(restAuthRedirectCallbackHandler.convertToJson(redirectCallback,1).getObject());
  JsonValue parsed=JsonValueBuilder.toJsonValue(json);
  assertThat(parsed).stringAt("String_Node_Str").isEqualTo("String_Node_Str");
  assertThat(parsed).hasArray("String_Node_Str").hasSize(4);
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str","String_Node_Str"));
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str","String_Node_Str"));
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str",false));
  assertThat(parsed).hasObject("String_Node_Str").containsExactly(entry("String_Node_Str","String_Node_Str"),entry("String_Node_Str",redirectData));
}
Program: 79650
Project: 79650
Buggy source:
@Test public void shouldFailConvertToJson() throws RestAuthException {
  RedirectCallback redirectCallback=mock(RedirectCallback.class);
  given(redirectCallback.getRedirectUrl()).willReturn("String_Node_Str");
  given(redirectCallback.getMethod()).willReturn("String_Node_Str");
  given(redirectCallback.getRedirectData()).willReturn(Collections.<String,String>emptyMap());
  JsonValue json=restAuthRedirectCallbackHandler.convertToJson(redirectCallback,1);
  assertThat(json.asMap()).hasSize(2);
  assertThat(json.get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").asList()).hasSize(3);
  assertThat(json.get("String_Node_Str").get(0).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(0).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(1).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(1).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(2).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(2).get("String_Node_Str").asMap()).hasSize(0);
}

Fixed version (ground truth):
@Test public void shouldFailConvertToJson() throws RestAuthException {
  RedirectCallback redirectCallback=mock(RedirectCallback.class);
  given(redirectCallback.getRedirectUrl()).willReturn("String_Node_Str");
  given(redirectCallback.getMethod()).willReturn("String_Node_Str");
  given(redirectCallback.getRedirectData()).willReturn(Collections.<String,String>emptyMap());
  JsonValue json=restAuthRedirectCallbackHandler.convertToJson(redirectCallback,1);
  assertThat(json.asMap()).hasSize(2);
  assertThat(json.get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").asList()).hasSize(4);
  assertThat(json.get("String_Node_Str").get(0).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(0).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(1).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(1).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(2).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(2).get("String_Node_Str").asBoolean()).isEqualTo(false);
  assertThat(json.get("String_Node_Str").get(3).get("String_Node_Str").asString()).isEqualTo("String_Node_Str");
  assertThat(json.get("String_Node_Str").get(3).get("String_Node_Str").asMap()).hasSize(0);
}
Program: 79651
Project: 79651
Buggy source:
public void handleRedirectCallback(HttpServletRequest request,HttpServletResponse response,RedirectCallback redirectCallback,String loginURL) throws IOException {
  setRedirectCallbackCookie(request,response,redirectCallback,loginURL);
  String qString=AuthClientUtils.getQueryStrFromParameters(redirectCallback.getRedirectData());
  StringBuilder redirectUrl=new StringBuilder(redirectCallback.getRedirectUrl());
  if (qString != null && qString.length() != 0) {
    redirectUrl.append(qString);
  }
  String rUrl=redirectUrl.toString();
  if (rUrl.startsWith("String_Node_Str")) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str" + "String_Node_Str" + rUrl + "String_Node_Str"+ AuthClientUtils.getServiceURI());
    }
    response.sendRedirect(AuthClientUtils.getServiceURI() + rUrl);
  }
 else {
    if (redirectCallback.getMethod().equalsIgnoreCase("String_Node_Str")) {
      request.setAttribute("String_Node_Str",redirectCallback.getRedirectData());
      request.setAttribute("String_Node_Str",redirectCallback.getRedirectUrl());
      try {
        request.getRequestDispatcher(FORWARDING_PLACE).forward(request,response);
      }
 catch (      ServletException e) {
        if (debug.warningEnabled()) {
          debug.warning("String_Node_Str" + e.toString());
        }
        throw new RedirectException("String_Node_Str",e);
      }
    }
 else {
      response.sendRedirect(rUrl);
    }
  }
}

Fixed version (ground truth):
public void handleRedirectCallback(HttpServletRequest request,HttpServletResponse response,RedirectCallback redirectCallback,String loginURL) throws IOException {
  setRedirectCallbackCookie(request,response,redirectCallback,loginURL);
  String qString=AuthClientUtils.getQueryStrFromParameters(redirectCallback.getRedirectData());
  StringBuilder redirectUrl=new StringBuilder(redirectCallback.getRedirectUrl());
  if (qString != null && qString.length() != 0) {
    redirectUrl.append(qString);
  }
  String rUrl=redirectUrl.toString();
  if (rUrl.startsWith("String_Node_Str")) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str" + "String_Node_Str" + rUrl + "String_Node_Str"+ AuthClientUtils.getServiceURI());
    }
    response.sendRedirect(AuthClientUtils.getServiceURI() + rUrl);
  }
 else {
    if (redirectCallback.getMethod().equalsIgnoreCase("String_Node_Str")) {
      Map<String,String> dataMap=redirectCallback.getRedirectData();
      if (dataMap == null) {
        dataMap=new HashMap<>();
      }
      request.setAttribute("String_Node_Str",dataMap);
      request.setAttribute("String_Node_Str",redirectCallback.getRedirectUrl());
      try {
        request.getRequestDispatcher(FORWARDING_PLACE).forward(request,response);
      }
 catch (      ServletException e) {
        if (debug.warningEnabled()) {
          debug.warning("String_Node_Str" + e.toString());
        }
        throw new RedirectException("String_Node_Str",e);
      }
    }
 else {
      response.sendRedirect(rUrl);
    }
  }
}
Program: 79652
Project: 79652
Buggy source:
private Privilege parsePrivilege(String providedName,JsonValue jsonValue) throws EntitlementException {
  try {
    JsonPolicy policy=MAPPER.readValue(jsonValue.toString(),JsonPolicy.class);
    Privilege privilege=policy.asPrivilege();
    if (isBlank(privilege.getName())) {
      privilege.setName(providedName);
    }
    if (isBlank(privilege.getName())) {
      throw new EntitlementException(EntitlementException.MISSING_PRIVILEGE_NAME);
    }
    if (privilege.getCondition() != null) {
      privilege.getCondition().validate();
    }
    return privilege;
  }
 catch (  UnrecognizedPropertyException ex) {
    throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{ex.getUnrecognizedPropertyName()});
  }
catch (  JsonMappingException ex) {
    throw new EntitlementException(EntitlementException.INVALID_JSON,ex,ex.getCause().getMessage());
  }
catch (  IOException e) {
    throw new EntitlementException(EntitlementException.UNABLE_TO_CREATE_POLICY,e);
  }
}

Fixed version (ground truth):
private Privilege parsePrivilege(String providedName,JsonValue jsonValue) throws EntitlementException {
  try {
    JsonPolicy policy=MAPPER.readValue(jsonValue.toString(),JsonPolicy.class);
    Privilege privilege=policy.asPrivilege();
    if (isBlank(privilege.getName())) {
      privilege.setName(providedName);
    }
    if (isBlank(privilege.getName())) {
      throw new EntitlementException(EntitlementException.MISSING_PRIVILEGE_NAME);
    }
    if (privilege.getCondition() != null) {
      privilege.getCondition().validate();
    }
    return privilege;
  }
 catch (  UnrecognizedPropertyException ex) {
    throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{ex.getUnrecognizedPropertyName()});
  }
catch (  JsonMappingException ex) {
    throw new EntitlementException(EntitlementException.INVALID_JSON,ex,ex.getMessage());
  }
catch (  IOException e) {
    throw new EntitlementException(EntitlementException.UNABLE_TO_CREATE_POLICY,e);
  }
}
Program: 79654
Project: 79654
Buggy source:
/** 
 * "Inspired" by the OAuth2 module. We use this cookie to remind us exactly where we are when returning from a remote server as we currently cannot trust the RedirectCallback's authentication framework equiv.
 */
private void setCookiesForRedirects(final HttpServletRequest request,final HttpServletResponse response){
  final Set<String> domains=AuthClientUtils.getCookieDomains();
  final StringBuilder originalUrl=new StringBuilder();
  final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
  final String requestedQuery=request.getQueryString();
  if (xuiState.isXUIEnabled()) {
    originalUrl.append(request.getContextPath());
  }
 else {
    originalUrl.append(request.getRequestURI());
  }
  if (StringUtils.isNotEmpty(realm)) {
    originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
  }
  if (requestedQuery != null) {
    originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
    originalUrl.append(requestedQuery);
  }
  for (  String domain : domains) {
    CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(Constants.AM_LOCATION_COOKIE,originalUrl.toString(),"String_Node_Str",domain));
  }
}

Fixed version (ground truth):
/** 
 * "Inspired" by the OAuth2 module. We use this cookie to remind us exactly where we are when returning from a remote server as we currently cannot trust the RedirectCallback's authentication framework equiv.
 */
private void setCookiesForRedirects(final HttpServletRequest request,final HttpServletResponse response){
  final Set<String> domains=AuthClientUtils.getCookieDomains();
  final StringBuilder originalUrl=new StringBuilder();
  final String requestedQuery=request.getQueryString();
  final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
  if (xuiState.isXUIEnabled()) {
    originalUrl.append(request.getContextPath());
  }
 else {
    originalUrl.append(request.getRequestURI());
  }
  if (StringUtils.isNotEmpty(realm)) {
    originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
  }
  if (requestedQuery != null) {
    originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
    originalUrl.append(requestedQuery);
  }
  for (  String domain : domains) {
    CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(Constants.AM_LOCATION_COOKIE,originalUrl.toString(),"String_Node_Str",domain));
  }
}
Program: 79655
Project: 79655
Buggy source:
/** 
 * Adds information necessary for the session to be federated completely (if attributes are being drawn in, and to configure ready for SLO).
 */
private void setSessionProperties(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setUserSessionProperty(SAML2Constants.SINGLE_LOGOUT,String.valueOf(singleLogoutEnabled));
  if (singleLogoutEnabled) {
    setUserSessionProperty(SAML2Constants.RELAY_STATE,sloRelayState);
  }
  setUserSessionProperty(SAML2Constants.SESSION_INDEX,sessionIndex);
  setUserSessionProperty(SAML2Constants.IDPENTITYID,entityName);
  setUserSessionProperty(SAML2Constants.SPENTITYID,SPSSOFederate.getSPEntityId(metaAlias));
  setUserSessionProperty(SAML2Constants.METAALIAS,metaAlias);
  setUserSessionProperty(SAML2Constants.REQ_BINDING,reqBinding);
  setUserSessionProperty(SAML2Constants.NAMEID,nameId.toXMLString(true,true));
  setUserSessionProperty(Constants.IS_TRANSIENT,Boolean.toString(isTransient));
  setUserSessionProperty(Constants.REQUEST_ID,respInfo.getResponse().getInResponseTo());
  setAttributeProperties(assertion,userName);
}

Fixed version (ground truth):
/** 
 * Adds information necessary for the session to be federated completely (if attributes are being drawn in, and to configure ready for SLO).
 */
private void setSessionProperties(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setUserSessionProperty(SAML2Constants.SINGLE_LOGOUT,String.valueOf(singleLogoutEnabled));
  if (singleLogoutEnabled) {
    setUserSessionProperty(SAML2Constants.RELAY_STATE,sloRelayState);
  }
  setUserSessionProperty(SAML2Constants.SESSION_INDEX,sessionIndex);
  setUserSessionProperty(SAML2Constants.IDPENTITYID,entityName);
  setUserSessionProperty(SAML2Constants.SPENTITYID,SPSSOFederate.getSPEntityId(metaAlias));
  setUserSessionProperty(SAML2Constants.METAALIAS,metaAlias);
  setUserSessionProperty(SAML2Constants.REQ_BINDING,reqBinding);
  setUserSessionProperty(SAML2Constants.NAMEID,nameId.toXMLString(true,true));
  setUserSessionProperty(Constants.IS_TRANSIENT,Boolean.toString(isTransient));
  setUserSessionProperty(Constants.REQUEST_ID,respInfo.getResponse().getInResponseTo());
  setUserSessionProperty(SAML2Constants.BINDING,binding);
  setUserSessionProperty(Constants.CACHE_KEY,storageKey);
}
Program: 79657
Project: 79657
Buggy source:
/** 
 * Sets the auth module's logged-in username via storeUsernamePasswd, triggers call to add information necessary for SLO (if configured) and returns success.
 */
private int success(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setSessionProperties(assertion,nameId,userName);
  DEBUG.message("String_Node_Str",getPrincipal().getName());
  storeUsernamePasswd(DNUtils.DNtoName(getPrincipal().getName()),null);
  return ISAuthConstants.LOGIN_SUCCEED;
}

Fixed version (ground truth):
/** 
 * Sets the auth module's logged-in username via storeUsernamePasswd, triggers call to add information necessary for SLO (if configured) and returns success.
 */
private int success(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setSessionProperties(assertion,nameId,userName);
  setSessionAttributes(assertion,userName);
  DEBUG.message("String_Node_Str",getPrincipal().getName());
  storeUsernamePasswd(DNUtils.DNtoName(getPrincipal().getName()),null);
  return ISAuthConstants.LOGIN_SUCCEED;
}
Program: 79660
Project: 79660
Buggy source:
@Override public void onLogout(HttpServletRequest request,HttpServletResponse response,SSOToken ssoToken) throws AuthenticationException {
  try {
    final String ssOutEnabled=ssoToken.getProperty(SAML2Constants.SINGLE_LOGOUT);
    if (Boolean.parseBoolean(ssOutEnabled)) {
      request.setAttribute(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,ssoToken.getProperty(SLO_SESSION_LOCATION) + ssoToken.getProperty(SLO_SESSION_REFERENCE));
      ssoToken.setProperty(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,ssoToken.getProperty(SLO_SESSION_LOCATION) + ESAPI.encoder().encodeForURL(ssoToken.getProperty(SLO_SESSION_REFERENCE)));
    }
  }
 catch (  EncodingException|SSOException e) {
    DEBUG.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onLogout(HttpServletRequest request,HttpServletResponse response,SSOToken ssoToken) throws AuthenticationException {
  try {
    final String ssOutEnabled=ssoToken.getProperty(SAML2Constants.SINGLE_LOGOUT);
    if (Boolean.parseBoolean(ssOutEnabled)) {
      final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
      final StringBuilder logoutLocation=new StringBuilder();
      logoutLocation.append(ssoToken.getProperty(SLO_SESSION_LOCATION));
      if (xuiState.isXUIEnabled()) {
        logoutLocation.append(ESAPI.encoder().encodeForURL(ssoToken.getProperty(SLO_SESSION_REFERENCE)));
      }
 else {
        logoutLocation.append(ssoToken.getProperty(SLO_SESSION_REFERENCE));
      }
      request.setAttribute(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,logoutLocation.toString());
    }
  }
 catch (  EncodingException|SSOException e) {
    DEBUG.warning("String_Node_Str",e);
  }
}
Program: 79661
Project: 79661
Buggy source:
private void configureIdpInitSLO(SSOToken session,String sessionIndex,String metaAlias,NameIDInfo info,boolean isTransient,String requestID) throws SessionException, SAML2Exception, SSOException {
  SessionProvider sessionProvider=SessionManager.getProvider();
  SPACSUtils.saveInfoInMemory(sessionProvider,session,sessionIndex,metaAlias,info,IDPProxyUtil.isIDPProxyEnabled(requestID),isTransient);
}

Fixed version (ground truth):
private void configureIdpInitSLO(SessionProvider sessionProvider,SSOToken session,String sessionIndex,String metaAlias,NameIDInfo info,boolean isTransient,String requestID) throws SessionException, SAML2Exception, SSOException {
  SPACSUtils.saveInfoInMemory(sessionProvider,session,sessionIndex,metaAlias,info,IDPProxyUtil.isIDPProxyEnabled(requestID),isTransient);
}
Program: 79662
Project: 79662
Buggy source:
/** 
 * Clears the session of all the temp data we passed to set up SLO.
 */
private void clearSession(SSOToken ssoToken) throws SSOException {
  ssoToken.setProperty(SAML2Constants.RELAY_STATE,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SESSION_INDEX,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.IDPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.METAALIAS,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.REQ_BINDING,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.NAMEID,"String_Node_Str");
  ssoToken.setProperty(Constants.IS_TRANSIENT,"String_Node_Str");
  ssoToken.setProperty(Constants.REQUEST_ID,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Clears the session of all the temp data we passed to set up SLO.
 */
private void clearSession(SSOToken ssoToken) throws SSOException {
  ssoToken.setProperty(SAML2Constants.RELAY_STATE,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SESSION_INDEX,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.IDPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.METAALIAS,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.REQ_BINDING,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.NAMEID,"String_Node_Str");
  ssoToken.setProperty(Constants.IS_TRANSIENT,"String_Node_Str");
  ssoToken.setProperty(Constants.REQUEST_ID,"String_Node_Str");
  ssoToken.setProperty(Constants.CACHE_KEY,"String_Node_Str");
}
Program: 79663
Project: 79663
Buggy source:
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        if (((JacksonRepresentation)representation).getObject() instanceof Map) {
          return extractValues((Map<String,Object>)((JacksonRepresentation)representation).getObject());
        }
        return json(object());
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        if (!representation.isEmpty() && ((JacksonRepresentation)representation).getObject() instanceof Map) {
          return extractValues((Map<String,Object>)((JacksonRepresentation)representation).getObject());
        }
        return json(object());
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}
Program: 79664
Project: 79664
Buggy source:
@Override protected void configure(){
  bind(ResourceTypeConfiguration.class).to(ResourceTypeConfigurationImpl.class);
  bind(ResourceTypeService.class).to(ResourceTypeServiceImpl.class);
  bind(ConstraintValidator.class).to(ConstraintValidatorImpl.class);
  install(new FactoryModuleBuilder().implement(ApplicationService.class,ApplicationServiceImpl.class).build(ApplicationServiceFactory.class));
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(ResourceTypeConfiguration.class).to(ResourceTypeConfigurationImpl.class);
  bind(ResourceTypeService.class).to(ResourceTypeServiceImpl.class);
  bind(ConstraintValidator.class).to(ConstraintValidatorImpl.class);
  install(new FactoryModuleBuilder().implement(ApplicationService.class,ApplicationServiceImpl.class).build(ApplicationServiceFactory.class));
  bind(SessionCache.class).toInstance(SessionCache.getInstance());
}
Program: 79666
Project: 79666
Buggy source:
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues((Map<String,Object>)((JacksonRepresentation)representation).getObject());
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues((Map<String,Object>)(new JacksonRepresentation(representation).getObject()));
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}
Program: 79667
Project: 79667
Buggy source:
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jsonAuditor(String... fields){
  return new RestletBodyAuditor<JSONObject>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues(((JsonRepresentation)representation).getJsonObject());
      }
 catch (      JSONException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    JSONObject object) throws AuditException {
      return object.opt(field);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jsonAuditor(String... fields){
  return new RestletBodyAuditor<JSONObject>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues(new JsonRepresentation(representation).getJsonObject());
      }
 catch (      IOException|JSONException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    JSONObject object) throws AuditException {
      return object.opt(field);
    }
  }
;
}
Program: 79668
Project: 79668
Buggy source:
/** 
 * Handles POST requests to the OpenId Connect client registration endpoint for creating OpenId Connect client registrations.
 * @param entity The representation of the client registration details.
 * @return The representation of the client registration details as created in the store.
 * @throws OAuth2RestletException If an error occurs whilst processing the client registration.
 */
@Post public Representation createClient(Representation entity) throws OAuth2RestletException {
  final OAuth2Request request=requestFactory.create(getRequest());
  final ChallengeResponse authHeader=getRequest().getChallengeResponse();
  final String accessToken=authHeader != null ? authHeader.getRawValue() : null;
  try {
    final String deploymentUrl=getRequest().getHostRef().toString() + "String_Node_Str" + getRequest().getResourceRef().getSegments().get(0);
    final JsonValue registration=clientRegistrationService.createRegistration(accessToken,deploymentUrl,request);
    setStatus(Status.SUCCESS_CREATED);
    return new JsonRepresentation(registration.asMap());
  }
 catch (  OAuth2Exception e) {
    throw new OAuth2RestletException(e.getStatusCode(),e.getError(),e.getMessage(),null);
  }
}

Fixed version (ground truth):
/** 
 * Handles POST requests to the OpenId Connect client registration endpoint for creating OpenId Connect client registrations.
 * @param entity The representation of the client registration details.
 * @return The representation of the client registration details as created in the store.
 * @throws OAuth2RestletException If an error occurs whilst processing the client registration.
 */
@Post public Representation createClient(Representation entity) throws OAuth2RestletException {
  final OAuth2Request request=requestFactory.create(getRequest());
  final ChallengeResponse authHeader=getRequest().getChallengeResponse();
  final String accessToken=authHeader != null ? authHeader.getRawValue() : null;
  try {
    final String deploymentUrl=getRequest().getHostRef().toString() + "String_Node_Str" + getRequest().getResourceRef().getSegments().get(0);
    final JsonValue registration=clientRegistrationService.createRegistration(accessToken,deploymentUrl,request);
    setStatus(Status.SUCCESS_CREATED);
    return new JacksonRepresentation(registration.asMap());
  }
 catch (  OAuth2Exception e) {
    throw new OAuth2RestletException(e.getStatusCode(),e.getError(),e.getMessage(),null);
  }
}
Program: 79669
Project: 79669
Buggy source:
/** 
 * Handles GET requests to the OpenId Connect client registration endpoint for retrieving OpenId Connect client registrations.
 * @return The representation of the client registration details.
 * @throws OAuth2RestletException If an error occurs whilst retrieving the client registration.
 */
@Get public Representation getClient() throws OAuth2RestletException {
  final OAuth2Request request=requestFactory.create(getRequest());
  final String clientId=request.getParameter(OAuth2Constants.OAuth2Client.CLIENT_ID);
  final String accessToken=getRequest().getChallengeResponse().getRawValue();
  try {
    final JsonValue registration=clientRegistrationService.getRegistration(clientId,accessToken,request);
    return new JsonRepresentation(registration.asMap());
  }
 catch (  OAuth2Exception e) {
    throw new OAuth2RestletException(e.getStatusCode(),e.getError(),e.getMessage(),null);
  }
}

Fixed version (ground truth):
/** 
 * Handles GET requests to the OpenId Connect client registration endpoint for retrieving OpenId Connect client registrations.
 * @return The representation of the client registration details.
 * @throws OAuth2RestletException If an error occurs whilst retrieving the client registration.
 */
@Get public Representation getClient() throws OAuth2RestletException {
  final OAuth2Request request=requestFactory.create(getRequest());
  final String clientId=request.getParameter(OAuth2Constants.OAuth2Client.CLIENT_ID);
  final String accessToken=getRequest().getChallengeResponse().getRawValue();
  try {
    final JsonValue registration=clientRegistrationService.getRegistration(clientId,accessToken,request);
    return new JacksonRepresentation(registration.asMap());
  }
 catch (  OAuth2Exception e) {
    throw new OAuth2RestletException(e.getStatusCode(),e.getError(),e.getMessage(),null);
  }
}
Program: 79670
Project: 79670
Buggy source:
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues((Map<String,Object>)(new JacksonRepresentation(representation).getObject()));
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jacksonAuditor(String... fields){
  return new RestletBodyAuditor<Map<String,Object>>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        if (((JacksonRepresentation)representation).getObject() instanceof Map) {
          return extractValues((Map<String,Object>)((JacksonRepresentation)representation).getObject());
        }
        return json(object());
      }
 catch (      IOException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    Map<String,Object> object) throws AuditException {
      return object.get(field);
    }
  }
;
}
Program: 79671
Project: 79671
Buggy source:
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jsonAuditor(String... fields){
  return new RestletBodyAuditor<JSONObject>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        return extractValues(new JsonRepresentation(representation).getJsonObject());
      }
 catch (      IOException|JSONException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    JSONObject object) throws AuditException {
      return object.opt(field);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create a body auditor for JSON bodies.
 * @param fields The fields that should be captured if they exist.
 * @return The auditor object.
 */
public static RestletBodyAuditor jsonAuditor(String... fields){
  return new RestletBodyAuditor<JSONObject>(fields){
    @Override public JsonValue apply(    Representation representation) throws AuditException {
      try {
        boolean isBufferingRepresentation=(representation instanceof BufferingRepresentation);
        boolean isEmptyBufferingRepresentation=isBufferingRepresentation && ((BufferingRepresentation)representation).getWrappedRepresentation().isEmpty();
        if (isEmptyBufferingRepresentation || (!isBufferingRepresentation && representation.isEmpty())) {
          return json(object());
        }
        return extractValues(new JsonRepresentation(representation).getJsonObject());
      }
 catch (      IOException|JSONException e) {
        throw new AuditException("String_Node_Str",e);
      }
    }
    @Override Object getValue(    String field,    JSONObject object) throws AuditException {
      return object.opt(field);
    }
  }
;
}
Program: 79672
Project: 79672
Buggy source:
/** 
 * Adds and removes labels on the updated resource set, creating the label if required and deleting labels which are no longer used.
 * @param resourceSet The updated resource set.
 */
void updateLabelsForExistingResourceSet(ResourceSetDescription resourceSet){
  JsonValue newLabels=resourceSet.getDescription().get(OAuth2Constants.ResourceSets.LABELS);
  if (newLabels.isNull()) {
    newLabels=json(array());
  }
  Collection<String> addedLabels=newLabels.asSet(String.class);
  try {
    Set<ResourceSetLabel> labels=labelsStore.forResourceSet(resourceSet.getRealm(),resourceSet.getResourceOwnerId(),resourceSet.getId(),true);
    Collection<String> removedLabels=new HashSet<>();
    for (    ResourceSetLabel label : labels) {
      String labelName=label.getName().substring(label.getName().lastIndexOf("String_Node_Str") + 1);
      if (!addedLabels.remove(labelName)) {
        removedLabels.add(labelName);
      }
    }
    updateLabels(resourceSet,addedLabels,removedLabels);
  }
 catch (  ResourceException e) {
    logger.error("String_Node_Str",resourceSet.getId(),e);
  }
}

Fixed version (ground truth):
/** 
 * Adds and removes labels on the updated resource set, creating the label if required and deleting labels which are no longer used.
 * @param resourceSet The updated resource set.
 */
void updateLabelsForExistingResourceSet(ResourceSetDescription resourceSet){
  JsonValue newLabels=resourceSet.getDescription().get(OAuth2Constants.ResourceSets.LABELS);
  if (newLabels.isNull()) {
    newLabels=json(array());
  }
  Collection<String> addedLabels=new HashSet<>(newLabels.asSet(String.class));
  try {
    Set<ResourceSetLabel> labels=labelsStore.forResourceSet(resourceSet.getRealm(),resourceSet.getResourceOwnerId(),resourceSet.getId(),true);
    Collection<String> removedLabels=new HashSet<>();
    for (    ResourceSetLabel label : labels) {
      String labelName=label.getName().substring(label.getName().lastIndexOf("String_Node_Str") + 1);
      if (!addedLabels.remove(labelName)) {
        removedLabels.add(labelName);
      }
    }
    updateLabels(resourceSet,addedLabels,removedLabels);
  }
 catch (  ResourceException e) {
    logger.error("String_Node_Str",resourceSet.getId(),e);
  }
}
Program: 79673
Project: 79673
Buggy source:
private Representation readResourceSet(String resourceSetId) throws NotFoundException, ServerException {
  ResourceSetStore store=providerSettingsFactory.get(requestFactory.create(getRequest())).getResourceSetStore();
  return createJsonResponse(store.read(resourceSetId),true,true);
}

Fixed version (ground truth):
private Representation readResourceSet(String resourceSetId) throws NotFoundException, ServerException {
  ResourceSetStore store=providerSettingsFactory.get(requestFactory.create(getRequest())).getResourceSetStore();
  ResourceSetDescription resourceSetDescription=store.read(resourceSetId);
  Set<String> labels=new HashSet<String>();
  try {
    Set<ResourceSetLabel> labelSet=umaLabelsStore.forResourceSet(resourceSetDescription.getRealm(),resourceSetDescription.getResourceOwnerId(),resourceSetDescription.getId(),false);
    for (    ResourceSetLabel label : labelSet) {
      labels.add(label.getName());
    }
  }
 catch (  org.forgerock.json.resource.ResourceException e) {
    throw new ServerException(e);
  }
  resourceSetDescription.getDescription().put("String_Node_Str",labels);
  return createJsonResponse(resourceSetDescription,true,true);
}
Program: 79675
Project: 79675
Buggy source:
private Tag generateETag(ResourceSetDescription resourceSetDescription){
  return new Tag(Integer.toString(resourceSetDescription.hashCode()),true);
}

Fixed version (ground truth):
private Tag generateETag(ResourceSetDescription resourceSetDescription){
  int hashCode=resourceSetDescription.hashCode();
  JsonValue description=resourceSetDescription.getDescription();
  if (!description.isDefined(OAuth2Constants.ResourceSets.LABELS)) {
    description.put(OAuth2Constants.ResourceSets.LABELS,null);
    hashCode=resourceSetDescription.hashCode();
    description.remove(OAuth2Constants.ResourceSets.LABELS);
  }
  return new Tag(Integer.toString(hashCode),true);
}
Program: 79676
Project: 79676
Buggy source:
@Put public Representation updateResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  if (!isConditionalRequest()) {
    throw new ResourceException(512,"String_Node_Str","String_Node_Str",null);
  }
  final Map<String,Object> resourceSetDescriptionAttributes=validator.validate(toMap(entity));
  final String resourceSetId=getResourceSetId();
  ResourceSetStore store=providerSettingsFactory.get(requestFactory.create(getRequest())).getResourceSetStore();
  ResourceSetDescription resourceSetDescription=store.read(resourceSetId).update(resourceSetDescriptionAttributes);
  JsonValue labels=resourceSetDescription.getDescription().get(OAuth2Constants.ResourceSets.LABELS);
  resourceSetDescription.getDescription().remove(OAuth2Constants.ResourceSets.LABELS);
  store.update(resourceSetDescription);
  resourceSetDescription.getDescription().add(OAuth2Constants.ResourceSets.LABELS,labels);
  labelRegistration.updateLabelsForExistingResourceSet(resourceSetDescription);
  return createJsonResponse(resourceSetDescription,false,true);
}

Fixed version (ground truth):
@Put public Representation updateResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  if (!isConditionalRequest()) {
    throw new ResourceException(512,"String_Node_Str","String_Node_Str",null);
  }
  final Map<String,Object> resourceSetDescriptionAttributes=validator.validate(toMap(entity));
  final String resourceSetId=getResourceSetId();
  ResourceSetStore store=providerSettingsFactory.get(requestFactory.create(getRequest())).getResourceSetStore();
  ResourceSetDescription resourceSetDescription=store.read(resourceSetId).update(resourceSetDescriptionAttributes);
  JsonValue labels=resourceSetDescription.getDescription().get(OAuth2Constants.ResourceSets.LABELS);
  resourceSetDescription.getDescription().remove(OAuth2Constants.ResourceSets.LABELS);
  store.update(resourceSetDescription);
  if (labels.isNotNull()) {
    resourceSetDescription.getDescription().add(OAuth2Constants.ResourceSets.LABELS,labels.asSet());
  }
 else {
    resourceSetDescription.getDescription().add(OAuth2Constants.ResourceSets.LABELS,new HashSet<String>());
  }
  labelRegistration.updateLabelsForExistingResourceSet(resourceSetDescription);
  return createJsonResponse(resourceSetDescription,false,true);
}
Program: 79677
Project: 79677
Buggy source:
/** 
 * Construct a new ResourceSetRegistrationEndpoint instance.
 * @param providerSettingsFactory An instance of the {@link OAuth2ProviderSettingsFactory}.
 * @param validator An instance of the {@link ResourceSetDescriptionValidator}.
 * @param requestFactory An instance of the OAuth2RequestFactory.
 * @param listeners A {@code Set} of {@code ResourceSetRegistrationListener}s.
 * @param labelRegistration An instance of the {@code ResourceSetLabelRegistration}.
 * @param extensionFilterManager An instance of the {@code ExtensionFilterManager}.
 * @param exceptionHandler An instance of the {@code ExceptionHandler}.
 */
@Inject public ResourceSetRegistrationEndpoint(OAuth2ProviderSettingsFactory providerSettingsFactory,ResourceSetDescriptionValidator validator,OAuth2RequestFactory<Request> requestFactory,Set<ResourceSetRegistrationListener> listeners,ResourceSetLabelRegistration labelRegistration,ExtensionFilterManager extensionFilterManager,ExceptionHandler exceptionHandler){
  this.providerSettingsFactory=providerSettingsFactory;
  this.validator=validator;
  this.requestFactory=requestFactory;
  this.listeners=listeners;
  this.labelRegistration=labelRegistration;
  this.extensionFilterManager=extensionFilterManager;
  this.exceptionHandler=exceptionHandler;
}

Fixed version (ground truth):
/** 
 * Construct a new ResourceSetRegistrationEndpoint instance.
 * @param providerSettingsFactory An instance of the {@link OAuth2ProviderSettingsFactory}.
 * @param validator An instance of the {@link ResourceSetDescriptionValidator}.
 * @param requestFactory An instance of the OAuth2RequestFactory.
 * @param listeners A {@code Set} of {@code ResourceSetRegistrationListener}s.
 * @param labelRegistration An instance of the {@code ResourceSetLabelRegistration}.
 * @param extensionFilterManager An instance of the {@code ExtensionFilterManager}.
 * @param exceptionHandler An instance of the {@code ExceptionHandler}.
 * @param umaLabelsStore An instance of the Uma Label Store
 */
@Inject public ResourceSetRegistrationEndpoint(OAuth2ProviderSettingsFactory providerSettingsFactory,ResourceSetDescriptionValidator validator,OAuth2RequestFactory<Request> requestFactory,Set<ResourceSetRegistrationListener> listeners,ResourceSetLabelRegistration labelRegistration,ExtensionFilterManager extensionFilterManager,ExceptionHandler exceptionHandler,UmaLabelsStore umaLabelsStore){
  this.providerSettingsFactory=providerSettingsFactory;
  this.validator=validator;
  this.requestFactory=requestFactory;
  this.listeners=listeners;
  this.labelRegistration=labelRegistration;
  this.extensionFilterManager=extensionFilterManager;
  this.exceptionHandler=exceptionHandler;
  this.umaLabelsStore=umaLabelsStore;
}
Program: 79680
Project: 79680
Buggy source:
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
protected Promise<AuthorizationResult,ResourceException> authorize(Context context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newResultPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newResultPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return e.asPromise();
  }
}

Fixed version (ground truth):
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
protected Promise<AuthorizationResult,ResourceException> authorize(Context context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newResultPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newResultPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ForbiddenException e) {
    return Promises.newResultPromise(AuthorizationResult.accessDenied("String_Node_Str"));
  }
catch (  ResourceException re) {
    return re.asPromise();
  }
}