diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
index 8a22cae7befa..53c1061f7e2d 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
@@ -1893,7 +1893,8 @@ arrays.deep.hash.code.quickfix=Replace with 'Arrays.deepHashCode()'
arrays.hash.code.quickfix=Replace with 'Arrays.hashCode()'
method.can.be.variable.arity.method.display.name=Method can be variable arity method
method.can.be.variable.arity.method.problem.descriptor=#ref() can be converted to variable arity method #loc
-method.can.be.variable.arity.method.ignore.byte.short.option=Ignore methods with a last parameter of type byte[] or short[]
+method.can.be.variable.arity.method.ignore.byte.short.option=Ignore methods with a last parameter of type byte[] or short[]
+method.can.be.variable.arity.method.ignore.multiple.arrays.option=Ignore methods with multiple array parameters
convert.to.variable.arity.method.quickfix=Convert to varargs method
mismatched.string.builder.query.update.display.name=Mismatched query and update of StringBuilder
mismatched.string.builder.updated.problem.descriptor=Contents of {0} #ref are updated, but never queried #loc
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/MethodCanBeVariableArityMethodInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/MethodCanBeVariableArityMethodInspection.java
index 3a761f5561c4..8a1d76760319 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/MethodCanBeVariableArityMethodInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/MethodCanBeVariableArityMethodInspection.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 Bas Leijdekkers
+ * Copyright 2011-2014 Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,9 @@ public class MethodCanBeVariableArityMethodInspection extends BaseInspection {
@SuppressWarnings("PublicField")
public boolean onlyReportPublicMethods = false;
+ @SuppressWarnings("PublicField")
+ public boolean ignoreMultipleArrayParameters = false;
+
@Nls
@NotNull
@Override
@@ -62,6 +65,8 @@ public class MethodCanBeVariableArityMethodInspection extends BaseInspection {
"ignoreByteAndShortArrayParameters");
panel.addCheckbox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), "ignoreOverridingMethods");
panel.addCheckbox(InspectionGadgetsBundle.message("only.report.public.methods.option"), "onlyReportPublicMethods");
+ panel.addCheckbox(InspectionGadgetsBundle.message("method.can.be.variable.arity.method.ignore.multiple.arrays.option"),
+ "ignoreMultipleArrayParameters");
return panel;
}
@@ -116,6 +121,14 @@ public class MethodCanBeVariableArityMethodInspection extends BaseInspection {
if (ignoreOverridingMethods && MethodUtils.hasSuper(method)) {
return;
}
+ if (ignoreMultipleArrayParameters) {
+ for (int i = 0, length = parameters.length - 1; i < length; i++) {
+ final PsiParameter parameter = parameters[i];
+ if (parameter.getType() instanceof PsiArrayType) {
+ return;
+ }
+ }
+ }
registerMethodError(method);
}
}
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/MethodCanBeVariableArityMethod.html b/plugins/InspectionGadgets/src/inspectionDescriptions/MethodCanBeVariableArityMethod.html
index 0c97059e474b..8f51c948e4a1 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/MethodCanBeVariableArityMethod.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/MethodCanBeVariableArityMethod.html
@@ -7,10 +7,14 @@ This inspection only reports if the project or module is configured to use a
language level of 5.0 or higher.
-Use the first checkbox below to not offer to convert byte[] or short[] parameters to vararg. +Use the first checkbox below to not offer to convert byte[] or short[] parameters to vararg.
Use the second checkbox below to ignore methods overriding or implementing a method from a superclass.
+Use the third checkbox below to only report when the method is public +
+Use the fourth checkbox below ot ignore method with more than one array parameter. +
New in 10.5