From 911d9f4a7e3020578f4609860d7e5ede422a8f28 Mon Sep 17 00:00:00 2001
From: Liam Miller-Cushon Java code has a column limit of 100 characters.
+ Java code has a column limit of 100 characters. A "character" means any Unicode code point.
Except as noted below, any line that would exceed this limit must be line-wrapped, as explained in
Section 4.5, Line-wrapping.
Each Unicode code point counts as one character, even if its display width is
+greater or less. For example, if using
+fullwidth characters,
+you may choose to wrap the line earlier than where this rule strictly requires. Exceptions: Every variable declaration (field or local) declares only one variable: declarations such as
Exception: Multiple variable declarations are acceptable in the header of a
+ Local variables are not habitually declared at the start of their containing
@@ -842,15 +850,17 @@ with Underscores may appear in JUnit test method names to separate logical components of the
-name. One typical pattern is Constant names use 4.4 Column limit: 100
-
@@ -551,7 +556,7 @@ Javadoc, a single ASCII space also appears in the following places only<
This rule is never interpreted as requiring or forbidding additional space at the start or
-end of a line; it addresses only interior space.
+end of a line; it addresses only interior space.
4.6.3 Horizontal alignment: never required
@@ -623,6 +628,9 @@ as if it were an array initializer (see Section 4.8.3.1 on
int a, b;
are not used.for
loop.4.8.2.2 Declared when needed
Test
. For example,
stop
.test<MethodUnderTest>_<state>
,
-for example testPop_emptyStack
. There is no One Correct
+name, with each component written in lowerCamelCase.
+One typical pattern is <methodUnderTest>_<state>
,
+for example pop_emptyStack
. There is no One Correct
Way to name test methods.5.2.4 Constant names
CONSTANT_CASE
: all uppercase
-letters, with words separated by underscores. But what is a constant, exactly?
Constants are static final fields whose contents are deeply immutable and whose methods have no detectable side effects. This includes primitives, Strings, immutable types, and immutable