nus-yam/ex-repair huggingface dataset:
Program: 99335
Project: 99335
Buggy source:
@Override protected void doConfigure(RegisterController controller,Config config){
  controller.setClient(config.getClient());
  controller.setAuthenticationResultSaver(config.getAuthenticationResultSaver());
  controller.setLoginUri(config.getLoginConfig().getUri());
  controller.setVerifyViewName(config.getVerifyConfig().getView());
  controller.setAutoLogin(config.isRegisterAutoLoginEnabled());
  controller.setPreRegisterHandler(config.getRegisterPreHandler());
  controller.setPostRegisterHandler(config.getRegisterPostHandler());
  controller.setAccountStoreResolver(config.getAccountStoreResolver());
}

Fixed version (ground truth):
@Override protected void doConfigure(RegisterController controller,Config config){
  controller.setClient(config.getClient());
  controller.setAuthenticationResultSaver(config.getAuthenticationResultSaver());
  controller.setLoginUri(config.getLoginConfig().getUri());
  controller.setVerifyViewName(config.getVerifyConfig().getView());
  controller.setAutoLogin(config.isRegisterAutoLoginEnabled());
  controller.setPreRegisterHandler(config.getRegisterPreHandler());
  controller.setPostRegisterHandler(config.getRegisterPostHandler());
  controller.setAccountStoreResolver(config.getAccountStoreResolver());
  controller.setApplicationResolver(config.getApplicationResolver());
}
Program: 99336
Project: 99336
Buggy source:
public Controller stormpathRegisterController(){
  if (idSiteEnabled) {
    return createIdSiteController(idSiteRegisterUri);
  }
  RegisterController c=configure(new RegisterController(),stormpathRegisterConfig());
  c.setClient(client);
  c.setAuthenticationResultSaver(stormpathAuthenticationResultSaver());
  c.setLoginUri(stormpathLoginConfig().getUri());
  c.setVerifyViewName(stormpathVerifyConfig().getView());
  c.setAutoLogin(registerAutoLogin);
  c.setPreRegisterHandler(registerPreHandler);
  c.setPostRegisterHandler(registerPostHandler);
  c.setAccountStoreResolver(stormpathAccountStoreResolver());
  return init(c);
}

Fixed version (ground truth):
public Controller stormpathRegisterController(){
  if (idSiteEnabled) {
    return createIdSiteController(idSiteRegisterUri);
  }
  RegisterController c=configure(new RegisterController(),stormpathRegisterConfig());
  c.setClient(client);
  c.setAuthenticationResultSaver(stormpathAuthenticationResultSaver());
  c.setLoginUri(stormpathLoginConfig().getUri());
  c.setVerifyViewName(stormpathVerifyConfig().getView());
  c.setAutoLogin(registerAutoLogin);
  c.setPreRegisterHandler(registerPreHandler);
  c.setPostRegisterHandler(registerPostHandler);
  c.setAccountStoreResolver(stormpathAccountStoreResolver());
  c.setApplicationResolver(stormpathApplicationResolver());
  return init(c);
}
Program: 99339
Project: 99339
Buggy source:
@Override protected ProviderAccountRequest getAccountProviderRequest(HttpServletRequest request){
  String providerId=ServletUtils.getCleanParam(request,"String_Node_Str");
  String code=ServletUtils.getCleanParam(request,"String_Node_Str");
  if (StringUtils.hasText(code)) {
    return Providers.OAUTH2.account().setProviderId(providerId).setCode(code).build();
  }
 else {
    String accessToken=ServletUtils.getCleanParam(request,"String_Node_Str");
    return Providers.OAUTH2.account().setProviderId(providerId).setAccessToken(accessToken).build();
  }
}

Fixed version (ground truth):
@Override public ProviderAccountRequest getAccountProviderRequest(HttpServletRequest request){
  String providerId=ServletUtils.getCleanParam(request,"String_Node_Str");
  String code=ServletUtils.getCleanParam(request,"String_Node_Str");
  if (StringUtils.hasText(code)) {
    return Providers.OAUTH2.account().setProviderId(providerId).setCode(code).build();
  }
 else {
    String accessToken=ServletUtils.getCleanParam(request,"String_Node_Str");
    return Providers.OAUTH2.account().setProviderId(providerId).setAccessToken(accessToken).build();
  }
}
Program: 99340
Project: 99340
Buggy source:
@SuppressWarnings("String_Node_Str") protected String getAuthorizeBaseUri(@SuppressWarnings("String_Node_Str") HttpServletRequest request,ApplicationWebConfig webConfig){
  String authorizeBaseUri=null;
  if (webConfig.getLogin().isEnabled()) {
    authorizeBaseUri="String_Node_Str" + webConfig.getDomainName();
  }
  return authorizeBaseUri;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected String getAuthorizeBaseUri(@SuppressWarnings("String_Node_Str") HttpServletRequest request,ApplicationWebConfig webConfig){
  String authorizeBaseUri=null;
  if (webConfig.getStatus() == ApplicationWebConfigStatus.ENABLED && webConfig.getLogin().isEnabled()) {
    authorizeBaseUri="String_Node_Str" + webConfig.getDomainName();
  }
  return authorizeBaseUri;
}
Program: 99341
Project: 99341
Buggy source:
@Override public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder,WebApplicationContext context){
  String stormpathFilterBeanId="String_Node_Str";
  String springSecurityFilterBeanId=BeanIds.SPRING_SECURITY_FILTER_CHAIN;
  if (this.springSecurityFilter == null && context.containsBean(springSecurityFilterBeanId)) {
    this.springSecurityFilter=context.getBean(springSecurityFilterBeanId,Filter.class);
  }
  if (this.stormpathFilter == null && context.containsBean(stormpathFilterBeanId)) {
    this.stormpathFilter=context.getBean(stormpathFilterBeanId,Filter.class);
  }
  if (this.springSecurityFilter == null) {
    throw new IllegalStateException("String_Node_Str" + springSecurityFilterBeanId + "String_Node_Str");
  }
  if (this.stormpathFilter == null) {
    throw new IllegalStateException("String_Node_Str" + stormpathFilterBeanId + "String_Node_Str");
  }
  builder.addFilters(this.stormpathFilter);
  builder.addFilters(this.springSecurityFilter);
  context.getServletContext().setAttribute(StormpathFilter.class.getName(),this.stormpathFilter.getClass().getName());
  context.getServletContext().setAttribute(BeanIds.SPRING_SECURITY_FILTER_CHAIN,this.springSecurityFilter);
  return testSecurityContext();
}

