Skip to content

Commit

Permalink
Don't tell people to go right ahead and put arrays in their AutoValues.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 650644658
  • Loading branch information
eamonnmcmanus authored and Google Java Core Libraries committed Jul 9, 2024
1 parent 4768928 commit bc7278e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions value/userguide/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,12 @@ them!
## <a name="primitive_array"></a>... use a primitive array for a property value?
Go right ahead! AutoValue will generate code that acts on the *values* stored
AutoValue supports this, and will generate code that acts on the *values* stored
the array, not the object identity of the array itself, which is (with virtual
certainty) what you want. Heed the warnings given above about [mutable
properties](#mutable_property).
properties](#mutable_property). AutoValue will by default warn about this case,
because of the mutability, but you can silence the warning with
`@SuppressWarnings("mutable")` on the accessor method.
## <a name="object_array"></a>... use an object array for a property value?
Expand Down

0 comments on commit bc7278e

Please sign in to comment.