Android: fix styleguide for BuildConfig changes
No change to logic, only docs. This updates the Java style guide for
BuildConfig.ENABLE_ASSERTS:
* BuildConfig moved to the "org.chromium.build" package in
https://crrev.com/c/2774858
* DCHECK_IS_ON was renamed to ENABLE_ASSERTS by
https://crrev.com/c/2731127
Test: Upload to gerrit > open file > click "gitiles"
Change-Id: I414be4b35c08bf8a85d70de6154e2ed0b71ea212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2937883
Commit-Queue: Nate Fischer <[email protected]>
Commit-Queue: Andrew Grieve <[email protected]>
Auto-Submit: Nate Fischer <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/master@{#889088}
diff --git a/styleguide/java/java.md b/styleguide/java/java.md
index 2c6ca80..1cabacb 100644
--- a/styleguide/java/java.md
+++ b/styleguide/java/java.md
@@ -94,7 +94,8 @@
the [same
scenarios](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md#CHECK_DCHECK_and-NOTREACHED)
where C++ DCHECK()s make sense. For multi-statement asserts, use
-`org.chromium.base.BuildConfig.DCHECK_IS_ON` to guard your code.
+`org.chromium.build.BuildConfig.ENABLE_ASSERTS` to guard your code (similar to
+`#if DCHECK_IS_ON()` in C++).
Example assert:
@@ -102,10 +103,14 @@
assert someCallWithoutSideEffects() : "assert description";
```
-Example use of `DCHECK_IS_ON`:
+Example use of `BuildConfig.ENABLE_ASSERTS`:
```java
-if (org.chromium.base.BuildConfig.DCHECK_IS_ON) {
+import org.chromium.build.BuildConfig;
+
+...
+
+if (BuildConfig.ENABLE_ASSERTS) {
// Any code here will be stripped in Release by ProGuard.
...
}