diff --git a/javaguide.html b/javaguide.html index d6f54bfb5..8f58d1f5a 100644 --- a/javaguide.html +++ b/javaguide.html @@ -183,7 +183,12 @@

3.2 Package declaration

-

The package declaration is not line-wrapped. The column limit (Section 4.4, +

Every source file must have a package declaration. +Compact source files are not used. (This rule obviously does not apply to +module-info.java files, which have a different syntax that does not include a +package declaration.) + +

The package declaration is not line-wrapped. The column limit (Section 4.4, Column limit: 100) does not apply to package declarations.

@@ -194,6 +199,16 @@

3.3.1 No wildcard imports

Wildcard ("on-demand") imports, static or otherwise, are not used.

+

3.3.1.1 No module imports

+ +

+Module imports are not used.

+ +

Example:

+ +
import module java.base;
+
+

3.3.2 No line-wrapping

Imports are not line-wrapped. The column limit (Section 4.4, @@ -1111,6 +1126,14 @@

5.2.8 Type variable names

FooBarT). +

5.2.9 Unnamed variables

+ +

The _ syntax for unnamed variables and parameters is +allowed wherever it is applicable. For example:

+ +
Predicate<String> alwaysTrue = _ -> true;
+
+

5.3 Camel case: defined

@@ -1232,7 +1255,7 @@

6.2 Caught exceptions: not ignored

try {
   int i = Integer.parseInt(response);
   return handleNumericResponse(i);
-} catch (NumberFormatException ok) {
+} catch (NumberFormatException _) {
   // it's not numeric; that's fine, just continue
 }
 return handleTextResponse(response);