Method with same arguments message updated (IDEA-142026)

This commit is contained in:
Tagir Valeev
2018-09-26 09:56:28 +07:00
parent 3273089317
commit 25da1af820
2 changed files with 6 additions and 6 deletions
@@ -1,16 +1,16 @@
class X {
void test(int x, int y) {
System.out.println(Math.<warning descr="Arguments of 'max()' are always the same which unlikely makes sense">max</warning>(x, x));
System.out.println(Math.<warning descr="Arguments of 'max' are the same. Calling this method with the same arguments is meaningless.">max</warning>(x, x));
int z = x;
System.out.println(Math.<warning descr="Arguments of 'min()' are always the same which unlikely makes sense">min</warning>(x, z));
System.out.println(Math.<warning descr="Arguments of 'min' are the same. Calling this method with the same arguments is meaningless.">min</warning>(x, z));
String s = "foo";
String t = "foo";
System.out.println("foobar".<warning descr="Arguments of 'replace()' are always the same which unlikely makes sense">replace</warning>(s, t));
System.out.println("foobar".<warning descr="Arguments of 'replace()' are always the same which unlikely makes sense">replace</warning>('x', 'x'));
System.out.println("foobar".<warning descr="Arguments of 'replace' are the same. Calling this method with the same arguments is meaningless.">replace</warning>(s, t));
System.out.println("foobar".<warning descr="Arguments of 'replace' are the same. Calling this method with the same arguments is meaningless.">replace</warning>('x', 'x'));
}
int testCondition(int a) {
if(a == 100) return Math.<warning descr="Arguments of 'max()' are always the same which unlikely makes sense">max</warning>(a, 100);
if(a == 100) return Math.<warning descr="Arguments of 'max' are the same. Calling this method with the same arguments is meaningless.">max</warning>(a, 100);
return 0;
}
}
@@ -97,7 +97,7 @@ dataflow.message.array.index.out.of.bounds=Array index is out of bounds
dataflow.message.immutable.modified=Immutable object is modified
dataflow.message.immutable.passed=Immutable object is passed where mutable is expected
dataflow.message.redundant.assignment=Variable is already assigned to this value
dataflow.message.pointless.same.arguments=Arguments of '#ref()' are always the same which unlikely makes sense
dataflow.message.pointless.same.arguments=Arguments of '#ref' are the same. Calling this method with the same arguments is meaningless.
inspection.optional.get.without.is.present.message=<code>{0}.#ref()</code> without ''isPresent()'' check