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
This commit is contained in:
Timothy Bish 2020-07-31 11:42:47 -04:00
parent aed91a7474
commit 742a7f42f0
1 changed files with 3 additions and 1 deletions

View File

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