mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
MismatchedArrayReadWrite: fix when array is passed as the second argument of Arrays.fill.
This commit is contained in:
+3
-2
@@ -298,8 +298,9 @@ public class MismatchedArrayReadWriteInspection extends BaseInspection {
|
||||
}
|
||||
}
|
||||
else if (CommonClassNames.JAVA_UTIL_ARRAYS.equals(qualifiedName)) {
|
||||
if ("fill".equals(methodName) || "parallelPrefix".equals(methodName) || "parallelSetAll".equals(methodName) ||
|
||||
"parallelSort".equals(methodName) || "setAll".equals(methodName) || "sort".equals(methodName)) {
|
||||
if (("fill".equals(methodName) || "parallelPrefix".equals(methodName) || "parallelSetAll".equals(methodName) ||
|
||||
"parallelSort".equals(methodName) || "setAll".equals(methodName) || "sort".equals(methodName)) &&
|
||||
PsiTreeUtil.isAncestor(expressionList.getExpressions()[0], expression, false)) {
|
||||
myWritten = true;
|
||||
}
|
||||
else {
|
||||
|
||||
+6
@@ -84,6 +84,12 @@ public class MismatchedArrayReadWrite {
|
||||
allResults[row] = new int[9];
|
||||
}
|
||||
}
|
||||
|
||||
void fillSecondArg(int[][] data) {
|
||||
int[] arr = new int[3];
|
||||
arr[0] = 0;
|
||||
Arrays.fill(data, arr);
|
||||
}
|
||||
}
|
||||
class Test{
|
||||
public void bar(){
|
||||
|
||||
Reference in New Issue
Block a user