Fixed version (ground truth):
@Override public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder,WebApplicationContext context){
  String stormpathFilterBeanId="String_Node_Str";
  String springSecurityFilterBeanId=BeanIds.SPRING_SECURITY_FILTER_CHAIN;
  if (this.springSecurityFilter == null && context.containsBean(springSecurityFilterBeanId)) {
    this.springSecurityFilter=context.getBean(springSecurityFilterBeanId,Filter.class);
  }
  if (this.stormpathFilter == null && context.containsBean(stormpathFilterBeanId)) {
    this.stormpathFilter=context.getBean(stormpathFilterBeanId,Filter.class);
  }
  if (this.springSecurityFilter == null) {
    throw new IllegalStateException("String_Node_Str" + springSecurityFilterBeanId + "String_Node_Str");
  }
  if (this.stormpathFilter == null) {
    throw new IllegalStateException("String_Node_Str" + stormpathFilterBeanId + "String_Node_Str");
  }
  builder.addFilters(this.springSecurityFilter);
  builder.addFilters(this.stormpathFilter);
  context.getServletContext().setAttribute(StormpathFilter.class.getName(),this.stormpathFilter.getClass().getName());
  context.getServletContext().setAttribute(BeanIds.SPRING_SECURITY_FILTER_CHAIN,this.springSecurityFilter);
  return testSecurityContext();
}
Program: 99343
Project: 99343
Buggy source:
/** 
 * @since 1.0.RC8.3
 */
private AccessTokenResult tokenAuthenticationRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthPasswordGrantRequestAuthentication passwordGrantRequest=createPasswordGrantAuthenticationRequest(request);
    authenticationResult=Authenticators.OAUTH_PASSWORD_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(passwordGrantRequest);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_REQUEST,"String_Node_Str",e);
  }
  return createAccessTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.0.RC8.3
 */
private AccessTokenResult tokenAuthenticationRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthPasswordGrantRequestAuthentication passwordGrantRequest=createPasswordGrantAuthenticationRequest(request);
    authenticationResult=Authenticators.OAUTH_PASSWORD_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(passwordGrantRequest);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw convertToOAuthException(e,OAuthErrorCode.INVALID_REQUEST);
  }
  return createAccessTokenResult(request,response,authenticationResult);
}
Program: 99344
Project: 99344
Buggy source:
/** 
 * @since 1.1.0
 */
private AccessTokenResult stormpathSocialAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    String providerId=request.getParameter("String_Node_Str");
    String accessToken=request.getParameter("String_Node_Str");
    String code=request.getParameter("String_Node_Str");
    OAuthStormpathSocialGrantRequestAuthentication grantRequestAuthentication=new DefaultOAuthStormpathSocialGrantRequestAuthentication(providerId,accessToken,code);
    authenticationResult=Authenticators.OAUTH_STORMPATH_SOCIAL_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(grantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_CLIENT,"String_Node_Str");
  }
  return createAccessTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.1.0
 */
private AccessTokenResult stormpathSocialAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    String providerId=request.getParameter("String_Node_Str");
    String accessToken=request.getParameter("String_Node_Str");
    String code=request.getParameter("String_Node_Str");
    OAuthStormpathSocialGrantRequestAuthentication grantRequestAuthentication=new DefaultOAuthStormpathSocialGrantRequestAuthentication(providerId,accessToken,code);
    authenticationResult=Authenticators.OAUTH_STORMPATH_SOCIAL_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(grantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw convertToOAuthException(e,OAuthErrorCode.INVALID_CLIENT);
  }
  return createAccessTokenResult(request,response,authenticationResult);
}
Program: 99345
Project: 99345
Buggy source:
/** 
 * @since 1.0.RC8.3
 */
private AccessTokenResult refreshTokenAuthenticationRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthRefreshTokenRequestAuthentication refreshGrantRequest=createRefreshTokenAuthenticationRequest(request);
    authenticationResult=Authenticators.OAUTH_REFRESH_TOKEN_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(refreshGrantRequest);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_GRANT,"String_Node_Str");
  }
  return createRefreshTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.0.RC8.3
 */
