Back to Intellij Community

JavaReflectionInvocation

java/java-impl/resources/inspectionDescriptions/JavaReflectionInvocation.html

2025.3-rc-2351 B
Original Source

Reports cases in which the arguments provided to Method.invoke() and Constructor.newInstance() do not match the signature specified in Class.getMethod() and Class.getConstructor().

Example:

Method m = myObj.getClass().getMethod("myMethod", int.class);
  // the argument should be an int value
  m.invoke(myObj, "abc");

New in 2017.2