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 @@ 4.3 One statement per line
4.4 Column limit: 100
-
@@ -551,7 +556,7 @@
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.2 Horizontal whitespace
4.6.3 Horizontal alignment: never required
@@ -623,6 +628,9 @@ 4.8.2.1 One variable per declaration
int a, b;
are not used.for
loop.4.8.2.2 Declared when needed
5.2.3 Method names
stop
.
Underscores may appear in JUnit test method names to separate logical components of the
-name. One typical pattern is 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.
Constant names use 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