The method index in PropertyValuesHolder was using only the method name
+ the number of parameters in the call to index the different properties
methods. This worked ok most of the time because, for a given method
name (let's say setTrimStartOffset), the class is usually the same.
However, if the same method name is used in multiple classes, this will
cause collisions and will most likely crash.
Change-Id: Ie6fa8872c5c5e69e690f4f1bb79191a31bef2a28
private static long registerMethod(Class<?> targetClass, String methodName, Class[] types,
int nArgs) {
// Encode the number of arguments in the method name
- String methodIndexName = String.format("%1$s#%2$d", methodName, nArgs);
+ String methodIndexName = String.format("%1$s.%2$s#%3$d", targetClass.getSimpleName(),
+ methodName, nArgs);
synchronized (sMethodIndexLock) {
Long methodId = METHOD_NAME_TO_ID.get(methodIndexName);