diff --git a/javaguide.html b/javaguide.html index 59f03dc..b171426 100644 --- a/javaguide.html +++ b/javaguide.html @@ -346,11 +346,16 @@ applies to both code and comments throughout the block. (See the example in Sect

4.4 Column limit: 100

-

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:

    @@ -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

Every variable declaration (field or local) declares only one variable: declarations such as int a, b; are not used.

+

Exception: Multiple variable declarations are acceptable in the header of a +for loop.

+
4.8.2.2 Declared when needed

Local variables are not habitually declared at the start of their containing @@ -842,15 +850,17 @@ with Test. For example, 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.

5.2.4 Constant names

Constant names use CONSTANT_CASE: all uppercase -letters, with words separated by underscores. But what is a constant, exactly?

+letters, with each word separated from the next by a single underscore. 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