Skip to content

Commit

Permalink
Write more about withSignature.
Browse files Browse the repository at this point in the history
(prompted by unknown commit)

PiperOrigin-RevId: 667597716
  • Loading branch information
cpovirk authored and Error Prone Team committed Aug 26, 2024
1 parent 90d9390 commit 78218f2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/bugpattern/WithSignatureDiscouraged.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
`withSignature` replies on the string representation of internal classes in the
javac implementation. Those string representations are not necessarily stable
across versions of javac, and they can change when a method is annotated with
type-use annotations.

Additionally, `withSignature` currently has at least one undocumented behavioral
quirk.

The most reasonable use case for `withSignature` is for methods that declare or
use type variables, which are difficult or impossible to express with the rest
of the `MethodMatchers` API. Still, where practical, prefer to write your own
matching code instead of using `withSignature`.

0 comments on commit 78218f2

Please sign in to comment.