Fix mutable issues in AutoValue classes
We are currently using primitive arrays in some cases inside our auto value classes which are potentially mutable, we should look further into this and resolve the issue or suppress the warnings.
@cammace was this fixed with the latest 3.0.0? Not quite sure what this means in terms of AutoValue
Hey @cammace could you clarify what this means in terms of AutoValue when you have a chance?
resolve the issue or suppress the warnings
In our model classes which use AutoValue, some of the methods use arrays which are by nature mutable in Java after the instance is built. To resolve this issue you have two choices, inside the Builder#build method, convert to an immutable list (I think there's a Collections method for this but can't remember off the top of my head) or you can simply suppress the warning so, during compile time, the warning isn't thrown. Check out the AutoValue docs for more info.
See https://github.com/google/auto/blob/master/value/userguide/howto.md#mutable_property
Per Kotlin migration we don't use AutoValue anymore.
Closing here as not actionable.
cc @kmadsen
The directions api objects still have mutable lists. Another option is to move this ticket to mapbox-java
For example, you can change a BannerText list item because they have mutable lists
val bannerComponents = bannerText?.components()
bannerComponents?.set(0, bannerComponents[0].toBuilder()
.imageUrl(null)
.build())
Another option is to move this ticket to mapbox-java
👍
Re-opened @kmadsen