Skip to content

Commit f9347e1

Browse files
cushonshicks
authored andcommitted
Update Java style guide
1 parent e5d807c commit f9347e1

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Diff for: javaguide.html

+15-13
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ <h3 id="s4.6-whitespace">4.6 Whitespace</h3>
459459

460460
<h4 id="s4.6.1-vertical-whitespace">4.6.1 Vertical Whitespace</h4>
461461

462-
<p>A single blank line appears:</p>
462+
<p>A single blank line always appears:</p>
463463

464464
<ol>
465465
<li><em>Between</em> consecutive members or initializers of a class: fields, constructors,
@@ -473,17 +473,17 @@ <h4 id="s4.6.1-vertical-whitespace">4.6.1 Vertical Whitespace</h4>
473473
</ul>
474474
</li>
475475

476-
<li>Between statements, <em>as needed</em> to organize the code into logical subsections.
477-
478-
</li><li><em>Optionally</em> before the first member or initializer, or after the last member or
479-
initializer of the class (neither encouraged nor discouraged).</li>
480-
481476
<li>As required by other sections of this document (such as Section 3,
482477
<a href="#s3-source-file-structure">Source file structure</a>, and Section 3.3,
483478
<a href="#s3.3-import-statements">Import statements</a>).</li>
484479
</ol>
485480

486-
<p><em>Multiple</em> consecutive blank lines are permitted, but never required (or encouraged).</p>
481+
<p>A single blank line may also appear anywhere it improves readability, for example between
482+
statements to organize the code into logical subsections. A blank line before the first member or
483+
initializer, or after the last member or initializer of the class, is neither encouraged nor
484+
discouraged.
485+
486+
</p><p><em>Multiple</em> consecutive blank lines are permitted, but never required (or encouraged).</p>
487487

488488
<h4 id="s4.6.2-horizontal-whitespace">4.6.2 Horizontal whitespace</h4>
489489

@@ -553,10 +553,13 @@ <h4 id="s4.6.2-horizontal-whitespace">4.6.2 Horizontal whitespace</h4>
553553
<code class="prettyprint lang-java">new int[] { 5, 6 }</code> are both valid</li>
554554
</ul>
555555
</li>
556+
557+
<li>Between a type annotation and <code class="prettyprint lang-java">[]</code> or
558+
<code class="prettyprint lang-java">...</code>.</li>
556559
</ol>
557560

558-
This rule is never interpreted as requiring or forbidding additional space at the start or
559-
end of a line; it addresses only <em>interior</em> space.
561+
<p>This rule is never interpreted as requiring or forbidding additional space at the start or
562+
end of a line; it addresses only <em>interior</em> space.</p>
560563

561564
<h4 id="s4.6.3-horizontal-alignment">4.6.3 Horizontal alignment: never required</h4>
562565

@@ -809,10 +812,9 @@ <h3 id="s5.1-identifier-names">5.1 Rules common to all identifiers</h3>
809812
underscores. Thus each valid identifier name is matched by the regular expression
810813
<code>\w+</code> .</p>
811814

812-
<p>In Google Style special prefixes or
813-
suffixes, like those seen in the examples <code class="badcode">name_</code>,
814-
<code class="badcode">mName</code>, <code class="badcode">s_name</code> and
815-
<code class="badcode">kName</code>, are <strong>not</strong> used.</p>
815+
<p>In Google Style, special prefixes or suffixes are <strong>not</strong> used. For example, these
816+
names are not Google Style: <code class="badcode">name_</code>, <code class="badcode">mName</code>,
817+
<code class="badcode">s_name</code> and <code class="badcode">kName</code>.</p>
816818

817819
<h3 id="s5.2-specific-identifier-names">5.2 Rules by identifier type</h3>
818820

0 commit comments

Comments
 (0)