Skip to content

Commit

Permalink
Fix a typo in MixedDescriptors (getDescriptors -> getDescriptor)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 727839435
  • Loading branch information
graememorgan authored and Error Prone Team committed Feb 17, 2025
1 parent 711d705 commit faec219
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/bugpattern/MixedDescriptors.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
A proto's `Descriptor` was created by mixing the `Descriptors` class from one
proto with the field number from another. E.g.:
A field `Descriptor` was created by mixing the message `Descriptor` from one
proto message with the field number from another. For example:

```java
Foo.getDescriptors().findFieldByNumber(Bar.ID_FIELD_NUMBER)
Foo.getDescriptor().findFieldByNumber(Bar.ID_FIELD_NUMBER)
```

This accesses the `Descriptor` of a field in `Foo` with a field number from
`Bar`. One of these was probably intended:

```java
Foo.getDescriptors().findFieldByNumber(Foo.ID_FIELD_NUMBER)
Bar.getDescriptors().findFieldByNumber(Bar.ID_FIELD_NUMBER)
Foo.getDescriptor().findFieldByNumber(Foo.ID_FIELD_NUMBER)
Bar.getDescriptor().findFieldByNumber(Bar.ID_FIELD_NUMBER)
```

0 comments on commit faec219

Please sign in to comment.