Original issue created by dbeaumont@google.com on 2013-10-14 at 05:19 PM
Matchers should not throw an exception for unexpected input.
Currently the Matchers.staticMethod(className, methodName) matcher throws IllegalArgumentException when not given a method invocation to match. It should just fail to match and return false.
Currently I had to wrap usage with a 'safe' matcher to catch exceptions and return false - which works, but isn't nice.
This philosophy of never throwing exceptions applies to every matcher in general.
Original issue created by dbeaumont@google.com on 2013-10-14 at 05:19 PM
Matchers should not throw an exception for unexpected input.
Currently the Matchers.staticMethod(className, methodName) matcher throws IllegalArgumentException when not given a method invocation to match. It should just fail to match and return false.
Currently I had to wrap usage with a 'safe' matcher to catch exceptions and return false - which works, but isn't nice.
This philosophy of never throwing exceptions applies to every matcher in general.