[AMQ-7121] Set setter accessible (for JDK 11)

This commit is contained in:
jbonofre 2020-06-22 17:35:49 +02:00
parent 937c31e036
commit 88525ce650
2 changed files with 6 additions and 0 deletions

View File

@ -175,6 +175,9 @@ public final class IntrospectionSupport {
return false; return false;
} }
// JDK 11: class or setter might not be publicly accessible
setter.setAccessible(true);
// If the type is null or it matches the needed type, just use the // If the type is null or it matches the needed type, just use the
// value directly // value directly
if (value == null || value.getClass() == setter.getParameterTypes()[0]) { if (value == null || value.getClass() == setter.getParameterTypes()[0]) {

View File

@ -64,6 +64,9 @@ public final class IntrospectionSupport {
return false; return false;
} }
// JDK 11: class or setter might not be publicly accessible
setter.setAccessible(true);
// If the type is null or it matches the needed type, just use the // If the type is null or it matches the needed type, just use the
// value directly // value directly
if (value == null || value.getClass() == setter.getParameterTypes()[0]) { if (value == null || value.getClass() == setter.getParameterTypes()[0]) {