CPD Results

The following document contains the results of PMD's CPD 7.14.0.

Duplications

File Line
org/forgerock/selfservice/stages/email/VerifyEmailAccountStage.java 175
org/forgerock/selfservice/stages/user/EmailUsernameStage.java 93
bodyText = bodyText.replace(config.getVerificationLinkToken(), emailUrl);

        try (Connection connection = connectionFactory.getConnection()) {
            ActionRequest request = Requests
                    .newActionRequest(config.getEmailServiceUrl(), "send")
                    .setContent(
                            json(
                                    object(
                                            field("to", email),
                                            field("from", config.getFrom()),
                                            field("subject", subjectText),
                                            field("type", config.getMimeType()),
                                            field("body", bodyText))));

            for (Map.Entry<String, String> parameter : config.getEmailServiceParameters().entrySet()) {
                request.setAdditionalParameter(parameter.getKey(), parameter.getValue());
            }

            connection.action(processContext.getRequestContext(), request);
        }
    }

}
File Line
org/forgerock/selfservice/stages/email/VerifyEmailAccountConfig.java 268
org/forgerock/selfservice/stages/user/EmailUsernameConfig.java 221
VerifyEmailAccountConfig that = (VerifyEmailAccountConfig) o;
        return Objects.equals(getName(), that.getName())
                && Objects.equals(getProgressStageClassName(), that.getProgressStageClassName())
                && Objects.equals(emailServiceUrl, that.emailServiceUrl)
                && Objects.equals(emailServiceParameters, that.emailServiceParameters)
                && Objects.equals(subjectTranslations, that.subjectTranslations)
                && Objects.equals(from, that.from)
                && Objects.equals(messageTranslations, that.messageTranslations)
                && Objects.equals(mimeType, that.mimeType)
                && Objects.equals(verificationLink, that.verificationLink)