Source:
<code>public static String getUserConsentURL(OAuth2Parameters params, String loggedInUser, String sessionDataKey, boolean isOIDC) throws OAuthSystemException { String queryString = ""; if (log.isDebugEnabled()) { log.debug("Received Session Data Key is : " + sessionDataKey); if (params == null) { log.debug("Received OAuth2 params are Null for UserConsentURL"); } } SessionDataCacheEntry entry = (SessionDataCacheEntry) SessionDataCache.getInstance() .getValueFromCache(new SessionDataCacheKey(sessionDataKey)); String consentPage = null; try { if (entry == null) { if (log.isDebugEnabled()) { log.debug("Cache Entry is Null from SessionDataCache "); } } else { queryString = URLEncoder.encode(entry.getQueryString(), "UTF-8"); } if (isOIDC) { consentPage = CarbonUIUtil.getAdminConsoleURL("/") + "../authenticationendpoint/oauth2_consent.do"; } else { consentPage = CarbonUIUtil.getAdminConsoleURL("/") + "../authenticationendpoint/oauth2_authz.do"; } if (params != null) { consentPage += "?" + OAuthConstants.OIDC_LOGGED_IN_USER + "=" + URLEncoder.encode(loggedInUser, "UTF-8") + "&application=" + URLEncoder.encode(params.getApplicationName(), "ISO-8859-1") + "&" + OAuthConstants.OAuth20Params.SCOPE + "=" + URLEncoder.encode(EndpointUtil.getScope (params), "ISO-8859-1") + "&" + OAuthConstants.SESSION_DATA_KEY_CONSENT + "=" + URLEncoder .encode(sessionDataKey, "UTF-8") + "&spQueryParams=" + queryString; } else { throw new OAuthSystemException("Error while retrieving the application name"); } } catch (UnsupportedEncodingException e) { <START> throw new OAuthSystemException(e.getMessage(), e); <END> } return consentPage; }</code><technical_language>e.getMessage()</technical_language>

Target:
public static String getUserConsentURL(OAuth2Parameters params, String loggedInUser, String sessionDataKey, boolean isOIDC) throws OAuthSystemException { String queryString = ""; if (log.isDebugEnabled()) { log.debug("Received Session Data Key is : " + sessionDataKey); if (params == null) { log.debug("Received OAuth2 params are Null for UserConsentURL"); } } SessionDataCacheEntry entry = (SessionDataCacheEntry) SessionDataCache.getInstance() .getValueFromCache(new SessionDataCacheKey(sessionDataKey)); String consentPage = null; try { if (entry == null) { if (log.isDebugEnabled()) { log.debug("Cache Entry is Null from SessionDataCache "); } } else { queryString = URLEncoder.encode(entry.getQueryString(), "UTF-8"); } if (isOIDC) { consentPage = CarbonUIUtil.getAdminConsoleURL("/") + "../authenticationendpoint/oauth2_consent.do"; } else { consentPage = CarbonUIUtil.getAdminConsoleURL("/") + "../authenticationendpoint/oauth2_authz.do"; } if (params != null) { consentPage += "?" + OAuthConstants.OIDC_LOGGED_IN_USER + "=" + URLEncoder.encode(loggedInUser, "UTF-8") + "&application=" + URLEncoder.encode(params.getApplicationName(), "ISO-8859-1") + "&" + OAuthConstants.OAuth20Params.SCOPE + "=" + URLEncoder.encode(EndpointUtil.getScope (params), "ISO-8859-1") + "&" + OAuthConstants.SESSION_DATA_KEY_CONSENT + "=" + URLEncoder .encode(sessionDataKey, "UTF-8") + "&spQueryParams=" + queryString; } else { throw new OAuthSystemException("Error while retrieving the application name"); } } catch (UnsupportedEncodingException e) { throw new OAuthSystemException("Error while encoding the url", e); } return consentPage; }