/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public static Method findMethod(@NotNull ReferenceType refType, @NonNls String methodName, @Nullable @NonNls String methodSignature) {
if (refType instanceof ArrayType) {
// for array types methodByName() in JDI always returns empty list
- final Method method = findMethod(refType.virtualMachine().classesByName(CommonClassNames.JAVA_LANG_OBJECT).get(0), methodName, methodSignature);
+ Method method = findMethod(refType.virtualMachine().classesByName(CommonClassNames.JAVA_LANG_OBJECT).get(0), methodName, methodSignature);
if (method != null) {
return method;
}
+ // for arrays, clone signature may return array of objects, there is no such method in Object class
+ if ("clone".equals(methodName) && "()[Ljava/lang/Object;".equals(methodSignature)) {
+ method = findMethod(refType.virtualMachine().classesByName(CommonClassNames.JAVA_LANG_OBJECT).get(0), "clone", null);
+ if (method != null) {
+ return method;
+ }
+ }
}
Method method = null;