Since reflection is used to create the instances, isn't it possible to
support both? There are plenty of containers like JBoss EAP that still
use javax instead of jakarta.
The code changes would be quite small in PropertyConverter:
1) Use two class name constants instead of one. Let's use
INTERNET_ADDRESS_CLASSNAME_JAVAX and INTERNET_ADDRESS_CLASSNAME_JAKARTA
as examples.
2) Let the toInternetAddress take an additional class name argument
that's used instead of the hard-coded constant.
3) Change the class name check:
} else if (cls.getName().equals(INTERNET_ADDRESS_CLASSNAME_JAVAX)
|| cls.getName().equals(INTERNET_ADDRESS_CLASSNAME_JAKARTA)) {
return toInternetAddress(value, cls.getName());
You can even have dependencies for both JavaMail versions at the same
time, so you can still unit test both.
On 10/06/2022 20:41, Matt Sicker wrote:
Seems reasonable to me given the use case.
—
Matt Sicker
On Jun 9, 2022, at 20:23, Matt Juntunen <matt.a.juntu...@gmail.com> wrote:
Hello,
We are slowly getting closer to a 2.8.0 release for
commons-configuration. One remaining item on the list is a PR [1] for
bumping the com.sun.mail:mailapi optional dependency from 1.6.7 to
2.0.1. I'd like to get community input on this change since it
involves a package name change in the javamail api (javax to jakarta).
This change has also been discussed recently for commons-email and
ultimately rejected in favor of backwards compatibility [2]. The
situation in configuration is a bit different, however, because
1. the mailapi dependency is optional and
2. it is not part of the public API and could be considered a
convenience type conversion.
As far as I can tell, the only impacted users would be those using the
Configuration.get(Class<T> cls, String key) method to get a mailapi
InternetAddress object. If we go with this change, calls using the
previous mailapi InternetAddress class, such as
Configuration.get(javax.mail.internet.InternetAddress.class, key)
would begin to throw ConversionExceptions. Users would then need to
update their mailapi version and begin using
Configuration.get(jakarta.mail.internet.InternetAddress.class, key)
Is anyone opposed to this change?
Regards,
Matt J
[1] https://github.com/apache/commons-configuration/pull/185
[2] https://github.com/apache/commons-email/pull/80
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org