From e684a3455bcc29a6e3e66a004e352dea4e1141e7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 13 Feb 2019 15:05:36 +0100 Subject: BASELINE: Update Chromium to 72.0.3626.110 and Ninja to 1.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic57220b00ecc929a893c91f5cc552f5d3e99e922 Reviewed-by: Michael BrĂ¼ning --- chromium/styleguide/java/java.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chromium/styleguide/java/java.md') diff --git a/chromium/styleguide/java/java.md b/chromium/styleguide/java/java.md index 530b779f618..46815e917e9 100644 --- a/chromium/styleguide/java/java.md +++ b/chromium/styleguide/java/java.md @@ -114,6 +114,18 @@ if (org.chromium.base.BuildConfig.DCHECK_IS_ON) { } ``` +### Finalizers +In line with [Google's Java style guide](https://google.github.io/styleguide/javaguide.html#s6.4-finalizers), +never override `Object.finalize()`. + +Custom finalizers: +* are called on a background thread, and at an unpredicatble point in time, +* swallow all exceptions (asserts won't work), +* causes additional garbage collector jank. + +Classes that need destructor logic should provide an explicit `destroy()` +method. + ### Other Android Support Library Annotations * Use them! They are [documented here](https://developer.android.com/studio/write/annotations). * They generally improve readability. -- cgit v1.2.1