File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,20 @@ try (java.util.stream.Stream<Path> walk = Files.walk(dir))
5151
5252** Exception:** FQNs are acceptable in Javadoc ` {@link} ` / ` {@code} ` tags when the type is not already imported.
5353
54+ ### Static Imports for Common Constants
55+
56+ Use static imports for frequently used constants to reduce verbosity:
57+
58+ ``` java
59+ // Good - static import
60+ import static java.nio.charset.StandardCharsets.UTF_8 ;
61+
62+ byte [] bytes = str. getBytes(UTF_8 );
63+
64+ // Avoid - qualified constant
65+ byte [] bytes = str. getBytes(StandardCharsets . UTF_8 );
66+ ```
67+
5468### Single-Statement Blocks
5569Omit braces for if/else/for/while with a single-statement body that fits on one visual line.
5670Add braces when the body spans multiple visual lines (e.g., string concatenation continuation):
You can’t perform that action at this time.
0 commit comments