Merge "crafting-changes: Add some info on Optional/Nullable" into stable-3.1
This commit is contained in:
@@ -159,6 +159,9 @@ run `./tools/setup_gjf.sh` to download a local copy and set up a
|
|||||||
wrapper script. If you run your own copy, please use the same version,
|
wrapper script. If you run your own copy, please use the same version,
|
||||||
as there may be slight differences between versions.
|
as there may be slight differences between versions.
|
||||||
|
|
||||||
|
[[code-rules]]
|
||||||
|
== Code Rules
|
||||||
|
=== Final
|
||||||
When to use `final` modifier and when not (in new code):
|
When to use `final` modifier and when not (in new code):
|
||||||
|
|
||||||
Always:
|
Always:
|
||||||
@@ -180,6 +183,12 @@ Never:
|
|||||||
be removed
|
be removed
|
||||||
* method parameters: similar to local variables
|
* method parameters: similar to local variables
|
||||||
|
|
||||||
|
=== Optional / Nullable
|
||||||
|
Recommended:
|
||||||
|
|
||||||
|
* Optionals in arguments are discouraged (use @Nullable instead)
|
||||||
|
* Return types should be objects or Optionals of objects, but not null/nullable
|
||||||
|
|
||||||
[[code-organization]]
|
[[code-organization]]
|
||||||
== Code Organization
|
== Code Organization
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user