Search code examples
javajakarta-mail

JavaMail: Runtime change of encodeParameters


I see that in ParameterList.java, a handful of system properties are stored in static final variables:

private static final boolean encodeParameters =
    PropUtil.getBooleanSystemProperty("mail.mime.encodeparameters", true);

Is there a reason why these are not a bit more flexible to account for a property potentially being changed during runtime?


Solution

  • It's a runtime cost vs. flexibility tradeoff. In most cases these properties will be configured once and never changed so we favored the increased runtime efficiency of only having to read the System property once.