0

[Styleguide] Fix Java comments on assert.

Discussion thread:
https://groups.google.com/a/chromium.org/d/topic/java/CpIn_jDOgRk/discussion

Bug: 
Change-Id: I3331d3180d9ee88993c942ef20d045f545ff4cbc
Reviewed-on: https://chromium-review.googlesource.com/671025
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502606}
This commit is contained in:
Samuel Huang
2017-09-18 17:43:23 +00:00
committed by Commit Bot
parent 54d1913011
commit 3b10f2dff0

@ -94,7 +94,7 @@ try {
somethingThatThrowsIOException();
somethingThatThrowsParseException();
} catch (IOException | ParseException e) {
Log.e(TAG, "Failed to do something with exception: ", e)
Log.e(TAG, "Failed to do something with exception: ", e);
}
```
@ -111,16 +111,15 @@ where C++ DCHECK()s make sense. For multi-statement asserts, use
Example assert:
```java
assert someCallWithSideEffects() : "assert description";
assert someCallWithoutSideEffects() : "assert description";
```
Example use of `DCHECK_IS_ON`:
```java
if (org.chromium.base.BuildConfig.DCHECK_IS_ON) {
if (!someCallWithSideEffects()) {
throw new AssertionError("assert description");
}
// Any code here will be stripped in Release by ProGuard.
...
}
```