diff --git a/javaguide.html b/javaguide.html index d6f54bfb5..8f58d1f5a 100644 --- a/javaguide.html +++ b/javaguide.html @@ -183,7 +183,12 @@
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 @@Wildcard ("on-demand") imports, static or otherwise, are not used.
++Module imports are not used.
+ +Example:
+ +import module java.base; ++
Imports are not line-wrapped. The column limit (Section 4.4, @@ -1111,6 +1126,14 @@
FooBarT).
+The _ syntax for unnamed variables and parameters is
+allowed wherever it is applicable. For example:
Predicate<String> alwaysTrue = _ -> true; ++
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);