Bartosz Spyrko-Smietanko created BEANUTILS-547:
--------------------------------------------------

             Summary: MethodUtils.getMatchingAccessibleMethod with security 
manager enabled on Java 11 throws StringIndexOutOfBoundsException
                 Key: BEANUTILS-547
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-547
             Project: Commons BeanUtils
          Issue Type: Bug
    Affects Versions: 1.9.3
            Reporter: Bartosz Spyrko-Smietanko


Calling MethodUtils.getMatchingAccessibleMethod with security manager enabled 
on Java 11 (without ReflectPermission("suppressAccessChecks")) results in 
{noformat}
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String 
index out of range: 2Exception in thread "main" 
java.lang.StringIndexOutOfBoundsException: String index out of range: 2 at 
java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47) at 
java.base/java.lang.String.charAt(String.java:693) at 
org.apache.commons.beanutils.MethodUtils.setMethodAccessible(MethodUtils.java:1069)
 at 
org.apache.commons.beanutils.MethodUtils.getMatchingAccessibleMethod(MethodUtils.java:963){noformat}
 

The reason seems to be check at 
[https://github.com/apache/commons-beanutils/blob/master/src/main/java/org/apache/commons/beanutils2/MethodUtils.java#L1046-L1054]
 not being able to deal with Java 11 version



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to