Skip to content

Commit

Permalink
Fix findbugs issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Avarjana committed Mar 7, 2024
1 parent 7026780 commit 67ea960
Showing 1 changed file with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
import org.wso2.carbon.identity.rest.api.server.email.template.v2.model.SimpleEmailTemplate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.Response;

import static org.wso2.carbon.identity.api.server.common.Constants.V2_API_PATH_COMPONENT;
Expand Down Expand Up @@ -394,32 +392,6 @@ private List<SimpleEmailTemplate> buildSimpleEmailTemplatesList(List<EmailTempla
return simpleEmailTemplates;
}

/**
* Create a list EmailTemplateTypeWithoutTemplates objects by reading an internal EmailTemplate list.
*
* @param emailTemplateTypes List of available email template types.
* @return List of EmailTemplateTypeWithoutTemplates objects.
*/
private List<EmailTemplateTypeWithID> buildEmailTemplateTypeWithoutTemplatesList(
List<String> emailTemplateTypes) {

Map<String, EmailTemplateTypeWithID> templateTypeMap = new HashMap<>();
for (String templateType : emailTemplateTypes) {

EmailTemplateTypeWithID emailTemplateType = new EmailTemplateTypeWithID();
// Set display name.
emailTemplateType.setDisplayName(templateType);
// Set id.
String templateTypeId = getEmailTemplateIdFromDisplayName(templateType);
emailTemplateType.setId(templateTypeId);
// Set location.
emailTemplateType.setSelf(getTemplateTypeLocation(templateTypeId));
templateTypeMap.put(templateType, emailTemplateType);
}

return new ArrayList<>(templateTypeMap.values());
}

/**
* Convert an internal email template to a new Email Template object.
*/
Expand Down

0 comments on commit 67ea960

Please sign in to comment.