private AccessTokenResult refreshTokenAuthenticationRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthRefreshTokenRequestAuthentication refreshGrantRequest=createRefreshTokenAuthenticationRequest(request);
    authenticationResult=Authenticators.OAUTH_REFRESH_TOKEN_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(refreshGrantRequest);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw convertToOAuthException(e,OAuthErrorCode.INVALID_GRANT);
  }
  return createRefreshTokenResult(request,response,authenticationResult);
}
Program: 99347
Project: 99347
Buggy source:
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_CLIENT,"String_Node_Str");
  }
  return createAccessTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw convertToOAuthException(e,OAuthErrorCode.INVALID_CLIENT);
  }
  return createAccessTokenResult(request,response,authenticationResult);
}
Program: 99348
Project: 99348
Buggy source:
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_GRANT,"String_Node_Str");
  }
  return createAccessTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_CLIENT,"String_Node_Str");
  }
  return createAccessTokenResult(request,response,authenticationResult);
}
Program: 99349
Project: 99349
Buggy source:
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw convertToOAuthException(e,OAuthErrorCode.INVALID_CLIENT);
  }
  return createAccessTokenResult(request,response,authenticationResult);
}

Fixed version (ground truth):
/** 
 * @since 1.0.0
 */
private AccessTokenResult clientCredentialsAuthenticationRequest(HttpServletRequest request,HttpServletResponse response){
  DefaultBasicApiAuthenticationRequest authenticationRequest=new DefaultBasicApiAuthenticationRequest(new DefaultHttpServletRequestWrapper(request));
  OAuthGrantRequestAuthenticationResult authenticationResult;
  try {
    Application app=getApplication(request);
    OAuthClientCredentialsGrantRequestAuthentication clientCredentialsGrantRequestAuthentication=OAuthRequests.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST.builder().setApiKeyId(authenticationRequest.getPrincipals()).setApiKeySecret(authenticationRequest.getCredentials()).build();
    authenticationResult=Authenticators.OAUTH_CLIENT_CREDENTIALS_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(clientCredentialsGrantRequestAuthentication);
  }
 catch (  ResourceException e) {
    log.debug("String_Node_Str",e.getMessage(),e);
    throw new OAuthException(OAuthErrorCode.INVALID_GRANT,"String_Node_Str");
  }
  return createAccessTokenResult(request,response,authenticationResult);
}
Program: 99350
Project: 99350
Buggy source:
@Override protected void configure(AccessTokenController c,Config config) throws Exception {
  AccessTokenAuthenticationRequestFactory accessTokenAuthenticationRequestFactory=config.getInstance(ACCESS_TOKEN_AUTHENTICATION_REQUEST_FACTORY);
  RefreshTokenAuthenticationRequestFactory refreshTokenAuthenticationRequestFactory=config.getInstance(REFRESH_TOKEN_AUTHENTICATION_REQUEST_FACTORY);
  RequestAuthorizer requestAuthorizer=config.getInstance(REQUEST_AUTHORIZER);
  AccessTokenResultFactory accessTokenResultFactory=config.getInstance(ACCESS_TOKEN_RESULT_FACTORY);
  RefreshTokenResultFactory refreshTokenResultFactory=config.getInstance(REFRESH_TOKEN_RESULT_FACTORY);
  Saver<AuthenticationResult> accountSaver=config.getInstance(ACCOUNT_SAVER);
  Publisher<RequestEvent> eventPublisher=config.getInstance(EVENT_PUBLISHER);
  BasicAuthenticationScheme basicAuthenticationScheme=config.getInstance(BASIC_AUTHENTICATION_REQUEST_FACTORY);
  c.setEventPublisher(eventPublisher);
  c.setAccessTokenAuthenticationRequestFactory(accessTokenAuthenticationRequestFactory);
  c.setAccessTokenResultFactory(accessTokenResultFactory);
  c.setRefreshTokenAuthenticationRequestFactory(refreshTokenAuthenticationRequestFactory);
  c.setRefreshTokenResultFactory(refreshTokenResultFactory);
  c.setAccountSaver(accountSaver);
  c.setRequestAuthorizer(requestAuthorizer);
  c.setBasicAuthenticationScheme(basicAuthenticationScheme);
}

