You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bartosz Spyrko-Smietanko (Jira)" <ji...@apache.org> on 2021/03/12 15:05:00 UTC

[jira] [Created] (BEANUTILS-547) MethodUtils.getMatchingAccessibleMethod with security manager enabled on Java 11 throws StringIndexOutOfBoundsException

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)