Skip to content

Commit 7150812

Browse files
committed
refactor(heatmaps): Replace check with require in HeatmapTileProvider.Builder
This commit replaces the `check` function with `require` for validating input data in the `HeatmapTileProvider.Builder`. Using `require` is more idiomatic for precondition checks, throwing an `IllegalArgumentException` which is more appropriate in this context than the `IllegalStateException` thrown by `check`.
1 parent 2be8037 commit 7150812

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/src/main/java/com/google/maps/android/heatmaps/HeatmapTileProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class HeatmapTileProvider private constructor(builder: Builder) : TileProvider {
138138
* @return A new HeatmapTileProvider.
139139
*/
140140
fun build(): HeatmapTileProvider {
141-
check(this.weightedData?.isNotEmpty() == true) { "No input data: you must use either .data or .weightedData before building." }
141+
require(this.weightedData?.isNotEmpty() == true) { "No input data: you must use either .data or .weightedData before building." }
142142
return HeatmapTileProvider(this)
143143
}
144144
}

0 commit comments

Comments
 (0)