Fixed version (ground truth):
@Override protected void configure(AccessTokenController c,Config config) throws Exception {
  AccessTokenAuthenticationRequestFactory accessTokenAuthenticationRequestFactory=config.getInstance(ACCESS_TOKEN_AUTHENTICATION_REQUEST_FACTORY);
  RefreshTokenAuthenticationRequestFactory refreshTokenAuthenticationRequestFactory=config.getInstance(REFRESH_TOKEN_AUTHENTICATION_REQUEST_FACTORY);
  RequestAuthorizer requestAuthorizer=config.getInstance(REQUEST_AUTHORIZER);
  AccessTokenResultFactory accessTokenResultFactory=config.getInstance(ACCESS_TOKEN_RESULT_FACTORY);
  RefreshTokenResultFactory refreshTokenResultFactory=config.getInstance(REFRESH_TOKEN_RESULT_FACTORY);
  Saver<AuthenticationResult> accountSaver=config.getInstance(ACCOUNT_SAVER);
  Publisher<RequestEvent> eventPublisher=config.getInstance(EVENT_PUBLISHER);
  BasicAuthenticationScheme basicAuthenticationScheme=config.getInstance(BASIC_AUTHENTICATION_REQUEST_FACTORY);
  GrantTypeStatusValidator grantTypeStatusValidator=config.getGrantTypeStatusValidator();
  c.setEventPublisher(eventPublisher);
  c.setAccessTokenAuthenticationRequestFactory(accessTokenAuthenticationRequestFactory);
  c.setAccessTokenResultFactory(accessTokenResultFactory);
  c.setRefreshTokenAuthenticationRequestFactory(refreshTokenAuthenticationRequestFactory);
  c.setRefreshTokenResultFactory(refreshTokenResultFactory);
  c.setAccountSaver(accountSaver);
  c.setRequestAuthorizer(requestAuthorizer);
  c.setBasicAuthenticationScheme(basicAuthenticationScheme);
  c.setGrantTypeStatusValidator(grantTypeStatusValidator);
}
Program: 99351
Project: 99351
Buggy source:
public OAuthException(OAuthErrorCode code,String message,Exception cause){
  super(message != null ? message : (code != null ? code.getValue() : "String_Node_Str"),cause);
  Assert.notNull(code,"String_Node_Str");
  this.errorCode=code;
  this.message=message;
}

Fixed version (ground truth):
public OAuthException(OAuthErrorCode code,String message,Exception cause){
  super(message != null ? message : (code != null ? code.getValue() : "String_Node_Str"),cause);
  Assert.notNull(code,"String_Node_Str");
  this.errorCode=code;
}
Program: 99353
Project: 99353
Buggy source:
@Override protected MeFilter createInstance(ServletContext servletContext,Config config) throws Exception {
  MeController c=new MeController();
  c.setUri(config.getMeUrl());
  c.setProduces(config.getProducedMediaTypes());
  c.setExpands(config.getMeExpandedProperties());
  c.setObjectMapper(config.getObjectMapper());
  c.setLoginPageRedirector(new DefaultLoginPageRedirector(config.getLoginConfig().getUri()));
  c.setApplicationResolver(config.getApplicationResolver());
  c.init();
  MeFilter filter=new MeFilter();
  filter.setProducedMediaTypes(config.getProducedMediaTypes());
  filter.setController(c);
  return filter;
}

Fixed version (ground truth):
@Override protected MeFilter createInstance(ServletContext servletContext,Config config) throws Exception {
  MeController c=new MeController();
  c.setUri(config.getMeUrl());
  c.setProduces(config.getProducedMediaTypes());
  c.setExpandsResolver(new DefaultExpandsResolver(config.getMeExpandedProperties()));
  c.setObjectMapper(config.getObjectMapper());
  c.setLoginPageRedirector(new DefaultLoginPageRedirector(config.getLoginConfig().getUri()));
  c.setApplicationResolver(config.getApplicationResolver());
  c.init();
  MeFilter filter=new MeFilter();
  filter.setProducedMediaTypes(config.getProducedMediaTypes());
  filter.setController(c);
  return filter;
}
Program: 99354
Project: 99354
Buggy source:
@Override protected ViewModel doGet(HttpServletRequest request,HttpServletResponse response) throws Exception {
  Account account=AccountResolver.INSTANCE.getAccount(request);
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setContentType(MediaType.APPLICATION_JSON_VALUE);
  if (account == null) {
    if (isHtmlPreferred(request,response)) {
      loginPageRedirector.redirectToLoginPage(request,response);
    }
    if (isJsonPreferred(request,response)) {
      Application application=applicationResolver.getApplication(request.getServletContext());
      String bearerRealm=String.format("String_Node_Str",application.getName());
      response.addHeader("String_Node_Str",bearerRealm);
      response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    }
    return null;
  }
  objectMapper.writeValue(response.getOutputStream(),java.util.Collections.singletonMap("String_Node_Str",accountModelFactory.toMap(account,expands)));
  return null;
}

Fixed version (ground truth):
@Override protected ViewModel doGet(HttpServletRequest request,HttpServletResponse response) throws Exception {
  Account account=AccountResolver.INSTANCE.getAccount(request);
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setContentType(MediaType.APPLICATION_JSON_VALUE);
  if (account == null) {
    if (isHtmlPreferred(request,response)) {
      loginPageRedirector.redirectToLoginPage(request,response);
    }
    if (isJsonPreferred(request,response)) {
      Application application=applicationResolver.getApplication(request.getServletContext());
      String bearerRealm=String.format("String_Node_Str",application.getName());
      response.addHeader("String_Node_Str",bearerRealm);
      response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    }
    return null;
  }
  objectMapper.writeValue(response.getOutputStream(),java.util.Collections.singletonMap("String_Node_Str",accountModelFactory.toMap(account,expandsResolver.getExpands())));
  return null;
}
Program: 99355
Project: 99355
Buggy source:
public Controller stormpathMeController(){
  List<String> expandedAccountAttributes=new ArrayList<>();
  getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str");
  Pattern pattern=Pattern.compile("String_Node_Str");
  for (  String key : getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str").keySet()) {
    Matcher matcher=pattern.matcher(key);
    if (matcher.find()) {
      if (environment.getProperty(key,Boolean.class,false)) {
        expandedAccountAttributes.add(matcher.group(1));
      }
    }
  }
  MeController controller=new MeController();
  controller.setExpands(expandedAccountAttributes);
  controller.setObjectMapper(objectMapper);
  controller.setProduces(stormpathProducedMediaTypes());
  controller.setUri(meUri);
  controller.setLoginPageRedirector(new DefaultLoginPageRedirector(stormpathLoginConfig().getUri()));
  controller.setApplicationResolver(stormpathApplicationResolver());
  init(controller);
  return controller;
}

