garydgregory commented on code in PR #186:
URL:
https://github.com/apache/commons-configuration/pull/186#discussion_r896733283
##########
src/main/java/org/apache/commons/configuration2/convert/PropertyConverter.java:
##########
@@ -607,12 +612,22 @@ static Object toInternetAddress(final Object value)
throws ConversionException {
if (value.getClass().getName().equals(INTERNET_ADDRESS_CLASSNAME)) {
return value;
}
+ if
(value.getClass().getName().equals(INTERNET_ADDRESS_CLASSNAME_JAKARTA)) {
+ return value;
+ }
if (!(value instanceof String)) {
throw new ConversionException("The value " + value + " can't be
converted to a InternetAddress");
}
try {
- final Constructor<?> ctor =
Class.forName(INTERNET_ADDRESS_CLASSNAME).getConstructor(String.class);
- return ctor.newInstance(value);
+ try {
Review Comment:
So this WILL cause a class cast exception? How is that ok?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]