Skip to content

Commit

Permalink
sonar cloud fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SrdjanStevanetic committed Apr 15, 2024
1 parent 8950eed commit 3eee219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public ETranslationTranslationService(String baseUrl, String domain, String call

private void validateETranslConfigParams(String baseUrl, String domain, String callbackUrl,
int maxWaitMillisec, String username, String password) throws TranslationException {
StringBuilder missingParams=new StringBuilder(100);
StringBuilder missingParams=new StringBuilder();
if(StringUtils.isBlank(baseUrl)) {
missingParams.append("baseUrl");
}
Expand Down Expand Up @@ -186,7 +186,7 @@ private void createRedisMessageListenerAndWaitForResults(List<TranslationObj> tr
* @throws TranslationException
*/
private String generateJointHtmlForTranslation(List<TranslationObj> translationObjs) throws TranslationException {
StringBuilder translJointString=new StringBuilder(100);
StringBuilder translJointString=new StringBuilder();
translJointString.append("<!DOCTYPE html>\n<htlm>\n<body>\n");
for(TranslationObj translObj : translationObjs) {
translJointString.append("<p>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public void eTranslationCallback(
@RequestParam(value = "external-reference", required = true) String externalReference,
@RequestBody String body) {
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("eTranslation callback on translation api has been received with the request-id: {}, "
+ "and the external-reference: {}", requestId, externalReference);
LOGGER.debug("eTranslation callback on translation api has been received with the external-reference: {}", externalReference);

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarCloud
}
if(externalReference!=null && body!=null) {
redisTemplate.convertAndSend(externalReference, body);
Expand Down

0 comments on commit 3eee219

Please sign in to comment.