Fixed version (ground truth):
public Controller stormpathMeController(){
  MeController controller=new MeController();
  controller.setExpandsResolver(stormpathMeExpandsResolver());
  controller.setObjectMapper(objectMapper);
  controller.setProduces(stormpathProducedMediaTypes());
  controller.setUri(meUri);
  controller.setLoginPageRedirector(new DefaultLoginPageRedirector(stormpathLoginConfig().getUri()));
  controller.setApplicationResolver(stormpathApplicationResolver());
  init(controller);
  return controller;
}
Program: 99356
Project: 99356
Buggy source:
/** 
 * Returns the   {@link WebConfiguration} associated with this application.
 * @return the {@link WebConfiguration} associated with this application.
 * @since 1.1.0
 */
WebConfiguration getWebConfiguration();

Fixed version (ground truth):
/** 
 * Returns the   {@link WebConfiguration} associated with this application.
 * @return the {@link WebConfiguration} associated with this application.
 * @since 1.2.0
 */
WebConfiguration getWebConfiguration();
Program: 99357
Project: 99357
Buggy source:
protected <T,P>T getParentAwareObjectProperty(String name,Class<T> type,Class<P> parentType){
  Object value=getProperty(name);
  if (value == null) {
    return null;
  }
  if (type.isAssignableFrom(value.getClass())) {
    return (T)value;
  }
  if (value instanceof Map) {
    writeLock.lock();
    try {
      Constructor<T> propertyConstructor=Classes.getConstructor(type,String.class,Map.class,parentType);
      @SuppressWarnings("String_Node_Str") T instance=propertyConstructor.newInstance(name,new Enlistment((Map<String,Object>)value),this);
      getProperties().put(name,instance);
      return instance;
    }
 catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str",e);
    }
 finally {
      writeLock.unlock();
    }
  }
  String msg="String_Node_Str" + name + "String_Node_Str"+ type.getTypeName()+ "String_Node_Str"+ value.getClass().getName();
  msg+=(isPrintableProperty(name) ? "String_Node_Str" + value : "String_Node_Str");
  throw new IllegalArgumentException(msg);
}

Fixed version (ground truth):
protected <T,P>T getParentAwareObjectProperty(String name,Class<T> type,Class<P> parentType){
  Object value=getProperty(name);
  if (value == null) {
    return null;
  }
  if (type.isAssignableFrom(value.getClass())) {
    return (T)value;
  }
  if (value instanceof Map) {
    writeLock.lock();
    try {
      Constructor<T> propertyConstructor=Classes.getConstructor(type,String.class,Map.class,parentType);
      @SuppressWarnings("String_Node_Str") T instance=propertyConstructor.newInstance(name,new Enlistment((Map<String,Object>)value),this);
      getProperties().put(name,instance);
      return instance;
    }
 catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str",e);
    }
 finally {
      writeLock.unlock();
    }
  }
  String msg="String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ value.getClass().getName();
  msg+=(isPrintableProperty(name) ? "String_Node_Str" + value : "String_Node_Str");
  throw new IllegalArgumentException(msg);
}
Program: 99358
Project: 99358
Buggy source:
WebConfigurationStatus getStatus();

Fixed version (ground truth):
/** 
 * Returns the webConfiguration's status. Users won't be able to use the applications' api if the webConfiguration is disabled.
 * @return the webConfiguration's status.
 */
WebConfigurationStatus getStatus();
Program: 99359
Project: 99359
Buggy source:
void setStatus(WebConfigurationStatus status);

Fixed version (ground truth):
/** 
 * Sets the webConfiguration's status. Users won't be able to use the applications' api if the webConfiguration is disabled.
 * @param status the webConfiguration's status.
 */
void setStatus(WebConfigurationStatus status);
Program: 99360
Project: 99360
Buggy source:
String getDomainName();

Fixed version (ground truth):
/** 
 * Returns the WebConfiguration's Domain name, this is automatically generated by Stormpath (using the   {@link #getDnsLabel() value}and is guaranteed to be unique across all   {@link com.stormpath.sdk.tenant.Tenant tenants} in Stormpath.
 * @return the WebConfiguration's Domain name value or {@code null} if one hasn't been generated for {@code this}resource.
 */
String getDomainName();
Program: 99361
Project: 99361
Buggy source:
private static String toScopeString(List<String> scopeList){
  String scope=scopeList.toString();
  scope=scope.replaceAll("String_Node_Str","String_Node_Str");
  scope=scope.replaceAll("String_Node_Str","String_Node_Str");
  return scope;
}

