From c412e03e1f9ff04aa48959d83dd3dd90f527ebe9 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Sat, 2 Jun 2018 16:14:15 +0000 Subject: [PATCH] Update pre review checklist --- pre-review-checklist.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pre-review-checklist.md b/pre-review-checklist.md index aab0b9f..6d308ee 100644 --- a/pre-review-checklist.md +++ b/pre-review-checklist.md @@ -1,13 +1,13 @@ #### Thread safety * Classes should be immutable where possible * Classes that may be used by multiple threads must be thread-safe -* If a class is used by a single thread and is not thread-safe, add a comment +* If a class is not thread-safe, annotate it @NotThreadSafe * Fields that are used by multiple threads must be volatile or guarded by locks -* If a field or method is guarded by a lock, add a comment +* If a field or method is guarded by a lock, add a comment, e.g. `// Locking: foo` #### Visibility * Minimise the visibility of classes, fields and methods -* Fields should be private or protected +* Fields should usually be private, with getters and setters if needed * Fields should be final where possible * Inner classes should be static where possible