Skip to content

Commit

Permalink
LPS-205919 JSONFactory and Language are portal-impl service, safe to …
Browse files Browse the repository at this point in the history
…use util.
  • Loading branch information
shuyangzhou authored and brianchandotcom committed Jan 11, 2024
1 parent 653919c commit 3385b9c
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactory;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.json.JSONUtil;
import com.liferay.portal.kernel.language.Language;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.model.Company;
Expand Down Expand Up @@ -128,7 +128,8 @@ public Map<String, Object> connectAnalyticsDataSource(
"Unable to connect analytics data source");
}

JSONObject contentJSONObject = _jsonFactory.createJSONObject(content);
JSONObject contentJSONObject = JSONFactoryUtil.createJSONObject(
content);

_connectionProperties = contentJSONObject.toMap();

Expand Down Expand Up @@ -397,7 +398,7 @@ private JSONObject _decodeToken(String connectionToken) throws Exception {
throw new IllegalArgumentException();
}

return _jsonFactory.createJSONObject(
return JSONFactoryUtil.createJSONObject(
new String(Base64.decode(connectionToken)));
}
catch (Exception exception) {
Expand Down Expand Up @@ -428,7 +429,7 @@ private JSONArray _getGroupsJSONArray(Group[] groups, Locale locale)
catch (PortalException portalException) {
_log.error(portalException);

return _language.get(locale, "unknown");
return LanguageUtil.get(locale, "unknown");
}
}
);
Expand Down Expand Up @@ -465,12 +466,6 @@ private Http.Options _getOptions(
@Reference
private Http _http;

@Reference
private JSONFactory _jsonFactory;

@Reference
private Language _language;

private static class ObjectMapperHolder {

private static final ObjectMapper _objectMapper = new ObjectMapper() {
Expand Down

0 comments on commit 3385b9c

Please sign in to comment.