Fixed version (ground truth):
private static String toScopeString(List<String> scopeList){
  if (scopeList == null) {
    return null;
  }
  String scope=scopeList.toString();
  scope=scope.replaceAll("String_Node_Str","String_Node_Str");
  scope=scope.replaceAll("String_Node_Str","String_Node_Str");
  return scope;
}
Program: 99362
Project: 99362
Buggy source:
public View stormpathJacksonView(){
  JacksonView view=new JacksonView();
  view.setObjectMapper(stormpathObjectMapper());
  return view;
}

Fixed version (ground truth):
public View stormpathJacksonView(){
  JacksonView view=new JacksonView();
  view.setObjectMapper(objectMapper);
  return view;
}
Program: 99363
Project: 99363
Buggy source:
public Controller stormpathMeController(){
  List<String> expandedAccountAttributes=new ArrayList<>();
  getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str");
  Pattern pattern=Pattern.compile("String_Node_Str");
  for (  String key : getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str").keySet()) {
    Matcher matcher=pattern.matcher(key);
    if (matcher.find()) {
      if (environment.getProperty(key,Boolean.class,false)) {
        expandedAccountAttributes.add(matcher.group(1));
      }
    }
  }
  MeController controller=new MeController();
  controller.setExpands(expandedAccountAttributes);
  controller.setObjectMapper(stormpathObjectMapper());
  controller.setProduces(stormpathProducedMediaTypes());
  controller.setUri(meUri);
  controller.setLoginPageRedirector(new DefaultLoginPageRedirector(stormpathLoginConfig().getUri()));
  controller.setApplicationResolver(stormpathApplicationResolver());
  init(controller);
  return controller;
}

Fixed version (ground truth):
public Controller stormpathMeController(){
  List<String> expandedAccountAttributes=new ArrayList<>();
  getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str");
  Pattern pattern=Pattern.compile("String_Node_Str");
  for (  String key : getPropertiesStartingWith((ConfigurableEnvironment)environment,"String_Node_Str").keySet()) {
    Matcher matcher=pattern.matcher(key);
    if (matcher.find()) {
      if (environment.getProperty(key,Boolean.class,false)) {
        expandedAccountAttributes.add(matcher.group(1));
      }
    }
  }
  MeController controller=new MeController();
  controller.setExpands(expandedAccountAttributes);
  controller.setObjectMapper(objectMapper);
  controller.setProduces(stormpathProducedMediaTypes());
  controller.setUri(meUri);
  controller.setLoginPageRedirector(new DefaultLoginPageRedirector(stormpathLoginConfig().getUri()));
  controller.setApplicationResolver(stormpathApplicationResolver());
  init(controller);
  return controller;
}
Program: 99364
Project: 99364
Buggy source:
public org.springframework.web.servlet.View stormpathJsonView(){
  MappingJackson2JsonView jsonView=new MappingJackson2JsonView(stormpathObjectMapper());
  jsonView.setDisableCaching(false);
  return jsonView;
}

