As a result of the project scan, we found a false positive regarding the S1874 rule on the use of a deprecated method. We are using an updated method with a modified order of input parameters with the same name
Hello there, I failed to reproduce the issue. I could not simply copy paste your example as there are some missing information. It would be great if you could provide a self-contained and compiling snippet of code that I could just copy paste.
What I tried is the following, in class B I have:
public void deprecatedMethod(String sql, Object o, @Nullable Object... args){
//do something
}
@Deprecated(since = "1.0", forRemoval = true)
public void deprecatedMethod(String sql, @Nullable Object[] args, Object o){
//do something
}
Then in class A I do this:
void foo() {
B mocked = mock(B.class);
mocked.deprecatedMethod("SELECT * FROM DUAL", (Object) any(), new Object());
}