From d1e499413b0f8f27b194e2b33981719e74e99ae5 Mon Sep 17 00:00:00 2001 From: "eh@google.com" Date: Mon, 30 Dec 2013 20:03:36 +0000 Subject: [PATCH] java style guide expand TOC --- javaguide.css | 4 ++ javaguide.html | 142 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 134 insertions(+), 12 deletions(-) diff --git a/javaguide.css b/javaguide.css index 4571058..c15c9fa 100644 --- a/javaguide.css +++ b/javaguide.css @@ -203,6 +203,10 @@ dd { margin-left:1.5em; } +dd.toc3 { + margin-left:3em; +} + hr { height:0; border:0; diff --git a/javaguide.html b/javaguide.html index d09f49e..3588367 100644 --- a/javaguide.html +++ b/javaguide.html @@ -10,12 +10,13 @@

Google Java Style

-
Last changed: December 17, 2013
+
Last changed: December 19, 2013
@@ -660,6 +778,6 @@ means!

needed. Whenever an implementation comment would be used to define the overall purpose or behavior of a class, method or field, that comment is written as Javadoc instead. (It's more uniform, and more tool-friendly.)


-
Last changed: December 17, 2013
+
Last changed: December 19, 2013
-
+
+
1 Introduction
@@ -24,7 +25,8 @@
1.2 Guide notes
-
+
+
2 Source file basics
@@ -36,7 +38,17 @@
2.3 Special characters
-
+
+2.3.1 Whitespace characters +
+
+2.3.2 Special escape sequences +
+
+2.3.3 Non-ASCII characters +
+
+
3 Source file structure
@@ -48,18 +60,43 @@
3.3 Import statements
+
+3.3.1 No wildcard imports +
+
+3.3.2 No line-wrapping +
+
+3.3.3 Ordering and spacing +
3.4 Class declaration
+
+3.4.1 Exactly one top-level class declaration +
+
+3.4.2 Class member ordering +
-
+
+
4 Formatting
4.1 Braces
+
+4.1.1 Braces are used where optional +
+
+4.1.2 Nonempty blocks: K & R style +
+
+4.1.3 Empty blocks: may be concise +
4.2 Block indentation: +2 spaces
@@ -72,16 +109,56 @@
4.5 Line-wrapping
+
+4.5.1 Where to break +
+
+4.5.2 Indent continuation lines at least +4 spaces +
4.6 Whitespace
+
+4.6.1 Vertical Whitespace +
+
+4.6.2 Horizontal whitespace +
+
+4.6.3 Horizontal alignment: never required +
4.7 Grouping parentheses: recommended
4.8 Specific constructs
-
+
+4.8.1 Enum classes +
+
+4.8.2 Variable declarations +
+
+4.8.3 Arrays +
+
+4.8.4 Switch statements +
+
+4.8.5 Annotations +
+
+4.8.6 Comments +
+
+4.8.7 Modifiers +
+
+
+
+
+
5 Naming
@@ -90,13 +167,35 @@
5.2 Rules by identifier type
+
+5.2.1 Package names +
+
+5.2.2 Class names +
+
+5.2.3 Method names +
+
+5.2.4 Constant names +
+
+5.2.5 Non-constant field names +
+
+5.2.6 Parameter names +
+
+5.2.7 Local variable names +
+
+5.2.8 Type variable names +
5.3 Camel case: defined
-
-
-
-
+
+
6 Programming Practices
@@ -111,18 +210,37 @@
6.4 Finalizers: not used
-
+
+
7 Javadoc
7.1 Formatting
+
+7.1.1 General form +
+
+7.1.2 Paragraphs +
+
+7.1.3 At-clauses +
7.2 The summary fragment
7.3 Where Javadoc is used
+
+7.3.1 Exception: self-explanatory methods +
+
+7.3.2 Exception: overrides +
+
+7.3.3 Optional javadoc +