Fixed version (ground truth):
public org.springframework.web.servlet.View stormpathJsonView(){
  MappingJackson2JsonView jsonView=new MappingJackson2JsonView(objectMapper);
  jsonView.setDisableCaching(false);
  return jsonView;
}
Program: 99365
Project: 99365
Buggy source:
protected boolean isHtmlPreferred(HttpServletRequest request,HttpServletResponse response){
  try {
    return MediaType.TEXT_HTML.equals(contentNegotiationResolver.getContentType(request,response,produces));
  }
 catch (  UnresolvedMediaTypeException e) {
    log.info("String_Node_Str",e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
protected boolean isHtmlPreferred(HttpServletRequest request,HttpServletResponse response){
  try {
    return MediaType.TEXT_HTML.equals(contentNegotiationResolver.getContentType(request,response,produces));
  }
 catch (  UnresolvedMediaTypeException e) {
    log.debug("String_Node_Str",e.getMessage());
    return false;
  }
}
Program: 99366
Project: 99366
Buggy source:
protected boolean isJsonPreferred(HttpServletRequest request,HttpServletResponse response){
  try {
    return MediaType.APPLICATION_JSON.equals(contentNegotiationResolver.getContentType(request,response,produces));
  }
 catch (  UnresolvedMediaTypeException e) {
    log.info("String_Node_Str",e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
protected boolean isJsonPreferred(HttpServletRequest request,HttpServletResponse response){
  try {
    return MediaType.APPLICATION_JSON.equals(contentNegotiationResolver.getContentType(request,response,produces));
  }
 catch (  UnresolvedMediaTypeException e) {
    log.debug("String_Node_Str",e.getMessage());
    return false;
  }
}
Program: 99367
Project: 99367
Buggy source:
@Override public String getStatusMessage(HttpServletRequest request,String status){
  EnumSet<LoginStatus> validStatus=EnumSet.allOf(LoginStatus.class);
  if (validStatus.contains(LoginStatus.valueOf(status.toUpperCase()))) {
    return messageSource.getMessage("String_Node_Str" + status,request.getLocale(),verifyEmailUri);
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String getStatusMessage(HttpServletRequest request,String status){
  EnumSet<LoginStatus> validStatus=EnumSet.allOf(LoginStatus.class);
  try {
    if (validStatus.contains(LoginStatus.valueOf(status.toUpperCase()))) {
      return messageSource.getMessage("String_Node_Str" + status,request.getLocale(),verifyEmailUri);
    }
  }
 catch (  IllegalArgumentException e) {
  }
  return "String_Node_Str";
}
Program: 99368
Project: 99368
Buggy source:
@Override protected FilterChainManager createInstance(ServletContext servletContext) throws Exception {
  DefaultFilterChainManager mgr=new DefaultFilterChainManager(servletContext);
  for (  DefaultFilter defaultFilter : DefaultFilter.values()) {
    Object o=defaultFilter.getFactoryClass();
    if (o == null) {
      o=defaultFilter.getFilterClass();
    }
    mgr.addFilter(defaultFilter.name(),o);
  }
  Config config=getConfig();
  for (  String key : config.keySet()) {
    if (key.startsWith(FILTER_CONFIG_PREFIX)) {
      String instanceName=key.substring(FILTER_CONFIG_PREFIX.length());
      int i=instanceName.indexOf('.');
      if (i >= 0) {
        continue;
      }
      String className=config.getInstance(key);
      Object instance=Classes.newInstance(className);
      mgr.addFilter(instanceName,instance);
    }
  }
  return new DefaultFilterChainManagerConfigurer(mgr,servletContext,config).configure();
}

Fixed version (ground truth):
@Override protected FilterChainManager createInstance(ServletContext servletContext) throws Exception {
  DefaultFilterChainManager mgr=new DefaultFilterChainManager(servletContext);
  for (  DefaultFilter defaultFilter : DefaultFilter.values()) {
    Object o=defaultFilter.getFactoryClass();
    if (o == null) {
      o=defaultFilter.getFilterClass();
    }
    mgr.addFilter(defaultFilter.name(),o);
  }
  Config config=getConfig();
  for (  String key : config.keySet()) {
    if (key.startsWith(FILTER_CONFIG_PREFIX)) {
      String instanceName=key.substring(FILTER_CONFIG_PREFIX.length());
      int i=instanceName.indexOf('.');
      if (i >= 0) {
        continue;
      }
      String className=config.get(key);
      Object instance=Classes.newInstance(className);
      mgr.addFilter(instanceName,instance);
    }
  }
  return new DefaultFilterChainManagerConfigurer(mgr,servletContext,config).configure();
}
Program: 99369
Project: 99369
Buggy source:
@Override public Authentication attemptAuthentication(HttpServletRequest request,HttpServletResponse response) throws AuthenticationException {
  if (postOnly && !request.getMethod().equals("String_Node_Str")) {
    throw new AuthenticationServiceException("String_Node_Str" + request.getMethod());
  }
  if (supportedMediaTypes == null) {
    throw new AuthenticationServiceException("String_Node_Str");
  }
  MediaType mediaType;
  try {
    mediaType=ContentNegotiationResolver.INSTANCE.getContentType(request,response,supportedMediaTypes);
  }
 catch (  UnresolvedMediaTypeException umt) {
    throw new AuthenticationServiceException("String_Node_Str" + umt.getMessage(),umt);
  }
  if (!MediaType.APPLICATION_JSON.equals(mediaType) || request.getContentType().contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE)) {
    return super.attemptAuthentication(request,response);
  }
  UsernamePasswordAuthenticationToken authRequest=getUserNamePasswordAuthenticationToken(request);
  setDetails(request,authRequest);
  return getAuthenticationManager().authenticate(authRequest);
}

Fixed version (ground truth):
@Override public Authentication attemptAuthentication(HttpServletRequest request,HttpServletResponse response) throws AuthenticationException {
  if (postOnly && !request.getMethod().equals("String_Node_Str")) {
    throw new AuthenticationServiceException("String_Node_Str" + request.getMethod());
  }
  if (supportedMediaTypes == null) {
    throw new AuthenticationServiceException("String_Node_Str");
  }
  MediaType mediaType;
  try {
    mediaType=ContentNegotiationResolver.INSTANCE.getContentType(request,response,supportedMediaTypes);
  }
 catch (  UnresolvedMediaTypeException umt) {
    throw new AuthenticationServiceException("String_Node_Str" + umt.getMessage(),umt);
  }
  System.out.println("String_Node_Str" + mediaType);
  System.out.println("String_Node_Str" + request.getContentType());
  if (!MediaType.APPLICATION_JSON.equals(mediaType) || request.getHeader("String_Node_Str").contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE) || request.getContentType().contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE)) {
    return super.attemptAuthentication(request,response);
  }
  UsernamePasswordAuthenticationToken authRequest=getUserNamePasswordAuthenticationToken(request);
  setDetails(request,authRequest);
  return getAuthenticationManager().authenticate(authRequest);
}
Program: 99370
Project: 99370
Buggy source:
@Override protected ViewModel onValidSubmit(HttpServletRequest request,HttpServletResponse response,Form form) throws Exception {
  String password=form.getFieldValue("String_Node_Str");
  Application application=(Application)request.getAttribute(Application.class.getName());
  String sptoken=form.getFieldValue("String_Node_Str");
  if (isJsonPreferred(request,response)) {
    Map<String,Object> model=new HashMap<String,Object>();
    try {
      Account account=application.resetPassword(sptoken,password);
      if (autoLogin) {
        final AuthenticationResult result=new TransientAuthenticationResult(account);
        this.authenticationResultSaver.set(request,response,result);
        model.put("String_Node_Str",accountModelFactory.toMap(account,Collections.EMPTY_LIST));
      }
 else {
        return new DefaultViewModel("String_Node_Str");
      }
    }
 catch (    Exception e) {
      model=errorModelFactory.toError(request,e).toMap();
      response.setStatus(errorModelFactory.toError(request,e).getStatus());
    }
    return new DefaultViewModel("String_Node_Str",model);
  }
  Account account=application.resetPassword(sptoken,password);
  String next;
  if (autoLogin) {
    final AuthenticationResult result=new TransientAuthenticationResult(account);
    this.authenticationResultSaver.set(request,response,result);
    next=loginNextUri;
  }
 else {
    next=this.nextUri;
  }
  return new DefaultViewModel(next).setRedirect(true);
}

Fixed version (ground truth):
@Override protected ViewModel onValidSubmit(HttpServletRequest request,HttpServletResponse response,Form form) throws Exception {
  String password=form.getFieldValue("String_Node_Str");
  Application application=(Application)request.getAttribute(Application.class.getName());
  String sptoken=form.getFieldValue("String_Node_Str");
  if (isJsonPreferred(request,response)) {
    Map<String,Object> model=new HashMap<String,Object>();
    try {
      Account account=application.resetPassword(sptoken,password);
      if (autoLogin) {
        final AuthenticationResult result=new TransientAuthenticationResult(account);
        this.authenticationResultSaver.set(request,response,result);
        model.put("String_Node_Str",accountModelFactory.toMap(account,Collections.EMPTY_LIST));
      }
 else {
        return new DefaultViewModel("String_Node_Str");
      }
    }
 catch (    Exception e) {
      model=errorModelFactory.toError(request,e).toMap();
      response.setStatus(errorModelFactory.toError(request,e).getStatus());
    }
    return new DefaultViewModel("String_Node_Str",model);
  }
  String next;
  try {
    Account account=application.resetPassword(sptoken,password);
    if (autoLogin) {
      final AuthenticationResult result=new TransientAuthenticationResult(account);
      this.authenticationResultSaver.set(request,response,result);
      next=loginNextUri;
    }
 else {
      next=this.nextUri;
    }
  }
 catch (  Exception e) {
    next=errorUri;
  }
  return new DefaultViewModel(next).setRedirect(true);
}
Program: 99371
Project: 99371
Buggy source:
@Override protected ViewModel doGet(HttpServletRequest request,HttpServletResponse response) throws Exception {
  String sptoken=Strings.clean(fieldValueResolver.getValue(request,"String_Node_Str"));
  if (isJsonPreferred(request,response)) {
    Map<String,Object> model=new HashMap<String,Object>(1);
    if (sptoken == null) {
      model.put("String_Node_Str",HttpServletResponse.SC_BAD_REQUEST);
      model.put("String_Node_Str",i18n(request,"String_Node_Str"));
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    }
 else {
      try {
        Application application=(Application)request.getAttribute(Application.class.getName());
        application.verifyPasswordResetToken(sptoken);
        return new DefaultViewModel("String_Node_Str");
      }
 catch (      Exception e) {
        model=errorModelFactory.toError(request,e).toMap();
        response.setStatus(errorModelFactory.toError(request,e).getStatus());
      }
    }
    return new DefaultViewModel("String_Node_Str",model);
  }
  if (sptoken == null) {
    return new DefaultViewModel(forgotPasswordUri).setRedirect(true);
  }
 else {
    try {
      Application application=(Application)request.getAttribute(Application.class.getName());
      application.verifyPasswordResetToken(sptoken);
    }
 catch (    ResourceException re) {
      return new DefaultViewModel(errorUri).setRedirect(true);
    }
    return super.doGet(request,response);
  }
}

Fixed version (ground truth):
@Override protected ViewModel doGet(HttpServletRequest request,HttpServletResponse response) throws Exception {
  String sptoken=Strings.clean(request.getParameter("String_Node_Str"));
  if (isJsonPreferred(request,response)) {
    Map<String,Object> model=new HashMap<String,Object>(1);
    if (sptoken == null) {
      model.put("String_Node_Str",HttpServletResponse.SC_BAD_REQUEST);
      model.put("String_Node_Str",i18n(request,"String_Node_Str"));
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    }
 else {
      try {
        Application application=(Application)request.getAttribute(Application.class.getName());
        application.verifyPasswordResetToken(sptoken);
        return new DefaultViewModel("String_Node_Str");
      }
 catch (      Exception e) {
        model=errorModelFactory.toError(request,e).toMap();
        response.setStatus(errorModelFactory.toError(request,e).getStatus());
      }
    }
    return new DefaultViewModel("String_Node_Str",model);
  }
  if (sptoken == null) {
    return new DefaultViewModel(forgotPasswordUri).setRedirect(true);
  }
 else {
    try {
      Application application=(Application)request.getAttribute(Application.class.getName());
      application.verifyPasswordResetToken(sptoken);
    }
 catch (    ResourceException re) {
      return new DefaultViewModel(errorUri).setRedirect(true);
    }
    return super.doGet(request,response);
  }
}