AMQ-8016 Fix introspection support not checking Boolean class types

Support class should check both primitive and Object based types for
conversion from String to boolean or Boolean targets

(cherry picked from commit 742a7f42f0168302c0d1d1ea779fdefa09ade4a0)
This commit is contained in:
Timothy Bish 2020-07-31 11:42:47 -04:00
parent 2fa7f09fb9
commit fdf9809d49

View File

@ -20,7 +20,9 @@ import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import javax.net.ssl.SSLServerSocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -97,7 +99,7 @@ public final class IntrospectionSupport {
return to.cast(value);
}
if (boolean.class.isAssignableFrom(to) && value instanceof String) {
if ((boolean.class.isAssignableFrom(to) || Boolean.class.isAssignableFrom(to)) && value instanceof String) {
return Boolean.valueOf((String)value);
}