mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
@@ -2,7 +2,7 @@
|
|||||||
* Classes should be immutable where possible
|
* Classes should be immutable where possible
|
||||||
* Classes that may be used by multiple threads must be thread-safe
|
* 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 used by a single thread and is not thread-safe, add a comment
|
||||||
* Fields that are accessed by multiple threads must be volatile or guarded by locks
|
* 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
|
||||||
|
|
||||||
#### Visibility
|
#### Visibility
|
||||||
@@ -11,9 +11,10 @@
|
|||||||
* Fields should be final where possible
|
* Fields should be final where possible
|
||||||
* Inner classes should be static where possible
|
* Inner classes should be static where possible
|
||||||
|
|
||||||
#### Instantiation
|
#### Constructors and Dependencies
|
||||||
* Don't allow `this` to escape the constructor
|
* Never allow `this` to escape the constructor
|
||||||
* Complex dependencies should be injected or constructed by factories
|
* Complex dependencies should be injected or constructed by factories
|
||||||
|
* Avoid static methods, except for simple and ubiquitous tasks
|
||||||
* Use executors rather than creating threads where possible
|
* Use executors rather than creating threads where possible
|
||||||
|
|
||||||
#### Exceptions
|
#### Exceptions
|
||||||
|
|||||||
Reference in New Issue
Block a user