it’s a clean-code type question.
application sends emails on appropriate addresses. but when variable X is set, it overrides all email addresses. all emails are sent to the address specified in X. variable X is being read from config file during deployment time and set by IoC container
sth like:
public class EmailSender {
@Value("config.option.X")
private String X;
public void sendEmail() {
...
if (X != null) message.setEmailAddress(X);
internalEmailSender.send(message);
}
}
and i have no idea how to name X properly. replacerEmailAddress? emailAddressOverrider? any better ideas?
What’s the context in which variable X is set? I would try and name it to reference that condition in some way.